From adb3d20f3c8d3a720b293d3d5977a1849a9e0cb7 Mon Sep 17 00:00:00 2001 From: Bobi Jam Date: Fri, 9 Aug 2024 11:56:36 +0800 Subject: [PATCH] LU-18102 tests: skip read/write in sanity/27J for some kernels Kernel commit v5.11-10234-gcbd59c48ae2b (5.12) skips filemap_read() with 0 file size, commit v6.2-rc4-61-g5956592ce337 (6.2) just correct the last page read in filemap_read(), it still skips the real file read with 0 sized file. Test-Parameters: trivial Fixes: b711af7d24 ("LU-16101 tests: skip sanity/27J for more kernels") Signed-off-by: Bobi Jam Change-Id: I1c562cce1374df7659c8d178fb3601e4dfb01744 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55977 Reviewed-by: Andreas Dilger Reviewed-by: Jian Yu Reviewed-by: Oleg Drokin Tested-by: jenkins Tested-by: Maloo --- lustre/tests/sanity.sh | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 7852a5f..062fd5e 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -2876,11 +2876,6 @@ test_27J() { (( $MDS1_VERSION > $(version_code 2.12.51) )) || skip "Need MDS version newer than 2.12.51" - # skip basic ops on file with foreign LOV tests on 5.12-6.2 kernels - # until the filemap_read() issue is fixed by v6.2-rc4-61-g5956592ce337 - (( $LINUX_VERSION_CODE < $(version_code 5.12.0) || - $LINUX_VERSION_CODE >= $(version_code 6.2.0) )) || - skip "Need kernel < 5.12.0 or >= 6.2.0 for filemap_read() fix" test_mkdir $DIR/$tdir local uuid1=$(cat /proc/sys/kernel/random/uuid) @@ -2949,14 +2944,19 @@ test_27J() { $LFS setstripe -c 2 $DIR/$tdir/${tfile}2 && error "$DIR/$tdir/${tfile}2: setstripe should fail" - # R/W should fail - cat $DIR/$tdir/$tfile && error "$DIR/$tdir/$tfile: read should fail" - cat $DIR/$tdir/${tfile}2 && - error "$DIR/$tdir/${tfile}2: read should fail" - cat /etc/passwd > $DIR/$tdir/$tfile && - error "$DIR/$tdir/$tfile: write should fail" - cat /etc/passwd > $DIR/$tdir/${tfile}2 && - error "$DIR/$tdir/${tfile}2: write should fail" + # skip basic ops on file with foreign LOV tests on >5.12 kernels + (( $LINUX_VERSION_CODE < $(version_code 5.12.0) )) && { + # kernel >= 5.12.0 would skip filemap_read() with 0 sized file + # R/W should fail + cat $DIR/$tdir/$tfile && + error "$DIR/$tdir/$tfile: read should fail" + cat $DIR/$tdir/${tfile}2 && + error "$DIR/$tdir/${tfile}2: read should fail" + cat /etc/passwd > $DIR/$tdir/$tfile && + error "$DIR/$tdir/$tfile: write should fail" + cat /etc/passwd > $DIR/$tdir/${tfile}2 && + error "$DIR/$tdir/${tfile}2: write should fail" + } # chmod should work chmod 222 $DIR/$tdir/$tfile || -- 1.8.3.1