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

Cen Zhang <[email protected]> Tue, 16 Jun 2026 15:45:10 +0800
Newsgroups dev.linux.lists.ocfs2-devel,org.kernel.vger.linux-kernel
Message-ID <CAFRLqsU_PdYYdKejY83CeKWoYx++6eNeFFa9SwR4o2irNJtjCA@mail.gmail.com>
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