Skip to content

Commit

Permalink
l2arc space accounting mismatch
Browse files Browse the repository at this point in the history
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 openzfs#6239)
MFC after:	2 weeks

fixes ZFS on Linux:

openzfs#3114
openzfs#3400
  • Loading branch information
delphij authored and kernelOfTruth committed May 19, 2015
1 parent 19b6408 commit d7e1fd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/zfs/arc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d7e1fd0

Please sign in to comment.