Linux-Raid Archives mirror
 help / color / mirror / Atom feed
From: Song Liu <song@kernel.org>
To: Yu Kuai <yukuai1@huaweicloud.com>
Cc: Gui-Dong Han <2045gemini@gmail.com>,
	linux-raid@vger.kernel.org,  linux-kernel@vger.kernel.org,
	baijiaju1990@outlook.com,  stable@vger.kernel.org,
	"yukuai (C)" <yukuai3@huawei.com>
Subject: Re: [PATCH v4] md/raid5: fix atomicity violation in raid5_cache_count
Date: Tue, 27 Feb 2024 14:28:00 -0800	[thread overview]
Message-ID: <CAPhsuW5u1SHCjw-0EUEvOp9-+nyh3s67Nio=OR=P1ftRTe33gA@mail.gmail.com> (raw)
In-Reply-To: <e0c5f9d4-6b65-02f7-2a8c-0484fd1f9815@huaweicloud.com>

On Thu, Feb 1, 2024 at 11:11 PM Yu Kuai <yukuai1@huaweicloud.com> wrote:
>
> Hi,
>
> 在 2024/01/30 15:37, Song Liu 写道:
> > On Thu, Jan 11, 2024 at 11:10 PM Gui-Dong Han <2045gemini@gmail.com> wrote:
> >>
> > [...]
> >>
> >>          raid5_release_stripe(sh);
> >> -       conf->max_nr_stripes++;
> >> +       WRITE_ONCE(conf->max_nr_stripes, conf->max_nr_stripes + 1);
> >
> > This is weird. We are reading max_nr_stripes without READ_ONCE.
>
> We don't need READ_ONCE() here because writers are protected by
> 'cache_size_mutex', there are no concurrent writers, it's safe to
> read 'max_nr_stripes' directly.

OK, that makes sense. Applied to md-6.9.

Thanks,
Song

      reply	other threads:[~2024-02-27 22:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-12  7:10 [PATCH v4] md/raid5: fix atomicity violation in raid5_cache_count Gui-Dong Han
2024-01-14  3:12 ` Yu Kuai
2024-01-30  7:37 ` Song Liu
2024-02-02  7:11   ` Yu Kuai
2024-02-27 22:28     ` Song Liu [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='CAPhsuW5u1SHCjw-0EUEvOp9-+nyh3s67Nio=OR=P1ftRTe33gA@mail.gmail.com' \
    --to=song@kernel.org \
    --cc=2045gemini@gmail.com \
    --cc=baijiaju1990@outlook.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=yukuai1@huaweicloud.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).