From c6f5e9d92f1af425cc190fe1d0c8946170bbb570 Mon Sep 17 00:00:00 2001 From: George Amanakis Date: Tue, 22 Sep 2020 19:08:05 -0400 Subject: Restore clearing of L2CACHE flag in arc_read_done() Commit 45152dc removed clearing of L2CACHE flag in arc_read_done() and moved related code in l2arc_write_eligible(). After careful code inspection arc_read_done() is not bypassed in the case of prefetches. Thus restore the old behavior. Reviewed-by: Brian Behlendorf Reviewed-by: adam moss Signed-off-by: George Amanakis Closes #10951 --- module/zfs/arc.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'module/zfs/arc.c') diff --git a/module/zfs/arc.c b/module/zfs/arc.c index 53ebf629e..1cce068e6 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -5724,6 +5724,8 @@ arc_read_done(zio_t *zio) } arc_hdr_clear_flags(hdr, ARC_FLAG_L2_EVICTED); + if (l2arc_noprefetch && HDR_PREFETCH(hdr)) + arc_hdr_clear_flags(hdr, ARC_FLAG_L2CACHE); callback_list = hdr->b_l1hdr.b_acb; ASSERT3P(callback_list, !=, NULL); @@ -7990,11 +7992,9 @@ l2arc_write_eligible(uint64_t spa_guid, arc_buf_hdr_t *hdr) * 2. is already cached on the L2ARC. * 3. has an I/O in progress (it may be an incomplete read). * 4. is flagged not eligible (zfs property). - * 5. is a prefetch and l2arc_noprefetch is set. */ if (hdr->b_spa != spa_guid || HDR_HAS_L2HDR(hdr) || - HDR_IO_IN_PROGRESS(hdr) || !HDR_L2CACHE(hdr) || - (l2arc_noprefetch && HDR_PREFETCH(hdr))) + HDR_IO_IN_PROGRESS(hdr) || !HDR_L2CACHE(hdr)) return (B_FALSE); return (B_TRUE); -- cgit v1.2.3