]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
common/blkdev: include stdout and stderr on join error
authorSage Weil <sage@redhat.com>
Tue, 2 Jul 2019 18:20:06 +0000 (13:20 -0500)
committerKonstantin Shalygin <k0ste@k0ste.ru>
Wed, 26 Feb 2020 01:39:17 +0000 (08:39 +0700)
Signed-off-by: Sage Weil <sage@redhat.com>
(cherry picked from commit cff30ce6661bec5a1e046423e6335ec49471966a)

src/common/blkdev.cc

index 940765d936368f75cf9e51c816b596151c612dc2..dfe7b1ad3d0c2680ac6f58f283c67ce2d68cda65 100644 (file)
@@ -698,8 +698,10 @@ static int block_device_run_smartctl(const string& devname, int timeout,
     *result = output.to_str();
   }
 
-  if (smartctl.join() != 0) {
-    *result = std::string("smartctl returned an error:") + smartctl.err();
+  int joinerr = smartctl.join();
+  if (joinerr) {
+    *result = std::string("smartctl returned an error (") + stringify(joinerr) +
+      "): stderr:\n") + smartctl.err() + "\nstdout:\n" + *result;
     return -EINVAL;
   }