ONLY=${ONLY:-"$*"}
-#Bug number for excepting test LU-10406
-ALWAYS_EXCEPT="$SANITY_LFSCK_EXCEPT 31c"
+#Bug number for excepting test
+ALWAYS_EXCEPT="$SANITY_LFSCK_EXCEPT"
[ "$SLOW" = "no" ] && EXCEPT_SLOW=""
# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
local D_POS1=$($SHOW_NAMESPACE |
awk '/^latest_start_position/ { print $4 }')
+ echo "Additional debug for 6b"
+ $SHOW_NAMESPACE
if [ "$D_POS0" == "N/A" -o "$D_POS1" == "N/A" ]; then
[[ $O_POS0 -lt $O_POS1 ]] ||
error "(7.1) $O_POS1 is not larger than $O_POS0"
dd if=/dev/zero of=$DIR/$tdir/f0 bs=1M count=1
cancel_lru_locks osc
+ # created but no setattr or write to the file.
+ mkdir $DIR/$tdir/d1
+ chown $RUNAS_ID:$RUNAS_GID $DIR/$tdir/d1
+ $RUNAS createmany -o $DIR/$tdir/d1/o 100 || error "create failed"
+
echo "Inject failure stub to skip OST-object owner changing"
#define OBD_FAIL_LFSCK_BAD_OWNER 0x1613
do_facet $SINGLEMDS $LCTL set_param fail_loc=0x1613
run_test 18a "Find out orphan OST-object and repair it (1)"
test_18b() {
+ [ -n "$FILESET" ] && skip "Not functional for FILESET set"
+
echo "#####"
echo "The target MDT-object is lost. The LFSCK should re-create the"
echo "MDT-object under .lustre/lost+found/MDTxxxx. The admin should"
run_test 18b "Find out orphan OST-object and repair it (2)"
test_18c() {
+ [ -n "$FILESET" ] && skip "Not functional for FILESET set"
+
echo "#####"
echo "The target MDT-object is lost, and the OST-object FID is missing."
echo "The LFSCK should re-create the MDT-object with new FID under the "
run_test 18d "Find out orphan OST-object and repair it (4)"
test_18e() {
+ [ -n "$FILESET" ] && skip "Not functional for FILESET set"
+
echo "#####"
echo "The target MDT-object layout EA slot is occpuied by some new"
echo "created OST-object when repair dangling reference case. Such"
run_test 18f "Skip the failed OST(s) when handle orphan OST-objects"
test_18g() {
+ [ -n "$FILESET" ] && skip "Not functional for FILESET set"
+
echo "#####"
echo "The target MDT-object is lost, but related OI mapping is there"
echo "The LFSCK should recreate the lost MDT-object without affected"
test_20a() {
[ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return
+ [ -n "$FILESET" ] && skip "Not functional for FILESET set"
echo "#####"
echo "The target MDT-object and some of its OST-object are lost."
test_20b() {
[ $OSTCOUNT -lt 2 ] && skip "needs >= 2 OSTs" && return
+ [ -n "$FILESET" ] && skip "Not functional for FILESET set"
echo "#####"
echo "The target MDT-object and some of its OST-object are lost."
test_24() {
[ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
+ [ -n "$FILESET" ] && skip "Not functional for FILESET set"
echo "#####"
echo "Two MDT-objects back reference the same name entry via their"
run_test 26b "LFSCK can add the missing remote name entry back to the namespace"
test_27a() {
+ [ -n "$FILESET" ] && skip "Not functional for FILESET set"
+
echo "#####"
echo "The local parent referenced by the MDT-object linkEA is lost."
echo "The namespace LFSCK will re-create the lost parent as orphan."
test_27b() {
[ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
+ [ -n "$FILESET" ] && skip "Not functional for FILESET set"
echo "#####"
echo "The remote parent referenced by the MDT-object linkEA is lost."
test_30() {
[ $(facet_fstype $SINGLEMDS) != ldiskfs ] &&
skip "ldiskfs only test" && return
+ [ -n "$FILESET" ] && skip "Not functional for FILESET set"
echo "#####"
echo "The namespace LFSCK will move the orphans from backend"
}
run_test 36c "rebuild LOV EA for mirrored file (3)"
+test_37()
+{
+ local PID
+ local rc
+ local t_dir="$DIR/$tdir/d0"
+ check_mount_and_prep
+
+ $LFS mkdir -i 0 $t_dir || error "(2) Fail to mkdir $t_dir on MDT0"
+ multiop_bg_pause $t_dir D_c || { error "multiop failed: $?"; return 1; }
+ PID=$!
+ rmdir $t_dir
+
+ $START_NAMESPACE -r -A || {
+ error "(3) Fail to start LFSCK for namespace!"; kill -USR1 $PID; }
+
+ wait_all_targets_blocked namespace completed 4
+ stat $t_dir && rc=1
+ kill -USR1 $PID
+ return $rc
+}
+run_test 37 "LFSCK must skip a ORPHAN"
+
+
# restore MDS/OST size
MDSSIZE=${SAVED_MDSSIZE}
OSTSIZE=${SAVED_OSTSIZE}