News: 0001476289

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

Linux 6.11 To Introduce Block Atomic Writes - Including NVMe & SCSI Support

([Linux Storage] 6 Hours Ago Atomic Writes)


The Linux kernel's block subsystem for storage is poised to introduce support for atomic writes with the upcoming [1]Linux 6.11 merge window.

Ahead of the Linux 6.11 merge window opening up in the next week or so, block subsystem maintainer Jens Axboe has been preparing his "for-6.11" Git branches of new material set to be introduced. Among the recently queued up patches have been Oracle's work around atomic writes. The block atomic writes support includes the plumbing for SCSI and NVMe storage and is set for merging in Linux 6.11.

Oracle engineer John Garry led the charge on this block atomic writes capabilities and explained in [2]the patch series :

"This series introduces a proposal to implementing atomic writes in the kernel for torn-write protection.

This series takes the approach of adding a new "atomic" flag to each of pwritev2() and iocb->ki_flags - RWF_ATOMIC and IOCB_ATOMIC, respectively. When set, these indicate that we want the write issued "atomically".

Only direct IO is supported and for block devices here. For this, atomic write HW is required, like SCSI ATOMIC WRITE (16).

...

The goal here is to provide an interface that allows applications use application-specific block sizes larger than logical block size reported by the storage device or larger than filesystem block size as reported by stat().

With this new interface, application blocks will never be torn or fractured when written. For a power fail, for each individual application block, all or none of the data to be written. A racing atomic write and read will mean that the read sees all the old data or all the new data, but never a mix of old and new.

...

SCSI sd.c and scsi_debug and NVMe kernel support is added."

Separately there are patches pending for the XFS file-system in making use of this atomic write support.

This atomic write support is living within the [3]linux-block.git's for-6.11/block branch until the Linux 6.11 merge window opens up.



[1] https://www.phoronix.com/search/Linux+6.11

[2] https://lore.kernel.org/all/20240620125359.2684798-1-john.g.garry@oracle.com/

[3] https://git.kernel.org/pub/scm/linux/kernel/git/axboe/linux-block.git/log/?h=for-6.11/block



Kjell

ol3geezer

geerge

/me thinks ext2 code is more effectively encrypted than DVDs are ;)

- Andrew Ebling on #kernelnewbies