struct md_op_data *op_data = &minfo->mi_data;
struct obd_device *obd = exp->exp_obd;
struct lmv_obd *lmv = &obd->u.lmv;
- struct lmv_tgt_desc *tgt = NULL;
+ struct lmv_tgt_desc *ptgt;
+ struct lmv_tgt_desc *ctgt;
int rc;
+
ENTRY;
if (!fid_is_sane(&op_data->op_fid2))
RETURN(-EINVAL);
- tgt = lmv_find_target(lmv, &op_data->op_fid1);
- if (IS_ERR(tgt))
- RETURN(PTR_ERR(tgt));
+ ptgt = lmv_locate_tgt(lmv, op_data);
+ if (IS_ERR(ptgt))
+ RETURN(PTR_ERR(ptgt));
+
+ ctgt = lmv_find_target(lmv, &op_data->op_fid2);
+ if (IS_ERR(ctgt))
+ RETURN(PTR_ERR(ctgt));
/*
- * no special handle for remote dir, which needs to fetch both LOOKUP
- * lock on parent, and then UPDATE lock on child MDT, which makes all
- * complicated because this is done async. So only LOOKUP lock is
- * fetched for remote dir, but considering remote dir is rare case,
- * and not supporting it in statahead won't cause any issue, just leave
- * it as is.
+ * remote object needs two RPCs to lookup and getattr, considering the
+ * complexity don't support statahead for now.
*/
+ if (ctgt != ptgt)
+ RETURN(-EREMOTE);
+
+ rc = md_intent_getattr_async(ptgt->ltd_exp, minfo);
- rc = md_intent_getattr_async(tgt->ltd_exp, minfo);
RETURN(rc);
}
test_60g() {
local pid
+ local i
test_mkdir -c $MDSCOUNT $DIR/$tdir
- $LFS setdirstripe -D -i -1 -c $MDSCOUNT $DIR/$tdir
(
local index=0
while true; do
+ $LFS setdirstripe -i $(($index % $MDSCOUNT)) \
+ -c $MDSCOUNT $DIR/$tdir/subdir$index \
+ 2>/dev/null
mkdir $DIR/$tdir/subdir$index 2>/dev/null
rmdir $DIR/$tdir/subdir$index 2>/dev/null
index=$((index + 1))
pid=$!
- for i in $(seq 100); do
+ for i in {0..100}; do
# define OBD_FAIL_OSD_TXN_START 0x19a
- do_facet mds1 lctl set_param fail_loc=0x8000019a
+ local index=$((i % MDSCOUNT + 1))
+
+ do_facet mds$index $LCTL set_param fail_loc=0x8000019a \
+ > /dev/null
usleep 100
done
kill -9 $pid
+ for i in $(seq $MDSCOUNT); do
+ do_facet mds$i $LCTL set_param fail_loc=0 > /dev/null
+ done
+
mkdir $DIR/$tdir/new || error "mkdir failed"
rmdir $DIR/$tdir/new || error "rmdir failed"
+
+ do_facet mds1 $LCTL lfsck_start -M $(facet_svc mds1) -A -C \
+ -t namespace
+ for i in $(seq $MDSCOUNT); do
+ wait_update_facet mds$i "$LCTL get_param -n \
+ mdd.$(facet_svc mds$i).lfsck_namespace |
+ awk '/^status/ { print \\\$2 }'" "completed"
+ done
+
+ ls -R $DIR/$tdir || error "ls failed"
+ rm -rf $DIR/$tdir || error "rmdir failed"
}
run_test 60g "transaction abort won't cause MDT hung"