From: Fan Yong Date: Sun, 13 Nov 2016 11:14:48 +0000 (+0800) Subject: LU-9259 tests: set fail_loc on the right MDT X-Git-Tag: 2.9.56~10 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=a0a812d2b019b97356b0d6a1a8debd7d46fed00b LU-9259 tests: set fail_loc on the right MDT 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 Change-Id: I35acefb6b7a361f25593843e1f2a097e786e5f11 Reviewed-on: https://review.whamcloud.com/26225 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Jian Yu Reviewed-by: Andreas Dilger --- diff --git a/lustre/osd-ldiskfs/osd_handler.c b/lustre/osd-ldiskfs/osd_handler.c index 2af1a52..50acaa4 100644 --- a/lustre/osd-ldiskfs/osd_handler.c +++ b/lustre/osd-ldiskfs/osd_handler.c @@ -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, diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 146525c..4a6ad12 100755 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -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}