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
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
}
fi
local osc=$($LCTL dl | grep -v mdt | awk '$3 == "osc" {print $4; exit}')
- local host=$(awk '/current_connection:/ {print $2}' /proc/fs/lustre/osc/$osc/import)
- local target=$(awk '/target:/ {print $2}' /proc/fs/lustre/osc/$osc/import)
+ local host=$(lctl get_param -n osc.$osc.import |
+ awk '/current_connection:/ {print $2}' )
+ local target=$(lctl get_param -n osc.$osc.import |
+ awk '/target:/ {print $2}' )
target=${target%_UUID}
[[ -n $target ]] && { setup_obdecho_osc $host $target || rc=1; } || rc=1
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"
+test_221() {
+ cp `which date` $MOUNT
+
+ #define OBD_FAIL_LLITE_FAULT_TRUNC_RACE 0x1401
+ $LCTL set_param fail_loc=0x80001401
+
+ $MOUNT/date > /dev/null
+ rm -f $MOUNT/date
+}
+run_test 221 "make sure fault and truncate race to not cause OOM"
+
#
# tests that do cleanup/setup should be run at the end
#