Whamcloud - gitweb
LU-989 ldlm: Fix client's import destruction
authorAndriy Skulysh <Andriy_Skulysh@xyratex.com>
Fri, 13 Jan 2012 14:08:57 +0000 (16:08 +0200)
committerOleg Drokin <green@whamcloud.com>
Thu, 29 Mar 2012 04:55:27 +0000 (00:55 -0400)
Move client's import destruction from disconnect to cleanup phase
The patch allows to use connect after disconnect.

Xyratex-bug-id: MRP-288
Signed-off-by: Andriy Skulysh <Andriy_Skulysh@xyratex.com>
Change-Id: I984660a2917a7e4d5c95cd8288dd6974a7c3ccba
Reviewed-by: Alexey Lyashkov <alexey_lyashkov@xyratex.com>
Reviewed-by: Vitaly Fertman <vitaly_fertman@xyratex.com>
Reviewed-on: http://review.whamcloud.com/1963
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Mike Pershin <tappro@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/obd_class.h
lustre/ldlm/ldlm_lib.c
lustre/obdclass/genops.c

index 3d43dd4..6a2a7de 100644 (file)
@@ -657,7 +657,7 @@ static inline void obd_cleanup_client_import(struct obd_device *obd)
                         ptlrpc_free_rq_pool(imp->imp_rq_pool);
                         imp->imp_rq_pool = NULL;
                 }
-                class_destroy_import(imp);
+                client_destroy_import(imp);
                 obd->u.cli.cl_import = NULL;
         }
         cfs_up_write(&obd->u.cli.cl_sem);
index 44bdcd4..6c13613 100644 (file)
@@ -226,6 +226,7 @@ void client_destroy_import(struct obd_import *imp)
         sptlrpc_import_sec_put(imp);
         class_import_put(imp);
 }
+EXPORT_SYMBOL(client_destroy_import);
 
 /* configure an RPC client OBD device
  *
@@ -428,6 +429,8 @@ int client_obd_cleanup(struct obd_device *obddev)
         ldlm_namespace_free_post(obddev->obd_namespace);
         obddev->obd_namespace = NULL;
 
+        LASSERT(obddev->u.cli.cl_import == NULL);
+
         ldlm_put_ref();
         RETURN(0);
 }
@@ -560,13 +563,6 @@ int client_disconnect_export(struct obd_export *exp)
 
         ptlrpc_invalidate_import(imp);
 
-        if (imp->imp_rq_pool) {
-                ptlrpc_free_rq_pool(imp->imp_rq_pool);
-                imp->imp_rq_pool = NULL;
-        }
-        client_destroy_import(imp);
-        cli->cl_import = NULL;
-
         EXIT;
 
  out_disconnect:
index ce151fa..1584930 100644 (file)
@@ -1606,6 +1606,7 @@ static void obd_zombie_export_add(struct obd_export *exp) {
  */
 static void obd_zombie_import_add(struct obd_import *imp) {
         LASSERT(imp->imp_sec == NULL);
+        LASSERT(imp->imp_rq_pool == NULL);
         cfs_spin_lock(&obd_zombie_impexp_lock);
         LASSERT(cfs_list_empty(&imp->imp_zombie_chain));
         zombies_count++;