Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-20291

Direct I/O broken on Lustre client with Linux 6.18+

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Major
    • None
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      On Linux 7.0 6.18 and later kernels, Lustre client Direct I/O is broken.
      All O_DIRECT writes and reads on a Lustre mount return -EINVAL even when
      the user buffer and file offset are properly page-aligned.

       

      Steps to reproduce:

      1. Mount a Lustre filesystem on a client running Linux 7.0+ 6.18+ (e.g. Ubuntu 26.04)
      2. Disable unaligned_dio:
        lctl set_param llite.*.unaligned_dio=0 
      1. Perform an O_DIRECT write with a page-aligned buffer:
        fd = open("testfile", O_WRONLY|O_CREAT|O_DIRECT, 0644);
        posix_memalign(&buf, 4096, 4096);
        n = write(fd, buf, 4096);
        // Returns -1, errno=EINVAL
        

      Root cause

      The compat shim for iov_iter_is_aligned() in include/lustre_compat/linux/uio.h incorrectly checks the kernel stack address instead of the user buffer address for ITER_UBUF iterators,
      causing all aligned buffers to be misidentified as unaligned. The compat shim is used on Linux 7.0+ 6.18+ where iov_iter_is_aligned() is no longer available.

       

      Attachments

        Issue Links

          Activity

            People

              wc-triage WC Triage
              skoyama Sohei Koyama
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: