]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
FileStore: Conditional collection of drive metadata 6956/head
authorSomnath Roy <somnath.roy@sandisk.com>
Fri, 20 Nov 2015 03:06:17 +0000 (22:06 -0500)
committerSomnath Roy <somnath.roy@sandisk.com>
Wed, 16 Dec 2015 22:02:17 +0000 (17:02 -0500)
get_device_by_uuid->blkid_find_dev_with_tag() call from
FileStore::collect_metadata() is hanging for ~3min before returning
EINVAL in case the drive is visible but reserved for some other host.
This is probably is bug within blkid* calls. fdisk/lsblk call is coming
out immediately saying device is inaccessible. This call is now
protected by config option filestore_collect_device_partition_information

Signed-off-by: Somnath Roy <somnath.roy@sandisk.com>
src/common/config_opts.h
src/os/FileStore.cc

index 39f64998c8b92e8e18cbcbd340e541be1ecb14b7..f7d6fd0d2873eb622d8ab0347649d14b6642eacc 100644 (file)
@@ -903,6 +903,8 @@ OPTION(filestore_fsync_flushes_journal_data, OPT_BOOL, false)
 OPTION(filestore_fiemap, OPT_BOOL, false)     // (try to) use fiemap
 OPTION(filestore_seek_data_hole, OPT_BOOL, false)     // (try to) use seek_data/hole
 OPTION(filestore_fadvise, OPT_BOOL, true)
+//collect device partition information for management application to use
+OPTION(filestore_collect_device_partition_information, OPT_BOOL, true)
 
 // (try to) use extsize for alloc hint NOTE: extsize seems to trigger
 // data corruption in xfs prior to kernel 3.5.  filestore will
index d58fa5ffe4cf50c65f4cb831d5595d9c4aeaceee..a0f7c8e4c470e3d4ac8cb2519f689f9722a11da2 100644 (file)
@@ -674,8 +674,12 @@ void FileStore::collect_metadata(map<string,string> *pm)
   ss << "0x" << std::hex << m_fs_type << std::dec;
   (*pm)["filestore_f_type"] = ss.str();
 
-  rc = get_device_by_uuid(get_fsid(), "PARTUUID", partition_path,
-        dev_node);
+  if (g_conf->filestore_collect_device_partition_information) {
+    rc = get_device_by_uuid(get_fsid(), "PARTUUID", partition_path,
+          dev_node);
+  } else {
+    rc = -EINVAL;
+  }
 
   switch (rc) {
     case -EOPNOTSUPP: