OSDN Git Service

NFS: Directory page cache pages need to be locked when read
authorTrond Myklebust <trondmy@gmail.com>
Sun, 2 Feb 2020 22:53:54 +0000 (17:53 -0500)
committerAnna Schumaker <Anna.Schumaker@Netapp.com>
Mon, 3 Feb 2020 21:37:17 +0000 (16:37 -0500)
commit114de38225d9b300f027e2aec9afbb6e0def154b
tree91e89fd40ee60c54284a0bdfe56e56aeeb68db4e
parent4b310319c6a8ce708f1033d57145e2aa027a883c
NFS: Directory page cache pages need to be locked when read

When a NFS directory page cache page is removed from the page cache,
its contents are freed through a call to nfs_readdir_clear_array().
To prevent the removal of the page cache entry until after we've
finished reading it, we must take the page lock.

Fixes: 11de3b11e08c ("NFS: Fix a memory leak in nfs_readdir")
Cc: stable@vger.kernel.org # v2.6.37+
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Reviewed-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
fs/nfs/dir.c