]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/ObjectStore: make device uuid probe output something friendly 8418/head
authorSage Weil <sage@redhat.com>
Tue, 5 Apr 2016 15:10:54 +0000 (11:10 -0400)
committerSage Weil <sage@redhat.com>
Tue, 5 Apr 2016 15:10:54 +0000 (11:10 -0400)
Otherwise, all you see is errors about the probes that failed (e.g., a
failure to decode a non-bluestore superblock as bluestore).

Signed-off-by: Sage Weil <sage@redhat.com>
src/ceph_osd.cc
src/os/ObjectStore.cc
src/os/ObjectStore.h

index 0c25fb639bf69bcb0210f07e022037cecef52854..7deb5a159c9520b2973948d409415e2049e905aa 100644 (file)
@@ -189,7 +189,8 @@ int main(int argc, const char **argv)
   }
   if (get_device_fsid) {
     uuid_d uuid;
-    int r = ObjectStore::probe_block_device_fsid(device_path, &uuid);
+    int r = ObjectStore::probe_block_device_fsid(g_ceph_context, device_path,
+                                                &uuid);
     if (r < 0) {
       cerr << "failed to get device fsid for " << device_path
           << ": " << cpp_strerror(r) << std::endl;
index f319e765688280a4c303dd0400146a6bdcef090f..d03ab3b99e9768fbe500fc72ad8f390b197c62e6 100644 (file)
@@ -86,6 +86,7 @@ ObjectStore *ObjectStore::create(CephContext *cct,
 }
 
 int ObjectStore::probe_block_device_fsid(
+  CephContext *cct,
   const string& path,
   uuid_d *fsid)
 {
@@ -95,14 +96,20 @@ int ObjectStore::probe_block_device_fsid(
   // first try bluestore -- it has a crc on its header and will fail
   // reliably.
   r = BlueStore::get_block_device_fsid(path, fsid);
-  if (r == 0)
+  if (r == 0) {
+    lgeneric_dout(cct, 0) << __func__ << " " << path << " is bluestore, "
+                         << *fsid << dendl;
     return r;
+  }
 #endif
 
   // okay, try FileStore (journal).
   r = FileStore::get_block_device_fsid(path, fsid);
-  if (r == 0)
+  if (r == 0) {
+    lgeneric_dout(cct, 0) << __func__ << " " << path << " is filestore, "
+                         << *fsid << dendl;
     return r;
+  }
 
   return -EINVAL;
 }
index 1effc27a645159b8550d6e8dae2c0f146c61e44b..04e3e67ff9715422e8f686988d1baf72b8106a84 100644 (file)
@@ -119,8 +119,10 @@ public:
    * @param path path to device
    * @param fsid [out] osd uuid
    */
-  static int probe_block_device_fsid(const string& path,
-                                    uuid_d *fsid);
+  static int probe_block_device_fsid(
+    CephContext *cct,
+    const string& path,
+    uuid_d *fsid);
 
   Logger *logger;