Whamcloud - gitweb
b=11778
authornathan <nathan>
Tue, 16 Oct 2007 21:23:04 +0000 (21:23 +0000)
committernathan <nathan>
Tue, 16 Oct 2007 21:23:04 +0000 (21:23 +0000)
i=shadow
i=adilger
remove client blocking for ost connection
(since the earlier 11778 patch didn't land on head anyhow, really this
is just syncing to b1_6, without changing functionality.)

lustre/include/obd.h
lustre/mds/mds_lov.c
lustre/obdclass/obd_mount.c
lustre/tests/conf-sanity.sh
lustre/tests/sanity.sh

index 5d1fe3b..119469c 100644 (file)
@@ -524,7 +524,6 @@ struct mds_obd {
         struct lov_desc                  mds_lov_desc;
         __u32                            mds_id;
 
-        unsigned int                     mds_lov_objids_dirty:1;
         struct file                     *mds_lov_objid_filp;
         /* protect update vs free in lov_add_target */
         struct rw_semaphore              mds_lov_objids_sem;
@@ -544,10 +543,12 @@ struct mds_obd {
         struct semaphore                 mds_qonoff_sem;
         struct semaphore                 mds_health_sem;
         unsigned long                    mds_lov_objids_valid:1,
+                                         mds_lov_objids_dirty:1,
                                          mds_fl_user_xattr:1,
                                          mds_fl_acl:1,
-                                         mds_evict_ost_nids:1;
-
+                                         mds_evict_ost_nids:1,
+                                         mds_fl_cfglog:1,
+                                         mds_fl_synced:1;
 
         struct upcall_cache             *mds_identity_cache;
         struct upcall_cache             *mds_rmtacl_cache;
index 7688a2d..07a47a4 100644 (file)
@@ -91,7 +91,7 @@ static int mds_lov_read_objids(struct obd_device *obd)
 
         rc = fsfilt_read_record(obd, mds->mds_lov_objid_filp, ids, size, &off);
         if (rc < 0) {
-               OBD_FREE(ids, size);
+                OBD_FREE(ids, size);
                 CERROR("Error reading objids %d\n", rc);
                 GOTO(out, rc);
         }
@@ -692,6 +692,18 @@ int mds_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
 
 }
 
+/* Collect the preconditions we need to allow client connects */
+static void mds_allow_cli(struct obd_device *obd, unsigned int flag)
+{
+        if (flag & CONFIG_LOG)
+                obd->u.mds.mds_fl_cfglog = 1;
+        if (flag & CONFIG_SYNC)
+                obd->u.mds.mds_fl_synced = 1;
+        if (obd->u.mds.mds_fl_cfglog /* bz11778: && obd->u.mds.mds_fl_synced */)
+                /* Open for clients */
+                obd->obd_no_conn = 0;
+}
+
 struct mds_lov_sync_info {
         struct obd_device *mlsi_obd;     /* the lov device to sync */
         struct obd_device *mlsi_watched; /* target osc */
@@ -887,8 +899,7 @@ int mds_notify(struct obd_device *obd, struct obd_device *watched,
         case OBD_NOTIFY_SYNC_NONBLOCK:
                 break;
         case OBD_NOTIFY_CONFIG:
-                /* Open for clients */
-                obd->obd_no_conn = 0;
+                mds_allow_cli(obd, (unsigned int)data);
         default:
                 RETURN(0);
         }
@@ -919,6 +930,7 @@ int mds_notify(struct obd_device *obd, struct obd_device *watched,
                                     obd->u.mds.mds_lov_desc.ld_tgt_count,
                                     &watched->u.cli.cl_target_uuid);
                 mutex_up(&obd->obd_dev_sem);
+                mds_allow_cli(obd, CONFIG_SYNC);
                 RETURN(rc);
         }
 
index 202c740..89572b5 100644 (file)
@@ -750,8 +750,8 @@ static int lustre_stop_mgc(struct super_block *sb)
 {
         struct lustre_sb_info *lsi = s2lsi(sb);
         struct obd_device *obd;
-        char *niduuid, *ptr = 0;
-        int i, rc = 0, len;
+        char *niduuid = 0, *ptr = 0;
+        int i, rc = 0, len = 0;
         ENTRY;
 
         if (!lsi)
index 2056f1e..d36a22c 100644 (file)
@@ -299,8 +299,6 @@ run_test 5d "mount with ost down"
 test_5e() {
        start_ost
        start_mds
-        # give MDS a chance to connect to OSTs (bz 10476)
-       sleep 5 
 
 #define OBD_FAIL_PTLRPC_DELAY_SEND       0x506
        do_facet client "sysctl -w lustre.fail_loc=0x80000506"
@@ -787,7 +785,6 @@ test_22() {
        echo Client mount with a running ost
        start_ost
        mount_client $MOUNT
-       sleep 5 #bz10476
        check_mount || return 41
        pass
 
index ff0a217..d7d2771 100644 (file)
@@ -2165,6 +2165,7 @@ test_51() {
                FNUM=$(($FNUM + 1))
                echo -n "+"
        done
+       echo
        ls -l $DIR/d51 > /dev/null || error
 }
 run_test 51 "special situations: split htree with empty entry =="