Re: [PATCH] exfat: preserve the 64-bit FITRIM minimum length

From: Namjae Jeon

Date: Sat Oct 31 2026 - 22:20:55 EST


On Sun, Nov 1, 2026 at 7:28 AM Hungyu Lin <dennylin0707@xxxxxxxxx> wrote:
>
> The FITRIM minimum length is a 64-bit value, but exfat_ioctl_fitrim()
> uses max_t(unsigned int, ...) to compare it with the discard granularity.
> This truncates the requested minimum on both 32-bit and 64-bit kernels.
>
> For example, fstrim --minimum 4GiB can trim smaller free extents because
> the minimum wraps to zero before being raised to the device granularity.
>
> Use a u64 comparison to preserve the userspace value. exfat_trim_fs()
> already stores the minimum cluster count in a u64.
>
> Fixes: 654762df2ec7 ("exfat: add support ioctl and FITRIM function")
> Cc: stable@xxxxxxxxxxxxxxx
> Signed-off-by: Hungyu Lin <dennylin0707@xxxxxxxxx>
Applied it to #dev.
Thanks!