From: Sage Weil Date: Wed, 19 Jun 2013 04:44:15 +0000 (-0700) Subject: os/FileStore: disable fadvise on XFS X-Git-Tag: v0.65~31 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=95bd048062dbcb5d221b8f41459cd21ba30f1461;p=ceph.git 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 Reviewed-by: Samuel Just --- diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc index 4218f695bc34..bfc485113849 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" @@ -1062,6 +1065,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;