struct lfsck_rec_lmv_save li_rec_lmv_save[LFSCK_REC_LMV_MAX_DEPTH];
};
+static inline bool lfsck_is_dryrun(struct lfsck_instance *lfsck)
+{
+ return lfsck->li_bookmark_ram.lb_param & LPF_DRYRUN;
+}
+
struct lfsck_async_interpret_args {
struct lfsck_component *laia_com;
struct lfsck_tgt_descs *laia_ltds;
int rc = 0;
ENTRY;
+ if (lfsck_is_dryrun(lfsck))
+ GOTO(log, rc = 0);
+
if (unlikely(lpf == NULL))
GOTO(log, rc = -ENXIO);
if (rc != 0 && rc != -ENOENT)
GOTO(unlock, rc);
+ if (lfsck_is_dryrun(com->lc_lfsck))
+ GOTO(unlock, rc = 0);
+
th = dt_trans_create(env, dev);
if (IS_ERR(th))
GOTO(unlock, rc = PTR_ERR(th));
bool new_mirror = true;
ENTRY;
+ if (lfsck_is_dryrun(lfsck))
+ RETURN(0);
+
rc = lfsck_ibits_lock(env, lfsck, parent, &lh,
MDS_INODELOCK_LAYOUT | MDS_INODELOCK_XATTR,
LCK_EX);
cancel_lru_locks mdc
cancel_lru_locks osc
+ # dryrun mode only check orphans, not repaie
+ echo "Trigger layout LFSCK --dryrun to find out orphan OST-object"
+ $START_LAYOUT --dryrun -o -r ||
+ error "Fail to start layout LFSCK in dryrun mode"
+ wait_all_targets_blocked layout completed 2
+
+ local PARAMS=$($SHOW_LAYOUT | awk '/^param/ { print $2 }')
+ [ "$PARAMS" == "dryrun,all_targets,orphan" ] ||
+ error "Expect 'dryrun,all_targets,orphan', got '$PARAMS'"
+
+ local orphans=$(do_facet mds1 $LCTL get_param -n \
+ mdd.$(facet_svc mds1).lfsck_layout |
+ awk '/^inconsistent_orphan/ { print $2 }')
+ [ $orphans -eq 3 ] ||
+ error "Expect 3 found on mds1, but got: $orphans"
+
+ # orphan parents should not be created
+ local subdir
+ for subdir in $MOUNT/.lustre/lost+found/*; do
+ [ ! "$(ls -A $subdir)" ] || error "$subdir not empty"
+ done
+
echo "Trigger layout LFSCK on all devices to find out orphan OST-object"
$START_LAYOUT -r -o || error "(1) Fail to start LFSCK for layout!"