]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
osd: update metadata and smart code to report get_device_id errors
authorSage Weil <sage@redhat.com>
Fri, 21 Dec 2018 17:22:17 +0000 (11:22 -0600)
committerSage Weil <sage@redhat.com>
Fri, 4 Jan 2019 00:10:26 +0000 (18:10 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/osd/OSD.cc

index 0cd46a8812cd8a9e048948fe098680a478f5d0cb..db30fb3686c3188de557e293d3314a71cbb25db3 100644 (file)
@@ -5753,14 +5753,16 @@ void OSD::_collect_metadata(map<string,string> *pm)
   (*pm)["devices"] = stringify(devnames);
   string devids;
   for (auto& dev : devnames) {
-    if (!devids.empty()) {
-      devids += ",";
-    }
-    string id = get_device_id(dev);
+    string err;
+    string id = get_device_id(dev, &err);
     if (id.size()) {
+      if (!devids.empty()) {
+       devids += ",";
+      }
       devids += dev + "=" + id;
     } else {
-      dout(10) << __func__ << " no unique device id for " << dev << dendl;
+      dout(10) << __func__ << " no unique device id for " << dev << ": "
+              << err << dendl;
     }
   }
   (*pm)["device_ids"] = devids;
@@ -6621,10 +6623,11 @@ void OSD::probe_smart(const string& only_devid, ostream& ss)
       continue;
     }
 
-    string devid = get_device_id(dev);
+    string err;
+    string devid = get_device_id(dev, &err);
     if (devid.size() == 0) {
-      dout(10) << __func__ << " no unique id for dev " << dev << ", skipping"
-              << dendl;
+      dout(10) << __func__ << " no unique id for dev " << dev << " ("
+              << err << "), skipping" << dendl;
       continue;
     }
     if (only_devid.size() && devid != only_devid) {