public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Andreas Gruenbacher <agruenba@redhat.com>
Cc: Christoph Hellwig <hch@infradead.org>,
	Jens Axboe <axboe@kernel.dk>, Chris Mason <clm@fb.com>,
	David Sterba <dsterba@suse.com>,
	linux-block@vger.kernel.org, linux-btrfs@vger.kernel.org,
	linux-raid@vger.kernel.org, dm-devel@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC 03/12] bio: add bio_set_errno
Date: Mon, 15 Dec 2025 23:58:11 -0800	[thread overview]
Message-ID: <aUERE4HJN_ek4Eba@infradead.org> (raw)
In-Reply-To: <20251208121020.1780402-4-agruenba@redhat.com>

On Mon, Dec 08, 2025 at 12:10:10PM +0000, Andreas Gruenbacher wrote:
> Add a bio_set_errno(bio, errno) helper that sets bio->bi_status to
> errno_to_blk_status(errno) if errno != 0.  Replace instances of this
> pattern in the code with a call to the new helper.
> 
> The WRITE_ONCE() in bio_set_errno() ensures that the compiler won't
> reorder things in a weird way, but it isn't needed to prevent tearing
> because a single-byte field like bi_status cannot tear.

Not a fan of this.  We should not be doing that very often (and as
seen by the diff don't), so don't add a helper for it that makes
people do it more often.


  reply	other threads:[~2025-12-16  7:58 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-08 12:10 [RFC 00/12] bio cleanups Andreas Gruenbacher
2025-12-08 12:10 ` [RFC 01/12] bio: rename bio_chain arguments Andreas Gruenbacher
2025-12-16  7:57   ` Christoph Hellwig
2025-12-08 12:10 ` [RFC 02/12] bio: use bio_io_error more often Andreas Gruenbacher
2025-12-16  7:57   ` Christoph Hellwig
2025-12-08 12:10 ` [RFC 03/12] bio: add bio_set_errno Andreas Gruenbacher
2025-12-16  7:58   ` Christoph Hellwig [this message]
2025-12-08 12:10 ` [RFC 04/12] bio: use bio_set_errno in more places Andreas Gruenbacher
2025-12-08 12:10 ` [RFC 05/12] bio: add bio_set_status Andreas Gruenbacher
2025-12-16  7:59   ` Christoph Hellwig
2025-12-08 12:10 ` [RFC 06/12] bio: don't check target->bi_status on error Andreas Gruenbacher
2025-12-16  7:59   ` Christoph Hellwig
2025-12-16  8:41     ` Andreas Gruenbacher
2025-12-16 10:44       ` Christoph Hellwig
2025-12-16 11:20         ` Andreas Gruenbacher
2025-12-18  8:47           ` Christoph Hellwig
2025-12-19 20:14             ` Andreas Gruenbacher
2025-12-08 12:10 ` [RFC 07/12] bio: use bio_set_status for BLK_STS_* status codes Andreas Gruenbacher
2025-12-08 12:10 ` [RFC 08/12] bio: use bio_set_status in some more places Andreas Gruenbacher
2025-12-08 12:10 ` [RFC 09/12] bio: switch to bio_set_status in submit_bio_noacct Andreas Gruenbacher
2025-12-08 12:10 ` [RFC 10/12] bio: never set bi_status to BLK_STS_OK during completion Andreas Gruenbacher
2025-12-08 12:10 ` [RFC 11/12] bio: add bio_endio_errno Andreas Gruenbacher
2025-12-16  8:00   ` Christoph Hellwig
2025-12-08 12:10 ` [RFC 12/12] bio: add bio_endio_status Andreas Gruenbacher
2025-12-16  8:01   ` Christoph Hellwig
2025-12-08 19:37 ` [RFC 00/12] bio cleanups David Sterba
2025-12-08 21:16   ` Andreas Gruenbacher

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=aUERE4HJN_ek4Eba@infradead.org \
    --to=hch@infradead.org \
    --cc=agruenba@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=clm@fb.com \
    --cc=dm-devel@lists.linux.dev \
    --cc=dsterba@suse.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    /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