From 3296905f955f34b15a1885e240d4e945b9d0324b Mon Sep 17 00:00:00 2001 From: Somnath Roy Date: Thu, 19 Nov 2015 22:06:17 -0500 Subject: [PATCH] FileStore: Conditional collection of drive metadata 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 --- src/common/config_opts.h | 2 ++ src/os/FileStore.cc | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 39f64998c8b92..f7d6fd0d2873e 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -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 diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index d58fa5ffe4cf5..a0f7c8e4c470e 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -674,8 +674,12 @@ void FileStore::collect_metadata(map *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: -- 2.39.5