]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/crush/CrushLocation.cc
update sources to ceph Nautilus 14.2.1
[ceph.git] / ceph / src / crush / CrushLocation.cc
index 4831616c0cb3ab81cb7987b33763ebbca6be4705..a73a739c785c637f0a5d2d6006fe49f4bde5d508 100644 (file)
@@ -4,9 +4,11 @@
 #include "include/compat.h"
 #include "CrushLocation.h"
 #include "CrushWrapper.h"
+#include "common/ceph_context.h"
 #include "common/config.h"
 #include "include/str_list.h"
 #include "common/debug.h"
+#include "common/errno.h"
 #include "include/compat.h"
 
 #include "common/SubProcess.h"
@@ -76,7 +78,6 @@ int CrushLocation::update_from_hook()
     lderr(cct) << "stderr:\n";
     err.hexdump(*_dout);
     *_dout << dendl;
-    return ret;
   }
 
   if (hook.join() != 0) {
@@ -84,6 +85,9 @@ int CrushLocation::update_from_hook()
     return -EINVAL;
   }
 
+  if (ret < 0)
+    return ret;
+
   std::string out;
   bl.copy(0, bl.length(), out);
   out.erase(out.find_last_not_of(" \n\r\t")+1);