NFS: Don't move layouts to plh_return_segs list while in use
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 4 Aug 2020 20:30:30 +0000 (16:30 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 19 Aug 2020 06:24:15 +0000 (08:24 +0200)
commit36dafe0035debe1887967e4234458fa059a2a946
tree1204fa0c8a65f43e88c86a29255a115077263901
parentae189bfb784786e94b3b8826d01253500f95b605
NFS: Don't move layouts to plh_return_segs list while in use

commit ff041727e9e029845857cac41aae118ead5e261b upstream.

If the layout segment is still in use for a read or a write, we should
not move it to the layout plh_return_segs list. If we do, we can end
up returning the layout while I/O is still in progress.

Fixes: e0b7d420f72a ("pNFS: Don't discard layout segments that are marked for return")
Cc: stable@vger.kernel.org # v4.19+
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/pnfs.c