[PATCH] FUSE: 3/3 ABI version change

From: Miklos Szeredi (miklos_at_szeredi.hu)
Date: 03/31/05

  • Next message: Roland Dreier: "Re: Stack usage tasks"
    To: akpm@osdl.org
    Date:	Thu, 31 Mar 2005 23:02:04 +0200
    
    

    Change ABI major version from 5 to 6, and check if userspace supports
    the new interface. If the version in INIT reply doesn't match the
    current one, return ECONNREFUSED error on all operations.

    Signed-off-by: Miklos Szeredi <miklos@szeredi.hu>

    diff -rup linux-2.6.12-rc1-mm4/fs/fuse/dev.c linux-fuse/fs/fuse/dev.c
    --- linux-2.6.12-rc1-mm4/fs/fuse/dev.c 2005-03-31 21:43:42.000000000 +0200
    +++ linux-fuse/fs/fuse/dev.c 2005-03-31 21:50:31.000000000 +0200
    @@ -183,6 +183,10 @@ static void request_end(struct fuse_conn
             wake_up(&req->waitq);
             if (req->in.h.opcode == FUSE_INIT) {
                     int i;
    +
    + if (req->misc.init_in_out.major != FUSE_KERNEL_VERSION)
    + fc->conn_error = 1;
    +
                     /* After INIT reply is received other requests can go
                        out. So do (FUSE_MAX_OUTSTANDING - 1) number of
                        up()s on outstanding_sem. The last up() is done in
    @@ -329,8 +333,11 @@ static void request_send_wait(struct fus
     {
             req->isreply = 1;
             spin_lock(&fuse_lock);
    - req->out.h.error = -ENOTCONN;
    - if (fc->file) {
    + if (!fc->file)
    + req->out.h.error = -ENOTCONN;
    + else if (fc->conn_error)
    + req->out.h.error = -ECONNREFUSED;
    + else {
                     queue_request(fc, req);
                     /* acquire extra reference, since request is still needed
                        after request_end() */
    diff -rup linux-2.6.12-rc1-mm4/fs/fuse/fuse_i.h linux-fuse/fs/fuse/fuse_i.h
    --- linux-2.6.12-rc1-mm4/fs/fuse/fuse_i.h 2005-03-31 21:43:42.000000000 +0200
    +++ linux-fuse/fs/fuse/fuse_i.h 2005-03-31 21:50:31.000000000 +0200
    @@ -261,6 +261,9 @@ struct fuse_conn {
             /** Is removexattr not implemented by fs? */
             unsigned no_removexattr : 1;
     
    + /** Connection failed (version mismatch) */
    + unsigned conn_error : 1;
    +
             /** Backing dev info */
             struct backing_dev_info bdi;
     };
    diff -rup linux-2.6.12-rc1-mm4/include/linux/fuse.h linux-fuse/include/linux/fuse.h
    --- linux-2.6.12-rc1-mm4/include/linux/fuse.h 2005-03-31 21:50:44.000000000 +0200
    +++ linux-fuse/include/linux/fuse.h 2005-03-31 21:50:31.000000000 +0200
    @@ -11,7 +11,7 @@
     #include <asm/types.h>
     
     /** Version number of this interface */
    -#define FUSE_KERNEL_VERSION 5
    +#define FUSE_KERNEL_VERSION 6
     
     /** Minor version number of this interface */
     #define FUSE_KERNEL_MINOR_VERSION 1

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Roland Dreier: "Re: Stack usage tasks"

    Relevant Pages

    • Re: silent semantic changes with reiser4
      ... Or come up with a way to export some interface to userspace. ... Linux does not need to be screwed up by that. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [Xen-devel] Re: [RFC] [PATCH] sysfs support for Xen attributes
      ... It basically lets the userspace software stack bypass Linux and talk directly to the hypervisor. ... is pushing behavior and "hardware" knowledge out there, ... To expose the hypercalls to userspace via sysfs (or another high level interface) would require a whole bunch of complex code to encode the hypercalls and decode there results. ... To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • Re: [RFC] RNG rewrite...
      ... > It's a magic regsiter we just read/write and could be done in userspace. ... > interface is overkill b/c there will only be one RNG per system, ... MSR instructions cannot execute out of userspace, ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [patch] voluntary-preempt-2.6.9-rc1-bk12-R8
      ... > userspace to work just fine too. ... Init seems to explode ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [RFC][PATCH] inotify 0.10.0
      ... Another benefit of passing in an fd, by the way, would be to make it ... easier to make a writeinterface to inotify, and get rid of the ioctl ... communicating changes to userspace. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)