43a00e1438
bsc#1192929, compat to kernel v5.15 OBS-URL: https://build.opensuse.org/request/show/932870 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/drbd?expand=0&rev=136
27 lines
890 B
Diff
27 lines
890 B
Diff
/* {"version":"v5.16-rc1~73", "commit": "e92ab4eda516a5bfd96c087282ebe9521deba4f4", "comment": "drbd: add error handling support for add_disk()"} */
|
|
|
|
diff -Naur drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd_main.c drbd-9.0.30~1+git.8e9c0812/drbd/drbd_main.c
|
|
--- drbd-9.0.30~1+git.8e9c0812.orig/drbd/drbd_main.c 2021-11-19 15:36:33.405592808 +0800
|
|
+++ drbd-9.0.30~1+git.8e9c0812/drbd/drbd_main.c 2021-11-19 15:43:32.799929686 +0800
|
|
@@ -3794,7 +3794,10 @@
|
|
goto out_remove_peer_device;
|
|
}
|
|
|
|
- add_disk(disk);
|
|
+ err = add_disk(disk);
|
|
+ if (err)
|
|
+ goto out_cleanup_disk;
|
|
+
|
|
device->have_quorum[OLD] =
|
|
device->have_quorum[NEW] =
|
|
(resource->res_opts.quorum == QOU_OFF);
|
|
@@ -3811,6 +3814,8 @@
|
|
*p_device = device;
|
|
return NO_ERROR;
|
|
|
|
+out_cleanup_disk:
|
|
+ blk_cleanup_disk(disk);
|
|
out_remove_peer_device:
|
|
list_add_rcu(&tmp, &device->peer_devices);
|
|
list_del_init(&device->peer_devices);
|