Re: [PATCH v2] iomap: add IOMAP_DIO_FSBLOCK_ALIGNED flag

Qu Wenruo
2025-10-14T04:55:41Z

在 2025/10/14 15:06, Christoph Hellwig 写道:
> On Mon, Oct 13, 2025 at 07:35:16PM +1030, Qu Wenruo wrote:
>> - Remove the btrfs part that utilize the new flag
>> Now it's in the enablement patch of btrfs' bs > ps direct IO support.
>
> I didn't really suggest removing it, but splitting it into a separate
> patch in a two-patch series.

Oh, sorry, I just kept the btrfs part into the enablement patch, and
that enablement patch requires quite some other code that is only
submitted but not yet even merged into btrfs development branch.

Thus I didn't really want to send it right now.

> We could probably even move everything
> through the btrfs tree for 6.18 to get the fix in.

Unfortunately that may not be that easy. Either we merge it early,
meaning just this change + using the new flag in btrfs.
But that means it makes no real change at all, as bs > ps direct IO is
still disabled.

Or we wait for the btrfs sub-block checksum handling patchset merged,
then with the full bs > ps direct IO enablement.
But that also means we're waiting for some other btrfs patches.
There are already too many btrfs bs > ps patches pending now.

I'd prefer to get this merged through iomap tree, then utilize it in
btrfs tree later.
Just like what is going on with the remove_bdev() super block callback.
(VFS change is merged in v6.17, but btrfs will only merge it through v6.19)

Thanks,
Qu

> It's just important
> to keep infrastructure and user separate if you have to e.g. revert the
> btrfs part for some reason, but we have another user in the meantime.
> And I plan to use this for zoned XFS soon.
>
>> + /*
>> + * Align to the larger one of bdev and fs block size, to meet the
>> + * alignment requirement of both layers.
>> + */
>> + if (dio->flags & IOMAP_DIO_FSBLOCK_ALIGNED)
>> + alignment = max(alignment, fs_block_size);
>> +
>
> This looks much nicer, and thanks for the explanation!
>
> Looks good:
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>