]> git.baikalelectronics.ru Git - kernel.git/commitdiff
NFS/flexfiles: Fix up sparse RCU annotations
authorTrond Myklebust <trond.myklebust@hammerspace.com>
Tue, 26 Feb 2019 16:56:12 +0000 (11:56 -0500)
committerTrond Myklebust <trond.myklebust@hammerspace.com>
Fri, 1 Mar 2019 21:20:16 +0000 (16:20 -0500)
Signed-off-by: Trond Myklebust <trond.myklebust@hammerspace.com>
fs/nfs/flexfilelayout/flexfilelayout.c

index 32701b6a95660f417c931d37304802bf254c2181..244a03c22b312ff0621ded3f0bd5b6c2116f403a 100644 (file)
@@ -410,7 +410,7 @@ ff_layout_alloc_lseg(struct pnfs_layout_hdr *lh,
        for (i = 0; i < fls->mirror_array_cnt; i++) {
                struct nfs4_ff_layout_mirror *mirror;
                struct cred *kcred;
-               const struct cred *cred;
+               const struct cred __rcu *cred;
                kuid_t uid;
                kgid_t gid;
                u32 ds_count, fh_count, id;
@@ -501,7 +501,7 @@ ff_layout_alloc_lseg(struct pnfs_layout_hdr *lh,
                        goto out_err_free;
                kcred->fsuid = uid;
                kcred->fsgid = gid;
-               cred = kcred;
+               cred = RCU_INITIALIZER(kcred);
 
                if (lgr->range.iomode == IOMODE_READ)
                        rcu_assign_pointer(fls->mirror_array[i]->ro_cred, cred);