NFSv4: Fix locking in pnfs_generic_recover_commit_reqs
authorTrond Myklebust <trondmy@gmail.com>
Tue, 14 Aug 2018 21:25:37 +0000 (17:25 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 9 Sep 2018 17:55:59 +0000 (19:55 +0200)
commitc5759d5a7e6a00ffd8a342cde8f33340891bd095
treea5a141070ca8830246b848b2ca754bffeac94806
parentbf23ba3737e097d80363b5f5aea6239a952a36a9
NFSv4: Fix locking in pnfs_generic_recover_commit_reqs

commit d0fbb1d8a194c0ec0180c1d073ad709e45503a43 upstream.

The use of the inode->i_lock was converted to a mutex, but we forgot
to remove the old inode unlock/lock() pair that allowed the layout
segment to be put inside the loop.

Reported-by: Jia-Ju Bai <baijiaju1990@gmail.com>
Fixes: e824f99adaaf1 ("NFSv4: Use a mutex to protect the per-inode commit...")
Cc: stable@vger.kernel.org # v4.14+
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/pnfs_nfs.c