X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Ftests%2Fsanity-pfl.sh;h=b39ea7cf7f89875d26755f765306dc1430b9a9c6;hb=409719608cf0f607635fca5fb66b84a2e4aa1d4f;hp=df4c1a0cd2c269078a7cd4e4abbe8e5ae3412cad;hpb=ee916af10de2f9e1dd8b79d1f08a78401277ef96;p=fs%2Flustre-release.git diff --git a/lustre/tests/sanity-pfl.sh b/lustre/tests/sanity-pfl.sh index df4c1a0..b39ea7c 100644 --- a/lustre/tests/sanity-pfl.sh +++ b/lustre/tests/sanity-pfl.sh @@ -21,6 +21,10 @@ if [[ $(uname -m) = ppc64 ]]; then ALWAYS_EXCEPT+=" 14 16a 16b 17" fi +if [[ "$ost1_FSTYPE" == "zfs" ]]; then + # bug #: LU-1941 + ALWAYS_EXCEPT+="24a" +fi build_test_filter check_and_setup_lustre @@ -1405,7 +1409,7 @@ test_20a() { wait_mds_ost_sync # First component is on OST0 - $LFS setstripe -E 256M -i 0 -z 64M -E -1 -z 1G $comp_file || + $LFS setstripe -E 256M -i 0 -z 64M -E -1 -z 128M $comp_file || error "Create $comp_file failed" # write past end of first component, so it is extended @@ -1429,12 +1433,12 @@ test_20a() { $LFS getstripe $comp_file flg_opts="--comp-flags init" - found=$($LFS find --comp-start 128M -E 1152M $flg_opts $comp_file | \ + found=$($LFS find --comp-start 128M -E 256M $flg_opts $comp_file | \ wc -l) [ $found -eq 1 ] || error "Write: third component not found" flg_opts="--comp-flags extension" - found=$($LFS find --comp-start 1152M -E EOF $flg_opts $comp_file |wc -l) + found=$($LFS find --comp-start 256M -E EOF $flg_opts $comp_file |wc -l) [ $found -eq 1 ] || error "Write: fourth extension component not found" sel_layout_sanity $comp_file 3 @@ -1458,7 +1462,7 @@ test_20b() { # normal component to 10M, extendable component to 1G # further extendable to EOF - $LFS setstripe -E 10M -E 1G -p $TESTNAME -z 64M -E -1 -p "" -z 512M \ + $LFS setstripe -E 10M -E 1G -p $TESTNAME -z 64M -E -1 -p "" -z 128M \ $comp_file || error "Create $comp_file failed" replay_barrier $SINGLEMDS @@ -1483,11 +1487,11 @@ test_20b() { [ $found -eq 0 ] || error "Write: zero length component still present" flg_opts="--comp-flags init" - found=$($LFS find --comp-start 10M -E 522M $flg_opts $comp_file | wc -l) + found=$($LFS find --comp-start 10M -E 138M $flg_opts $comp_file | wc -l) [ $found -eq 1 ] || error "Write: second component not found" flg_opts="--comp-flags extension" - found=$($LFS find --comp-start 522M -E EOF $flg_opts $comp_file | wc -l) + found=$($LFS find --comp-start 138M -E EOF $flg_opts $comp_file | wc -l) [ $found -eq 1 ] || error "Write: third component not found" fail $SINGLEMDS @@ -1496,11 +1500,11 @@ test_20b() { [ $found -eq 0 ] || error "Failover: 0-length component still present" flg_opts="--comp-flags init" - found=$($LFS find --comp-start 10M -E 522M $flg_opts $comp_file | wc -l) + found=$($LFS find --comp-start 10M -E 138M $flg_opts $comp_file | wc -l) [ $found -eq 1 ] || error "Failover: second component not found" flg_opts="--comp-flags extension" - found=$($LFS find --comp-start 522M -E EOF $flg_opts $comp_file | wc -l) + found=$($LFS find --comp-start 138M -E EOF $flg_opts $comp_file | wc -l) [ $found -eq 1 ] || error "Failover: third component not found" sel_layout_sanity $comp_file 3 @@ -1687,7 +1691,7 @@ test_21b() { test_mkdir -p $DIR/$tdir # DoM, extendable component, further extendable component - $LFS setstripe -E 1M -L mdt -E 256M -i 0 -z 64M -E -1 -z 1G \ + $LFS setstripe -E 1M -L mdt -E 256M -i 0 -z 64M -E -1 -z 128M \ $comp_file || error "Create $comp_file failed" found=$($LFS find --comp-start 1M -E 1M $flg_opts $comp_file | wc -l) @@ -1711,11 +1715,11 @@ test_21b() { [ $found -eq 0 ] || error "Write: Zero length component still present" flg_opts="--comp-flags init" - found=$($LFS find --comp-start 1M -E 1025M $flg_opts $comp_file | wc -l) + found=$($LFS find --comp-start 1M -E 129M $flg_opts $comp_file | wc -l) [ $found -eq 1 ] || error "Write: extended component not found" flg_opts="--comp-flags extension" - found=$($LFS find --comp-start 1025M -E EOF $flg_opts $comp_file |wc -l) + found=$($LFS find --comp-start 129M -E EOF $flg_opts $comp_file |wc -l) [ $found -eq 1 ] || error "Write: extension component not found" sel_layout_sanity $comp_file 3 @@ -2206,6 +2210,66 @@ test_23f() { } run_test 23f "Append with low on space: repeat and remove EXT comp" +OLDIFS="$IFS" +cleanup_24() { + trap 0 + IFS="$OLDIFS" +} + +test_24a() { + [ "$OSTCOUNT" -lt "3" ] && skip_env "needs >= 3 OSTs" + + trap cleanup_24 EXIT RETURN + + local file=$DIR/$tfile + + $LFS setstripe -E 1m -c1 -o0 -E eof -c2 -o1,2 $file || + error "setstripe on $file" + + dd if=/dev/zero of=$file bs=1M count=3 || error "dd failed for $file" + sync + + filefrag -ves $file || error "filefrag $file failed" + filefrag_op=$(filefrag -ve -k $file | + sed -n '/ext:/,/found/{/ext:/d; /found/d; p}') + +#Filesystem type is: bd00bd0 +#File size of /mnt/lustre/f24a.sanity-pfl is 3145728 (3072 blocks of 1024 bytes) +# ext: device_logical: physical_offset: length: dev: flags: +# 0: 0.. 1023: 1572864.. 1573887: 1024: 0000: net +# 1: 0.. 1023: 1572864.. 1573887: 1024: 0002: net +# 2: 1024.. 2047: 1573888.. 1574911: 1024: 0001: last,net +#/mnt/lustre/f24a.sanity-pfl: 3 extents found + + last_lun=$(echo $filefrag_op | cut -d: -f5) + + IFS=$'\n' + tot_len=0 + num_luns=1 + for line in $filefrag_op; do + frag_lun=$(echo $line | cut -d: -f5) + ext_len=$(echo $line | cut -d: -f4) + if [[ "$frag_lun" != "$last_lun" ]]; then + if (( tot_len != 1024 )); then + cleanup_24 + error "$file: OST$last_lun $tot_len != 1024" + else + (( num_luns += 1 )) + tot_len=0 + fi + fi + (( tot_len += ext_len )) + last_lun=$frag_lun + done + if (( num_luns != 3 || tot_len != 1024 )); then + cleanup_24 + error "$file: $num_luns != 3, $tot_len != 1024 on OST$last_lun" + fi + + echo "FIEMAP on $file succeeded" +} +run_test 24a "FIEMAP upon PFL file" + complete $SECONDS check_and_cleanup_lustre exit_status