NFSv4: Always ask for type with READDIR
authorBenjamin Coddington <bcodding@redhat.com>
Wed, 6 Dec 2023 13:10:22 +0000 (08:10 -0500)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Thu, 4 Jan 2024 15:47:56 +0000 (10:47 -0500)
commitb4d4fd60f884e75d52bf9254bc56b3ea41ea2686
tree51f192fe26163d8dec0d9cd402ba9462bdbdd1ac
parentd76c769c8db4c321aa4d697e810e0ed0b30bcc91
NFSv4: Always ask for type with READDIR

Again we have claimed regressions for walking a directory tree, this time
with the "find" utility which always tries to optimize away asking for any
attributes until it has a complete list of entries.  This behavior makes
the readdir plus heuristic do the wrong thing, which causes a storm of
GETATTRs to determine each entry's type in order to continue the walk.

For v4 add the type attribute to each READDIR request to include it no
matter the heuristic.  This allows a simple `find` command to proceed
quickly through a directory tree.

Suggested-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/nfs4xdr.c