pNFS: Always free the session slot on error in nfs4_layoutget_handle_exception
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Fri, 15 Jun 2018 19:58:45 +0000 (15:58 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 24 Aug 2018 11:09:01 +0000 (13:09 +0200)
commit586ae5694e375ceced8abafe1501eece4e922852
tree6a9e5506550241ed84d5e34bc3f506facc54c4a6
parent395c67c1c02d6282a61224139560050c9d238479
pNFS: Always free the session slot on error in nfs4_layoutget_handle_exception

[ Upstream commit 2dbf8dffbf35fd8f611083b9d9fe74fdccf912a3 ]

Right now, we can call nfs_commit_inode() while holding the session slot,
which could lead to NFSv4 deadlocks. Ensure we only keep the slot if
the server returned a layout that we have to process.

Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfs/nfs4proc.c