From d67a885d8fff50dbe364eaf132eaaf4bb4854707 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Fri, 3 Sep 2021 15:53:30 -0500 Subject: [PATCH] blk/zoned: print error during init Otherwise it is easy to miss things like EPERM during testing. Signed-off-by: Sage Weil --- src/blk/zoned/HMSMRDevice.cc | 5 +++++ 1 file changed, 5 insertions(+) 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; } -- 2.39.5