From 7557a8139425d1705b481d7f010683169fd5e49b Mon Sep 17 00:00:00 2001 From: Samuel Just Date: Mon, 14 Jul 2014 13:29:37 -0700 Subject: [PATCH] XfsFileStoreBackend: default to disabling extsize on xfs This appears to be responsible for the deep scrub mismatches on some rbd workloads. Fixes: 8830 Signed-off-by: Samuel Just (cherry picked from commit 01cd3cdc726a3e838bce05b355a021778b4e5db1) --- src/common/config_opts.h | 6 ++++++ src/os/XfsFileStoreBackend.cc | 19 ++++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/src/common/config_opts.h b/src/common/config_opts.h index 2c65e6ca3a9b..f8dd5f0ed968 100644 --- a/src/common/config_opts.h +++ b/src/common/config_opts.h @@ -651,6 +651,12 @@ OPTION(filestore_btrfs_clone_range, OPT_BOOL, true) OPTION(filestore_zfs_snap, OPT_BOOL, false) // zfsonlinux is still unstable OPTION(filestore_fsync_flushes_journal_data, OPT_BOOL, false) OPTION(filestore_fiemap, OPT_BOOL, false) // (try to) use fiemap + +// (try to) use extsize for alloc hint +// WARNING: extsize seems to trigger data corruption in xfs -- that is why it is +// off by default, see bug #8830 +OPTION(filestore_xfs_extsize, OPT_BOOL, false) + OPTION(filestore_journal_parallel, OPT_BOOL, false) OPTION(filestore_journal_writeahead, OPT_BOOL, false) OPTION(filestore_journal_trailing, OPT_BOOL, false) diff --git a/src/os/XfsFileStoreBackend.cc b/src/os/XfsFileStoreBackend.cc index ba51e6b36a73..e4d4aadfbf7b 100644 --- a/src/os/XfsFileStoreBackend.cc +++ b/src/os/XfsFileStoreBackend.cc @@ -106,15 +106,20 @@ int XfsFileStoreBackend::detect_features() goto out_close; } - ret = set_extsize(fd, 1U << 15); // a few pages - if (ret) { - ret = 0; - dout(0) << "detect_feature: failed to set test file extsize, assuming extsize is NOT supported" << dendl; - goto out_close; + if (g_conf->filestore_xfs_extsize) { + ret = set_extsize(fd, 1U << 15); // a few pages + if (ret) { + ret = 0; + dout(0) << "detect_feature: failed to set test file extsize, assuming extsize is NOT supported" << dendl; + goto out_close; + } else { + dout(0) << "detect_feature: extsize is supported" << dendl; + m_has_extsize = true; + } + } else { + dout(0) << "detect_feature: extsize is disabled by conf" << dendl; } - dout(0) << "detect_feature: extsize is supported" << dendl; - m_has_extsize = true; out_close: TEMP_FAILURE_RETRY(::close(fd)); -- 2.47.3