From: Abd-Alrhman Masalkhi <abd.masalkhi@gmail.com>
To: John Garry <john.g.garry@oracle.com>,
song@kernel.org, yukuai@fnnas.com, linan122@huawei.com,
martin.petersen@oracle.com, axboe@kernel.dk
Cc: linux-raid@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] raid1: fix nr_pending leak in REQ_ATOMIC bad-block error path
Date: Mon, 01 Jun 2026 11:13:09 +0200 [thread overview]
Message-ID: <m2eciqlj2y.fsf@gmail.com> (raw)
In-Reply-To: <8f8ca66c-aaa6-4b51-bcd7-54203603ba8a@oracle.com>
hi,
On Mon, Jun 01, 2026 at 10:05 +0100, John Garry wrote:
> On 01/06/2026 10:03, Abd-Alrhman Masalkhi wrote:
>>>> +++ b/drivers/md/raid1.c
>>>> @@ -1580,8 +1580,10 @@ static void raid1_write_request(struct mddev *mddev, struct bio *bio,
>>>> * complexity of supporting that is not worth
>>>> * the benefit.
>>>> */
>>>> - if (bio->bi_opf & REQ_ATOMIC)
>>>> + if (bio->bi_opf & REQ_ATOMIC) {
>>>> + rdev_dec_pending(rdev, mddev);
>>> It's not so nice that we have 2x locations that does the
>>> rdev_dec_pending work
>>>
>> Are you suggesting deferring atomic_inc(&rdev->nr_pending) until after
>> the if (test_bit(WriteErrorSeen, &rdev->flags)) {..} block? The patch
>> is already in md-7.2; should I send a separate cleanup patch?
>
> I'm not suggesting any further change. I am just mentioning that it is
> unfortunate that we have 2x locations which does the decrement, which
> makes error handling harder to follow.
You are absolutely right. Having two decrement paths makes the error
handling harder to follow. Thanks for pointing that out.
--
Best Regards,
Abd-Alrhman
prev parent reply other threads:[~2026-06-01 9:13 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-30 15:14 [PATCH] raid1: fix nr_pending leak in REQ_ATOMIC bad-block error path Abd-Alrhman Masalkhi
2026-05-31 10:21 ` Yu Kuai
2026-06-01 8:43 ` John Garry
2026-06-01 9:03 ` Abd-Alrhman Masalkhi
2026-06-01 9:05 ` John Garry
2026-06-01 9:13 ` Abd-Alrhman Masalkhi [this message]
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=m2eciqlj2y.fsf@gmail.com \
--to=abd.masalkhi@gmail.com \
--cc=axboe@kernel.dk \
--cc=john.g.garry@oracle.com \
--cc=linan122@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=song@kernel.org \
--cc=yukuai@fnnas.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