diff options
-rw-r--r-- | fs/fuse/file.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/fs/fuse/file.c b/fs/fuse/file.c index 8092f0d9fd1f..67ff2c6a8f63 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c | |||
@@ -1341,6 +1341,11 @@ static int fuse_setlk(struct file *file, struct file_lock *fl, int flock) | |||
1341 | pid_t pid = fl->fl_type != F_UNLCK ? current->tgid : 0; | 1341 | pid_t pid = fl->fl_type != F_UNLCK ? current->tgid : 0; |
1342 | int err; | 1342 | int err; |
1343 | 1343 | ||
1344 | if (fl->fl_lmops && fl->fl_lmops->fl_grant) { | ||
1345 | /* NLM needs asynchronous locks, which we don't support yet */ | ||
1346 | return -ENOLCK; | ||
1347 | } | ||
1348 | |||
1344 | /* Unlock on close is handled by the flush method */ | 1349 | /* Unlock on close is handled by the flush method */ |
1345 | if (fl->fl_flags & FL_CLOSE) | 1350 | if (fl->fl_flags & FL_CLOSE) |
1346 | return 0; | 1351 | return 0; |
@@ -1365,7 +1370,9 @@ static int fuse_file_lock(struct file *file, int cmd, struct file_lock *fl) | |||
1365 | struct fuse_conn *fc = get_fuse_conn(inode); | 1370 | struct fuse_conn *fc = get_fuse_conn(inode); |
1366 | int err; | 1371 | int err; |
1367 | 1372 | ||
1368 | if (cmd == F_GETLK) { | 1373 | if (cmd == F_CANCELLK) { |
1374 | err = 0; | ||
1375 | } else if (cmd == F_GETLK) { | ||
1369 | if (fc->no_lock) { | 1376 | if (fc->no_lock) { |
1370 | posix_test_lock(file, fl); | 1377 | posix_test_lock(file, fl); |
1371 | err = 0; | 1378 | err = 0; |
@@ -1373,7 +1380,7 @@ static int fuse_file_lock(struct file *file, int cmd, struct file_lock *fl) | |||
1373 | err = fuse_getlk(file, fl); | 1380 | err = fuse_getlk(file, fl); |
1374 | } else { | 1381 | } else { |
1375 | if (fc->no_lock) | 1382 | if (fc->no_lock) |
1376 | err = posix_lock_file_wait(file, fl); | 1383 | err = posix_lock_file(file, fl, NULL); |
1377 | else | 1384 | else |
1378 | err = fuse_setlk(file, fl, 0); | 1385 | err = fuse_setlk(file, fl, 0); |
1379 | } | 1386 | } |