Skip to content

Commit

Permalink
NFSv4: Don't hold the layoutget locks across multiple RPC calls
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Trond Myklebust authored and amschuma-ntap committed May 17, 2022
1 parent 126966d commit 6949493
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions fs/nfs/nfs4proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -3098,6 +3098,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;
Expand Down

0 comments on commit 6949493

Please sign in to comment.