From: ericm Date: Wed, 15 Jul 2009 21:55:05 +0000 (+0000) Subject: branch: HEAD X-Git-Tag: v1_9_220~19 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=676f57c42c9332bc956025663eb767cf834e5cba;ds=sidebyside branch: HEAD do not send destroy notification for reverse ctx. b=20040 r=fanyong r=wangdi --- diff --git a/lustre/include/lustre_sec.h b/lustre/include/lustre_sec.h index 50274fc..3fdf2e7 100644 --- a/lustre/include/lustre_sec.h +++ b/lustre/include/lustre_sec.h @@ -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_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); diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index a55a9b0..bb6e297 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -971,19 +971,6 @@ dont_check_exports: 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); } diff --git a/lustre/ptlrpc/gss/sec_gss.c b/lustre/ptlrpc/gss/sec_gss.c index 9b531f2..35dd68c 100644 --- a/lustre/ptlrpc/gss/sec_gss.c +++ b/lustre/ptlrpc/gss/sec_gss.c @@ -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); + /* + * 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 diff --git a/lustre/ptlrpc/sec.c b/lustre/ptlrpc/sec.c index 55bbdf2..beaf09d 100644 --- a/lustre/ptlrpc/sec.c +++ b/lustre/ptlrpc/sec.c @@ -1461,12 +1461,6 @@ static void import_flush_ctx_common(struct obd_import *imp, 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