Linux block layer
 help / color / mirror / Atom feed
From: John Garry <john.garry@linux.dev>
To: Tal Zussman <tz2294@columbia.edu>,
	Shin'ichiro Kawasaki <shinichiro.kawasaki@wdc.com>,
	linux-block@vger.kernel.org
Cc: Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH blktests v2 4/4] block/052: add a torn atomic write test for block devices
Date: Mon, 12 Oct 2026 09:12:10 +0100	[thread overview]
Message-ID: <7e6e2875-29f7-4cad-94f6-5f0e07569481@linux.dev> (raw)
In-Reply-To: <20261009-blkdev-fixes-tests-v2-4-fcb3599e47f7@columbia.edu>

On 10/10/26 00:53, Tal Zussman wrote:
> An atomic write is submitted as a single bio,

nit: A HW-based atomic write is always a single bio. A SW-based atomic 
write - like which xfs supports - does not have such a limit.

> so when its buffer can't
> be fully pinned, the direct I/O path has to fail the write rather than
> submit the pinned part. Otherwise, it submits what was pinned with
> REQ_ATOMIC set and leaves the rest to the buffered fallback, tearing the
> write at the pin boundary.
> 
> This is a regression test for that issue, fixed in the kernel patch
> "block: fail a short atomic pin in bio_iov_iter_get_pages()" [1].
> 
> Issue pwritev2() with RWF_ATOMIC to a scsi_debug device with atomic_wr=1
> from a buffer whose last page is PROT_NONE, so that pinning the buffer
> stops one page short, then read the range back with O_DIRECT and fail if
> it holds a mix of old and new data.
> 
> The write has to span at least two pages so that one can be left
> unpinnable, and the device has to support it atomically. Use the largest
> power of two up to 16K that the device's atomic write unit max allows,
> and skip the test if that is below two pages.

As you probably saw, we have other atomic writes tests and they use 
xfsprogs (xfs_io, specifically) to issue the atomic write and statx.

Is there scope to use xfsprogs again here? I suppose that the gap is the 
mmap and mprotect call.



  reply	other threads:[~2026-10-12  8:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-09 23:53 [PATCH blktests v2 0/4] blktests: tests for the direct I/O fallback, splice, bio trimming, and atomic write fixes Tal Zussman
2026-10-09 23:53 ` [PATCH blktests v2 1/4] block/049: add a direct I/O write fallback race test for block devices Tal Zussman
2026-10-09 23:53 ` [PATCH blktests v2 2/4] block/050: add a splice read " Tal Zussman
2026-10-09 23:53 ` [PATCH blktests v2 3/4] block/051: add a pinned page leak test for trimmed direct writes Tal Zussman
2026-10-09 23:53 ` [PATCH blktests v2 4/4] block/052: add a torn atomic write test for block devices Tal Zussman
2026-10-12  8:12   ` John Garry [this message]
2026-10-12 15:15     ` Tal Zussman
2026-10-12 16:04   ` John Garry

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=7e6e2875-29f7-4cad-94f6-5f0e07569481@linux.dev \
    --to=john.garry@linux.dev \
    --cc=hch@lst.de \
    --cc=linux-block@vger.kernel.org \
    --cc=shinichiro.kawasaki@wdc.com \
    --cc=tz2294@columbia.edu \
    /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