Whamcloud - gitweb
Revert "LU-7030 security: put imp_sec after all requests drained off" 09/17709/3
authorAndreas Dilger <andreas.dilger@intel.com>
Tue, 22 Dec 2015 18:47:21 +0000 (18:47 +0000)
committerOleg Drokin <oleg.drokin@intel.com>
Wed, 6 Jan 2016 19:53:02 +0000 (19:53 +0000)
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 <hpdd-maloo@intel.com>
Reviewed-by: John L. Hammond <john.hammond@intel.com>
Reviewed-by: Niu Yawei <yawei.niu@intel.com>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/include/obd_class.h
lustre/ldlm/ldlm_lib.c
lustre/obdclass/genops.c
lustre/ptlrpc/ptlrpc_module.c
lustre/ptlrpc/sec.c

index be9849d..9033e79 100644 (file)
@@ -1686,7 +1686,6 @@ struct lwp_register_item {
  * <shaver> // XXX do not look into _superhack with remaining eye
  * <shaver> // 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
index 13e3e59..fd4f142 100644 (file)
@@ -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);
index 2cc5e04..7ca03f0 100644 (file)
@@ -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);
         }
 
index 1038b24..d6a58a0 100644 (file)
@@ -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)
index 94ae681..254aed5 100644 (file)
@@ -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;
        }