Re: [PATCH] ocfs2/cluster: reject local node clears while heartbeat runs

From: Cen Zhang

Date: Tue Jun 16 2026 - 03:49:54 EST


Hi Joseph,

> Seems a simple fix for this issue is also clearing cluster->cl_has_local
> in the same path?

Thanks for your review.

Yes, clearing cluster->cl_has_local in that path is needed. I updated the
patch to do that.

While checking this path again, I found that clearing cl_has_local alone
does not cover the running heartbeat thread case. After local=0,
o2nm_this_node() still returns O2NM_MAX_NODES, which has the same value as
O2NM_INVALID_NODE_NUM, and the heartbeat thread can still use that value
for hr_slots[] or for the final node undepend path.

So in v2 I kept the local node number stable in the heartbeat region once
the region starts, used that stored node for heartbeat I/O and teardown,
and also cleared cl_has_local in o2nm_node_local_store() as you suggested.

I will send v2 shortly.

Best regards,
Cen Zhang