]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: Fix error message when mds not active
authorJos Collin <jcollin@redhat.com>
Wed, 22 Nov 2017 11:42:43 +0000 (17:12 +0530)
committerJos Collin <jcollin@redhat.com>
Wed, 22 Nov 2017 11:45:49 +0000 (17:15 +0530)
Fix error message for mds not active state. Also fixed the 'unrecognized command' logic by avoiding the new stringstream local object.

Signed-off-by: Jos Collin <jcollin@redhat.com>
src/mds/MDSDaemon.cc

index 7b974a60d4992b61094f5d26d7ab12b240b8979e..5179f937d80f366b5b0ad409edb1c564d5092f89 100644 (file)
@@ -823,18 +823,19 @@ int MDSDaemon::_handle_command(
     cpu_profiler_handle_command(argvec, ds);
   } else {
     // Give MDSRank a shot at the command
-    if (mds_rank) {
+    if (!mds_rank) {
+      ss << "MDS not active";
+      r = -EINVAL;
+    }
+    else {
       bool handled = mds_rank->handle_command(cmdmap, m, &r, &ds, &ss,
                                              need_reply);
-      if (handled) {
-        goto out;
+      if (!handled) {
+        // MDSDaemon doesn't know this command
+        ss << "unrecognized command! " << prefix;
+        r = -EINVAL;
       }
     }
-
-    // Neither MDSDaemon nor MDSRank know this command
-    std::ostringstream ss;
-    ss << "unrecognized command! " << prefix;
-    r = -EINVAL;
   }
 
 out: