ZFS L2ARC checksum errors after compression
Andriy Gapon
avg at FreeBSD.org
Fri Nov 4 14:46:48 UTC 2016
On 03/11/2016 21:43, Lev Serebryakov wrote:
> On 29.10.2016 16:32, Andriy Gapon wrote:
>
> Looks like L2ARC is unusable now if your have compression enabled on
> FSes. It shows 2x compression (ALLOC = 2xSIZE), and tons of checksum
> errors. I simply don't have compressible enough data on my FSes! It is
> mostly media files! Looks like this data is bogus.
>
>> I think that a recent upstream change, compressed ARC support, reintroduced an a
>> old problem that was fixed a while ago.
>
Lev,
because of the confusing variable names I made a mistake in the patch that I
offered you. Could you please try a new slight different patch?
Also, I think that there could be another problem in addition to the one that I
see. But I am quite busy at the moment, no time to investigate. Maybe on the
weekend or some time next week.
Thank you for reporting and testing.
Index: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c
===================================================================
--- sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c (revision 308225)
+++ sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c (working copy)
@@ -7028,7 +7028,22 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev,
continue;
}
- if ((write_asize + HDR_GET_LSIZE(hdr)) > target_sz) {
+ /*
+ * We rely on the L1 portion of the header below, so
+ * it's invalid for this header to have been evicted out
+ * of the ghost cache, prior to being written out. The
+ * ARC_FLAG_L2_WRITING bit ensures this won't happen.
+ */
+ ASSERT(HDR_HAS_L1HDR(hdr));
+
+ ASSERT3U(HDR_GET_PSIZE(hdr), >, 0);
+ ASSERT3P(hdr->b_l1hdr.b_pdata, !=, NULL);
+ ASSERT3U(arc_hdr_size(hdr), >, 0);
+ uint64_t size = arc_hdr_size(hdr);
+ uint64_t asize = vdev_psize_to_asize(dev->l2ad_vdev,
+ size);
+
+ if ((write_psize + asize) > target_sz) {
full = B_TRUE;
mutex_exit(hash_lock);
ARCSTAT_BUMP(arcstat_l2_write_full);
@@ -7063,21 +7078,6 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev,
list_insert_head(&dev->l2ad_buflist, hdr);
mutex_exit(&dev->l2ad_mtx);
- /*
- * We rely on the L1 portion of the header below, so
- * it's invalid for this header to have been evicted out
- * of the ghost cache, prior to being written out. The
- * ARC_FLAG_L2_WRITING bit ensures this won't happen.
- */
- ASSERT(HDR_HAS_L1HDR(hdr));
-
- ASSERT3U(HDR_GET_PSIZE(hdr), >, 0);
- ASSERT3P(hdr->b_l1hdr.b_pdata, !=, NULL);
- ASSERT3U(arc_hdr_size(hdr), >, 0);
- uint64_t size = arc_hdr_size(hdr);
- uint64_t asize = vdev_psize_to_asize(dev->l2ad_vdev,
- size);
-
(void) refcount_add_many(&dev->l2ad_alloc, size, hdr);
/*
--
Andriy Gapon
More information about the freebsd-fs
mailing list