Whamcloud - gitweb
LU-9259 tests: set fail_loc on the right MDT 25/26225/2
authorFan Yong <fan.yong@intel.com>
Sun, 13 Nov 2016 11:14:48 +0000 (19:14 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 19 Apr 2017 04:47:36 +0000 (04:47 +0000)
In sanity test_17o, we need to set the fail_loc on the MDT on which
the target file resides. So "getstripe -M" should be done after the
file created. In further client side ldlm locks should be cancelled
before failover the MDT.

Signed-off-by: Fan Yong <fan.yong@intel.com>
Change-Id: I35acefb6b7a361f25593843e1f2a097e786e5f11
Reviewed-on: https://review.whamcloud.com/26225
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Jian Yu <jian.yu@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/osd-ldiskfs/osd_handler.c
lustre/tests/sanity.sh

index 2af1a52..50acaa4 100644 (file)
@@ -750,7 +750,8 @@ static int osd_check_lma(const struct lu_env *env, struct osd_object *obj)
                rc = 0;
                lustre_lma_swab(lma);
                if (unlikely((lma->lma_incompat & ~LMA_INCOMPAT_SUPP) ||
-                            CFS_FAIL_CHECK(OBD_FAIL_OSD_LMA_INCOMPAT))) {
+                            (CFS_FAIL_CHECK(OBD_FAIL_OSD_LMA_INCOMPAT) &&
+                             S_ISREG(inode->i_mode)))) {
                        CWARN("%s: unsupported incompat LMA feature(s) %#x for "
                              "fid = "DFID", ino = %lu\n", osd_name(osd),
                              lma->lma_incompat & ~LMA_INCOMPAT_SUPP,
index 146525c..4a6ad12 100755 (executable)
@@ -705,11 +705,11 @@ test_17o() {
        local rc=0
 
        test_mkdir -p $WDIR
-       mdt_index=$($LFS getstripe -M $WDIR)
-       mdt_index=$((mdt_index+1))
-
        touch $WDIR/$tfile
+       mdt_index=$($LFS getstripe -M $WDIR/$tfile)
+       mdt_index=$((mdt_index+1))
 
+       cancel_lru_locks mdc
        #fail mds will wait the failover finish then set
        #following fail_loc to avoid interfer the recovery process.
        fail mds${mdt_index}