From 4e171380032f7defda1d93eeee31beb8dfc9f0b8 Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Mon, 27 Jan 2014 10:51:53 +0100 Subject: [PATCH] light: make detach/down more robust against following commands Immediately stop syncing when rource should go down. --- kernel/sy_old/mars_light.c | 5 +++++ userspace/marsadm | 2 ++ 2 files changed, 7 insertions(+) diff --git a/kernel/sy_old/mars_light.c b/kernel/sy_old/mars_light.c index e5adc15e..12b23c4f 100644 --- a/kernel/sy_old/mars_light.c +++ b/kernel/sy_old/mars_light.c @@ -3665,6 +3665,11 @@ static int make_sync(void *buf, struct mars_dent *dent) goto done; } + /* Don't try syncing detached resources + */ + if (do_start && !_check_allow(global, dent->d_parent, "attach")) + do_start = false; + /* Disallow contemporary sync & logfile_apply */ if (do_start && diff --git a/userspace/marsadm b/userspace/marsadm index c9b3ed15..0f1d763d 100755 --- a/userspace/marsadm +++ b/userspace/marsadm @@ -1248,6 +1248,8 @@ sub attach_res_phase2 { check_status($cmd, $res, "is-attached", $detach ? 0 : 1, 1); if ($detach) { check_mars_device($cmd, $res, 1, 1); + check_status($cmd, $res, "is-replaying", 0, 1); + check_status($cmd, $res, "is-syncing", 0, 1); } }