HomeFreeBSD

linux/zvol_os: fix zvol queue limits initialization

Description

linux/zvol_os: fix zvol queue limits initialization

zvol queue limits initialization depends on zv_volblocksize, but it is
initialized later, leading to several limits being initialized with
incorrect values, including max_discard_* limits. This also causes
blkdiscard command to consistently fail, as blk_ioctl_discard reads
bdev_max_discard_sectors() limits as 0, leading to failure. The fix is
straightforward: initialize zv->zv_volblocksize early, before setting
the queue limits. This PR should fix zvol/zvol_misc/zvol_misc_trim
failure on recent PRs, as the test case issues blkdiscard for a zvol.
Additionally, zvol_misc_trim was recently enabled in 6c7d41a,
which is why the issue wasn't identified earlier.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Tony Hutter <hutter2@llnl.gov>
Signed-off-by: Ameer Hamza <ahamza@ixsystems.com>
Closes #16454

Details

Provenance
Ameer Hamza <ahamza@ixsystems.com>Authored on Aug 15 2024, 9:29 PM
Tony Hutter <hutter2@llnl.gov>Committed on Aug 26 2024, 10:10 PM
Parents
rGd8fa32a79d8b: linux/zvol_os: tidy and document queue limit/config setup
Branches
Unknown
Tags
Unknown

Event Timeline

Tony Hutter <hutter2@llnl.gov> committed rGc60df6a80179: linux/zvol_os: fix zvol queue limits initialization (authored by Ameer Hamza <ahamza@ixsystems.com>).Aug 26 2024, 10:10 PM