light: make detach/down more robust against following commands

Immediately stop syncing when rource should go down.
This commit is contained in:
Thomas Schoebel-Theuer 2014-01-27 10:51:53 +01:00
parent 9e54983283
commit 4e17138003
2 changed files with 7 additions and 0 deletions

View File

@ -3665,6 +3665,11 @@ static int make_sync(void *buf, struct mars_dent *dent)
goto done; 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 /* Disallow contemporary sync & logfile_apply
*/ */
if (do_start && if (do_start &&

View File

@ -1248,6 +1248,8 @@ sub attach_res_phase2 {
check_status($cmd, $res, "is-attached", $detach ? 0 : 1, 1); check_status($cmd, $res, "is-attached", $detach ? 0 : 1, 1);
if ($detach) { if ($detach) {
check_mars_device($cmd, $res, 1, 1); check_mars_device($cmd, $res, 1, 1);
check_status($cmd, $res, "is-replaying", 0, 1);
check_status($cmd, $res, "is-syncing", 0, 1);
} }
} }