[lustre-devel] [PATCH 05/41] lustre: ptlrpc: do not output error when imp_sec is freed
James Simmons
jsimmons at infradead.org
Mon Apr 5 00:50:34 PST 2021
From: Sebastien Buisson <sbuisson at ddn.com>
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 already been freed.
Ensure to output the error message in import_sec_validate_get() only
if import is not already in the zombie work queue.
Fixes: 1a6cc3b1a9 ("staging: lustre: obdclass: use workqueue for zombie management")
WC-bug-id: https://jira.whamcloud.com/browse/LU-14355
Lustre-commit: 20cbbb084b671a1 ("LU-14355 ptlrpc: do not output error when imp_sec is freed")
Signed-off-by: Sebastien Buisson <sbuisson at ddn.com>
Reviewed-on: https://review.whamcloud.com/41310
Reviewed-by: Andreas Dilger <adilger at whamcloud.com>
Reviewed-by: John L. Hammond <jhammond at whamcloud.com>
Reviewed-by: Oleg Drokin <green at whamcloud.com>
Signed-off-by: James Simmons <jsimmons at infradead.org>
---
fs/lustre/ptlrpc/sec.c | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/fs/lustre/ptlrpc/sec.c b/fs/lustre/ptlrpc/sec.c
index 43d4f76..5b5faac 100644
--- a/fs/lustre/ptlrpc/sec.c
+++ b/fs/lustre/ptlrpc/sec.c
@@ -345,8 +345,11 @@ static int import_sec_validate_get(struct obd_import *imp,
*sec = sptlrpc_import_sec_ref(imp);
if (!*sec) {
- CERROR("import %p (%s) with no sec\n",
- imp, ptlrpc_import_state_name(imp->imp_state));
+ /* Only output an error when the import is still active */
+ if (!test_bit(WORK_STRUCT_PENDING_BIT,
+ work_data_bits(&imp->imp_zombie_work)))
+ CERROR("import %p (%s) with no sec\n",
+ imp, ptlrpc_import_state_name(imp->imp_state));
return -EACCES;
}
--
1.8.3.1
More information about the lustre-devel
mailing list