Skip to content

Commit

Permalink
drbd: Fixed processing of disk-barrier, disk-flushes and disk-drain
Browse files Browse the repository at this point in the history
Since drbd_bump_write_ordering() is called in the attaching
process while the disk state is D_ATTACHING, it was not
considering these three flags during attach.

A call to this function was missing form drbd_adm_disk_opts().

Fixed both issues.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
  • Loading branch information
Philipp Reisner committed Nov 8, 2012
1 parent 9ed57dc commit 27eb13e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions drivers/block/drbd/drbd_nl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1229,6 +1229,9 @@ int drbd_adm_disk_opts(struct sk_buff *skb, struct genl_info *info)
}

mutex_unlock(&mdev->tconn->conf_update);

drbd_bump_write_ordering(mdev->tconn, WO_bdev_flush);

drbd_md_sync(mdev);

if (mdev->state.conn >= C_CONNECTED)
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/drbd/drbd_receiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1229,7 +1229,7 @@ void drbd_bump_write_ordering(struct drbd_tconn *tconn, enum write_ordering_e wo
wo = min(pwo, wo);
rcu_read_lock();
idr_for_each_entry(&tconn->volumes, mdev, vnr) {
if (!get_ldev(mdev))
if (!get_ldev_if_state(mdev, D_ATTACHING))
continue;
dc = rcu_dereference(mdev->ldev->disk_conf);

Expand Down

0 comments on commit 27eb13e

Please sign in to comment.