[PATCH v2 0/7] io_uring r/w with metadata

Vincent Fu <[email protected]> Fri, 25 Jul 2025 13:57:56 -0400
Newsgroups org.kernel.vger.fio
Message-ID <[email protected]>
This patch series adds support for io_uring read and write operations for
block devices with metadata.

Patches 1-5 are refactors and cleanups to prepare for the new feature.
Patch 6 adds the actual support for read and write operations with metadata.
Patch 7 adds a test script for this feature using NVMe devices.

This code has been tested using the kernel below:
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs-6.17.integrity

The new feature has passed testing under the following settings:

QEMU NVMe device 512B data size; 8B, 16B, 64B metadata size; 16b Guard PI
QEMU NVMe device 4K data size; 16B, 64B metadata size, 64b Guard PI

I have not been able to run the following tests due to platform
issues:

QEMU NVMe device 4K data size; 16B, 64B metadata size; 16b Guard PI
   nvme format fails
scsi-debug device 
   module is loaded with dif=1,2,or 3 but PI support is not detected

Would appreciate help anyone can provide for the missing test setups.

This series has passed regression testing with fio's automated tests:
https://github.com/vincentkfu/fio/actions/runs/16526902163
https://github.com/vincentkfu/fio/actions/runs/16526978984

These patches are available as a branch in my fork of fio:
https://github.com/vincentkfu/fio/commits/pi-block-v2/

Changes compared to v1:
 - Added patch 1 to store ioengine id in ioengine data
 - Move refactoring changes from original feature patch to prep patches
   (Jens)
 - Added patch 4 to simplify io_u_free
 - Added patch 5 to fill in guard generation options at init time
 - Move metadata-specific code out of line to separate functions (Jens)

Vincent Fu (7):
  engines/io_uring: store ioengine id in ioengine data
  engines/nvme: move inline functions from .c to .h file
  engines/nvme: refactor filling protection information
  engines/io_uring: simplify io_u_free
  engines/io_uring: fill in guard generation options at init time
  engines/io_uring: support r/w with metadata
  t/io_uring_pi: test script for io_uring PI

 engines/io_uring.c  | 315 +++++++++++++++++++++++++++++-----
 engines/nvme.c      |  35 ++--
 engines/nvme.h      |  18 ++
 io_u.h              |   1 +
 os/linux/io_uring.h |  15 ++
 t/io_uring_pi.py    | 408 ++++++++++++++++++++++++++++++++++++++++++++
 6 files changed, 731 insertions(+), 61 deletions(-)
 create mode 100644 t/io_uring_pi.py

-- 
2.47.2