Re: [PATCH 1/9] block: fix data loss and stale date exposure problems during append write

Christoph Hellwig <[email protected]>
Newsgroups dev.linux.lists.gfs2,dev.linux.lists.ntfs3,dev.linux.lists.nvdimm,dev.linux.lists.virtualization,org.infradead.lists.linux-nvme,org.kernel.vger.linux-block,org.kernel.vger.linux-kernel,org.kernel.vger.linux-xfs
Message-ID <[email protected]>
On Fri, Nov 28, 2025 at 11:22:49AM +0800, Stephen Zhang wrote:
> Therefore, we could potentially change it to::
> 
>         if (bio->bi_status && !READ_ONCE(parent->bi_status))
>                 parent->bi_status = bio->bi_status;
> 
> But as you mentioned, the check might not be critical here. So ultimately,
> we can simplify it to:
> 
>         if (bio->bi_status)
>                 parent->bi_status = bio->bi_status;

It might make sense to just use cmpxchg.  See btrfs_bio_end_io as an
example (although it is operating on the btrfs_bio structure)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.