Skip to contentSkip to conversation

ocfs2: properly clean task pointer before o2hb thread exits abnormally

PATCH In review lihongweizz 2 participants 2 messages Nov 25, 2022 OCFS2

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ocfs2: properly clean task pointer before o2hb thread exits abnormally

From: Rock Li <[email protected]>

in case o2hb thread exits abnormally before stop o2cb service, heartbeat_drop_group_item will try to stop a noexit thread cause ret->hb_task was not clear properly.

---
 fs/ocfs2/cluster/heartbeat.c | 2 ++
 1 file changed, 2 insertions(+)
fs/ocfs2/cluster/heartbeat.c +2 -0
index b13d344..9db448d 100644
@@ -1258,6 +1258,8 @@ static int o2hb_thread(void *data)
 	/* Unpin node */
 	o2nm_undepend_this_node();
 
+	reg->hr_task = NULL;
+
 	mlog(ML_HEARTBEAT|ML_KTHREAD, "o2hb thread exiting\n");
 
 	return 0;
Signature · 1 line
1.8.3.1
maintainer
#1 lore raw
Quoted 6 lines · lihongweizz

From: Rock Li <[email protected]>

in case o2hb thread exits abnormally before stop o2cb service, heartbeat_drop_group_item will try to stop a noexit thread cause ret->hb_task was not clear properly.

Could you please describe the scenario in detail?

Thanks,
Joseph

Quoted 18 lines
---
 fs/ocfs2/cluster/heartbeat.c | 2 ++
 1 file changed, 2 insertions(+)
fs/ocfs2/cluster/heartbeat.c +2 -0
index b13d344..9db448d 100644
@@ -1258,6 +1258,8 @@ static int o2hb_thread(void *data)
 	/* Unpin node */
 	o2nm_undepend_this_node();
 
+	reg->hr_task = NULL;
+
 	mlog(ML_HEARTBEAT|ML_KTHREAD, "o2hb thread exiting\n");
 
 	return 0;