]> 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>
Fri, 10 Mar 2023 08:33:24 +0000 (09:33 +0100)
commit85ed3b684414a0a5736aae3783a031c8ddc458a6
treedf879e62e357775d81adf32bbf2f60972b359052
parent05a7e533c8a9c08dee6bb609e02a4175a9181fb9
nfsd: fix race to check ls_layouts

[ Upstream commit 1f8c7182031b62fea60dc366b065bc2729420868 ]

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