From: Sage Weil Date: Fri, 3 Sep 2021 20:53:30 +0000 (-0500) Subject: blk/zoned: print error during init X-Git-Tag: v17.1.0~535^2~56 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=d67a885d8fff50dbe364eaf132eaaf4bb4854707;p=ceph.git blk/zoned: print error during init Otherwise it is easy to miss things like EPERM during testing. Signed-off-by: Sage Weil --- diff --git a/src/blk/zoned/HMSMRDevice.cc b/src/blk/zoned/HMSMRDevice.cc index 0ff2f70af3d39..6459e80a54f1a 100644 --- a/src/blk/zoned/HMSMRDevice.cc +++ b/src/blk/zoned/HMSMRDevice.cc @@ -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 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; }