Commit d333597a authored by Amir Shehata's avatar Amir Shehata Committed by Greg Kroah-Hartman

staging: lustre: ptlrpc: Suppress error message when imp_sec is freed

There is a race condition on client reconnect when the import
is being destroyed.  Some outstanding client bound requests
are being processed when the imp_sec has alread been freed.
Ensure to suppress the error message in import_sec_validate_get()
in that case
Signed-off-by: default avatarAmir Shehata <amir.shehata@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3353
Reviewed-on: http://review.whamcloud.com/10200Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Reviewed-by: default avatarJames Simmons <uja.ornl@gmail.com>
Reviewed-by: default avatarOleg Drokin <oleg.drokin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a21e4b90
...@@ -311,6 +311,19 @@ static int import_sec_check_expire(struct obd_import *imp) ...@@ -311,6 +311,19 @@ static int import_sec_check_expire(struct obd_import *imp)
return sptlrpc_import_sec_adapt(imp, NULL, NULL); return sptlrpc_import_sec_adapt(imp, NULL, NULL);
} }
/**
* Get and validate the client side ptlrpc security facilities from
* \a imp. There is a race condition on client reconnect when the import is
* being destroyed while there are outstanding client bound requests. In
* this case do not output any error messages if import secuity is not
* found.
*
* \param[in] imp obd import associated with client
* \param[out] sec client side ptlrpc security
*
* \retval 0 if security retrieved successfully
* \retval -ve errno if there was a problem
*/
static int import_sec_validate_get(struct obd_import *imp, static int import_sec_validate_get(struct obd_import *imp,
struct ptlrpc_sec **sec) struct ptlrpc_sec **sec)
{ {
...@@ -323,9 +336,11 @@ static int import_sec_validate_get(struct obd_import *imp, ...@@ -323,9 +336,11 @@ static int import_sec_validate_get(struct obd_import *imp,
} }
*sec = sptlrpc_import_sec_ref(imp); *sec = sptlrpc_import_sec_ref(imp);
/* Only output an error when the import is still active */
if (!*sec) { if (!*sec) {
CERROR("import %p (%s) with no sec\n", if (list_empty(&imp->imp_zombie_chain))
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; return -EACCES;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment