fuse: fix flock breakage
authorMiklos Szeredi <mszeredi@suse.cz>
Mon, 12 Sep 2011 07:31:49 +0000 (09:31 +0200)
committerLinus Torvalds <torvalds@linux-foundation.org>
Mon, 12 Sep 2011 18:47:10 +0000 (11:47 -0700)
Commit 37fb3a30b4 ("fuse: fix flock") added in 3.1-rc4 caused flock() to
fail with ENOSYS with the kernel ABI version 7.16 or earlier.

Fix by falling back to testing FUSE_POSIX_LOCKS for ABI versions 7.16
and earlier.

Reported-by: Martin Ziegler <ziegler@email.mathematik.uni-freiburg.de>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
Tested-by: Martin Ziegler <ziegler@email.mathematik.uni-freiburg.de>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/fuse/inode.c

index 12b502929da9c51ef78f5ee6d53948e1f5b991a6..add96f6ffda563738a90b7a7a1572a9a1e2f3c5b 100644 (file)
@@ -812,6 +812,9 @@ static void process_init_reply(struct fuse_conn *fc, struct fuse_req *req)
                        if (arg->minor >= 17) {
                                if (!(arg->flags & FUSE_FLOCK_LOCKS))
                                        fc->no_flock = 1;
+                       } else {
+                               if (!(arg->flags & FUSE_POSIX_LOCKS))
+                                       fc->no_flock = 1;
                        }
                        if (arg->flags & FUSE_ATOMIC_O_TRUNC)
                                fc->atomic_o_trunc = 1;