diff options
author | Trond Myklebust <trond.myklebust@hammerspace.com> | 2022-05-14 10:08:14 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-06-14 16:59:34 +0200 |
commit | 6b3fc1496e7227cd6a39a80bbfb7588ef7c7a010 (patch) | |
tree | 0045caf3b326a2b7b57206a3cc56663595d0969b | |
parent | c4bf25d23ff848701d4a34065787ed038548d212 (diff) | |
download | linux-stable-6b3fc1496e7227cd6a39a80bbfb7588ef7c7a010.tar.gz |
NFSv4: Don't hold the layoutget locks across multiple RPC calls
[ Upstream commit 6949493884fe88500de4af182588e071cf1544ee ]
When doing layoutget as part of the open() compound, we have to be
careful to release the layout locks before we can call any further RPC
calls, such as setattr(). The reason is that those calls could trigger
a recall, which could deadlock.
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
Signed-off-by: Anna Schumaker <Anna.Schumaker@Netapp.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | fs/nfs/nfs4proc.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index 759c834b60fd..f48a11fa78bb 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -2920,6 +2920,10 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata, } out: + if (opendata->lgp) { + nfs4_lgopen_release(opendata->lgp); + opendata->lgp = NULL; + } if (!opendata->cancelled) nfs4_sequence_free_slot(&opendata->o_res.seq_res); return ret; |