Whamcloud - gitweb
LU-18284 llite: disallow udio exceptions 71/56571/6
authorShaun Tancheff <shaun.tancheff@hpe.com>
Fri, 4 Oct 2024 01:37:52 +0000 (08:37 +0700)
committerOleg Drokin <green@whamcloud.com>
Tue, 8 Oct 2024 06:20:02 +0000 (06:20 +0000)
Require the unaligned_dio feature flag to be present and
disable limited udio support for 2.14 and 2.15 as these
exceptions cause failures with 2.12 servers.

Test-Parameters: trivial
Test-Parameters: testlist=sanity clientarch=x86_64 clientdistro=el9.4  serverversion=2.12.9 serverdistro=el7.9 env=ONLY="119e 119f 119g 119h 119i 119j",ONLY_REPEAT=10
Test-Parameters: testlist=sanity clientarch=x86_64 clientdistro=el9.2  serverversion=2.12.9 serverdistro=el7.9 env=ONLY="119e 119f 119g 119h 119i 119j",ONLY_REPEAT=10
Test-Parameters: testlist=sanity clientarch=x86_64 clientdistro=el8.10 serverversion=2.12.9 serverdistro=el7.9 env=ONLY="119e 119f 119g 119h 119i 119j",ONLY_REPEAT=10
Test-Parameters: testlist=sanity clientarch=x86_64 clientdistro=el8.10 serverversion=2.15.4 serverdistro=el8.9 env=ONLY="119e 119f 119g 119h 119i 119j",ONLY_REPEAT=10
Fixes: 07a1272233 ("LU-17525 llite: unaligned DIO interop page alignment")
Signed-off-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Change-Id: If3d3d41f3f1f4f96279e9c3d7978f78dd7333259
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56571
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Timothy Day <timday@amazon.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/llite/rw26.c
lustre/tests/sanity.sh

index 4f83756..c3986e9 100644 (file)
@@ -541,27 +541,10 @@ ll_direct_IO_impl(struct kiocb *iocb, struct iov_iter *iter, int rw)
                RETURN(0);
 
        /* Unpatched older servers which cannot safely support unaligned DIO
-        * (osd-zfs) or i/o with page size interop issues should abort here
+        * should abort here
         */
-       if (unaligned && !cl_io_top(io)->ci_allow_unaligned_dio) {
-               unsigned int md0_offset;
-
-               if (cl_io_top(io)->ci_target_is_zfs)
-                       RETURN(-EINVAL);
-
-               /* unpatched ldiskfs is fine, unless MD0 does not align/fit */
-               md0_offset = file_offset & (MD_MAX_INTEROP_PAGE_SIZE - 1);
-               if ((count + md0_offset) >= LNET_MTU) {
-                       u64 iomax, iomin;
-
-                       iomax = cl_io_nob_aligned(file_offset, count,
-                                                 MD_MAX_INTEROP_PAGE_SIZE);
-                       iomin = cl_io_nob_aligned(file_offset, count,
-                                                 MD_MIN_INTEROP_PAGE_SIZE);
-                       if (iomax != iomin)
-                               RETURN(-EINVAL);
-               }
-       }
+       if (unaligned && !cl_io_top(io)->ci_allow_unaligned_dio)
+               RETURN(-EINVAL);
 
        /* if one part of an I/O is unaligned, just handle all of it that way -
         * otherwise we create significant complexities with managing the iovec
index 0ecbdf3..4fa0c46 100755 (executable)
@@ -14405,27 +14405,20 @@ unaligned_dio() {
 }
 
 # With unaligned_dio enabled there are no restrictions on dio.
-unaligned_dio_or_ldiskfs_with_same_page_size()
+unaligned_dio_or_skip()
 {
-       if [[ "${ost1_FSTYPE}" == "zfs" ]]; then
-               $LCTL get_param osc.*.import | grep connect_flags: |
-                       grep -q "unaligned_dio" ||
-               skip "Need ldiskfs server or 'unaligned_dio' support"
-       fi
-       if [[ $(get_page_size ost1) != $PAGE_SIZE ]]; then
-               $LCTL get_param osc.*.import | grep connect_flags: |
-                       grep -q "unaligned_dio" ||
-               skip "Need page interop support"
+       if ! unaligned_dio; then
+               skip "Need 'unaligned_dio' support"
        fi
 }
 
 dio_readv_writev_support()
 {
        # Kernels after 3.16 work:
-       (( $(version_code $(uname -r)) >= $(version_code 3.16) ))
+       (( $(version_code $(uname -r)) >= $(version_code 3.16) )) &&
                return 0
        # Lustre with LU-17524 works:
-       (( $OST1_VERSION > $(version_code 2.15.61.196) ))
+       (( $OST1_VERSION > $(version_code 2.15.61.196) )) &&
                return 0
 
        skip "need readv/writev with O_DIRECT support"
@@ -14474,7 +14467,7 @@ run_test 119c "Testing for direct read hitting hole"
 
 test_119e()
 {
-       unaligned_dio_or_ldiskfs_with_same_page_size
+       unaligned_dio_or_skip
        (( $OSTCOUNT >= 2 )) || skip "needs >= 2 OSTs"
 
        local stripe_size=$((1024 * 1024)) #1 MiB
@@ -14550,7 +14543,7 @@ run_test 119e "Basic tests of dio read and write at various sizes"
 
 test_119f()
 {
-       unaligned_dio_or_ldiskfs_with_same_page_size
+       unaligned_dio_or_skip
        (( $OSTCOUNT >= 2 )) || skip "needs >= 2 OSTs"
 
        local stripe_size=$((1024 * 1024)) #1 MiB
@@ -14625,7 +14618,7 @@ run_test 119f "dio vs dio race"
 
 test_119g()
 {
-       unaligned_dio_or_ldiskfs_with_same_page_size
+       unaligned_dio_or_skip
        (( $OSTCOUNT >= 2 )) || skip "needs >= 2 OSTs"
 
        local stripe_size=$((1024 * 1024)) #1 MiB
@@ -14695,7 +14688,7 @@ run_test 119g "dio vs buffered I/O race"
 
 test_119h()
 {
-       unaligned_dio_or_ldiskfs_with_same_page_size
+       unaligned_dio_or_skip
        (( $OSTCOUNT >= 2 )) || skip "needs >= 2 OSTs"
 
        local stripe_size=$((1024 * 1024)) #1 MiB
@@ -14771,7 +14764,7 @@ run_test 119h "basic tests of memory unaligned dio"
 # aiocp with the '-a' option makes testing memory unaligned aio trivial
 test_119i()
 {
-       unaligned_dio_or_ldiskfs_with_same_page_size
+       unaligned_dio_or_skip
        (( $OSTCOUNT >= 2 )) || skip "needs >= 2 OSTs"
        which aiocp || skip_env "no aiocp installed"
        skip "LU-18032: Unaligned AIO is disabled and may not be re-enabled"
@@ -14835,6 +14828,7 @@ run_test 119i "test unaligned aio at varying sizes"
 
 test_119j()
 {
+       unaligned_dio_or_skip
        (( $LINUX_VERSION_CODE > $(version_code 4.5.0) )) ||
                skip "needs kernel > 4.5.0 for ki_flags support"