Re: [PATCH v2] fs/buffer: serialize set_buffer_uptodate against concurrent clears

From: Matthew Wilcox

Date: Thu Jul 30 2026 - 20:46:39 EST


On Thu, Jul 30, 2026 at 06:09:24PM -0400, Chris S wrote:
> Yes, that works. And appreciate your reply.
> I prototyped it, and it survives a journal replay.
>
> Six sites, with bio_add_virt_nofail() covering the submit side:
>
> bh_offset() b_page may be NULL
> buffer_set_crypto_ctx() NULL guard
> __bh_submit() bio_add_virt_nofail() when !b_folio, and
> skip wbc_account_cgroup_owner()
> jbd2_journal_write_metadata_buffer()
> b_folio = NULL, b_data =
> jh->b_frozen_data, not folio_set_bh()
> jbd2_checksum_data(), jbd2_block_tag_csum_set() both kmap the temp bh
> (fs/jbd2/commit.c:705 and :745)
>
> 4 files, +38/-12. I'll send it as the first patch of the series.

Fantastic. Would you care to also include this patch as part of your
series?