Skip to content

Commit 69fb005

Browse files
Olga KornievskaiaUlrich Hecht
authored andcommitted
nfsd: nfserr_jukebox in nlm_fopen should lead to a retry
commit a082e4b4d08a4a0e656d90c2c05da85f23e6d0c9 upstream. When v3 NLM request finds a conflicting delegation, it triggers a delegation recall and nfsd_open fails with EAGAIN. nfsd_open then translates EAGAIN into nfserr_jukebox. In nlm_fopen, instead of returning nlm_failed for when there is a conflicting delegation, drop this NLM request so that the client retries. Once delegation is recalled and if a local lock is claimed, a retry would lead to nfsd returning a nlm_lck_blocked error or a successful nlm lock. Fixes: d343fce ("[PATCH] knfsd: Allow lockd to drop replies as appropriate") Cc: stable@vger.kernel.org # v6.6 Signed-off-by: Olga Kornievskaia <okorniev@redhat.com> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> [uli: backport to 4.19] Signed-off-by: Ulrich Hecht <uli@kernel.org>
1 parent 7d64429 commit 69fb005

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

fs/nfsd/lockd.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,21 @@ nlm_fopen(struct svc_rqst *rqstp, struct nfs_fh *f, struct file **filp)
4444
switch (nfserr) {
4545
case nfs_ok:
4646
return 0;
47+
case nfserr_jukebox:
48+
/* this error can indicate a presence of a conflicting
49+
* delegation to an NLM lock request. Options are:
50+
* (1) For now, drop this request and make the client
51+
* retry. When delegation is returned, client's lock retry
52+
* will complete.
53+
* (2) NLM4_DENIED as per "spec" signals to the client
54+
* that the lock is unavailable now but client can retry.
55+
* Linux client implementation does not. It treats
56+
* NLM4_DENIED same as NLM4_FAILED and errors the request.
57+
* (3) For the future, treat this as blocked lock and try
58+
* to callback when the delegation is returned but might
59+
* not have a proper lock request to block on.
60+
*/
61+
/* fallthrough */
4762
case nfserr_dropit:
4863
return nlm_drop_reply;
4964
case nfserr_stale:

0 commit comments

Comments
 (0)