mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: John Garry <john.g.garry@oracle.com>
To: Abd-Alrhman Masalkhi <abd.masalkhi@gmail.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, 1 Jun 2026 10:05:50 +0100	[thread overview]
Message-ID: <8f8ca66c-aaa6-4b51-bcd7-54203603ba8a@oracle.com> (raw)
In-Reply-To: <m2h5nmljj6.fsf@gmail.com>

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.

  reply	other threads:[~2026-06-01  9:11 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-30 15:14 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 [this message]
2026-06-01  9:13       ` Abd-Alrhman Masalkhi

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=8f8ca66c-aaa6-4b51-bcd7-54203603ba8a@oracle.com \
    --to=john.g.garry@oracle.com \
    --cc=abd.masalkhi@gmail.com \
    --cc=axboe@kernel.dk \
    --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

all inboxes | Powered by JetHome®