mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-28 17:41:50 +00:00
drbd: re-add lost conf_mutex protection in drbd_set_role
The conf_update mutex used to be held while clearing the net_conf->discard_my_data flag inside drbd_set_role. It was moved into drbd_adm_set_role with drbd: allow parallel promote/demote actions but then replaced at that location by the newly introduced adm_mutex with drbd: Fix a potential deadlock in drbdsetup, introduce resource->adm_mutex And I simply forgot to put it back in at the original location. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
This commit is contained in:
parent
fcb096740a
commit
66ce6dbce2
1 changed files with 2 additions and 2 deletions
|
@ -661,11 +661,11 @@ drbd_set_role(struct drbd_device *const device, enum drbd_role new_role, int for
|
||||||
put_ldev(device);
|
put_ldev(device);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
/* Called from drbd_adm_set_role only.
|
mutex_lock(&device->resource->conf_update);
|
||||||
* We are still holding the conf_update mutex. */
|
|
||||||
nc = connection->net_conf;
|
nc = connection->net_conf;
|
||||||
if (nc)
|
if (nc)
|
||||||
nc->discard_my_data = 0; /* without copy; single bit op is atomic */
|
nc->discard_my_data = 0; /* without copy; single bit op is atomic */
|
||||||
|
mutex_unlock(&device->resource->conf_update);
|
||||||
|
|
||||||
set_disk_ro(device->vdisk, false);
|
set_disk_ro(device->vdisk, false);
|
||||||
if (get_ldev(device)) {
|
if (get_ldev(device)) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue