Skip to content

Commit

Permalink
7915 checks in l2arc_evict could use some cleaning up
Browse files Browse the repository at this point in the history
Reviewed by: Dan Kimmel <dan.kimmel@delphix.com>
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Approved by: Matthew Ahrens <mahrens@delphix.com>
  • Loading branch information
avg-I authored and prakashsurya committed Jul 18, 2017
1 parent 73789e6 commit 267ae6c
Showing 1 changed file with 9 additions and 15 deletions.
24 changes: 9 additions & 15 deletions usr/src/uts/common/fs/zfs/arc.c
Expand Up @@ -6755,18 +6755,16 @@ l2arc_evict(l2arc_dev_t *dev, uint64_t distance, boolean_t all)
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,
Expand All @@ -6776,7 +6774,6 @@ l2arc_evict(l2arc_dev_t *dev, uint64_t distance, boolean_t all)
break;
}

ASSERT(HDR_HAS_L2HDR(hdr));
if (!HDR_HAS_L1HDR(hdr)) {
ASSERT(!HDR_L2_READING(hdr));
/*
Expand All @@ -6799,9 +6796,6 @@ l2arc_evict(l2arc_dev_t *dev, uint64_t distance, boolean_t all)
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);
Expand Down

0 comments on commit 267ae6c

Please sign in to comment.