imp_sec should be put after all requests being drained off.
Signed-off-by: Niu Yawei <yawei.niu@intel.com>
Change-Id: I35f572fcc79b2bd1991db14577226a3ea735630d
Reviewed-on: http://review.whamcloud.com/16071
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Sebastien Buisson <sebastien.buisson@bull.net>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
* <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
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);
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
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);
}
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)
}
*sec = sptlrpc_import_sec_ref(imp);
- /* Only output an error when the import is still active */
if (*sec == NULL) {
- if (list_empty(&imp->imp_zombie_chain))
- CERROR("import %p (%s) with no sec\n",
- imp, ptlrpc_import_state_name(imp->imp_state));
+ CERROR("import %p (%s) with no sec\n",
+ imp, ptlrpc_import_state_name(imp->imp_state));
return -EACCES;
}