summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-06-18 21:44:15 -0700
committerSage Weil <sage@inktank.com>2013-06-19 10:57:13 -0700
commit95bd048062dbcb5d221b8f41459cd21ba30f1461 (patch)
treeb3f205798c3311dac3648b910f506a67ed04b5d5
parentded0a5f4498afe4406636f47420f9276fdaf558a (diff)
downloadceph-95bd048062dbcb5d221b8f41459cd21ba30f1461.tar.gz
os/FileStore: disable fadvise on XFS
fadvise(DONTNEED) on XFS can break writeback ordering and zeroing; see http://oss.sgi.com/archives/xfs/2013-06/msg00066.html If we detect XFS, turn this option off. Signed-off-by: Sage Weil <sage@inktank.com> Reviewed-by: Samuel Just <sam.just@inktank.com>
-rw-r--r--src/os/FileStore.cc14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc
index 4218f695bc3..bfc48511384 100644
--- a/src/os/FileStore.cc
+++ b/src/os/FileStore.cc
@@ -90,6 +90,9 @@ using ceph::crypto::SHA1;
# ifndef BTRFS_SUPER_MAGIC
static const __SWORD_TYPE BTRFS_SUPER_MAGIC(0x9123683E);
# endif
+# ifndef XFS_SUPER_MAGIC
+static const __SWORD_TYPE XFS_SUPER_MAGIC(0x58465342);
+# endif
#endif
#define COMMIT_SNAP_ITEM "snap_%lld"
@@ -1063,6 +1066,17 @@ int FileStore::_detect_fs()
blk_size = st.f_bsize;
#if defined(__linux__)
+ if (st.f_type == XFS_SUPER_MAGIC) {
+ dout(1) << "mount detected xfs" << dendl;
+ if (m_filestore_replica_fadvise) {
+ dout(1) << " disabling 'filestore replica fadvise' due to known issues with fadvise(DONTNEED) on xfs" << dendl;
+ g_conf->set_val("filestore_replica_fadvise", "false");
+ assert(m_filestore_replica_fadvise == false);
+ }
+ }
+#endif
+
+#if defined(__linux__)
if (st.f_type == BTRFS_SUPER_MAGIC) {
dout(0) << "mount detected btrfs" << dendl;
wbthrottle.set_fs(WBThrottle::BTRFS);