Re: [PATCH v2 2/2] gfs2: move quota_init qc iterator increment

Andreas Gruenbacher <[email protected]> Wed, 22 Apr 2026 14:15:03 +0200
Newsgroups dev.linux.lists.gfs2,dev.linux.lists.linux-rt-devel
Message-ID <CAHc6FU4VNTMJT3cVbaUr_gUSe4=wo2tNP2XT-XbxzqEyaRh_sQ@mail.gmail.com>
On Tue, Apr 21, 2026 at 10:44 AM Jie Wang <[email protected]> wrote:
> 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 <[email protected]>
> ---
>  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
>

Thanks, I'll add this to for-next once -rc1 is out.

Andreas