]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
NFSv4/pNFS: Fix a race to wake on NFS_LAYOUT_DRAIN
authorBenjamin Coddington <bcodding@redhat.com>
Thu, 19 Jun 2025 15:02:21 +0000 (11:02 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Jul 2025 14:03:06 +0000 (16:03 +0200)
commit8ca65fa71024a1767a59ffbc6a6e2278af84735e
treede014df4ee274cedacf5f3bb9cbf5b1f5ae05ac1
parentd0877c479f44fe475f4c8c02c88ce9ad43e90298
NFSv4/pNFS: Fix a race to wake on NFS_LAYOUT_DRAIN

[ Upstream commit c01776287414ca43412d1319d2877cbad65444ac ]

We found a few different systems hung up in writeback waiting on the same
page lock, and one task waiting on the NFS_LAYOUT_DRAIN bit in
pnfs_update_layout(), however the pnfs_layout_hdr's plh_outstanding count
was zero.

It seems most likely that this is another race between the waiter and waker
similar to commit ed0172af5d6f ("SUNRPC: Fix a race to wake a sync task").
Fix it up by applying the advised barrier.

Fixes: 880265c77ac4 ("pNFS: Avoid a live lock condition in pnfs_update_layout()")
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfs/pnfs.c