Re: [PATCH 0/2] nilfs2: convert O_DIRECT reads to iomap

Christoph Hellwig <[email protected]> Tue, 28 Jul 2026 05:54:43 +0200
Newsgroups org.kernel.vger.linux-nilfs,org.kernel.vger.linux-fsdevel
Message-ID <[email protected]>
On Fri, Jul 24, 2026 at 03:27:43PM -0700, Viacheslav Dubeyko wrote:
> This series removes NILFS2 using of blockdev_direct_IO() by
> converting the O_DIRECT read path to iomap.

I think the important part here is that right now there are no
direct I/O writes in nilfs2, not that you only convert the read
path?

> NILFS2 is
> a log-structured, copy-on-write filesystem, which makes it
> a poor fit for a full iomap conversion. Newly allocated blocks
> are delay-allocated by nilfs_get_block() and only receive a real
> disk address when the segment constructor writes them out
> as part of a log.

That's just how zoned xfs and btrfs work.  In fact they only know
the disk address one the write returns, so even later.

Take a look at the IOMAP_F_ANON_WRITE flag used by xfs.  btrfs implements
a similar scheme, but hidden behind a few layers of cruft.

> The segment constructor walks buffer_head lists
> directly and is not integrated with the generic address_space
> writeback path.

This sounds like word-soup to me.