diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2013-12-20 11:17:02 +0100 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2014-07-10 15:22:22 +0200 |
commit | 70df70927b75eb86f12b14167c398b99dc3a56e4 (patch) | |
tree | 81225e07ec255438893b727d99937ffa16cdc732 /drivers/block/drbd/drbd_receiver.c | |
parent | drbd: refactor use of first_peer_device() (diff) | |
download | linux-70df70927b75eb86f12b14167c398b99dc3a56e4.tar.xz linux-70df70927b75eb86f12b14167c398b99dc3a56e4.zip |
drbd: allow write-ordering policy to be bumped up again
Previously, once you disabled flushes as a means of enforcing
write-ordering, you'd need to detach/re-attach to enable them again.
Allow drbdsetup disk-options to re-enable previously disabled
write-ordering policy options at runtime.
While at it fix RCU in drbd_bump_write_ordering()
max_allowed_wo() uses rcu_dereference, therefore it must
be called within rcu_read_lock()/rcu_read_unlock()
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_receiver.c')
-rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index bb1434dfec8a..8d8a6b7f8f5d 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -1290,7 +1290,8 @@ void drbd_bump_write_ordering(struct drbd_resource *resource, struct drbd_backin }; pwo = resource->write_ordering; - wo = min(pwo, wo); + if (wo != WO_bdev_flush) + wo = min(pwo, wo); rcu_read_lock(); idr_for_each_entry(&resource->devices, device, vnr) { if (get_ldev(device)) { @@ -1300,11 +1301,12 @@ void drbd_bump_write_ordering(struct drbd_resource *resource, struct drbd_backin put_ldev(device); } } - rcu_read_unlock(); if (bdev) wo = max_allowed_wo(bdev, wo); + rcu_read_unlock(); + resource->write_ordering = wo; if (pwo != resource->write_ordering || wo == WO_bdev_flush) drbd_info(resource, "Method to ensure write ordering: %s\n", write_ordering_str[resource->write_ordering]); |