From: Xinliang Liu Date: Thu, 28 Oct 2021 09:48:38 +0000 (+0000) Subject: LU-11667 tests: Fix sanity test 317 for 64K PAGE_SIZE OST X-Git-Tag: 2.14.56~80 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=63d4d9ff2f5c8cc992ca6b2f698bb43a3257bfb3;hp=85362faed8f5ee94ffee1f3f6330beee57ea9284 LU-11667 tests: Fix sanity test 317 for 64K PAGE_SIZE OST When create a file, blocks are allocated with PAGE_SIZE aligned, see function osd_ldiskfs_map_inode_pages(). E.g. for 64K PAGE_SIZE Arm64 OST server, if create a file with size less than 64K, it actually allocates 128 blocks each block 512 Bytes. It needs to adjust the test for 64K PAGE_SIZE OST server. Test-Parameters: trivial Test-Parameters: clientarch=aarch64 fstype=ldiskfs testlist=sanity \ env=PTLDEBUG=-1,ONLY=317 Test-Parameters: fstype=ldiskfs testlist=sanity \ env=PTLDEBUG=-1,ONLY=317 Change-Id: Iada701f4f424093e847fc70aa843873b75fe6b06 Signed-off-by: Xinliang Liu Reviewed-on: https://review.whamcloud.com/45395 Reviewed-by: Andreas Dilger Reviewed-by: Arshad Hussain Tested-by: jenkins Reviewed-by: James Simmons Tested-by: Maloo Reviewed-by: Oleg Drokin --- diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index c352d89..73e68e8 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -59,8 +59,8 @@ fi if [[ $(uname -m) = aarch64 ]]; then # bug number: LU-11596 ALWAYS_EXCEPT+=" $GRANT_CHECK_LIST" - # bug number: LU-11671 LU-11667 - ALWAYS_EXCEPT+=" 45 317" + # bug number: LU-11671 + ALWAYS_EXCEPT+=" 45" # bug number: LU-14067 LU-14067 ALWAYS_EXCEPT+=" 400a 400b" fi @@ -23891,19 +23891,19 @@ test_317() { # # sparse file test - # Create file with a hole and write actual two blocks. Block count - # must be 16. + # Create file with a hole and write actual 65536 bytes which aligned + # with 4K and 64K PAGE_SIZE. Block count must be 128. # - dd if=/dev/zero of=$DIR/$tfile bs=$grant_blk_size count=2 seek=5 \ - conv=fsync || error "Create file : $DIR/$tfile" - - # Calculate the final truncate size. - trunc_sz=$(($(stat --format=%s $DIR/$tfile) - (grant_blk_size + 1))) + local bs=65536 + dd if=/dev/zero of=$DIR/$tfile bs=$bs count=1 seek=5 conv=fsync || + error "Create file : $DIR/$tfile" # - # truncate to size $trunc_sz bytes. Strip the last block - # The block count must drop to 8 + # Truncate to size $trunc_sz bytes. Strip tail blocks and leave only 8 + # blocks. The block count must drop to 8. # + trunc_sz=$(($(stat --format=%s $DIR/$tfile) - \ + ((bs - grant_blk_size) + 1))) $TRUNCATE $DIR/$tfile $trunc_sz || error "truncate $tfile to $trunc_sz failed"