From 637811c926333764c04f95bc118ee1dc9d4bd5dc Mon Sep 17 00:00:00 2001 From: bobijam Date: Wed, 8 Apr 2009 02:50:28 +0000 Subject: [PATCH] Branch b1_8 b=17378 i=robert.read add test case: sanity.sh test_17h(). --- lustre/include/obd_support.h | 1 + lustre/lov/lov_qos.c | 4 ++++ lustre/tests/sanity.sh | 53 ++++++++++++++++++++++++++------------------ 3 files changed, 36 insertions(+), 22 deletions(-) diff --git a/lustre/include/obd_support.h b/lustre/include/obd_support.h index e35b1c2..c6159a7 100644 --- a/lustre/include/obd_support.h +++ b/lustre/include/obd_support.h @@ -184,6 +184,7 @@ extern unsigned int obd_alloc_fail_rate; #define OBD_FAIL_MDS_REMOVE_COMMON_EA 0x13e #define OBD_FAIL_MDS_ALLOW_COMMON_EA_SETTING 0x13f #define OBD_FAIL_MDS_FAIL_LOV_LOG_ADD 0x140 +#define OBD_FAIL_MDS_LOV_PREP_CREATE 0x141 #define OBD_FAIL_OST 0x200 #define OBD_FAIL_OST_CONNECT_NET 0x201 diff --git a/lustre/lov/lov_qos.c b/lustre/lov/lov_qos.c index 3193642..9df2597 100644 --- a/lustre/lov/lov_qos.c +++ b/lustre/lov/lov_qos.c @@ -1059,6 +1059,10 @@ int qos_prep_create(struct obd_export *exp, struct lov_request_set *set) if (stripes < lsm->lsm_stripe_count) qos_shrink_lsm(set); + if (OBD_FAIL_CHECK(OBD_FAIL_MDS_LOV_PREP_CREATE)) { + qos_shrink_lsm(set); + rc = -EIO; + } if (oti && (src_oa->o_valid & OBD_MD_FLCOOKIE)) { oti_alloc_cookies(oti, set->set_count); diff --git a/lustre/tests/sanity.sh b/lustre/tests/sanity.sh index 4ebf462..fb05e83 100644 --- a/lustre/tests/sanity.sh +++ b/lustre/tests/sanity.sh @@ -450,6 +450,15 @@ test_17g() { } run_test 17g "symlinks: really long symlink name ===============================" +test_17h() { #bug 17378 + mkdir -p $DIR/$tdir + $SETSTRIPE $DIR/$tdir -c -1 +#define OBD_FAIL_MDS_LOV_PREP_CREATE 0x141 + do_facet mds lctl set_param fail_loc=0x80000141 + touch $DIR/$tdir/$tfile || true +} +run_test 17h "create objects: lov_free_memmd() doesn't lbug" + test_18() { touch $DIR/f ls $DIR || error @@ -1043,7 +1052,7 @@ test_27s() { # bug 10725 mkdir -p $DIR/$tdir local stripe_size=$((4096 * 1024 * 1024)) # 2^32 local stripe_count=0 - [ $OSTCOUNT -eq 1 ] || stripe_count=2 + [ $OSTCOUNT -eq 1 ] || stripe_count=2 $SETSTRIPE $DIR/$tdir -s $stripe_size -c $stripe_count && \ error "stripe width >= 2^32 succeeded" || true } @@ -1128,7 +1137,7 @@ test_27w() { # bug 10997 } run_test 27w "check lfs setstripe -c -s -i options =============" -# createtest also checks that device nodes are created and +# createtest also checks that device nodes are created and # then visible correctly (#2091) test_28() { # bug 2091 mkdir $DIR/d28 @@ -2034,7 +2043,7 @@ test_46() { } run_test 46 "dirtying a previously written page ================" -# test_47 is removed "Device nodes check" is moved to test_28 +# test_47 is removed "Device nodes check" is moved to test_28 test_48a() { # bug 2399 check_kernel_version 34 || return 0 @@ -3791,7 +3800,7 @@ test_101b() { true } run_test 101b "check stride-io mode read-ahead =================" - + test_101c() { local STRIPE_SIZE=1048576 local FILE_LENGTH=$((STRIPE_SIZE*100)) @@ -3801,7 +3810,7 @@ test_101c() { cancel_lru_locks osc $LCTL set_param osc.*.rpc_stats 0 - $READS -f $DIR/$tfile -s$FILE_LENGTH -b65536 -n$nreads -t 180 + $READS -f $DIR/$tfile -s$FILE_LENGTH -b65536 -n$nreads -t 180 for OSC in `$LCTL get_param -N osc.*` do if [ "$OSC" == "osc.num_refs" ]; then @@ -3811,12 +3820,12 @@ test_101c() { if [ $lines -le 20 ]; then continue fi - + rpc4k=$($LCTL get_param -n $OSC | awk '$1 == "1:" { print $2; exit; }') rpc8k=$($LCTL get_param -n $OSC | awk '$1 == "2:" { print $2; exit; }') rpc16k=$($LCTL get_param -n $OSC | awk '$1 == "4:" { print $2; exit; }') rpc32k=$($LCTL get_param -n $OSC | awk '$1 == "8:" { print $2; exit; }') - + [ $rpc4k != 0 ] && error "Small 4k read IO ${rpc4k}!" [ $rpc8k != 0 ] && error "Small 8k read IO ${rpc8k}!" [ $rpc16k != 0 ] && error "Small 16k read IO ${rpc16k}!" @@ -3828,12 +3837,12 @@ test_101c() { rpc256k=$($LCTL get_param -n $OSC | awk '$1 == "64:" { print $2; exit; }') rpc512k=$($LCTL get_param -n $OSC | awk '$1 == "128:" { print $2; exit; }') rpc1024k=$($LCTL get_param -n $OSC | awk '$1 == "256:" { print $2; exit; }') - - [ $rpc64k == 0 ] && error "No 64k readahead IO ${rpc64k}" - [ $rpc128k == 0 ] && error "No 128k readahead IO ${rpc128k}" - [ $rpc256k == 0 ] && error "No 256k readahead IO ${rpc256k}" - [ $rpc512k == 0 ] && error "No 512k readahead IO ${rpc256k}" - [ $rpc1024k == 0 ] && error "No 1024k readahead IO ${rpc1024k}" + + [ $rpc64k == 0 ] && error "No 64k readahead IO ${rpc64k}" + [ $rpc128k == 0 ] && error "No 128k readahead IO ${rpc128k}" + [ $rpc256k == 0 ] && error "No 256k readahead IO ${rpc256k}" + [ $rpc512k == 0 ] && error "No 512k readahead IO ${rpc256k}" + [ $rpc1024k == 0 ] && error "No 1024k readahead IO ${rpc1024k}" echo "Big rpc check passed!" done cleanup_101 @@ -5152,7 +5161,7 @@ test_124a() { log "LVF=$LVF" local OLD_LVF=`lctl get_param -n $NSDIR.pool.lock_volume_factor` lctl set_param -n $NSDIR.pool.lock_volume_factor $LVF - + # Let's make sure that we really have some margin. Client checks # cached locks every 10 sec. SLEEP=$((SLEEP+20)) @@ -5806,31 +5815,31 @@ test_170() { $LCTL df $TMP/${tfile}_log_good > $TMP/${tfile}_log_good.out 2>&1 local good_line2=$(tail -n 1 $TMP/${tfile}_log_good.out | awk '{print $5}') - [ "$bad_line" ] && [ "$good_line1" ] && [ "$good_line2" ] || + [ "$bad_line" ] && [ "$good_line1" ] && [ "$good_line2" ] || error "bad_line good_line1 good_line2 are empty" - + + cat $TMP/${tfile}_log_good >> $TMP/${tfile}_logs_corrupt + cat $TMP/${tfile}_log_bad >> $TMP/${tfile}_logs_corrupt cat $TMP/${tfile}_log_good >> $TMP/${tfile}_logs_corrupt - cat $TMP/${tfile}_log_bad >> $TMP/${tfile}_logs_corrupt - cat $TMP/${tfile}_log_good >> $TMP/${tfile}_logs_corrupt $LCTL df $TMP/${tfile}_logs_corrupt > $TMP/${tfile}_log_bad.out 2>&1 local bad_line_new=$(tail -n 1 $TMP/${tfile}_log_bad.out | awk '{print $9}') local good_line_new=$(tail -n 1 $TMP/${tfile}_log_bad.out | awk '{print $5}') - [ "$bad_line_new" ] && [ "$good_line_new" ] || + [ "$bad_line_new" ] && [ "$good_line_new" ] || error "bad_line_new good_line_new are empty" - + local expected_good=$((good_line1 + good_line2*2)) rm -f $TMP/${tfile}* if [ $bad_line -ne $bad_line_new ]; then error "expected $bad_line bad lines, but got $bad_line_new" - return 1 + return 1 fi if [ $expected_good -ne $good_line_new ]; then error "expected $expected_good good lines, but got $good_line_new" - return 2 + return 2 fi true } -- 1.8.3.1