HomeFreeBSD

linux/zvol_os.c: Fix max_discard_sectors limit for 6.8+ kernel

Description

linux/zvol_os.c: Fix max_discard_sectors limit for 6.8+ kernel

In kernels 6.8 and later, the zvol block device is allocated with
qlimits passed during initialization. However, the zvol driver does not
set max_hw_discard_sectors, which is necessary to properly
initialize max_discard_sectors. This causes the zvol_misc_trim test
to fail on 6.8+ kernels when invoking the blkdiscard command. Setting
max_hw_discard_sectors in the HAVE_BLK_ALLOC_DISK_2ARG case resolve
the issue.

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

Details

Provenance
Ameer Hamza <ahamza@ixsystems.com>Authored on Aug 19 2024, 8:30 PM
Tony Hutter <hutter2@llnl.gov>Committed on Aug 22 2024, 10:43 PM
Parents
rG859f906a4b4d: Fix null ptr deref when renaming a zvol with snaps and snapdev=visible (#16316)
Branches
Unknown
Tags
Unknown

Event Timeline

Tony Hutter <hutter2@llnl.gov> committed rG0f9457d1dd7a: linux/zvol_os.c: Fix max_discard_sectors limit for 6.8+ kernel (authored by Ameer Hamza <ahamza@ixsystems.com>).Aug 22 2024, 10:43 PM