From: Lars Ellenberg Date: Mon, 19 Jul 2010 15:41:04 +0000 (+0200) Subject: drbd: drbd_md_sync before calling user space helpers X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=1090c056c5eb6d5335cceb381683e77ac24c71ab;p=openwrt%2Fstaging%2Fblogic.git drbd: drbd_md_sync before calling user space helpers Just in case we have some pending meta data changes to sync, do it before we call our userland helper, as that may take some time, or even cause a hard reboot. Signed-off-by: Philipp Reisner Signed-off-by: Lars Ellenberg --- diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index e0061a906ba8..5b30f90cab3e 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c @@ -172,6 +172,10 @@ int drbd_khelper(struct drbd_conf *mdev, char *cmd) put_net_conf(mdev); } + /* The helper may take some time. + * write out any unsynced meta data changes now */ + drbd_md_sync(mdev); + dev_info(DEV, "helper command: %s %s %s\n", usermode_helper, cmd, mb); drbd_bcast_ev_helper(mdev, cmd);