Skip to content

Commit ced6654

Browse files
committed
nfsd: fix handling of readdir in v4root vs. mount upcall timeout
Bugzilla: https://bugzilla.redhat.com/2152996 commit cad8533 Author: Jeff Layton <jlayton@kernel.org> Date: Tue Dec 13 13:08:26 2022 -0500 nfsd: fix handling of readdir in v4root vs. mount upcall timeout If v4 READDIR operation hits a mountpoint and gets back an error, then it will include that entry in the reply and set RDATTR_ERROR for it to the error. That's fine for "normal" exported filesystems, but on the v4root, we need to be more careful to only expose the existence of dentries that lead to exports. If the mountd upcall times out while checking to see whether a mountpoint on the v4root is exported, then we have no recourse other than to fail the whole operation. Cc: Steve Dickson <steved@redhat.com> Link: https://bugzilla.kernel.org/show_bug.cgi?id=216777 Reported-by: JianHong Yin <yin-jianhong@163.com> Signed-off-by: Jeff Layton <jlayton@kernel.org> Signed-off-by: Chuck Lever <chuck.lever@oracle.com> Cc: <stable@vger.kernel.org> Signed-off-by: Jeffrey Layton <jlayton@redhat.com>
1 parent ffda217 commit ced6654

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

fs/nfsd/nfs4xdr.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3529,6 +3529,17 @@ nfsd4_encode_dirent(void *ccdv, const char *name, int namlen,
35293529
case nfserr_noent:
35303530
xdr_truncate_encode(xdr, start_offset);
35313531
goto skip_entry;
3532+
case nfserr_jukebox:
3533+
/*
3534+
* The pseudoroot should only display dentries that lead to
3535+
* exports. If we get EJUKEBOX here, then we can't tell whether
3536+
* this entry should be included. Just fail the whole READDIR
3537+
* with NFS4ERR_DELAY in that case, and hope that the situation
3538+
* will resolve itself by the client's next attempt.
3539+
*/
3540+
if (cd->rd_fhp->fh_export->ex_flags & NFSEXP_V4ROOT)
3541+
goto fail;
3542+
fallthrough;
35323543
default:
35333544
/*
35343545
* If the client requested the RDATTR_ERROR attribute,

0 commit comments

Comments
 (0)