]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: MDSMonitor: don't return -EINVAL if function is bool
authorJoao Eduardo Luis <joao@redhat.com>
Fri, 17 Oct 2014 17:01:05 +0000 (18:01 +0100)
committerJoao Eduardo Luis <joao@redhat.com>
Fri, 17 Oct 2014 17:01:05 +0000 (18:01 +0100)
Returning -EINVAL on a function that expects bool and the error code to
be in a variable 'r' can only achieve one thing: if this path is ever
touched, instead of returning an error as it was supposed to, we're
returning 'true' with 'r = 0' and, for no apparent reason, the user will
think everything went smoothly but with no new fs created.

Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
src/mon/MDSMonitor.cc

index aa20d933a0fddc7ef6cbca0126a662ba518c33c2..0d32eaabe9e56fe15e7f5663c29ecc80b2a07266 100644 (file)
@@ -1092,7 +1092,8 @@ bool MDSMonitor::management_command(
         // Ensure fs name is not empty so that we can implement
         // commmands that refer to FS by name in future.
         ss << "Filesystem name may not be empty";
-        return -EINVAL;
+        r = -EINVAL;
+        return true;
     }
 
     if (pending_mdsmap.get_enabled()