Whamcloud - gitweb
LU-241 Support crc32c with hardware accelerated instruction as one of lustre checksums
[fs/lustre-release.git] / lustre / tests / sanity.sh
index 18b91e4..aa53e3c 100644 (file)
@@ -4171,13 +4171,12 @@ set_checksums()
        return 0
 }
 
-export ORIG_CSUM_TYPE=""
+export ORIG_CSUM_TYPE="`lctl get_param -n osc/*osc-[^mM]*/checksum_type |
+                        sed 's/.*\[\(.*\)\].*/\1/g' | head -n1`"
 CKSUM_TYPES=${CKSUM_TYPES:-"crc32 adler"}
+[ "$ORIG_CSUM_TYPE" = "crc32c" ] && CKSUM_TYPES="$CKSUM_TYPES crc32c"
 set_checksum_type()
 {
-       [ "$ORIG_CSUM_TYPE" ] || \
-               ORIG_CSUM_TYPE=`lctl get_param -n osc/*osc-[^mM]*/checksum_type |
-                                sed 's/.*\[\(.*\)\].*/\1/g' | head -n1`
        lctl set_param -n osc.*osc-[^mM]*.checksum_type $1
        log "set checksum type to $1"
        return 0
@@ -5090,7 +5089,7 @@ test_104a() {
        OSC=`lctl get_param -n devices | awk '/-osc-/ {print $4}' | head -n 1`
        lctl --device %$OSC deactivate
        lfs df || error "lfs df with deactivated OSC failed"
-       lctl --device %$OSC recover
+       lctl --device %$OSC activate
        lfs df || error "lfs df with reactivated OSC failed"
        rm -f $DIR/$tfile
 }
@@ -8260,21 +8259,22 @@ test_220() { #LU-325
        echo "OST still has $count objects"
 
        free=$((count + last_id - next_id))
-       echo "create $free files..."
+       echo "create $((free - next_id)) files @next_id..."
        createmany -o $DIR/$tdir/f $next_id $free || return 3
 
-       local last_id=$(do_facet mds${MDSIDX} lctl get_param -n \
+       local last_id2=$(do_facet mds${MDSIDX} lctl get_param -n \
                        osc.$mdtosc_proc1.prealloc_last_id)
-       local next_id=$(do_facet mds${MDSIDX} lctl get_param -n \
+       local next_id2=$(do_facet mds${MDSIDX} lctl get_param -n \
                        osc.$mdtosc_proc1.prealloc_next_id)
 
-       echo "after creation, last_id=$last_id, next_id=$next_id"
+       echo "after creation, last_id=$last_id2, next_id=$next_id2"
        $LFS df -i
 
        echo "cleanup..."
 
        do_facet mgs $LCTL pool_remove $FSNAME.$TESTNAME $OST || return 4
        do_facet mgs $LCTL pool_destroy $FSNAME.$TESTNAME || return 5
+       echo "unlink $((free - next_id)) files @ $next_id..."
        unlinkmany $DIR/$tdir/f $next_id $free || return 3
 }
 run_test 220 "the preallocated objects in MDS still can be used if ENOSPC is returned by OST with enough disk space"