Whamcloud - gitweb
Revert "b=22464 add writeconf as mount option (includes bz 23228)"
authorMikhail Pershin <tappro@sun.com>
Wed, 28 Jul 2010 17:09:48 +0000 (21:09 +0400)
committerMikhail Pershin <tappro@sun.com>
Wed, 28 Jul 2010 17:09:48 +0000 (21:09 +0400)
This reverts commit adcf9aa295e5c0bf51bc8dd45dde1e900b0e1165.

lustre/include/lustre_disk.h
lustre/mgs/mgs_handler.c
lustre/obdclass/obd_mount.c
lustre/tests/conf-sanity.sh

index 0915d80..56ac7b0 100644 (file)
 #define LDD_F_NEED_INDEX    0x0010
 /** never registered */
 #define LDD_F_VIRGIN        0x0020
-/** update the config logs for this server */
+/** update the config logs for this server*/
 #define LDD_F_UPDATE        0x0040
 /** rewrite the LDD */
 #define LDD_F_REWRITE_LDD   0x0080
-/** regenerate config logs for this fs or server */
+/** regenerate all logs for this fs */
 #define LDD_F_WRITECONF     0x0100
 /** COMPAT_14 */
 #define LDD_F_UPGRADE14     0x0200
@@ -194,7 +194,6 @@ struct lustre_mount_data {
                                         no other services */
 #define LMD_FLG_NOMGS        0x0020  /* Only start target for servers, reusing
                                         existing MGS services */
-#define LMD_FLG_WRITECONF    0x0040  /* Rewrite config log */
 
 #define lmd_is_client(x) ((x)->lmd_flags & LMD_FLG_CLIENT)
 
index e43cbf8..d2ee15d 100644 (file)
@@ -413,10 +413,6 @@ static int mgs_handle_target_reg(struct ptlrpc_request *req)
         mgs_counter_incr(req->rq_export, LPROC_MGS_TARGET_REG);
 
         mti = req_capsule_client_get(&req->rq_pill, &RMF_MGS_TARGET_INFO);
-
-        if (mti->mti_flags & LDD_F_NEED_INDEX)
-                mti->mti_flags |= LDD_F_WRITECONF;
-
         if (!(mti->mti_flags & (LDD_F_WRITECONF | LDD_F_UPGRADE14 |
                                 LDD_F_UPDATE))) {
                 /* We're just here as a startup ping. */
index 1618a15..8531464 100644 (file)
@@ -998,8 +998,6 @@ static int server_sb2mti(struct super_block *sb, struct mgs_target_info *mti)
 
         mti->mti_lustre_ver = LUSTRE_VERSION_CODE;
         mti->mti_config_ver = 0;
-        if (lsi->lsi_lmd->lmd_flags & LMD_FLG_WRITECONF)
-                ldd->ldd_flags |= LDD_F_WRITECONF;
         mti->mti_flags = ldd->ldd_flags;
         mti->mti_stripe_index = ldd->ldd_svindex;
         memcpy(mti->mti_uuid, ldd->ldd_uuid, sizeof(mti->mti_uuid));
@@ -1985,9 +1983,6 @@ static int lmd_parse(char *options, struct lustre_mount_data *lmd)
                 } else if (strncmp(s1, "nomgs", 5) == 0) {
                         lmd->lmd_flags |= LMD_FLG_NOMGS;
                         clear++;
-                } else if (strncmp(s1, "writeconf", 9) == 0) {
-                        lmd->lmd_flags |= LMD_FLG_WRITECONF;
-                        clear++;
                 } else if (strncmp(s1, "mgssec=", 7) == 0) {
                         rc = lmd_parse_mgssec(lmd, s1 + 7);
                         if (rc)
index 544779d..9da812a 100644 (file)
@@ -65,18 +65,13 @@ writeconf1() {
        return 0
 }
 
-writeclean() {
-       [ -e ${WCDIR}/$@ ] && rm ${WCDIR}/$@
-       true
+writeconf() {
+       # if writeconf failed, we reformatted
+       writeconf1 mds $MDSDEV || return 0
+       writeconf1 ost1 `ostdevname 1` || return 0
+       writeconf1 ost2 `ostdevname 2` || return 0
 }
 
-writeclean_all() {
-       writeclean wc.m
-       writeclean wc.o1
-       writeclean wc.o2
-}
-writeclean_all
-
 gen_config() {
        # The MGS must be started before the OSTs for a new fs, so start
        # and stop to generate the startup logs.
@@ -106,14 +101,7 @@ start_mds() {
        local num=$(echo $facet | tr -d "mds")
        local dev=$(mdsdevname $num)
        echo "start mds service on `facet_active_host $facet`"
-       start $facet ${dev} $MDS_MOUNT_OPTS $@ || return 94
-}
-
-start_mgsmds() {
-       if ! combined_mgs_mds ; then
-               start_mgs
-       fi
-       start_mds $@
+       start $facet ${dev} $MDS_MOUNT_OPTS || return 94
 }
 
 stop_mds() {
@@ -124,7 +112,7 @@ stop_mds() {
 
 start_ost() {
        echo "start ost1 service on `facet_active_host ost1`"
-       start ost1 `ostdevname 1` $OST_MOUNT_OPTS $@ || return 95
+       start ost1 `ostdevname 1` $OST_MOUNT_OPTS || return 95
 }
 
 stop_ost() {
@@ -135,7 +123,7 @@ stop_ost() {
 
 start_ost2() {
        echo "start ost2 service on `facet_active_host ost2`"
-       start ost2 `ostdevname 2` $OST_MOUNT_OPTS $@ || return 92
+       start ost2 `ostdevname 2` $OST_MOUNT_OPTS || return 92
 }
 
 stop_ost2() {
@@ -2450,40 +2438,6 @@ test_56() {
 }
 run_test 56 "check big indexes"
 
-count_osts() {
-        do_facet mgs $LCTL get_param mgs.MGS.live.$FSNAME | grep OST | wc -l
-}
-
-test_59() {
-       start_mgsmds >> /dev/null
-       local C1=$(count_osts)
-       if [ $C1 -eq 0 ]; then
-               start_ost >> /dev/null
-               C1=$(count_osts)
-       fi
-       stopall
-       echo "original ost count: $C1 (expect > 0)"
-       [ $C1 -gt 0 ] || error "No OSTs in $FSNAME log"
-       start_mgsmds -o writeconf >> /dev/null || error "MDT start failed"
-       local C2=$(count_osts)
-       echo "after mdt writeconf count: $C2 (expect 0)"
-       [ $C2 -gt 0 ] && error "MDT writeconf should erase OST logs"
-       echo "OST start without writeconf should fail:"
-       start_ost >> /dev/null && error "OST start without writeconf didn't fail"
-       echo "OST start with writeconf should succeed:"
-       start_ost -o writeconf >> /dev/null || error "OST1 start failed"
-       local C3=$(count_osts)
-       echo "after ost writeconf count: $C3 (expect 1)"
-       [ $C3 -eq 1 ] || error "new OST writeconf should add:"
-       start_ost2 -o writeconf >> /dev/null || error "OST2 start failed"
-       local C4=$(count_osts)
-       echo "after ost2 writeconf count: $C4 (expect 2)"
-       [ $C4 -eq 2 ] || error "OST2 writeconf should add log"
-       stop_ost2 >> /dev/null
-       cleanup_nocli >> /dev/null
-}
-run_test 59 "writeconf mount option"
-
 cleanup_gss
 equals_msg `basename $0`: test complete
 [ -f "$TESTSUITELOG" ] && cat $TESTSUITELOG && grep -q FAIL $TESTSUITELOG && exit 1 || true