diff --git a/src/os/filestore/FileJournal.h b/src/os/filestore/FileJournal.h index ff65cdb33b7..532fe2eae84 100644 --- a/src/os/filestore/FileJournal.h +++ b/src/os/filestore/FileJournal.h @@ -31,6 +31,9 @@ using std::deque; # include #endif +// re-include our assert to clobber the system one; fix dout: +#include "include/assert.h" + /** * Implements journaling on top of block device or file. * diff --git a/src/os/filestore/FileStore.cc b/src/os/filestore/FileStore.cc index d262725f65b..1d527e0c120 100644 --- a/src/os/filestore/FileStore.cc +++ b/src/os/filestore/FileStore.cc @@ -574,7 +574,7 @@ FileStore::FileStore(CephContext* cct, const std::string &base, m_filestore_max_inline_xattrs(0), m_filestore_max_xattr_value_size(0) { - m_filestore_kill_at.set(cct->_conf->filestore_kill_at); + m_filestore_kill_at = cct->_conf->filestore_kill_at; for (int i = 0; i < m_ondisk_finisher_num; ++i) { ostringstream oss; oss << "filestore-ondisk-" << i; @@ -2094,7 +2094,7 @@ int FileStore::queue_transactions(Sequencer *posr, vector& tls, osr = static_cast(posr->p.get()); dout(5) << "queue_transactions existing " << osr << " " << *osr << dendl; } else { - osr = new OpSequencer(cct, next_osr_id.inc()); + osr = new OpSequencer(cct, ++next_osr_id); osr->set_cct(cct); osr->parent = posr; posr->p = osr; @@ -5399,8 +5399,8 @@ int FileStore::_collection_move_rename(const coll_t& oldcid, const ghobject_t& o void FileStore::_inject_failure() { - if (m_filestore_kill_at.read()) { - int final = m_filestore_kill_at.dec(); + if (m_filestore_kill_at) { + int final = --m_filestore_kill_at; dout(5) << "_inject_failure " << (final+1) << " -> " << final << dendl; if (final == 0) { derr << "_inject_failure KILLING" << dendl; @@ -5738,7 +5738,7 @@ void FileStore::handle_conf_change(const struct md_config_t *conf, Mutex::Locker l(lock); m_filestore_min_sync_interval = conf->filestore_min_sync_interval; m_filestore_max_sync_interval = conf->filestore_max_sync_interval; - m_filestore_kill_at.set(conf->filestore_kill_at); + m_filestore_kill_at = conf->filestore_kill_at; m_filestore_fail_eio = conf->filestore_fail_eio; m_filestore_fadvise = conf->filestore_fadvise; m_filestore_sloppy_crc = conf->filestore_sloppy_crc; diff --git a/src/os/filestore/FileStore.h b/src/os/filestore/FileStore.h index f80b807bd78..63523ec11fe 100644 --- a/src/os/filestore/FileStore.h +++ b/src/os/filestore/FileStore.h @@ -20,10 +20,13 @@ #include #include -#include +#include #include + using namespace std; +#include + #include "include/unordered_map.h" #include "include/assert.h" @@ -364,7 +367,7 @@ private: FDCache fdcache; WBThrottle wbthrottle; - atomic_t next_osr_id; + std::atomic next_osr_id = { 0 }; bool m_disable_wbthrottle; deque op_queue; BackoffThrottle throttle_ops, throttle_bytes; @@ -766,7 +769,7 @@ private: bool m_filestore_do_dump; std::ofstream m_filestore_dump; JSONFormatter m_filestore_dump_fmt; - atomic_t m_filestore_kill_at; + std::atomic m_filestore_kill_at = { 0 }; bool m_filestore_sloppy_crc; int m_filestore_sloppy_crc_block_size; uint64_t m_filestore_max_alloc_hint_size;