public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Damien Le Moal <dlemoal@kernel.org>
To: Yongpeng Yang <yangyongpeng.storage@gmail.com>,
	Christoph Hellwig <hch@lst.de>, Jens Axboe <axboe@kernel.dk>,
	Ming Lei <ming.lei@redhat.com>
Cc: linux-block@vger.kernel.org,
	Yongpeng Yang <yangyongpeng@xiaomi.com>,
	Yongpeng Yang <yangyongpeng.storage@outlook.com>
Subject: Re: [PATCH v3 1/2] loop: use READ_ONCE() to read lo->lo_state without locking
Date: Mon, 15 Dec 2025 20:52:50 +0900	[thread overview]
Message-ID: <b80227a1-d05d-4302-bf12-ad9bfc468351@kernel.org> (raw)
In-Reply-To: <20251215094522.1493061-2-yangyongpeng.storage@gmail.com>

On 12/15/25 18:45, Yongpeng Yang wrote:
> From: Yongpeng Yang <yangyongpeng@xiaomi.com>
> 
> When lo->lo_mutex is not held, direct access may read stale data. This
> patch uses READ_ONCE() to read lo->lo_state and data_race() to silence
> code checkers, and changes all assignments to use WRITE_ONCE().
> 
> Signed-off-by: Yongpeng Yang <yangyongpeng@xiaomi.com>

Looks good to me.

Reviewed-by: Damien Le Moal <dlemoal@kernel.org>

-- 
Damien Le Moal
Western Digital Research

  parent reply	other threads:[~2025-12-15 11:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-15  9:45 [PATCH v3 1/2] loop: use READ_ONCE() to read lo->lo_state without locking Yongpeng Yang
2025-12-15  9:45 ` [PATCH v3 2/2] zloop: use READ_ONCE() to read lo->lo_state in queue_rq path Yongpeng Yang
2025-12-15 11:53   ` Damien Le Moal
2025-12-15 14:38   ` Christoph Hellwig
2025-12-15 11:52 ` Damien Le Moal [this message]
2025-12-15 14:38 ` [PATCH v3 1/2] loop: use READ_ONCE() to read lo->lo_state without locking Christoph Hellwig
2025-12-15 15:07   ` Yongpeng Yang

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=b80227a1-d05d-4302-bf12-ad9bfc468351@kernel.org \
    --to=dlemoal@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=ming.lei@redhat.com \
    --cc=yangyongpeng.storage@gmail.com \
    --cc=yangyongpeng.storage@outlook.com \
    --cc=yangyongpeng@xiaomi.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