Whamcloud - gitweb
Revert "LU-8922 lod: check master stripes properly" 50/24750/5
authorJames Nunez <james.a.nunez@intel.com>
Fri, 6 Jan 2017 18:29:55 +0000 (18:29 +0000)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 9 Jan 2017 05:42:28 +0000 (05:42 +0000)
It causes frequent testing failures tracked in LU-8985

This reverts commit 1be03a1088d2aa583c2651435634ba336b48f939.

Test-Parameters: testlist=conf-sanity,conf-sanity,conf-sanity,conf-sanity,conf-sanity,conf-sanity

Change-Id: I444ce9e65c72db7db3f53692d9fe4f823943fade
Signed-off-by: James Nunez <james.a.nunez@intel.com>
Reviewed-on: https://review.whamcloud.com/24750
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/lod/lod_object.c
lustre/mgs/mgs_llog.c
lustre/tests/conf-sanity.sh

index eb26b30..cb15551 100644 (file)
@@ -1718,7 +1718,7 @@ static int lod_prep_md_striped_create(const struct lu_env *env,
        if (stripe == NULL)
                GOTO(out_free, rc = -ENOMEM);
 
        if (stripe == NULL)
                GOTO(out_free, rc = -ENOMEM);
 
-       /* Start index must be the master MDT */
+       /* Start index will be the master MDT */
        master_index = lu_site2seq(lod2lu_dev(lod)->ld_site)->ss_node_id;
        idx_array[0] = master_index;
        for (i = 0; i < stripe_count; i++) {
        master_index = lu_site2seq(lod2lu_dev(lod)->ld_site)->ss_node_id;
        idx_array[0] = master_index;
        for (i = 0; i < stripe_count; i++) {
@@ -1738,6 +1738,19 @@ static int lod_prep_md_striped_create(const struct lu_env *env,
 
                        CDEBUG(D_INFO, "try idx %d, mdt cnt %u, allocated %u\n",
                               idx, lod->lod_remote_mdt_count + 1, i);
 
                        CDEBUG(D_INFO, "try idx %d, mdt cnt %u, allocated %u\n",
                               idx, lod->lod_remote_mdt_count + 1, i);
+                       if (idx == master_index) {
+                               /* Allocate the FID locally */
+                               rc = obd_fid_alloc(env, lod->lod_child_exp,
+                                                  &fid, NULL);
+                               if (rc < 0)
+                                       GOTO(out_put, rc);
+                               tgt_dt = lod->lod_child;
+                               break;
+                       }
+
+                       /* Find next available target */
+                       if (!cfs_bitmap_check(ltd->ltd_tgt_bitmap, idx))
+                               continue;
 
                        if (likely(!OBD_FAIL_CHECK(OBD_FAIL_LARGE_STRIPE))) {
                                /* check whether the idx already exists
 
                        if (likely(!OBD_FAIL_CHECK(OBD_FAIL_LARGE_STRIPE))) {
                                /* check whether the idx already exists
@@ -1753,22 +1766,6 @@ static int lod_prep_md_striped_create(const struct lu_env *env,
                                        continue;
                        }
 
                                        continue;
                        }
 
-                       /* Sigh, this index is not in the bitmap, let's check
-                        * next available target */
-                       if (!cfs_bitmap_check(ltd->ltd_tgt_bitmap, idx) &&
-                           idx != master_index)
-                               continue;
-
-                       if (idx == master_index) {
-                               /* Allocate the FID locally */
-                               rc = obd_fid_alloc(env, lod->lod_child_exp,
-                                                  &fid, NULL);
-                               if (rc < 0)
-                                       GOTO(out_put, rc);
-                               tgt_dt = lod->lod_child;
-                               break;
-                       }
-
                        /* check the status of the OSP */
                        tgt = LTD_TGT(ltd, idx);
                        if (tgt == NULL)
                        /* check the status of the OSP */
                        tgt = LTD_TGT(ltd, idx);
                        if (tgt == NULL)
@@ -1794,7 +1791,7 @@ static int lod_prep_md_striped_create(const struct lu_env *env,
                /* Can not allocate more stripes */
                if (j == lod->lod_remote_mdt_count) {
                        CDEBUG(D_INFO, "%s: require stripes %u only get %d\n",
                /* Can not allocate more stripes */
                if (j == lod->lod_remote_mdt_count) {
                        CDEBUG(D_INFO, "%s: require stripes %u only get %d\n",
-                              lod2obd(lod)->obd_name, stripe_count, i);
+                              lod2obd(lod)->obd_name, stripe_count, i - 1);
                        break;
                }
 
                        break;
                }
 
index 922f1e6..5d9c535 100644 (file)
@@ -3485,7 +3485,7 @@ static int mgs_write_log_param(const struct lu_env *env,
                                LCONSOLE_ERROR_MSG(0x144, "%s: MDC0 can not be"
                                                   " (de)activated.\n",
                                                   mti->mti_svname);
                                LCONSOLE_ERROR_MSG(0x144, "%s: MDC0 can not be"
                                                   " (de)activated.\n",
                                                   mti->mti_svname);
-                               GOTO(end, rc = -EPERM);
+                               GOTO(end, rc = -EINVAL);
                        }
                }
 
                        }
                }
 
index a3a6af5..f8ad8ad 100755 (executable)
@@ -3705,7 +3705,6 @@ test_50i() {
        # prepare MDT/OST, make OSC inactive for OST1
        [ "$MDSCOUNT" -lt "2" ] && skip_env "$MDSCOUNT < 2, skipping" && return
 
        # prepare MDT/OST, make OSC inactive for OST1
        [ "$MDSCOUNT" -lt "2" ] && skip_env "$MDSCOUNT < 2, skipping" && return
 
-       load_modules
        [ $(facet_fstype mds2) == zfs ] && import_zpool mds2
        do_facet mds2 "$TUNEFS --param mdc.active=0 $(mdsdevname 2)" ||
                error "tunefs MDT2 failed"
        [ $(facet_fstype mds2) == zfs ] && import_zpool mds2
        do_facet mds2 "$TUNEFS --param mdc.active=0 $(mdsdevname 2)" ||
                error "tunefs MDT2 failed"
@@ -3736,7 +3735,7 @@ test_50i() {
        rm -rf $DIR/$tdir/2 || error "unlink dir failed"
 
        # deactivate MDC for MDT2
        rm -rf $DIR/$tdir/2 || error "unlink dir failed"
 
        # deactivate MDC for MDT2
-       TEST="$LCTL get_param -n mdc.${FSNAME}-MDT0001-mdc-[!M]*.active"
+       local TEST="$LCTL get_param -n mdc.${FSNAME}-MDT0001-mdc-[!M]*.active"
        set_conf_param_and_check client                                 \
                "$TEST" "${FSNAME}-MDT0001.mdc.active" 0 ||
                error "Unable to deactivate MDT2"
        set_conf_param_and_check client                                 \
                "$TEST" "${FSNAME}-MDT0001.mdc.active" 0 ||
                error "Unable to deactivate MDT2"
@@ -3744,13 +3743,6 @@ test_50i() {
        $LFS mkdir -i1 $DIR/$tdir/2 &&
                error "mkdir $DIR/$tdir/2 succeeds after deactive MDT"
 
        $LFS mkdir -i1 $DIR/$tdir/2 &&
                error "mkdir $DIR/$tdir/2 succeeds after deactive MDT"
 
-       $LFS mkdir -i0 -c$MDSCOUNT $DIR/$tdir/striped_dir ||
-               error "mkdir $DIR/$tdir/striped_dir fails after deactive MDT2"
-
-       local stripe_count=$($LFS getdirstripe -c $DIR/$tdir/striped_dir)
-       [ $stripe_count -eq $((MDSCOUNT - 1)) ] ||
-               error "wrong $stripe_count != $((MDSCOUNT -1)) for striped_dir"
-
        # cleanup
        umount_client $MOUNT || error "Unable to umount client"
        stop_mds
        # cleanup
        umount_client $MOUNT || error "Unable to umount client"
        stop_mds