From: Sebastien Buisson Date: Mon, 25 Jan 2021 08:24:19 +0000 (+0900) Subject: LU-14355 ptlrpc: do not output error when imp_sec is freed X-Git-Tag: 2.14.0-RC2~2 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=20cbbb084b671a1e82bd9ad23f8f1a074fc41afb;p=fs%2Flustre-release.git LU-14355 ptlrpc: do not output error 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 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: 135fea8fa9 ("LU-4423 obdclass: use workqueue for zombie management") Signed-off-by: Sebastien Buisson Change-Id: I4b431128e04f11b1e3ee7de47090af87538c3558 Reviewed-on: https://review.whamcloud.com/41310 Tested-by: jenkins Reviewed-by: Andreas Dilger Tested-by: Maloo Reviewed-by: John L. Hammond Reviewed-by: Oleg Drokin --- diff --git a/lustre/ptlrpc/sec.c b/lustre/ptlrpc/sec.c index 093a1a3..27da5c8 100644 --- a/lustre/ptlrpc/sec.c +++ b/lustre/ptlrpc/sec.c @@ -405,8 +405,11 @@ static int import_sec_validate_get(struct obd_import *imp, *sec = sptlrpc_import_sec_ref(imp); if (*sec == NULL) { - 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; }