]> www.infradead.org Git - users/dwmw2/linux.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Feb 2020 12:37:02 +0000 (04:37 -0800)
commitf977c61c234f8eadcef349ce68a995dbd23f2a2e
treeff3f167fdda03d2cd490776a68eb01a0bfb22fb0
parent8c19c882c6d8d10521659e020e8b4e83aebbfb34
NFS: Directory page cache pages need to be locked when read

commit 114de38225d9b300f027e2aec9afbb6e0def154b upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/dir.c