Reply to Sashiko:
> + if (start_off % dio_align != 0 || writesize % dio_align != 0) {
> + ksft_test_result_skip("DIO alignment (%u) incompatible with "
> + "buf offset %u and writesize %zu\n",
> + dio_align, start_off, writesize);
> + return;
> + }
> Does start_off represent the memory buffer alignment rather than the file
> offset alignment?
> If it represents the memory buffer offset within the page-aligned hugepage,
> should it be validated against stx_dio_mem_align instead of
> stx_dio_offset_align?
Hmm, I don't believe this unless you give me strong evidence here!
After looking though Filesystems for handling the direct IO process, I just
found that Btrfs does the buffer-address alignment check but it uses the
dio_offset_align rather than dio_mem_align.
And, the check_direct_IO() does not actually distinguish between the two
alignments in its fast-path check. It applies dio_offset_align uniformly
to pos, length, and buffer address.
Also, I tried the reproducer on Btrfs, ext2/3/4, xfs, vfat, ntfs, all get
passed with this patch. So I'd keep the patch not check for dio_mem_align.
--
Regards,
Li Wang