From fab24c80763bbe329ab722dded375a840f46bf87 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 28 Jun 2011 10:54:53 -0700 Subject: [PATCH] filestore: allow FIEMAP to be disabled via conf The ext4 fiemap ioctl is buggy in some older kernels. Allow the admin to disable it. Fixes: #1222 Signed-off-by: Sage Weil --- src/common/config.cc | 1 + src/common/config.h | 1 + src/os/FileStore.cc | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/src/common/config.cc b/src/common/config.cc index 8d2715a2f44fe..03a08eeaa05b8 100644 --- a/src/common/config.cc +++ b/src/common/config.cc @@ -384,6 +384,7 @@ struct config_option config_optionsp[] = { OPTION(filestore_btrfs_snap, OPT_BOOL, true), OPTION(filestore_btrfs_clone_range, OPT_BOOL, true), OPTION(filestore_fsync_flushes_journal_data, OPT_BOOL, false), + OPTION(filestore_fiemap, OPT_BOOL, true), // (try to) use fiemap OPTION(filestore_flusher, OPT_BOOL, true), OPTION(filestore_flusher_max_fds, OPT_INT, 512), OPTION(filestore_sync_flush, OPT_BOOL, false), diff --git a/src/common/config.h b/src/common/config.h index ac3c1609057e5..af14ffa324b48 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -467,6 +467,7 @@ public: bool filestore_btrfs_snap; bool filestore_btrfs_clone_range; bool filestore_fsync_flushes_journal_data; + bool filestore_fiemap; bool filestore_flusher; int filestore_flusher_max_fds; bool filestore_sync_flush; diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 110743429c30e..a0f477838a822 100644 --- a/src/os/FileStore.cc +++ b/src/os/FileStore.cc @@ -1301,6 +1301,10 @@ int FileStore::_detect_fs() dout(0) << "mount FIEMAP ioctl is supported" << dendl; ioctl_fiemap = true; } + if (!g_conf->filestore_fiemap) { + dout(0) << "mount FIEMAP ioctl is disabled via 'filestore fiemap' config option" << dendl; + ioctl_fiemap = false; + } struct statfs st; r = ::fstatfs(fd, &st); -- 2.39.5