]> git.itanic.dy.fi Git - linux-stable/commit
NFS: Don't overfill uncached readdir pages
authortrondmy@kernel.org <trondmy@kernel.org>
Wed, 19 Jan 2022 00:25:42 +0000 (19:25 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Feb 2022 11:58:30 +0000 (12:58 +0100)
commit98512f35a20028f4793e1b97db96dc75e2ef1cdb
tree84916dc0b9d0a289886f81dfda9f6f82fb51a83f
parentd038dc10afe771949836c67c82387e6f205a933a
NFS: Don't overfill uncached readdir pages

[ Upstream commit d9c4e39c1f8f8a8ebaccf00b8f22c14364b2d27e ]

If we're doing an uncached read of the directory, then we ideally want
to read only the exact set of entries that will fit in the buffer
supplied by the getdents() system call. So unlike the case where we're
reading into the page cache, let's send only one READDIR call, before
trying to fill up the buffer.

Fixes: 35df59d3ef69 ("NFS: Reduce number of RPC calls when doing uncached readdir")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/dir.c