Looks the fix of LU-3353 isn't quite right, see client_destroy_import(): It calls sptlrpc_import_sec_put() to clear imp_sec first, then calls class_import_put() to add the import onto zombie list.
Then look at the import_sec_validate_get():
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));
return -EACCES;
}
When checking imp->imp_zombie_chain, the import may not be put on zombie list yet.
Amir, could you take a look?
Jeremy, I'd be happy to drop the reversion patch if you can submit a patch to remove those extra refcounts for the security flavours.