Skip to content

Commit 7224c67

Browse files
Alex Reecebehlendorf
authored andcommitted
Illumos 5422 - preserve AVL invariants in dn_dbufs
Author: Alex Reece <alex@delphix.com> 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> References: https://www.illumos.org/issues/5422 illumos/illumos-gate@a846f19 Ported-by: Chris Dunlop <chris@onthe.net.au> Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov> Closes #3381
1 parent e485333 commit 7224c67

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

module/zfs/dnode.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,14 @@ dbuf_compare(const void *x1, const void *x2)
8383
return (1);
8484
}
8585

86-
if (d1->db_state < d2->db_state) {
86+
if (d1->db_state == DB_SEARCH) {
87+
ASSERT3S(d2->db_state, !=, DB_SEARCH);
8788
return (-1);
88-
}
89-
if (d1->db_state > d2->db_state) {
89+
} else if (d2->db_state == DB_SEARCH) {
90+
ASSERT3S(d1->db_state, !=, DB_SEARCH);
9091
return (1);
9192
}
9293

93-
ASSERT3S(d1->db_state, !=, DB_SEARCH);
94-
ASSERT3S(d2->db_state, !=, DB_SEARCH);
95-
9694
if ((uintptr_t)d1 < (uintptr_t)d2) {
9795
return (-1);
9896
}

0 commit comments

Comments
 (0)