Files
linux/fs
Joseph Qi 12c2ab42db ocfs2: cluster: fix o2hb_dependent_users leak on pin failure
In o2hb_region_inc_user(), o2hb_dependent_users is incremented
unconditionally before calling o2hb_region_pin().  If the pin fails, the
counter is never decremented and any partially-pinned regions are never
unpinned, since the caller does not call o2hb_region_dec_user() on error.

The leaked counter causes subsequent o2hb_region_inc_user() calls to skip
pinning entirely (the > 1 check), leaving heartbeat regions unprotected.

Fix by rolling back on failure: call o2hb_region_unpin(NULL) to release
any partially-pinned regions and decrement o2hb_dependent_users to restore
the pre-increment state.

Link: https://lore.kernel.org/20260722124933.430554-4-joseph.qi@linux.alibaba.com
Fixes: 58a3158a5d ("ocfs2/cluster: Pin/unpin o2hb regions")
Signed-off-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: Mark Fasheh <mark@fasheh.com>
Cc: Joel Becker <jlbec@evilplan.org>
Cc: Junxiao Bi <junxiao.bi@oracle.com>
Cc: Changwei Ge <gechangwei@live.cn>
Cc: Jun Piao <piaojun@huawei.com>
Cc: Heming Zhao <heming.zhao@suse.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2026-08-05 11:20:12 -07:00
..
2026-05-21 13:39:35 +02:00
2026-05-21 13:39:35 +02:00
2026-06-11 11:42:21 -07:00
2026-07-27 12:31:11 +08:00
2026-07-01 15:26:47 +02:00
2026-01-02 13:43:41 -05:00
2026-07-01 15:26:47 +02:00
2026-05-21 13:39:36 +02:00
2026-05-21 13:39:35 +02:00
2026-01-12 16:52:09 +01:00
2026-07-24 10:30:58 +02:00