提交 cad85337 编写于 作者: J Jeff Layton 提交者: Chuck Lever

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=216777Reported-by: NJianHong Yin <yin-jianhong@163.com>
Signed-off-by: NJeff Layton <jlayton@kernel.org>
Signed-off-by: NChuck Lever <chuck.lever@oracle.com>
Cc: <stable@vger.kernel.org>
上级 789e1e10
...@@ -3629,6 +3629,17 @@ nfsd4_encode_dirent(void *ccdv, const char *name, int namlen, ...@@ -3629,6 +3629,17 @@ nfsd4_encode_dirent(void *ccdv, const char *name, int namlen,
case nfserr_noent: case nfserr_noent:
xdr_truncate_encode(xdr, start_offset); xdr_truncate_encode(xdr, start_offset);
goto skip_entry; goto skip_entry;
case nfserr_jukebox:
/*
* The pseudoroot should only display dentries that lead to
* exports. If we get EJUKEBOX here, then we can't tell whether
* this entry should be included. Just fail the whole READDIR
* with NFS4ERR_DELAY in that case, and hope that the situation
* will resolve itself by the client's next attempt.
*/
if (cd->rd_fhp->fh_export->ex_flags & NFSEXP_V4ROOT)
goto fail;
fallthrough;
default: default:
/* /*
* If the client requested the RDATTR_ERROR attribute, * If the client requested the RDATTR_ERROR attribute,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册