diff --git a/ceph/config.cc b/ceph/config.cc index dc14b8c709d..4f856c2d75f 100644 --- a/ceph/config.cc +++ b/ceph/config.cc @@ -156,6 +156,7 @@ md_config_t g_conf = { bdev_el_bw_max_ms: 300, // restart elevator at least once every 300 ms bdev_el_bidir: true, // bidirectional elevator? bdev_iov_max: 512, // max # iov's to collect into a single readv()/writev() call + bdev_debug_check_io_overlap: true, // [DEBUG] check for any pending io overlaps // --- fakeclient (mds regression testing) (ancient history) --- num_fakeclient: 100, diff --git a/ceph/config.h b/ceph/config.h index 35240ba28ed..aaffdd806ef 100644 --- a/ceph/config.h +++ b/ceph/config.h @@ -129,6 +129,7 @@ struct md_config_t { int bdev_el_bw_max_ms; bool bdev_el_bidir; int bdev_iov_max; + bool bdev_debug_check_io_overlap; // fake client int num_fakeclient; diff --git a/ceph/ebofs/BlockDevice.cc b/ceph/ebofs/BlockDevice.cc index 2d26b8cdc11..1e6834473ab 100644 --- a/ceph/ebofs/BlockDevice.cc +++ b/ceph/ebofs/BlockDevice.cc @@ -382,7 +382,7 @@ void BlockDevice::_submit_io(biovec *b) io_wakeup.SignalAll(); // [DEBUG] check for overlapping ios - if (0) { + if (g_conf.bdev_debug_check_io_overlap) { // BUG: this doesn't catch everything! eg 1~10000000 will be missed.... multimap::iterator p = io_queue.lower_bound(b->start); if ((p != io_queue.end() && diff --git a/ceph/osd/FakeStore.cc b/ceph/osd/FakeStore.cc index d6422966ebf..f7fc256e8fc 100644 --- a/ceph/osd/FakeStore.cc +++ b/ceph/osd/FakeStore.cc @@ -2,6 +2,7 @@ #include "FakeStore.h" #include "include/types.h" +#include "common/Timer.h" #include #include diff --git a/ceph/osd/OSDMap.h b/ceph/osd/OSDMap.h index dab80c6ca1d..97c5166a9fd 100644 --- a/ceph/osd/OSDMap.h +++ b/ceph/osd/OSDMap.h @@ -88,7 +88,7 @@ class OSDMap { // oid -> ps ps_t object_to_ps(object_t oid) { static crush::Hash H(777); - return H( (oid & 0xffffffffUL) ^ (oid >> 32) ) & PG_PS_MASK; + return H( oid ^ (oid >> 32) ) & PG_PS_MASK; } // (ps, nrep) -> pg @@ -112,8 +112,9 @@ class OSDMap { int pg_to_osds(pg_t pg, vector& osds) { // list of osd addr's int num_rep = pg_to_nrep(pg); + pg_t ps = pg_to_ps(pg); crush.do_rule(crush.rules[num_rep], - (pg & 0xffffffff) ^ (pg >> 32), + ps ^ (ps >> 32), osds); return osds.size(); }