Re: [PATCH 1/2] block: fail a short atomic bounce in bio_iov_iter_bounce_write()

From: John Garry

Date: Mon Nov 09 2026 - 13:48:46 EST


On 11/9/26 18:27, Tal Zussman wrote:
This looks reasonable, as atomic stable writes are implied to be
supported from 3373503df025a ("xfs: use bounce buffering direct I/O when
the device requires stable pages"). I am wondering how to test and prove
this (change is good and maintained)?

I tested this with XFS on scsi_debug (dif=1 dix=1 atomic_wr=1), doing
1M RWF_ATOMIC direct writes and using fail_page_alloc to make the
folio allocations in bio_alloc_bounce_folios() fail partway through.
I had an LLM make it pretty precise and target bio_alloc_bounce_folios()
using the stack filtering mechanism, so I don't think this necessarily
makes sense as an xfstest if that's what you were thinking...

Without this patch, the write returns -EINVAL and hits the
WARN_ON_ONCE() in iomap_dio_bio_iter_one(). With it, the write returns
-EINVAL without the warning.

This also happened to turn up a scsi_debug bug: with dif=1 dix=1 it
doesn't store the protection information for WRITE ATOMIC(16), so
reading back an atomic write fails. I'll send a separate patch for that.

ok, I'll await the patch.


Does that answer your question/is that what you were getting at?

Yes, this is ok. I am really just getting at whether we can add a test for this scenario.

Thanks,
John