Re: [PATCH] exfat: keep FITRIM within the requested range

Namjae Jeon <[email protected]>
Newsgroups dev.linux.lists.exfat,org.kernel.vger.linux-kernel
Message-ID <CAKYAXd-GfPRMB5RNfqu5q2AWFTy-qP_-Q3fWj7hv2sbFPi_L-w@mail.gmail.com>
On Thu, Aug 13, 2026 at 11:29 PM Yang Wen <[email protected]> wrote:
>
> exfat_find_free_bitmap() searches the entire allocation bitmap and may
> wrap around to its beginning. exfat_trim_fs() does not verify that the
> returned cluster is still within the requested FITRIM range.
>
> As a result, a partial FITRIM operation may discard free clusters outside
> the user-specified range and report a trimmed length larger than the
> requested length.
>
> Validate each returned cluster against the requested range and stop the
> search when it wraps around or passes the range end.
>
> Signed-off-by: Yang Wen <[email protected]>
Applied it to #dev.
Thanks!
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.