NFS: Fix races nfs_page_group_destroy() vs nfs_destroy_unlinked_subrequests()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Wed, 1 Apr 2020 17:04:49 +0000 (13:04 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Oct 2020 11:12:40 +0000 (13:12 +0200)
commit05a4c45d090948e4f6fde4363407cc09c9839fad
tree669766173379e97c3d896ca9f2d02cff0a50827f
parent78483c1c7741ffa72991d93d19a75bfdcc2cbf57
NFS: Fix races nfs_page_group_destroy() vs nfs_destroy_unlinked_subrequests()

[ Upstream commit 08ca8b21f760c0ed5034a5c122092eec22ccf8f4 ]

When a subrequest is being detached from the subgroup, we want to
ensure that it is not holding the group lock, or in the process
of waiting for the group lock.

Fixes: 5b2b5187fa85 ("NFS: Fix nfs_page_group_destroy() and nfs_lock_and_join_requests() race cases")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/pagelist.c
fs/nfs/write.c
include/linux/nfs_page.h