summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Reece <[email protected]>2015-05-07 03:08:25 +1000
committerBrian Behlendorf <[email protected]>2015-05-11 15:09:29 -0700
commit7224c67fea3c427ab0d5bafb6d7fba32a7a592d9 (patch)
treecde8af2f6110969a5a71248b4b0f8259cc168471
parente48533383b6ba1737245ac4338c492865a97b0e9 (diff)
Illumos 5422 - preserve AVL invariants in dn_dbufs
Author: Alex Reece <[email protected]> Reviewed by: Matthew Ahrens <[email protected]> Reviewed by: Paul Dagnelie <[email protected]> Reviewed by: Josef 'Jeff' Sipek <[email protected]> Reviewed by: Albert Lee <[email protected]> Approved by: Dan McDonald <[email protected]> References: https://www.illumos.org/issues/5422 https://github.com/illumos/illumos-gate/commit/a846f19 Ported-by: Chris Dunlop <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #3381
-rw-r--r--module/zfs/dnode.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/module/zfs/dnode.c b/module/zfs/dnode.c
index e1ea165aa..6865cd01e 100644
--- a/module/zfs/dnode.c
+++ b/module/zfs/dnode.c
@@ -83,16 +83,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);
}