]> git.tuebingen.mpg.de Git - dss.git/commitdiff
Merge branch 'master' into rm_hook
authorAndre Noll <maan@systemlinux.org>
Tue, 7 Apr 2009 12:18:14 +0000 (14:18 +0200)
committerAndre Noll <maan@systemlinux.org>
Tue, 7 Apr 2009 12:18:14 +0000 (14:18 +0200)
1  2 
dss.c

diff --combined dss.c
index 2660348254d0fca329b2ac24d43df245fb3364a7,2a18857ecd1f3db9f12a698710385f415be8b53b..2a0fb9edce9cb6af9ee9eecc880f9148bb2546bc
--- 1/dss.c
--- 2/dss.c
+++ b/dss.c
@@@ -54,8 -54,6 +54,8 @@@ static int64_t current_snapshot_creatio
  static char *path_to_last_complete_snapshot;
  /** \sa \ref snap.h for details. */
  static unsigned snapshot_creation_status;
 +/** \sa \ref snap.h for details. */
 +static unsigned snapshot_removal_status;
  
  
  DEFINE_DSS_ERRLIST;
@@@ -369,7 -367,7 +369,7 @@@ static int pre_create_hook(void
                snapshot_creation_status = SCS_PRE_HOOK_SUCCESS;
                return 0;
        }
-       DSS_NOTICE_LOG("executing %s\n", conf.pre_create_hook_arg);
+       DSS_DEBUG_LOG("executing %s\n", conf.pre_create_hook_arg);
        ret = dss_exec_cmdline_pid(&create_pid,
                conf.pre_create_hook_arg, fds);
        if (ret < 0)
@@@ -534,6 -532,7 +534,7 @@@ out
  static int handle_pre_create_hook_exit(int status)
  {
        int es, ret;
+       static int warn_count;
  
        if (!WIFEXITED(status)) {
                snapshot_creation_status = SCS_READY;
        }
        es = WEXITSTATUS(status);
        if (es) {
+               if (!warn_count--) {
+                       DSS_NOTICE_LOG("pre_create_hook %s returned %d\n",
+                               conf.pre_create_hook_arg, es);
+                       DSS_NOTICE_LOG("deferring snapshot creation...\n");
+                       warn_count = 60; /* warn only once per hour */
+               }
                snapshot_creation_status = SCS_READY;
                compute_next_snapshot_time();
-               ret = -E_BAD_EXIT_CODE;
+               ret = 0;
                goto out;
        }
+       warn_count = 0;
        snapshot_creation_status = SCS_PRE_HOOK_SUCCESS;
        ret = 1;
  out: