]> git.baikalelectronics.ru Git - kernel.git/commit
nfsd: fix race to check ls_layouts
authorBenjamin Coddington <bcodding@redhat.com>
Fri, 27 Jan 2023 16:18:56 +0000 (11:18 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 11 Mar 2023 15:43:49 +0000 (16:43 +0100)
commitf669ef2654b7a74d884af1d8f58e4ef168183561
tree11f7a8ec6a5f51ae1170fd3d6d5505096df52f12
parent7fba3427c7349cbf7dae9ed48c8450ac44c05b79
nfsd: fix race to check ls_layouts

[ Upstream commit fb610c4dbc996415d57d7090957ecddd4fd64fb6 ]

Its possible for __break_lease to find the layout's lease before we've
added the layout to the owner's ls_layouts list.  In that case, setting
ls_recalled = true without actually recalling the layout will cause the
server to never send a recall callback.

Move the check for ls_layouts before setting ls_recalled.

Fixes: 00dd9aef9522 ("nfsd: implement pNFS layout recalls")
Signed-off-by: Benjamin Coddington <bcodding@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfsd/nfs4layouts.c