Linux-NFS Archive mirror
 help / color / mirror / Atom feed
* [PATCH] NFSv4: setlease should return EAGAIN if locks are not available
@ 2021-06-26 16:00 trondmy
  0 siblings, 0 replies; only message in thread
From: trondmy @ 2021-06-26 16:00 UTC (permalink / raw
  To: linux-nfs

From: Trond Myklebust <trond.myklebust@hammerspace.com>

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>
---
 fs/nfs/nfs4proc.c | 4 ++--
 1 file 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,
-- 
2.31.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-26 16:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-06-26 16:00 [PATCH] NFSv4: setlease should return EAGAIN if locks are not available trondmy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).