Revert "os/bluestore: pass strict flag to bluestore_blob_use_tracker_t::equal()"

This reverts commit 5070999169.

The existing blob may have a vector-based au because it was, say, split, while the local one
may not (because it not needed).  Use a sloppy comparison.

Fixes: http://tracker.ceph.com/issues/21293
Signed-off-by: Sage Weil <sage@redhat.com>
This commit is contained in:
Sage Weil 2017-09-07 09:28:27 -04:00
parent b0f1545d3b
commit f9a63cdf32
3 changed files with 3 additions and 45 deletions

View File

@ -488,8 +488,7 @@ void bluestore_blob_use_tracker_t::split(
}
bool bluestore_blob_use_tracker_t::equal(
const bluestore_blob_use_tracker_t& other,
bool strict) const
const bluestore_blob_use_tracker_t& other) const
{
if (!num_au && !other.num_au) {
return total_bytes == other.total_bytes && au_size == other.au_size;
@ -505,10 +504,6 @@ bool bluestore_blob_use_tracker_t::equal(
return true;
}
if (strict) {
return false;
}
uint32_t n = num_au ? num_au : other.num_au;
uint32_t referenced =
num_au ? other.get_referenced_bytes() : get_referenced_bytes();

View File

@ -421,8 +421,7 @@ struct bluestore_blob_use_tracker_t {
bluestore_blob_use_tracker_t* r);
bool equal(
const bluestore_blob_use_tracker_t& other,
bool strict = true) const;
const bluestore_blob_use_tracker_t& other) const;
void bound_encode(size_t& p) const {
denc_varint(au_size, p);

View File

@ -1441,43 +1441,7 @@ TEST(GarbageCollector, BasicTest)
em.clear();
old_extents.clear();
}
}
TEST(bluestore_blob_use_tracker_t, equal)
{
bluestore_blob_use_tracker_t t1, t2, t3;
ASSERT_TRUE(t1.equal(t2));
ASSERT_TRUE(t1.equal(t2, false));
t1.init(0x8000, 0x1000);
t2.init(0x8000, 0x1000);
ASSERT_TRUE(t1.equal(t2));
ASSERT_TRUE(t1.equal(t2, false));
t1.get(0, 0x1000);
ASSERT_TRUE(!t1.equal(t2));
ASSERT_TRUE(!t1.equal(t2, false));
t2.get(0, 0x1000);
ASSERT_TRUE(t1.equal(t2));
ASSERT_TRUE(t1.equal(t2, false));
t1.get(0x1000, 0x1000);
t2.get(0x2000, 0x1000);
ASSERT_TRUE(!t1.equal(t2));
ASSERT_TRUE(!t1.equal(t2, false));
t3.init(0x8000, 0x8000);
t3.get(0x4000, 0x2000);
ASSERT_TRUE(!t3.equal(t1));
ASSERT_TRUE(t3.equal(t1, false));
ASSERT_TRUE(!t3.equal(t2));
ASSERT_TRUE(t3.equal(t2, false));
t1.clear();
t2.clear();
t3.clear();
}
}
int main(int argc, char **argv) {
vector<const char*> args;