]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
NFSv4.1: Fix a race in nfs4_proc_layoutget
authorTrond Myklebust <trond.myklebust@primarydata.com>
Tue, 27 Jun 2017 21:33:38 +0000 (17:33 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Jul 2017 12:41:38 +0000 (14:41 +0200)
commit95b2e0882b4236b9c2884e38a8c070e8c3cc436a
tree86e9c90be271a6e5740040a2ffd816645768d5f1
parentf8da5dee0901ff291a1a99e2c37a23617d8a52ea
NFSv4.1: Fix a race in nfs4_proc_layoutget

commit bd171930e6a3de4f5cffdafbb944e50093dfb59b upstream.

If the task calling layoutget is signalled, then it is possible for the
calls to nfs4_sequence_free_slot() and nfs4_layoutget_prepare() to race,
in which case we leak a slot.
The fix is to move the call to nfs4_sequence_free_slot() into the
nfs4_layoutget_release() so that it gets called at task teardown time.

Fixes: 2e80dbe7ac51 ("NFSv4.1: Close callback races for OPEN, LAYOUTGET...")
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/nfs4proc.c