diff options
| author | Joseph Qi <joseph.qi@linux.alibaba.com> | 2026-07-10 15:17:55 +0800 |
|---|---|---|
| committer | Andrew Morton <akpm@linux-foundation.org> | 2026-08-03 21:10:14 -0700 |
| commit | 609d45af831065d90880a693027d93806ad0b802 (patch) | |
| tree | f2da5a06679ad9f347ebd2c017131a9f02006682 /tools/perf/scripts/python | |
| parent | e31d33fc331a9b725426b6573237859606ece621 (diff) | |
ocfs2: cluster: use GFP_NOFS for heartbeat bio allocation
o2hb_setup_one_bio() allocates the heartbeat bio with GFP_ATOMIC. The
disk heartbeat runs in the o2hb kernel thread (o2hb_do_disk_heartbeat),
which is process context and can sleep, so there is no atomicity
requirement here.
GFP_ATOMIC lacks __GFP_DIRECT_RECLAIM, so the allocation is not served
from the fs_bio_set mempool reserve and can return NULL under memory
pressure. A failed heartbeat allocation aborts the heartbeat and can lead
to the local node being fenced, which is exactly what the old comment
worried about.
Use GFP_NOFS instead. It keeps __GFP_DIRECT_RECLAIM so the allocation is
backed by the fs_bio_set mempool and cannot fail, while avoiding recursion
back into the filesystem during heartbeat I/O. As the allocation can no
longer fail, drop the dead ERR_PTR(-ENOMEM) path in o2hb_setup_one_bio()
and the now-redundant IS_ERR() handling in its callers.
Link: https://lore.kernel.org/20260710071756.3586797-1-joseph.qi@linux.alibaba.com
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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
