代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/kmod-drbd90 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From ae54cae4a5e9d753884fe74f01c32e14dc97b7e7 Mon Sep 17 00:00:00 2001
From: Lars Ellenberg <lars.ellenberg@linbit.com>
Date: Wed, 3 Jul 2024 15:14:49 +0200
Subject: [PATCH 14/79] drbd: clear_peer_slot: give up if drbd_md_get_buffer
returns NULL
Fixes a NULL deref if it so happens that the disk fails
_just_ when we try to clear a bitmap slot.
---
drbd/drbd_actlog.c | 14 +++++++++-----
drbd/drbd_nl.c | 3 +++
2 files changed, 12 insertions(+), 5 deletions(-)
diff --git a/drbd/drbd_actlog.c b/drbd/drbd_actlog.c
index 55cbbf610..bc09dee2f 100644
--- a/drbd/drbd_actlog.c
+++ b/drbd/drbd_actlog.c
@@ -36,12 +36,16 @@ void *drbd_md_get_buffer(struct drbd_device *device, const char *intent)
device->disk_state[NOW] <= D_FAILED,
HZ * 10);
- if (t == 0)
- drbd_err(device, "Waited 10 Seconds for md_buffer! BUG?\n");
-
if (r) {
- drbd_err(device, "Failed to get md_buffer for %s, currently in use by %s\n",
- intent, device->md_io.current_use);
+ if (t == 0) {
+ drbd_err(device, "Waited 10 Seconds for md_buffer! BUG?\n");
+ drbd_err(device, "Failed to get md_buffer for %s, currently in use by %s\n",
+ intent, device->md_io.current_use);
+ } else {
+ drbd_err(device, "Failed to get md_buffer for %s: disk state %s\n",
+ intent, drbd_disk_str(device->disk_state[NOW]));
+ }
+
return NULL;
}
diff --git a/drbd/drbd_nl.c b/drbd/drbd_nl.c
index b732fa6f9..40577d30b 100644
--- a/drbd/drbd_nl.c
+++ b/drbd/drbd_nl.c
@@ -2643,6 +2643,8 @@ static int clear_peer_slot(struct drbd_device *device, int peer_node_id, u32 md_
freed_index = peer_md->bitmap_index;
}
buffer = drbd_md_get_buffer(device, __func__); /* lock meta-data IO to superblock */
+ if (buffer == NULL)
+ goto out_no_buffer;
/* Look for day0 UUID before changing this peer slot to a day0 slot. */
day0_md = day0_peer_md(device);
@@ -2687,6 +2689,7 @@ static int clear_peer_slot(struct drbd_device *device, int peer_node_id, u32 md_
drbd_md_write(device, buffer);
drbd_md_put_buffer(device);
+ out_no_buffer:
if (free_bitmap_slot)
drbd_resume_io(device);
--
2.33.1.windows.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。