summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-06-18 21:24:16 -0700
committerSage Weil <sage@inktank.com>2013-06-18 21:24:16 -0700
commitffade3c85dfffa13a16edd9630a52d99eb8a413d (patch)
tree6f4d6674d18bfc72faa8c28515c3c2c23458c157
parentc14dd154584eef97075e4a260719b6cbe686d4c7 (diff)
downloadceph-ffade3c85dfffa13a16edd9630a52d99eb8a413d.tar.gz
os/FileStore: use fdatasync(2) instead of sync_file_range(2)
The use of sync_file_range(2) on XFS screws up XFS' delicate ordering of writeback and range zeroing; see #4976 and this thread: http://oss.sgi.com/archives/xfs/2013-06/msg00066.html Instead, replace all sync_file_range(2) calls with fdatasync(2), which *does* do ordered writeback and should not leak unzeroed blocks. Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/os/FileStore.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc
index fec058edd17..966035f36bc 100644
--- a/src/os/FileStore.cc
+++ b/src/os/FileStore.cc
@@ -2957,7 +2957,7 @@ int FileStore::_write(coll_t cid, const hobject_t& oid,
!m_filestore_flusher ||
!(async_done = queue_flusher(fd, offset, len, replica))) {
if (should_flush && m_filestore_sync_flush) {
- ::sync_file_range(fd, offset, len, SYNC_FILE_RANGE_WRITE);
+ ::fdatasync(fd);
local_flush = true;
}
}
@@ -3325,7 +3325,7 @@ void FileStore::flusher_entry()
q.pop_front();
if (!stop && ep == sync_epoch) {
dout(10) << "flusher_entry flushing+closing " << fd << " ep " << ep << dendl;
- ::sync_file_range(fd, off, len, SYNC_FILE_RANGE_WRITE);
+ ::fdatasync(fd);
if (replica && m_filestore_replica_fadvise) {
int fa_r = posix_fadvise(fd, off, len, POSIX_FADV_DONTNEED);
if (fa_r) {