summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-06-18 21:31:23 -0700
committerSage Weil <sage@inktank.com>2013-06-18 21:31:23 -0700
commit3f32ded41818ad3c607339d723c095f166e36f7e (patch)
tree75282d4daae0f90f354f50863e6bea9b45fc30b4
parentffade3c85dfffa13a16edd9630a52d99eb8a413d (diff)
downloadceph-3f32ded41818ad3c607339d723c095f166e36f7e.tar.gz
os/FileStore: drop posix_fadvise(...DONTNEED)
On XFS this call is problematic because it directly calls the filemap writeback without vectoring through xfs. This can break the delicate ordering of writeback and range zeroing; see #4976 and this thread http://oss.sgi.com/archives/xfs/2013-06/msg00066.html Drop this behavior for now to avoid subtle data corruption. Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/os/FileStore.cc28
1 files changed, 0 insertions, 28 deletions
diff --git a/src/os/FileStore.cc b/src/os/FileStore.cc
index 966035f36bc..a91c252e531 100644
--- a/src/os/FileStore.cc
+++ b/src/os/FileStore.cc
@@ -2950,7 +2950,6 @@ int FileStore::_write(coll_t cid, const hobject_t& oid,
// flush?
{
bool should_flush = (ssize_t)len >= m_filestore_flush_min;
- bool local_flush = false;
#ifdef HAVE_SYNC_FILE_RANGE
bool async_done = false;
if (!should_flush ||
@@ -2958,7 +2957,6 @@ int FileStore::_write(coll_t cid, const hobject_t& oid,
!(async_done = queue_flusher(fd, offset, len, replica))) {
if (should_flush && m_filestore_sync_flush) {
::fdatasync(fd);
- local_flush = true;
}
}
//Both lfn_close() and possible posix_fadvise() done by flusher
@@ -2967,17 +2965,8 @@ int FileStore::_write(coll_t cid, const hobject_t& oid,
// no sync_file_range; (maybe) flush inline and close.
if (should_flush && m_filestore_sync_flush) {
::fdatasync(fd);
- local_flush = true;
}
#endif
- if (local_flush && replica && m_filestore_replica_fadvise) {
- int fa_r = posix_fadvise(fd, offset, len, POSIX_FADV_DONTNEED);
- if (fa_r) {
- dout(0) << "posic_fadvise failed: " << cpp_strerror(fa_r) << dendl;
- } else {
- dout(10) << "posix_fadvise performed after local flush" << dendl;
- }
- }
}
if (fd >= 0) lfn_close(fd);
@@ -3279,9 +3268,6 @@ bool FileStore::queue_flusher(int fd, uint64_t off, uint64_t len, bool replica)
if (flusher_queue_len < m_filestore_flusher_max_fds) {
flusher_queue.push_back(sync_epoch);
flusher_queue.push_back(fd);
- flusher_queue.push_back(off);
- flusher_queue.push_back(len);
- flusher_queue.push_back(replica);
flusher_queue_len++;
flusher_cond.Signal();
dout(10) << "queue_flusher ep " << sync_epoch << " fd " << fd << " " << off << "~" << len
@@ -3317,23 +3303,9 @@ void FileStore::flusher_entry()
q.pop_front();
int fd = q.front();
q.pop_front();
- uint64_t off = q.front();
- q.pop_front();
- uint64_t len = q.front();
- q.pop_front();
- bool replica = q.front();
- q.pop_front();
if (!stop && ep == sync_epoch) {
dout(10) << "flusher_entry flushing+closing " << fd << " ep " << ep << dendl;
::fdatasync(fd);
- if (replica && m_filestore_replica_fadvise) {
- int fa_r = posix_fadvise(fd, off, len, POSIX_FADV_DONTNEED);
- if (fa_r) {
- dout(0) << "posic_fadvise failed: " << cpp_strerror(fa_r) << dendl;
- } else {
- dout(10) << "posix_fadvise performed after local flush" << dendl;
- }
- }
} else
dout(10) << "flusher_entry JUST closing " << fd << " (stop=" << stop << ", ep=" << ep
<< ", sync_epoch=" << sync_epoch << ")" << dendl;