]> git.tuebingen.mpg.de Git - dss.git/commitdiff
Fix rm-hooks in case no post-remove hook was specified.
authorAndre Noll <maan@systemlinux.org>
Mon, 27 Apr 2009 18:19:11 +0000 (20:19 +0200)
committerAndre Noll <maan@systemlinux.org>
Mon, 27 Apr 2009 18:19:11 +0000 (20:19 +0200)
Without the patch the following assertion was triggered upon
removal of the second snapshot:

dss: dss.c:229: pre_remove_hook: Assertion `!snapshot_currently_being_removed' failed.

Thanks to Sebastian Stark who pointed out the issue.

dss.c

diff --git a/dss.c b/dss.c
index cee49d68885d88abc8af991647905fd6c91f354d..c0597f3af32e4586d6fbb98f78aea9b59f338aff 100644 (file)
--- a/dss.c
+++ b/dss.c
@@ -568,7 +568,10 @@ static int handle_rm_exit(int status)
                snapshot_removal_status = HS_READY;
                return -E_BAD_EXIT_CODE;
        }
-       snapshot_removal_status = HS_SUCCESS;
+       if (conf.post_remove_hook_given)
+               snapshot_removal_status = HS_SUCCESS;
+       else
+               snapshot_removal_status = HS_READY;
        return 1;
 }