mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 02:27:36 +03:00
Persistent L2ARC minor fixes
Minor fixes on persistent L2ARC improving code readability and fixing a typo in zdb.c when byte-swapping a log block. It also improves the pesist_l2arc_007_pos.ksh test by giving it more time to retrieve log blocks on the cache device. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Adam D. Moss <c@yotes.com> Signed-off-by: George Amanakis <gamanakis@gmail.com> Closes #10210
This commit is contained in:
+6
-8
@@ -9578,6 +9578,7 @@ l2arc_log_blk_read(l2arc_dev_t *dev,
|
||||
int err = 0;
|
||||
zio_cksum_t cksum;
|
||||
abd_t *abd = NULL;
|
||||
uint64_t psize;
|
||||
|
||||
ASSERT(this_lbp != NULL && next_lbp != NULL);
|
||||
ASSERT(this_lb != NULL && next_lb != NULL);
|
||||
@@ -9616,8 +9617,8 @@ l2arc_log_blk_read(l2arc_dev_t *dev,
|
||||
}
|
||||
|
||||
/* Make sure the buffer checks out */
|
||||
fletcher_4_native(this_lb,
|
||||
L2BLK_GET_PSIZE((this_lbp)->lbp_prop), NULL, &cksum);
|
||||
psize = L2BLK_GET_PSIZE((this_lbp)->lbp_prop);
|
||||
fletcher_4_native(this_lb, psize, NULL, &cksum);
|
||||
if (!ZIO_CHECKSUM_EQUAL(cksum, this_lbp->lbp_cksum)) {
|
||||
ARCSTAT_BUMP(arcstat_l2_rebuild_abort_cksum_lb_errors);
|
||||
zfs_dbgmsg("L2ARC log block cksum failed, offset: %llu, "
|
||||
@@ -9633,14 +9634,11 @@ l2arc_log_blk_read(l2arc_dev_t *dev,
|
||||
case ZIO_COMPRESS_OFF:
|
||||
break;
|
||||
case ZIO_COMPRESS_LZ4:
|
||||
abd = abd_alloc_for_io(L2BLK_GET_PSIZE(
|
||||
(this_lbp)->lbp_prop), B_TRUE);
|
||||
abd_copy_from_buf_off(abd, this_lb, 0,
|
||||
L2BLK_GET_PSIZE((this_lbp)->lbp_prop));
|
||||
abd = abd_alloc_for_io(psize, B_TRUE);
|
||||
abd_copy_from_buf_off(abd, this_lb, 0, psize);
|
||||
if ((err = zio_decompress_data(
|
||||
L2BLK_GET_COMPRESS((this_lbp)->lbp_prop),
|
||||
abd, this_lb, L2BLK_GET_PSIZE((this_lbp)->lbp_prop),
|
||||
sizeof (*this_lb))) != 0) {
|
||||
abd, this_lb, psize, sizeof (*this_lb))) != 0) {
|
||||
err = SET_ERROR(EINVAL);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user