From 952a681628d685f1afa8e68c09f10179d03c7244 Mon Sep 17 00:00:00 2001 From: Andreas Dilger Date: Tue, 22 Dec 2015 18:47:21 +0000 Subject: [PATCH] Revert "LU-7030 security: put imp_sec after all requests drained off" This is causing non-NULL security flavors to fail during cleanup. This reverts commit 504ca288d99779812495a91345421ad4ad8f7d95. Change-Id: I2f370a465c3b2bb49983d13ff98c9e7dec3d15a5 Reviewed-on: http://review.whamcloud.com/17709 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: John L. Hammond Reviewed-by: Niu Yawei Reviewed-by: Sebastien Buisson Reviewed-by: Oleg Drokin --- lustre/include/obd_class.h | 1 - lustre/ldlm/ldlm_lib.c | 3 +++ lustre/obdclass/genops.c | 6 ------ lustre/ptlrpc/ptlrpc_module.c | 1 - lustre/ptlrpc/sec.c | 6 ++++-- 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/lustre/include/obd_class.h b/lustre/include/obd_class.h index be9849d..9033e79 100644 --- a/lustre/include/obd_class.h +++ b/lustre/include/obd_class.h @@ -1686,7 +1686,6 @@ struct lwp_register_item { * // XXX do not look into _superhack with remaining eye * // XXX if this were any uglier, I'd get my own show on MTV */ extern int (*ptlrpc_put_connection_superhack)(struct ptlrpc_connection *c); -extern void (*sptlrpc_sec_put_superhack)(struct obd_import *imp); /* obd_mount.c */ #ifdef HAVE_SERVER_SUPPORT diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index 13e3e59..fd4f142 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -219,8 +219,11 @@ EXPORT_SYMBOL(client_import_find_conn); void client_destroy_import(struct obd_import *imp) { + /* Drop security policy instance after all RPCs have finished/aborted + * to let all busy contexts be released. */ class_import_get(imp); class_destroy_import(imp); + sptlrpc_import_sec_put(imp); class_import_put(imp); } EXPORT_SYMBOL(client_destroy_import); diff --git a/lustre/obdclass/genops.c b/lustre/obdclass/genops.c index 2cc5e04..7ca03f0 100644 --- a/lustre/obdclass/genops.c +++ b/lustre/obdclass/genops.c @@ -70,8 +70,6 @@ atomic_t obd_stale_export_num; int (*ptlrpc_put_connection_superhack)(struct ptlrpc_connection *c); EXPORT_SYMBOL(ptlrpc_put_connection_superhack); -void (*sptlrpc_sec_put_superhack)(struct obd_import *imp); -EXPORT_SYMBOL(sptlrpc_sec_put_superhack); /* * support functions: we could use inter-module communication, but this @@ -1027,10 +1025,6 @@ void class_import_put(struct obd_import *imp) if (atomic_dec_and_test(&imp->imp_refcount)) { CDEBUG(D_INFO, "final put import %p\n", imp); - /* Drop security policy instance after all RPCs have - * finished/aborted to let all busy contexts be released. */ - sptlrpc_sec_put_superhack(imp); - obd_zombie_import_add(imp); } diff --git a/lustre/ptlrpc/ptlrpc_module.c b/lustre/ptlrpc/ptlrpc_module.c index 1038b24..d6a58a0 100644 --- a/lustre/ptlrpc/ptlrpc_module.c +++ b/lustre/ptlrpc/ptlrpc_module.c @@ -90,7 +90,6 @@ static __init int ptlrpc_init(void) GOTO(err_portals, rc); ptlrpc_put_connection_superhack = ptlrpc_connection_put; - sptlrpc_sec_put_superhack = sptlrpc_import_sec_put; rc = ptlrpc_start_pinger(); if (rc) diff --git a/lustre/ptlrpc/sec.c b/lustre/ptlrpc/sec.c index 94ae681..254aed5 100644 --- a/lustre/ptlrpc/sec.c +++ b/lustre/ptlrpc/sec.c @@ -398,9 +398,11 @@ static int import_sec_validate_get(struct obd_import *imp, } *sec = sptlrpc_import_sec_ref(imp); + /* Only output an error when the import is still active */ if (*sec == NULL) { - CERROR("import %p (%s) with no sec\n", - imp, ptlrpc_import_state_name(imp->imp_state)); + if (list_empty(&imp->imp_zombie_chain)) + CERROR("import %p (%s) with no sec\n", + imp, ptlrpc_import_state_name(imp->imp_state)); return -EACCES; } -- 1.8.3.1