diff options
author | George Amanakis <[email protected]> | 2020-09-22 19:08:05 -0400 |
---|---|---|
committer | GitHub <[email protected]> | 2020-09-22 16:08:05 -0700 |
commit | c6f5e9d92f1af425cc190fe1d0c8946170bbb570 (patch) | |
tree | 10f1cc6a7cff66e937dcc5d2fcd3c8cd3969a661 /module | |
parent | 0daa0320e99437c72aac946500f445875e476010 (diff) |
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 <[email protected]>
Reviewed-by: adam moss <[email protected]>
Signed-off-by: George Amanakis <[email protected]>
Closes #10951
Diffstat (limited to 'module')
-rw-r--r-- | module/zfs/arc.c | 6 |
1 files changed, 3 insertions, 3 deletions
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); |