]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
NFSv4/flexfiles: Remove cred local variable dependency
authorJonathan Curley <jcurley@purestorage.com>
Wed, 24 Sep 2025 16:20:42 +0000 (16:20 +0000)
committerAnna Schumaker <anna.schumaker@oracle.com>
Fri, 26 Sep 2025 19:30:19 +0000 (15:30 -0400)
No-op preparation change to remove dependency on cred local
variable. Subsequent striping diff has a cred per stripe so this local
variable can't be trusted to be the same.

Signed-off-by: Jonathan Curley <jcurley@purestorage.com>
Signed-off-by: Anna Schumaker <anna.schumaker@oracle.com>
fs/nfs/flexfilelayout/flexfilelayout.c

index 15658a0316bf7900bdbb8b09c9089755284e4dfe..2ad371faab983442e7167201a2e0cb44c71f130d 100644 (file)
@@ -532,10 +532,10 @@ ff_layout_alloc_lseg(struct pnfs_layout_hdr *lh,
                if (mirror != fls->mirror_array[i]) {
                        /* swap cred ptrs so free_mirror will clean up old */
                        if (lgr->range.iomode == IOMODE_READ) {
-                               cred = xchg(&mirror->ro_cred, cred);
+                               cred = xchg(&mirror->ro_cred, fls->mirror_array[i]->ro_cred);
                                rcu_assign_pointer(fls->mirror_array[i]->ro_cred, cred);
                        } else {
-                               cred = xchg(&mirror->rw_cred, cred);
+                               cred = xchg(&mirror->rw_cred, fls->mirror_array[i]->rw_cred);
                                rcu_assign_pointer(fls->mirror_array[i]->rw_cred, cred);
                        }
                        ff_layout_free_mirror(fls->mirror_array[i]);