summaryrefslogtreecommitdiff
path: root/fs/nfs/nfs4proc.c
diff options
context:
space:
mode:
authorTrond Myklebust <trond.myklebust@hammerspace.com>2021-06-25 22:08:39 +0300
committerTrond Myklebust <trond.myklebust@hammerspace.com>2021-06-29 20:13:31 +0300
commitdf2c7b951f439a0342495a4a049d808f679c474c (patch)
tree0d4696a327c8ee2367a0061a5389437aad240feb /fs/nfs/nfs4proc.c
parente97bc66377bca097e1f3349ca18ca17f202ff659 (diff)
downloadlinux-df2c7b951f439a0342495a4a049d808f679c474c.tar.xz
NFSv4: setlease should return EAGAIN if locks are not available
Instead of returning ENOLCK when we can't hand out a lease, we should be returning EAGAIN. Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Diffstat (limited to 'fs/nfs/nfs4proc.c')
-rw-r--r--fs/nfs/nfs4proc.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 35df44ef2c35..e4efb7bccd7e 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -7452,13 +7452,13 @@ static int nfs4_add_lease(struct file *file, long arg, struct file_lock **lease,
/* No delegation, no lease */
if (!nfs4_have_delegation(inode, type))
- return -ENOLCK;
+ return -EAGAIN;
ret = generic_setlease(file, arg, lease, priv);
if (ret || nfs4_have_delegation(inode, type))
return ret;
/* We raced with a delegation return */
nfs4_delete_lease(file, priv);
- return -ENOLCK;
+ return -EAGAIN;
}
int nfs4_proc_setlease(struct file *file, long arg, struct file_lock **lease,