]> git.proxmox.com Git - mirror_zfs.git/commit - cmd/zfs/zfs_main.c
OpenZFS 9318 - vol_volsize_to_reservation does not account for raidz skip blocks
authorMike Gerdts <mike.gerdts@joyent.com>
Sun, 30 Jun 2019 23:38:07 +0000 (23:38 +0000)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Fri, 5 Jul 2019 22:35:15 +0000 (15:35 -0700)
commit341166c8435f54936cdea366d096b1f5556292c1
tree1b353d7f68cefe36a1c08655120a3eb78f86a849
parent6dbca94f0c0276108748487bbfbaa7140ebb000b
OpenZFS 9318 - vol_volsize_to_reservation does not account for raidz skip blocks

When a volume is created in a pool with raidz vdevs and
volblocksize != 128k, the volume can reference more space than is
reserved with the automatically calculated refreservation.  There
are two deficiencies in vol_volsize_to_reservation that contribute
to this:

  1) Skip blocks may be added to keep each allocation a multiple
     of parity + 1. This is the dominating factor when volblocksize
     is close to 2^ashift.

  2) raidz deflation for 128 KB blocks is different for most other
     block sizes.

See "The theory of raidz space accounting" comment in
libzfs_dataset.c for a full explanation.

Authored by: Mike Gerdts <mike.gerdts@joyent.com>
Reviewed by: Richard Elling <Richard.Elling@RichardElling.com>
Reviewed by: Sanjay Nadkarni <sanjay.nadkarni@nexenta.com>
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Matt Ahrens <matt@delphix.com>
Reviewed by: Kody Kantor <kody.kantor@joyent.com>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Approved by: Dan McDonald <danmcd@joyent.com>
Ported-by: Mike Gerdts <mike.gerdts@joyent.com>
Porting Notes:
* ZTS: wait for zvols to exist before writing
* ZTS: use log_must_busy with {zpool|zfs} destroy

OpenZFS-issue: https://www.illumos.org/issues/9318
OpenZFS-commit: https://github.com/illumos/illumos-gate/commit/b73ccab0
Closes #8973
cmd/zfs/zfs_main.c
include/libzfs.h
lib/libzfs/libzfs_dataset.c
tests/runfiles/linux.run
tests/zfs-tests/tests/functional/refreserv/Makefile.am
tests/zfs-tests/tests/functional/refreserv/refreserv_multi_raidz.ksh [new file with mode: 0755]
tests/zfs-tests/tests/functional/refreserv/refreserv_raidz.ksh [new file with mode: 0755]