]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commit
generic/676: Unstable d_type handling for NFS READDIR
authorBenjamin Coddington <bcodding@redhat.com>
Thu, 2 Feb 2023 14:48:04 +0000 (09:48 -0500)
committerZorro Lang <zlang@kernel.org>
Sat, 11 Feb 2023 04:31:05 +0000 (12:31 +0800)
commit8029b849785a23c17353daaaac086e77ea05cbcd
tree68756922710ce4d27869c7822ea42df4e470405e
parent99d0f81f194f785c159d58456577f0f2b49739c6
generic/676: Unstable d_type handling for NFS READDIR

The NFS client may send READDIR or READDIRPLUS to populate the dentry
cache, and switch between them to optimize for least RPC calls based on the
process' behavior.  When using READDIR, dentries will have d_type =
DT_UNKNOWN but with READDIRPLUS d_type will be set from the mode.

This heuristic will cause generic/676 to fail when comparing dentries
cached from one or the other call, since we compare d_type directly. Fix
this by bypassing the comparison of d_type if any entry is loaded with
DT_UNKNOWN.

Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Reviewed-by: Zorro Lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
src/t_readdir_3.c