nfsd4: dp->dl_stid.sc_file doesn't need locking
authorJ. Bruce Fields <bfields@redhat.com>
Fri, 16 Feb 2018 16:49:11 +0000 (11:49 -0500)
committerJ. Bruce Fields <bfields@redhat.com>
Tue, 20 Mar 2018 21:51:12 +0000 (17:51 -0400)
The delegation isn't visible to anyone yet.

Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
fs/nfsd/nfs4state.c

index 33538b98720a521adc71ec5dc899ccd387ed8beb..9e9f32f03bf48de7291617210a134804bce7617f 100644 (file)
@@ -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);