Whamcloud - gitweb
LU-11681 lmv: disable remote file statahead 30/33930/15
authorLai Siyao <lai.siyao@intel.com>
Wed, 12 Dec 2018 20:38:19 +0000 (04:38 +0800)
committerOleg Drokin <green@whamcloud.com>
Sat, 7 Sep 2019 01:50:58 +0000 (01:50 +0000)
Remote file statahead is not supported, because such file needs
two RPCs to fetch both LOOKUP and GETATTR lock, on LOOKUP success
we only know file FID, thus can't prepare an inode correctly.

Disable this to avoid noise messages and confusion.

Update sanity.sh test_60g.

Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Change-Id: Ied99dbce320f678ffd94c461bef9d67e107e673c
Reviewed-on: https://review.whamcloud.com/33930
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/lmv/lmv_obd.c
lustre/tests/sanity.sh

index 73fece5..7b12d26 100644 (file)
@@ -3468,27 +3468,32 @@ int lmv_intent_getattr_async(struct obd_export *exp,
        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);
 }
 
index 42bb2fe..dffdca6 100644 (file)
@@ -6928,13 +6928,16 @@ run_test 60e "no space while new llog is being created"
 
 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))
@@ -6943,16 +6946,34 @@ test_60g() {
 
        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"