freeze: If priority is invalid here, it's time to abort
authorAmitay Isaacs <amitay@gmail.com>
Mon, 1 Jul 2013 06:21:00 +0000 (16:21 +1000)
committerMichael Adam <obnox@samba.org>
Mon, 26 Aug 2013 11:35:51 +0000 (13:35 +0200)
ctdb_start_freeze() is called from ctdb_control_freeze() which fixes the
priority if it's 0 and return error if it's invalid.  Other callers of
ctdb_start_freeze() are internal to CTDB.  So if priority is invalid in
ctdb_start_freeze(), definitely something is seriously wrong.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 87716e8f504d659515d3dbcf93badbf106873bc8)

Conflicts:

server/ctdb_freeze.c

server/ctdb_freeze.c

index 36423e07b8fd5952919903493ad7d6be868ec00f..69fe88d5723f343dd812e52e1e468aa68fee6085 100644 (file)
@@ -252,14 +252,9 @@ static int ctdb_freeze_waiter_destructor(struct ctdb_freeze_waiter *w)
  */
 int ctdb_start_freeze(struct ctdb_context *ctdb, uint32_t priority)
 {
-       if (priority == 0) {
-               DEBUG(DEBUG_ERR,("Freeze priority 0 requested, remapping to priority 1\n"));
-               priority = 1;
-       }
-
        if ((priority < 1) || (priority > NUM_DB_PRIORITIES)) {
                DEBUG(DEBUG_ERR,(__location__ " Invalid db priority : %u\n", priority));
-               return -1;
+               ctdb_fatal(ctdb, "Internal error");
        }
 
        if (ctdb->freeze_mode[priority] == CTDB_FREEZE_FROZEN) {