diff mbox series

[17/18] lustre: ptlrpc: send disconnected events

Message ID 1654777994-29806-18-git-send-email-jsimmons@infradead.org (mailing list archive)
State Not Applicable
Headers show
Series lustre: sync with OpenSFS tree June 8, 2022 | expand

Commit Message

James Simmons June 9, 2022, 12:33 p.m. UTC
From: Alexander Boyko <alexander.boyko@hpe.com>

Failover of node does not produce disconnect event, only inactive.
Add sending disconnected events.

HPE-bug-id: LUS-10750
WC-bug-id: https://jira.whamcloud.com/browse/LU-15724
Lustre-commit: e55fc043679cdfadf ("LU-15724 osp: wakeup all precreate threads")
Signed-off-by: Alexander Boyko <alexander.boyko@hpe.com>
Reviewed-on: https://review.whamcloud.com/47005
Reviewed-by: Alexey Lyashkov <alexey.lyashkov@hpe.com>
Reviewed-by: Sergey Cheremencev <sergey.cheremencev@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/ptlrpc/import.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/fs/lustre/ptlrpc/import.c b/fs/lustre/ptlrpc/import.c
index 3dc987cf..c0aee34 100644
--- a/fs/lustre/ptlrpc/import.c
+++ b/fs/lustre/ptlrpc/import.c
@@ -1726,6 +1726,10 @@  int ptlrpc_disconnect_import(struct obd_import *imp, int noclose)
 	memset(&imp->imp_remote_handle, 0, sizeof(imp->imp_remote_handle));
 	spin_unlock(&imp->imp_lock);
 
+	obd_import_event(imp->imp_obd, imp, IMP_EVENT_DISCON);
+	if (!noclose)
+		obd_import_event(imp->imp_obd, imp, IMP_EVENT_INACTIVE);
+
 	if (rc == -ETIMEDOUT || rc == -ENOTCONN || rc == -ESHUTDOWN)
 		rc = 0;