From d7e1fd0a2b46f38815789ee7c9c425d0801a8d16 Mon Sep 17 00:00:00 2001 From: delphij Date: Tue, 19 May 2015 03:30:00 +0200 Subject: [PATCH] l2arc space accounting mismatch Use write_psize instead of write_asize when doing vdev_space_update. Without this change the accounting of L2ARC usage would be wrong and give 16EB free space because the number became negative and overflows. Obtained from: FreeNAS (issue #6239) MFC after: 2 weeks fixes ZFS on Linux: https://github.com/zfsonlinux/zfs/issues/3114 https://github.com/zfsonlinux/zfs/issues/3400 --- module/zfs/arc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/zfs/arc.c b/module/zfs/arc.c index 81f1335155b8..6628598d32a3 100644 --- a/module/zfs/arc.c +++ b/module/zfs/arc.c @@ -5904,7 +5904,7 @@ l2arc_write_buffers(spa_t *spa, l2arc_dev_t *dev, uint64_t target_sz, ARCSTAT_INCR(arcstat_l2_write_bytes, write_asize); ARCSTAT_INCR(arcstat_l2_size, write_sz); ARCSTAT_INCR(arcstat_l2_asize, write_asize); - vdev_space_update(dev->l2ad_vdev, write_asize, 0, 0); + vdev_space_update(dev->l2ad_vdev, write_psize, 0, 0); /* * Bump device hand to the device start if it is approaching the end.