Whamcloud - gitweb
Branch b1_6
authorliuy <liuy>
Tue, 14 Aug 2007 02:22:47 +0000 (02:22 +0000)
committerliuy <liuy>
Tue, 14 Aug 2007 02:22:47 +0000 (02:22 +0000)
b=11679
i=adilger, deen

fix lstripe failure with valid OST index

lustre/ChangeLog
lustre/lov/lov_pack.c
lustre/tests/sanity.sh

index bf25856..623579b 100644 (file)
@@ -193,6 +193,12 @@ Description: client-side metadata stat-ahead during readdir(directory readahead)
 Details    : perform client-side metadata stat-ahead when the client detects
              readdir and sequential stat of dir entries therein
 
+Severity   : normal 
+Bugzilla   : 11679
+Description: lstripe command fails for valid OST index
+Details    : The stripe offset is compared to 'lov->desc.ld_tgt_count' 
+            instead of lov->desc.ld_active_tgt_count.
+
 --------------------------------------------------------------------------------
 
 2007-07-30         Cluster File Systems, Inc. <info@clusterfs.com>
index f9b5ee3..53a5a88 100644 (file)
@@ -327,10 +327,10 @@ int lov_setstripe(struct obd_export *exp, struct lov_stripe_md **lsmp,
                 lum.lmm_stripe_size = LOV_MIN_STRIPE_SIZE;
         }
 
-        if ((lum.lmm_stripe_offset >= lov->desc.ld_active_tgt_count) &&
+        if ((lum.lmm_stripe_offset >= lov->desc.ld_tgt_count) &&
             (lum.lmm_stripe_offset != (typeof(lum.lmm_stripe_offset))(-1))) {
-                CDEBUG(D_IOCTL, "stripe offset %u > number of active OSTs %u\n",
-                       lum.lmm_stripe_offset, lov->desc.ld_active_tgt_count);
+                CDEBUG(D_IOCTL, "stripe offset %u > number of OSTs %u\n",
+                       lum.lmm_stripe_offset, lov->desc.ld_tgt_count);
                 RETURN(-EINVAL);
         }
         stripe_count = lov_get_stripecnt(lov, lum.lmm_stripe_count);
index 5cbb3ee..7197780 100644 (file)
@@ -2728,6 +2728,35 @@ test_65j() { # bug6367
 }
 run_test 65j "set default striping on root directory (bug 6367)="
 
+test_65k() { # bug11679
+        [ "$OSTCOUNT" -lt 2 ] && skip "too few OSTs" && return
+
+        echo "Check OST status: "
+        MDS_OSCS=`do_facet mds lctl dl | awk '/[oO][sS][cC].*md[ts]/ { print $4 }'`
+        for OSC in $MDS_OSCS; do
+                echo $OSC "is activate"
+                do_facet mds lctl --device %$OSC activate
+        done
+        mkdir -p $DIR/$tdir
+        for INACTIVE_OSC in $MDS_OSCS; do
+                echo $INACTIVE_OSC "is Deactivate:"
+                do_facet mds lctl --device  %$INACTIVE_OSC deactivate
+                for STRIPE_OSC in $MDS_OSCS; do
+                        STRIPE_OST=`osc_to_ost $STRIPE_OSC`
+                        STRIPE_INDEX=`do_facet mds cat $LPROC/lov/*md*/target_obd |
+                                      grep $STRIPE_OST | awk -F: '{print $1}'`
+                        echo "$SETSTRIPE $DIR/$tdir/${STRIPE_INDEX} 0 ${STRIPE_INDEX} 1"
+                        do_facet mds $SETSTRIPE $DIR/$tdir/${STRIPE_INDEX} 0 ${STRIPE_INDEX} 1
+                        RC=$?
+                        [ $RC -ne 0 ] && error "setstripe should have succeeded"
+                done
+                rm -f $DIR/$tdir/*
+                echo $INACTIVE_OSC "is Activate."
+                do_facet mds lctl --device  %$INACTIVE_OSC activate
+        done
+}
+run_test 65k "validate manual striping works properly with deactivated OSCs"
+
 # bug 2543 - update blocks count on client
 test_66() {
        COUNT=${COUNT:-8}