public inbox for gfs2@lists.linux.dev
 help / color / mirror / Atom feed
From: Jie Wang <jie.wang@intel.com>
To: agruenba@redhat.com
Cc: bigeasy@linutronix.de, clrkwllms@kernel.org,
	gfs2@lists.linux.dev, linux-rt-devel@lists.linux.dev,
	rostedt@goodmis.org,
	syzbot+642d0561f78362d67d3f@syzkaller.appspotmail.com,
	Jie Wang <jie.wang@intel.com>
Subject: [PATCH v2 2/2] gfs2: move quota_init qc iterator increment
Date: Tue, 21 Apr 2026 16:32:07 +0000	[thread overview]
Message-ID: <20260421163207.48565-3-jie.wang@intel.com> (raw)
In-Reply-To: <20260421163207.48565-1-jie.wang@intel.com>

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>
---
 fs/gfs2/quota.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
index df1cb99c3344..b9e13fe286be 100644
--- a/fs/gfs2/quota.c
+++ b/fs/gfs2/quota.c
@@ -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;
 
-- 
2.34.1


  parent reply	other threads:[~2026-04-21  8:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-20 11:06 [PATCH] gfs2: fix quota init duplicate scan Jie Wang
2026-04-20 12:35 ` Andreas Gruenbacher
2026-04-21 16:32   ` [PATCH v2 0/2] gfs2: fix quota init duplicate scan on PREEMPT_RT Jie Wang
2026-04-21 16:32     ` [PATCH v2 1/2] gfs2: fix quota init duplicate scan Jie Wang
2026-04-22 12:10       ` Andreas Gruenbacher
2026-04-23 13:39         ` [PATCH v3] " Jie Wang
2026-04-23  7:23           ` Andreas Gruenbacher
2026-04-21 16:32     ` Jie Wang [this message]
2026-04-22 12:15       ` [PATCH v2 2/2] gfs2: move quota_init qc iterator increment Andreas Gruenbacher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260421163207.48565-3-jie.wang@intel.com \
    --to=jie.wang@intel.com \
    --cc=agruenba@redhat.com \
    --cc=bigeasy@linutronix.de \
    --cc=clrkwllms@kernel.org \
    --cc=gfs2@lists.linux.dev \
    --cc=linux-rt-devel@lists.linux.dev \
    --cc=rostedt@goodmis.org \
    --cc=syzbot+642d0561f78362d67d3f@syzkaller.appspotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox