Re: [PATCH v3 2/2] exfat: EXFAT_IOC_GET_VALID_DATA ioctl
From: Matthew Wilcox
Date: Wed Mar 11 2026 - 23:23:30 EST
On Thu, Mar 12, 2026 at 07:26:13AM +0900, David Timber wrote:
> When a file in exfat fs gets truncated up or fallocate()'d up, only
> additional clusters are allocated and isize updated whilst VDL(valid
> data length) remains unchanged. If an application writes to the file
> past the VDL, significant IO delay can occur as the skipped range
> [VDL, offset) has to be zeroed out before returning to userspace. Some
> users may find this caveat unacceptible.
>
> Some niche applications(especially embedded systems) may want to query
> the discrepancy between the VDL and isize before doing lseek() and
> write() to estimate the delay from implicit zeroring.
>
> The commit introduces a new ioctl EXFAT_IOC_GET_VALID_DATA, which
> correspond to `fsutil file queryvaliddata ...` available on Windows.
> With the new ioctl, applications could assess the delay that may incur
> and make decisions accordingly before seeking past the VDL to write.
We already have two interfaces for this on Linux. One is SEEK_HOLE /
SEEK_DATA and the other is fiemap (Documentation/filesystems/fiemap.rst)
Why are both of these interfaces unsuitable?