]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
pNFS: Avoid a live lock condition in pnfs_update_layout()
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 31 May 2022 15:03:07 +0000 (11:03 -0400)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 26 Aug 2022 08:53:26 +0000 (10:53 +0200)
commitcd37142ca4e0afe96c92b1fbae3644bd658de43b
tree7b03c6a3e2f531c0f9e4a473f87e11d65f7eebc1
parent375d62eafb0155825b2205d99300e73e57ddf691
pNFS: Avoid a live lock condition in pnfs_update_layout()

BugLink: https://bugs.launchpad.net/bugs/1983149
[ Upstream commit 880265c77ac415090090d1fe72a188fee71cb458 ]

If we're about to send the first layoutget for an empty layout, we want
to make sure that we drain out the existing pending layoutget calls
first. The reason is that these layouts may have been already implicitly
returned to the server by a recall to which the client gave a
NFS4ERR_NOMATCHING_LAYOUT response.

The problem is that wait_var_event_killable() could in principle see the
plh_outstanding count go back to '1' when the first process to wake up
starts sending a new layoutget. If it fails to get a layout, then this
loop can continue ad infinitum...

Fixes: 0b77f97a7e42 ("NFSv4/pnfs: Fix layoutget behaviour after invalidation")
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
fs/nfs/callback_proc.c
fs/nfs/pnfs.c
fs/nfs/pnfs.h