[Drbd-dev] [PATCH] drbd_create_device: also remove device from resource idr on failure.

johannes at johannesthoma.com johannes at johannesthoma.com
Tue May 22 18:40:39 CEST 2018


From: Johannes Thoma <johannes at johannesthoma.com>

On failure, a drbdadm status may OOPS when the already freed
device is still on this idr, should we fail late in
drbd_create_device(). This patch does the cleanup.
---
 drbd/drbd_main.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drbd/drbd_main.c b/drbd/drbd_main.c
index 300b684..04ec052 100644
--- a/drbd/drbd_main.c
+++ b/drbd/drbd_main.c
@@ -3763,6 +3763,7 @@ out_remove_peer_device:
 		kref_debug_put(&connection->kref_debug, 3);
 		kref_put(&connection->kref, drbd_destroy_connection);
 	}
+	idr_remove(&resource->devices, vnr);
 
 out_idr_remove_minor:
 	idr_remove(&drbd_devices, minor);
-- 
2.7.4



More information about the drbd-dev mailing list