Skip to content

Commit

Permalink
nfsd4: dp->dl_stid.sc_file doesn't need locking
Browse files Browse the repository at this point in the history
The delegation isn't visible to anyone yet.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
  • Loading branch information
J. Bruce Fields committed Mar 20, 2018
1 parent 653e514 commit 0c911f5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/nfsd/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -4411,9 +4411,10 @@ nfs4_set_delegation(struct nfs4_client *clp, struct svc_fh *fh,
return ERR_PTR(-ENOMEM);

get_nfs4_file(fp);
dp->dl_stid.sc_file = fp;

spin_lock(&state_lock);
spin_lock(&fp->fi_lock);
dp->dl_stid.sc_file = fp;
if (!fp->fi_deleg_file) {
spin_unlock(&fp->fi_lock);
spin_unlock(&state_lock);
Expand Down

0 comments on commit 0c911f5

Please sign in to comment.