diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2012-08-28 16:48:03 +0200 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2012-11-09 14:11:08 +0100 |
commit | 19fffd7b0303e8843aa2decfd43fa57c9d511409 (patch) | |
tree | 19ac111fafeec46eac2b0e8cee4f41f4327a1129 /drivers/block/drbd/drbd_main.c | |
parent | d76440181d0e05826f228189b74b4dbf64b68981 (diff) | |
download | talos-obmc-linux-19fffd7b0303e8843aa2decfd43fa57c9d511409.tar.gz talos-obmc-linux-19fffd7b0303e8843aa2decfd43fa57c9d511409.zip |
drbd: Call drbd_md_sync() explicitly after a state change on the connection
Without this, the meta-data gets updates after 5 seconds by the
md_sync_timer. Better to do it immeditaly after a state change.
If the asender detects a network failure, it may take a bit until
the worker processes the according after-conn-state-change work item.
The worker might be blocked in sending something, i.e. it
takes until it gets into its timeout. That is 6 seconds by
default which is longer than the 5 seconds of the md_sync_timer.
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_main.c')
-rw-r--r-- | drivers/block/drbd/drbd_main.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 732053de1dbf..5e5a6abb2819 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c @@ -2820,6 +2820,22 @@ void drbd_free_sock(struct drbd_tconn *tconn) /* meta data management */ +void conn_md_sync(struct drbd_tconn *tconn) +{ + struct drbd_conf *mdev; + int vnr; + + rcu_read_lock(); + idr_for_each_entry(&tconn->volumes, mdev, vnr) { + kref_get(&mdev->kref); + rcu_read_unlock(); + drbd_md_sync(mdev); + kref_put(&mdev->kref, &drbd_minor_destroy); + rcu_read_lock(); + } + rcu_read_unlock(); +} + struct meta_data_on_disk { u64 la_size; /* last agreed size. */ u64 uuid[UI_SIZE]; /* UUIDs. */ |