lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aUERE4HJN_ek4Eba@infradead.org>
Date: Mon, 15 Dec 2025 23:58:11 -0800
From: Christoph Hellwig <hch@...radead.org>
To: Andreas Gruenbacher <agruenba@...hat.com>
Cc: Christoph Hellwig <hch@...radead.org>, Jens Axboe <axboe@...nel.dk>,
	Chris Mason <clm@...com>, David Sterba <dsterba@...e.com>,
	linux-block@...r.kernel.org, linux-btrfs@...r.kernel.org,
	linux-raid@...r.kernel.org, dm-devel@...ts.linux.dev,
	linux-kernel@...r.kernel.org
Subject: Re: [RFC 03/12] bio: add bio_set_errno

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.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ