[Drbd-dev] [PATCH] drbdadm: Fix does not allocate bitmap for stacked res

Nick Wang nwang at suse.com
Thu Jan 25 07:27:29 CET 2018


In e01b8b3e, allow peer_devices without bitmap.
However, should exclude stacked resource in this
case to avoid call trace caused by no bitmap,
bitmap->bitmap_index = -1.

Call Trace when init syncing to the stacked resource:
    drbd_bmio_set_n_write+0x39/0x70 [drbd]
    drbd_bitmap_io+0x8e/0xe0 [drbd]
    bitmap_mod_after_handshake+0xcb/0x1f0 [drbd]
    receive_state+0xada/0x16c0 [drbd]
    drbd_receiver+0x3b1/0x660 [drbd]

Signed-off-by: Nick Wang <nwang at suse.com>
CC: Lars Ellenberg <lars.ellenberg at linbit.com>
CC: Roland Kammerer <roland.kammerer at linbit.com>
CC: drbd-dev at lists.linbit.com
---
 user/v9/drbdadm_postparse.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/user/v9/drbdadm_postparse.c b/user/v9/drbdadm_postparse.c
index 1cefd5c2..2dabba66 100644
--- a/user/v9/drbdadm_postparse.c
+++ b/user/v9/drbdadm_postparse.c
@@ -465,7 +465,8 @@ static void add_no_bitmap_opt(struct d_resource *res)
 			continue;
 
 		STAILQ_FOREACH(peer_device, &conn->peer_devices, connection_link) {
-			if (peer_device->connection->peer && peer_diskless(peer_device))
+			if (peer_device->connection->peer && !peer_device->connection->peer->lower &&
+				peer_diskless(peer_device))
 				insert_tail(&peer_device->pd_options, new_opt("bitmap", "no"));
 		}
 	}
-- 
2.12.0



More information about the drbd-dev mailing list