5422 preserve AVL invariants in dn_dbufs

Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <paul.dagnelie@delphix.com>
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
Reviewed by: Albert Lee <trisk@nexenta.com>
Approved by: Dan McDonald <danmcd@omniti.com>
Author: Alex Reece <alex@delphix.com>

illumos/illumos-gate@a846f19d27
This commit is contained in:
Xin LI 2014-12-18 18:59:26 +00:00
parent d45822d0ec
commit cce363922b

View File

@ -79,16 +79,14 @@ dbuf_compare(const void *x1, const void *x2)
return (1);
}
if (d1->db_state < d2->db_state) {
if (d1->db_state == DB_SEARCH) {
ASSERT3S(d2->db_state, !=, DB_SEARCH);
return (-1);
}
if (d1->db_state > d2->db_state) {
} else if (d2->db_state == DB_SEARCH) {
ASSERT3S(d1->db_state, !=, DB_SEARCH);
return (1);
}
ASSERT3S(d1->db_state, !=, DB_SEARCH);
ASSERT3S(d2->db_state, !=, DB_SEARCH);
if ((uintptr_t)d1 < (uintptr_t)d2) {
return (-1);
}