zfsonfreebsd / ZoF

ZFS on FreeBSD - the official out of tree OpenZFS implementation for FreeBSD
https://freebsd.org
Other
100 stars 8 forks source link

zv_volblocksize never gets set on FreeBSD #124

Closed ghost closed 5 years ago

ghost commented 5 years ago

In module/os/freebsd/zfs/zvol.c, the zv_volblocksize member never gets set in a zvol's state. Notably, this causes indirect writes to enter an infinite loop allocating memory until all available RAM is wired and the starved system becomes unresponsive. Surely other code paths suffer as well.

An easy way to hit the indirect write code path is to create a zvol with logbias=throughput and try to write something to it.

truncate -s 1g disk0
zpool create testpool `pwd`/disk0
zfs create -V 256m -o logbias=throughput testpool/testvol
dd if=/dev/random of=/dev/zvol/testpool/testvol count=1
ghost commented 5 years ago

Fixed in zvol refactoring.