From: Trond Myklebust Date: Tue, 22 Feb 2005 12:22:00 +0000 (-0800) Subject: [PATCH] NFS: Further fixes for the -onolock case. X-Git-Tag: v2.6.11-rc5~1^2~1^2~5 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=9f459dee9e73e90a0a357e5bf53b4bc56282c1da;p=history.git [PATCH] NFS: Further fixes for the -onolock case. Duh... GETLK returns F_UNLCK if and only if the lock could be placed. Signed-off-by: Trond Myklebust Signed-off-by: Linus Torvalds --- diff --git a/fs/nfs/file.c b/fs/nfs/file.c index a6860e1f7bff..57ccbd277fce 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c @@ -303,10 +303,10 @@ static int do_getlk(struct file *filp, int cmd, struct file_lock *fl) status = NFS_PROTO(inode)->lock(filp, cmd, fl); else { struct file_lock *cfl = posix_test_lock(filp, fl); - if (cfl != NULL) { + + fl->fl_type = F_UNLCK; + if (cfl != NULL) memcpy(fl, cfl, sizeof(*fl)); - fl->fl_type = F_UNLCK; - } } unlock_kernel(); return status;