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)
committerAmitay Isaacs <amitay@gmail.com>
Tue, 2 Jul 2013 07:41:54 +0000 (17:41 +1000)
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 620d4c51b283e30c8a3df49e6e1e99a4bfbd7c80..b209b0e0d1b22e1eabd79cfcfd01e23f029ba31c 100644 (file)
@@ -280,14 +280,9 @@ static void ctdb_debug_locks(void)
  */
 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) {