]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerBen Hutchings <ben@decadent.org.uk>
Fri, 22 May 2020 20:19:43 +0000 (21:19 +0100)
commit4a6b1c75bceade9ece26918bb448d42b15afd29b
tree6006af66305e6e2a3be6bcea0be741e783364a78
parentb2b6bbf8c801fa2f9756b095e10c232418f7cddd
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")
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>
[bwh: Backported to 3.16: adjust context]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/nfs/dir.c