Re: [PATCH 4/4] xfs: fallback to buffered I/O for direct I/O when stable writes are required

Christoph Hellwig
2025-10-30T07:17:15Z

On Thu, Oct 30, 2025 at 05:44:22PM +1030, Qu Wenruo wrote:
> Because for whatever reasons, although the only reason I can come up with
> is performance.
>
> I thought the old kernel principle is, providing the mechanism not the
> policy.
> But the fallback-to-buffered looks more like a policy, and if that's the
> case user space should be more suitable.

I don't think so. O_DIRECT really is a hint. We already do fallbacks
for various reasons (for XFS e.g. unaligned writes on COW files), and
btrfs in fact falls back for any alignment mismatch already. And there's
really nothing an application can do when the most optimal way is not
available except for using a less optimal one. So there's really no
value add for an option to fail.