Whamcloud - gitweb
branch: HEAD
authorericm <ericm>
Wed, 15 Jul 2009 21:55:05 +0000 (21:55 +0000)
committerericm <ericm>
Wed, 15 Jul 2009 21:55:05 +0000 (21:55 +0000)
do not send destroy notification for reverse ctx.
b=20040
r=fanyong
r=wangdi

lustre/include/lustre_sec.h
lustre/ldlm/ldlm_lib.c
lustre/ptlrpc/gss/sec_gss.c
lustre/ptlrpc/sec.c

index 50274fc..3fdf2e7 100644 (file)
@@ -721,7 +721,6 @@ struct ptlrpc_sec *sptlrpc_import_sec_ref(struct obd_import *imp);
 void sptlrpc_import_sec_put(struct obd_import *imp);
 
 int  sptlrpc_import_check_ctx(struct obd_import *imp);
 void sptlrpc_import_sec_put(struct obd_import *imp);
 
 int  sptlrpc_import_check_ctx(struct obd_import *imp);
-void sptlrpc_import_inval_all_ctx(struct obd_import *imp);
 void sptlrpc_import_flush_root_ctx(struct obd_import *imp);
 void sptlrpc_import_flush_my_ctx(struct obd_import *imp);
 void sptlrpc_import_flush_all_ctx(struct obd_import *imp);
 void sptlrpc_import_flush_root_ctx(struct obd_import *imp);
 void sptlrpc_import_flush_my_ctx(struct obd_import *imp);
 void sptlrpc_import_flush_all_ctx(struct obd_import *imp);
index a55a9b0..bb6e297 100644 (file)
@@ -971,19 +971,6 @@ dont_check_exports:
                 obd_set_info_async(export, sizeof(KEY_REVIMP_UPD),
                                    KEY_REVIMP_UPD, 0, NULL, NULL);
 
                 obd_set_info_async(export, sizeof(KEY_REVIMP_UPD),
                                    KEY_REVIMP_UPD, 0, NULL, NULL);
 
-                /* in some recovery senarios, previous ctx init rpc handled
-                 * in sptlrpc_target_export_check() might be used to install
-                 * a reverse ctx in this reverse import, and later OBD_CONNECT
-                 * using the same gss ctx could reach here and following new
-                 * reverse import. note all reverse ctx in new/old import are
-                 * actually based on the same gss ctx. so we invalidate ctx
-                 * here before destroy import, otherwise flush old import will
-                 * lead to remote reverse ctx be destroied, thus the reverse
-                 * ctx of new import will lost its peer.
-                 * there might be a better way to deal with this???
-                 */
-                sptlrpc_import_inval_all_ctx(export->exp_imp_reverse);
-
                 client_destroy_import(export->exp_imp_reverse);
         }
 
                 client_destroy_import(export->exp_imp_reverse);
         }
 
index 9b531f2..35dd68c 100644 (file)
@@ -1211,6 +1211,15 @@ int gss_cli_ctx_fini_common(struct ptlrpc_sec *sec,
         LASSERT(atomic_read(&ctx->cc_refcount) == 0);
         LASSERT(ctx->cc_sec == sec);
 
         LASSERT(atomic_read(&ctx->cc_refcount) == 0);
         LASSERT(ctx->cc_sec == sec);
 
+        /*
+         * remove UPTODATE flag of reverse ctx thus we won't send fini rpc,
+         * this is to avoid potential problems of client side reverse svc ctx
+         * be mis-destroyed in various recovery senarios. anyway client can
+         * manage its reverse ctx well by associating it with its buddy ctx.
+         */
+        if (sec_is_reverse(sec))
+                ctx->cc_flags &= ~PTLRPC_CTX_UPTODATE;
+
         if (gctx->gc_mechctx) {
                 /* the final context fini rpc will use this ctx too, and it's
                  * asynchronous which finished by request_out_callback(). so
         if (gctx->gc_mechctx) {
                 /* the final context fini rpc will use this ctx too, and it's
                  * asynchronous which finished by request_out_callback(). so
index 55bbdf2..beaf09d 100644 (file)
@@ -1461,12 +1461,6 @@ static void import_flush_ctx_common(struct obd_import *imp,
         sptlrpc_sec_put(sec);
 }
 
         sptlrpc_sec_put(sec);
 }
 
-void sptlrpc_import_inval_all_ctx(struct obd_import *imp)
-{
-        /* use grace == 0 */
-        import_flush_ctx_common(imp, -1, 0, 1);
-}
-
 void sptlrpc_import_flush_root_ctx(struct obd_import *imp)
 {
         /* it's important to use grace mode, see explain in
 void sptlrpc_import_flush_root_ctx(struct obd_import *imp)
 {
         /* it's important to use grace mode, see explain in