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:
- Mount a Lustre filesystem on a client running Linux
7.0+6.18+ (e.g. Ubuntu 26.04) - Disable unaligned_dio:
lctl set_param llite.*.unaligned_dio=0
- 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
- is related to
-
LU-19526 iov_iter_is_aligned() should be checking actual buffer address
-
- Open
-