[LTP] [PATCH 2/3] syscalls/statx10: Add basic test for STATX_DIOALIGN

Eric Biggers ebiggers@kernel.org
Mon Apr 3 05:06:21 CEST 2023


On Mon, Apr 03, 2023 at 01:24:07AM +0000, xuyang2018.jy@fujitsu.com wrote:
> 
> Thanks for your explaination. IMO, ext4 and xfs should supported DIO.
> 
> I think I can test STATX_DIOALIGN only on ext4 and xfs (xfs can use 
> XFS_IOC_DIOINFO ioctl to verify dio alignment information ) instead of 
> all filesystem.
> 
> What do you think about it?

ext4 supports direct I/O only on files that don't use any of the following
filesystem features: data journalling, encryption, and verity.  Also potentially
future filesystem features that have yet to even be envisioned...

But, I suppose that if you create an ext4 filesystem with the default options,
mount it with the default options, and don't call any ioctls to enable features,
it's fairly safe to assume that direct I/O is supported.

> 
> > 
> >>> Filesystems aren't guaranteed to
> >>> support DIO, if they do, they aren't guaranteed to support it on all files.
> >>
> >> In this case, I only test a regular file.
> > 
> > It is possible that on a single filesystem, direct I/O is supported on some
> > regular files but not others.  It is also possible that files on the same
> > filesystem have different direct I/O alignment restrictions.
> > 
> > Likewise, this was part of the motivation for STATX_DIOALIGN.
> 
> Understand, If only test ext4 and xfs,  except for regular file, Which 
> file type does I should test?  device file, link file...

Just regular files.

You could also test block devices, which are unrelated to filesystems.

- Eric


More information about the ltp mailing list