]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
blk/zoned: print error during init
authorSage Weil <sage@newdream.net>
Fri, 3 Sep 2021 20:53:30 +0000 (15:53 -0500)
committerSage Weil <sage@newdream.net>
Fri, 29 Oct 2021 13:55:56 +0000 (09:55 -0400)
Otherwise it is easy to miss things like EPERM during testing.

Signed-off-by: Sage Weil <sage@newdream.net>
src/blk/zoned/HMSMRDevice.cc

index 0ff2f70af3d39faba7bb911e233e517d24fefa05..6459e80a54f1aa81a90d79c187eb32f6a042fa0d 100644 (file)
@@ -101,17 +101,22 @@ bool HMSMRDevice::set_smr_params(const std::string& path) {
 
   int dev = zbd_open(path.c_str(), O_RDWR | O_DIRECT | O_LARGEFILE, nullptr);
   if (dev < 0) {
+    derr << __func__ << " zbd_open failed on " << path << ": "
+        << cpp_strerror(errno) << dendl;
     return false;
   }
   auto close_dev = make_scope_guard([dev] { zbd_close(dev); });
 
   unsigned int nr_zones = 0;
   if (zbd_report_nr_zones(dev, 0, 0, ZBD_RO_NOT_WP, &nr_zones) != 0) {
+    derr << __func__ << " zbd_report_nr_zones failed on " << path << ": "
+        << cpp_strerror(errno) << dendl;
     return false;
   }
 
   std::vector<zbd_zone> zones(nr_zones);
   if (zbd_report_zones(dev, 0, 0, ZBD_RO_NOT_WP, zones.data(), &nr_zones) != 0) {
+    derr << __func__ << " zbd_report_zones failed on " << path << dendl;
     return false;
   }