All of lore.kernel.org
 help / color / mirror / Atom feed
From: SeongJae Park <sj@kernel.org>
To: Vineet Agarwal <agarwal.vineet2006@gmail.com>
Cc: SeongJae Park <sj@kernel.org>,
	akpm@linux-foundation.org, damon@lists.linux.dev,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/damon/sysfs-schemes: fix double increment of nr_regions
Date: Mon, 11 May 2026 21:53:47 -0700	[thread overview]
Message-ID: <20260512045347.102434-1-sj@kernel.org> (raw)
In-Reply-To: <20260512041157.109845-1-agarwal.vineet2006@gmail.com>

On Tue, 12 May 2026 09:41:57 +0530 Vineet Agarwal <agarwal.vineet2006@gmail.com> wrote:

> damos_sysfs_populate_region_dir() increments
> sysfs_regions->nr_regions twice when adding a new region:
> once explicitly before kobject_init_and_add(), and once
> again through the post-increment used for the kobject name.
> 
> As a result, nr_regions no longer matches the actual
> number of live regions, and region directory names skip
> numbers (1, 3, 5, ...).
> 
> Use the already incremented value for naming instead of
> incrementing nr_regions a second time.
> 
> Fixes: 66178e4ec30a ("mm/damon/sysfs: use damos_walk() for update_schemes_tried_{bytes,regions}")

FYI we decided [1] not to Cc stable@ because the bug is not making meaningful
real user issues.  The above Fixes: is only for people who seek more contexts
about from when the bug was introduced.

> Signed-off-by: Vineet Agarwal <agarwal.vineet2006@gmail.com>

Reviewed-by: SeongJae Park <sj@kernel.org>

> ---

From the next time, please consider adding patch changelog [2] here, with link
to previous revision.  To my understanding, this revision has no change from
the previous revision [1] except dropping the RFC tag.

[1] https://lore.kernel.org/20260511191218.98881-1-agarwal.vineet2006@gmail.com
[2] https://docs.kernel.org/process/submitting-patches.html#commentary


Thanks,
SJ

[...]

  reply	other threads:[~2026-05-12  4:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-12  4:11 [PATCH] mm/damon/sysfs-schemes: fix double increment of nr_regions Vineet Agarwal
2026-05-12  4:53 ` SeongJae Park [this message]
2026-05-13  4:21 ` sashiko-bot
2026-05-13  5:12   ` SeongJae Park

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=20260512045347.102434-1-sj@kernel.org \
    --to=sj@kernel.org \
    --cc=agarwal.vineet2006@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.