Whamcloud - gitweb
clear mgc import if they not connected, check cl_import under cl_sem.
authorshadow <shadow>
Mon, 20 Apr 2009 05:14:52 +0000 (05:14 +0000)
committershadow <shadow>
Mon, 20 Apr 2009 05:14:52 +0000 (05:14 +0000)
Branch b_release_1_8_0
b=18896
i=tappro
i=zam

lustre/mdc/mdc_request.c
lustre/mgc/libmgc.c
lustre/mgc/mgc_request.c
lustre/osc/osc_request.c
lustre/tests/conf-sanity.sh

index 5f5742e..0f1cf87 100644 (file)
@@ -1370,16 +1370,17 @@ static int mdc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
         case OBD_CLEANUP_EXPORTS:
                 /* If we set up but never connected, the
                    client import will not have been cleaned. */
+                down_write(&obd->u.cli.cl_sem);
                 if (obd->u.cli.cl_import) {
                         struct obd_import *imp;
-                        down_write(&obd->u.cli.cl_sem);
                         imp = obd->u.cli.cl_import;
                         CERROR("client import never connected\n");
                         ptlrpc_invalidate_import(imp);
                         class_destroy_import(imp);
-                        up_write(&obd->u.cli.cl_sem);
                         obd->u.cli.cl_import = NULL;
                 }
+                up_write(&obd->u.cli.cl_sem);
+
                 rc = obd_llog_finish(obd, 0);
                 if (rc != 0)
                         CERROR("failed to cleanup llogging subsystems\n");
index bb5f415..e6c1427 100644 (file)
@@ -89,6 +89,17 @@ static int mgc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
         switch (stage) {
         case OBD_CLEANUP_EARLY: 
         case OBD_CLEANUP_EXPORTS:
+                /* client import will not have been cleaned. */
+                down_write(&obd->u.cli.cl_sem);
+                if (obd->u.cli.cl_import) {
+                        struct obd_import *imp;
+                        imp = obd->u.cli.cl_import;
+                        CERROR("client import never connected\n");
+                        class_destroy_import(imp);
+                        obd->u.cli.cl_import = NULL;
+                }
+                up_write(&obd->u.cli.cl_sem);
+
                 rc = obd_llog_finish(obd, 0);
                 if (rc != 0)
                         CERROR("failed to cleanup llogging subsystems\n");
index cc23b99..d29bf43 100644 (file)
@@ -489,6 +489,17 @@ static int mgc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
                         spin_unlock(&config_list_lock);
                         cfs_waitq_signal(&rq_waitq);
                 }
+                /* client import will not have been cleaned. */
+                down_write(&obd->u.cli.cl_sem);
+                if (obd->u.cli.cl_import) {
+                        struct obd_import *imp;
+                        imp = obd->u.cli.cl_import;
+                        CERROR("client import never connected\n");
+                        class_destroy_import(imp);
+                        obd->u.cli.cl_import = NULL;
+                }
+                up_write(&obd->u.cli.cl_sem);
+
                 rc = obd_llog_finish(obd, 0);
                 if (rc != 0)
                         CERROR("failed to cleanup llogging subsystems\n");
index f74f672..6a41305 100644 (file)
@@ -4049,9 +4049,9 @@ static int osc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
         case OBD_CLEANUP_EXPORTS: {
                 /* If we set up but never connected, the
                    client import will not have been cleaned. */
+                down_write(&obd->u.cli.cl_sem);
                 if (obd->u.cli.cl_import) {
                         struct obd_import *imp;
-                        down_write(&obd->u.cli.cl_sem);
                         imp = obd->u.cli.cl_import;
                         CDEBUG(D_CONFIG, "%s: client import never connected\n",
                                obd->obd_name);
@@ -4061,9 +4061,10 @@ static int osc_precleanup(struct obd_device *obd, enum obd_cleanup_stage stage)
                                 imp->imp_rq_pool = NULL;
                         }
                         class_destroy_import(imp);
-                        up_write(&obd->u.cli.cl_sem);
                         obd->u.cli.cl_import = NULL;
                 }
+                up_write(&obd->u.cli.cl_sem);
+
                 rc = obd_llog_finish(obd, 0);
                 if (rc != 0)
                         CERROR("failed to cleanup llogging subsystems\n");
index c6ecae5..532f448 100644 (file)
@@ -587,8 +587,8 @@ test_22() {
        echo Client mount with ost in logs, but none running
        start_ost
        # wait until mds connected to ost and open client connection
-       # ping_interval + 1
-       sleep $((TIMEOUT / 4 + 1))
+       # 2*ping_interval + 1
+       sleep $((TIMEOUT / 2 + 1))
        stop_ost
        mount_client $MOUNT
        # check_mount will block trying to contact ost
@@ -1511,8 +1511,8 @@ test_46a() {
        start ost4 `ostdevname 4` $OST_MOUNT_OPTS || return 6
        start ost5 `ostdevname 5` $OST_MOUNT_OPTS || return 7
        # wait until ost2-5 is sync
-       # ping_interval + 1
-       sleep $((TIMEOUT / 4 + 1))
+       # 2*ping_interval + 1
+       sleep $((TIMEOUT / 2 + 1))
        #second client see both ost's
 
        mount_client $MOUNT2 || return 8