summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndriy Gapon <avg@FreeBSD.org>2017-02-28 23:32:55 +0200
committerPrakash Surya <prakash.surya@delphix.com>2017-07-18 12:24:25 -0700
commit267ae6c3a88d2fc39276af66caafa978b0935b82 (patch)
tree8ab68a33ce37b875c4852b4cf47559331a0d6799
parent73789e670fa73c1961b0449d97b3be10fe3c28ac (diff)
downloadillumos-joyent-267ae6c3a88d2fc39276af66caafa978b0935b82.tar.gz
7915 checks in l2arc_evict could use some cleaning up
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com> Reviewed by: Prakash Surya <prakash.surya@delphix.com> Approved by: Matthew Ahrens <mahrens@delphix.com>
-rw-r--r--usr/src/uts/common/fs/zfs/arc.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/usr/src/uts/common/fs/zfs/arc.c b/usr/src/uts/common/fs/zfs/arc.c
index 6719da33cd..2ccfe87842 100644
--- a/usr/src/uts/common/fs/zfs/arc.c
+++ b/usr/src/uts/common/fs/zfs/arc.c
@@ -6755,18 +6755,16 @@ top:
goto top;
}
- if (HDR_L2_WRITE_HEAD(hdr)) {
- /*
- * We hit a write head node. Leave it for
- * l2arc_write_done().
- */
- list_remove(buflist, hdr);
- mutex_exit(hash_lock);
- continue;
- }
+ /*
+ * A header can't be on this list if it doesn't have L2 header.
+ */
+ ASSERT(HDR_HAS_L2HDR(hdr));
- if (!all && HDR_HAS_L2HDR(hdr) &&
- (hdr->b_l2hdr.b_daddr > taddr ||
+ /* Ensure this header has finished being written. */
+ ASSERT(!HDR_L2_WRITING(hdr));
+ ASSERT(!HDR_L2_WRITE_HEAD(hdr));
+
+ if (!all && (hdr->b_l2hdr.b_daddr >= taddr ||
hdr->b_l2hdr.b_daddr < dev->l2ad_hand)) {
/*
* We've evicted to the target address,
@@ -6776,7 +6774,6 @@ top:
break;
}
- ASSERT(HDR_HAS_L2HDR(hdr));
if (!HDR_HAS_L1HDR(hdr)) {
ASSERT(!HDR_L2_READING(hdr));
/*
@@ -6799,9 +6796,6 @@ top:
arc_hdr_set_flags(hdr, ARC_FLAG_L2_EVICTED);
}
- /* Ensure this header has finished being written */
- ASSERT(!HDR_L2_WRITING(hdr));
-
arc_hdr_l2hdr_destroy(hdr);
}
mutex_exit(hash_lock);