From: Sajal Gupta <sajal2005gupta@gmail.com>
To: error27@gmail.com
Cc: linux-raid@vger.kernel.org, song@kernel.org, yukuai3@huawei.com,
tomasz.majchrzak@intel.com, linux-kernel@vger.kernel.org,
skhan@linuxfoundation.org, me@brighamcampbell.com,
linux-kernel-mentees@lists.linux.dev
Subject: Re: [PATCH] md/raid5-ppl: convert pending_flushes from atomic_t to refcount_t
Date: Mon, 22 Jun 2026 15:58:58 +0530 [thread overview]
Message-ID: <20260622102859.38034-1-sajal2005gupta@gmail.com> (raw)
In-Reply-To: <ajj1yljwrUk0bZwp@stanley.mountain>
Hi Dan,
> Have you tested this at all because it doesn't seem at all correct to
> me...
I have only done compile test, sorry, I forgot to mention that.
> How I imagined this would work would be:
> patch 1: add a break statement to fix the use after free
> patch 2: s/atomic_t/recount_t/
> The difference between atomic_t and refcount_t is that refount_t warns
> about overflows and underflows.
I did it like this because that is the pattern mostly used in the codebase.
Simple s/atomic_t/recount_t/ would have
refcount_set(&io->pending_flushes, 0) in init
and then later refcount_set(&io->pending_flushes, raid_disks) in
ppl_do_flush, which is not the usual way. I am treating it as a proper reference
counter rather than a mechanical type swap.
If that is too invasive, I’ll rework it into the break fix first, and do
s/atomic_t/recount_t cleanup separately.
Thanks,
Sajal
next prev parent reply other threads:[~2026-06-22 10:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-22 8:04 [PATCH] md/raid5-ppl: convert pending_flushes from atomic_t to refcount_t Sajal Gupta
2026-06-22 8:42 ` Dan Carpenter
2026-06-22 8:43 ` Dan Carpenter
2026-06-22 10:28 ` Sajal Gupta [this message]
2026-06-22 10:57 ` Dan Carpenter
2026-06-22 11:28 ` Sajal Gupta
2026-06-22 11:38 ` Dan Carpenter
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=20260622102859.38034-1-sajal2005gupta@gmail.com \
--to=sajal2005gupta@gmail.com \
--cc=error27@gmail.com \
--cc=linux-kernel-mentees@lists.linux.dev \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=me@brighamcampbell.com \
--cc=skhan@linuxfoundation.org \
--cc=song@kernel.org \
--cc=tomasz.majchrzak@intel.com \
--cc=yukuai3@huawei.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