Skip to content

ocfs2: harden heartbeat teardown races

Cen Zhang lkml ocfs2-devel 1 version Applied

Status from this message: [merged mm-nonmm-stable] ocfs2-o2hb-quiesce-negotiate-handlers-and-timeout-work.patch removed from -mm tree

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 6 repliesApplied 2/2

Patches in v1 All 2 applied

#Subject and filesSizeRepliesApplied
1/2ocfs2: synchronize heartbeat callbacks with o2net teardownfs/ocfs2/cluster/heartbeat.c fs/ocfs2/cluster/heartbeat.h fs/ocfs2/cluster/nodemanager.c +2 more+109 -271 replyApplied
2/2ocfs2: o2hb: quiesce negotiate handlers and timeout workfs/ocfs2/cluster/heartbeat.c fs/ocfs2/cluster/tcp.c fs/ocfs2/cluster/tcp.h+138 -221 replyApplied

Reviews trailers per patch

All 2 patches have a Reviewed-by or Acked-by.

PatchJoseph Qi
1/2R-b
2/2R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 0/2] ocfs2: harden heartbeat teardown races

Hi,

This series fixes two OCFS2 heartbeat/o2net teardown races found by KASAN.

This series is based on my earlier patch:

[PATCH v2] ocfs2/cluster: keep heartbeat local node stable

That patch has been queued in Andrew's -mm tree as:

ocfs2-cluster-keep-heartbeat-local-node-stable.patch

It is needed as the base because this series uses the stable per-region heartbeat node number from that patch instead of re-reading o2nm_this_node() during teardown.

Patch 1 stops heartbeat callbacks from queuing o2net reconnect and disconnect work after local o2net teardown has started, while still keeping the callbacks registered for quorum state.

Patch 2 keeps a heartbeat region non-armable while it is starting or stopping, unregisters negotiate handlers before tearing down state they can reach, and waits for the active or destroying o2net ordered workqueue before freeing the region.

Thanks,
Cen

Cen Zhang (2):
ocfs2: synchronize heartbeat callbacks with o2net teardown
ocfs2: o2hb: quiesce negotiate handlers and timeout work

 fs/ocfs2/cluster/heartbeat.c   |  99 ++++++++++++++----
 fs/ocfs2/cluster/heartbeat.h   |   5 +
 fs/ocfs2/cluster/nodemanager.c |   4 +
 fs/ocfs2/cluster/tcp.c         | 186 +++++++++++++++++++++++++++------
 fs/ocfs2/cluster/tcp.h         |   2 +
 5 files changed, 247 insertions(+), 49 deletions(-)
Signature · 1 line
2.43.0