From ddc67e61906c4f17adf87ade77fa40b2e0f20ac5 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Fri, 25 Jul 2008 01:49:02 -0700 Subject: [PATCH] --- yaml --- r: 106041 b: refs/heads/master c: 48e90761b570ff57f58b726229d229729949c5bb h: refs/heads/master i: 106039: 906adfc7239b1a36b6cd2f33e62f0639bc74074d v: v3 --- [refs] | 2 +- trunk/fs/fuse/file.c | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 2cc81b16ef2a..5dd1a86d3fb9 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 33670fa296860283f04a7975b8c790f101e43a6e +refs/heads/master: 48e90761b570ff57f58b726229d229729949c5bb diff --git a/trunk/fs/fuse/file.c b/trunk/fs/fuse/file.c index 8092f0d9fd1f..67ff2c6a8f63 100644 --- a/trunk/fs/fuse/file.c +++ b/trunk/fs/fuse/file.c @@ -1341,6 +1341,11 @@ static int fuse_setlk(struct file *file, struct file_lock *fl, int flock) pid_t pid = fl->fl_type != F_UNLCK ? current->tgid : 0; int err; + if (fl->fl_lmops && fl->fl_lmops->fl_grant) { + /* NLM needs asynchronous locks, which we don't support yet */ + return -ENOLCK; + } + /* Unlock on close is handled by the flush method */ if (fl->fl_flags & FL_CLOSE) return 0; @@ -1365,7 +1370,9 @@ static int fuse_file_lock(struct file *file, int cmd, struct file_lock *fl) struct fuse_conn *fc = get_fuse_conn(inode); int err; - if (cmd == F_GETLK) { + if (cmd == F_CANCELLK) { + err = 0; + } else if (cmd == F_GETLK) { if (fc->no_lock) { posix_test_lock(file, fl); err = 0; @@ -1373,7 +1380,7 @@ static int fuse_file_lock(struct file *file, int cmd, struct file_lock *fl) err = fuse_getlk(file, fl); } else { if (fc->no_lock) - err = posix_lock_file_wait(file, fl); + err = posix_lock_file(file, fl, NULL); else err = fuse_setlk(file, fl, 0); }