]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
gfs2: move quota_init qc iterator increment
authorJie Wang <jie.wang@intel.com>
Tue, 21 Apr 2026 16:32:07 +0000 (16:32 +0000)
committerAndreas Gruenbacher <agruenba@redhat.com>
Thu, 23 Apr 2026 07:18:48 +0000 (09:18 +0200)
Move qc++ from the loop body into the for-loop increment
expression in gfs2_quota_init().

This keeps iterator progression explicit and avoids mixing pointer
advance with duplicate-slot handling in the loop body.

Signed-off-by: Jie Wang <jie.wang@intel.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
fs/gfs2/quota.c

index 934397248fe76c5839d4a0dbf4984055c2150e9d..91e9975d25e890f89d5ca42a3aabe0b019d54351 100644 (file)
@@ -1447,7 +1447,7 @@ int gfs2_quota_init(struct gfs2_sbd *sdp)
 
                qc = (struct gfs2_quota_change *)(bh->b_data + sizeof(struct gfs2_meta_header));
                for (y = 0; y < sdp->sd_qc_per_block && slot < sdp->sd_quota_slots;
-                    y++, slot++) {
+                    y++, slot++, qc++) {
                        struct gfs2_quota_data *old_qd, *qd;
                        s64 qc_change = be64_to_cpu(qc->qc_change);
                        u32 qc_flags = be32_to_cpu(qc->qc_flags);
@@ -1455,7 +1455,6 @@ int gfs2_quota_init(struct gfs2_sbd *sdp)
                                                USRQUOTA : GRPQUOTA;
                        struct kqid qc_id = make_kqid(&init_user_ns, qtype,
                                                      be32_to_cpu(qc->qc_id));
-                       qc++;
                        if (!qc_change)
                                continue;