ValidDataLength (exFAT)
ValidDataLength is the exFAT stream field that records the initialized prefix length in bytes.
ValidDataLength and DataLength are 8-byte fields at offsets 8 and 24 of the 32-byte Stream Extension directory entry. For a regular file, VDL lies between zero and DataLength. Reads in the remaining logical tail return zeros although its on-media bytes are undefined. This differs from allocation size and does not demonstrate erasure. Directories require both lengths to match, with a directory limit of 256 MB. [1]
Kernel source at tag v6.12 distinguishes the partially initialized block from later unwritten blocks in exfat_get_block. Readahead that crosses the valid boundary falls back to page-by-page reads, and exfat_direct_IO zeroes the returned bytes past valid_size in a partially written block. This is version-specific code evidence, not a mounted-volume experiment. [2]
Relations
- related
- exFAT, Allocation bitmap, File storage, posix_fallocate
Advantages
- A file can be extended by raising DataLength and allocating clusters without first writing zeros to the new tail. [1]
Limitations
- Bytes left from earlier use can remain on the medium past ValidDataLength, where tools that bypass the filesystem can read them. [1]
- Memory-mapped writes do not pass through exfat_write_end, so the v6.12 code lowers valid_size to the on-disk size when it writes the directory entry back. [2]
Citations
- Microsoft exFAT 1.00 specification: section 7.6.5, ValidDataLength
- Linux v6.12: exfat_get_block and exfat_direct_IO, fs/exfat/inode.c
Sources & caveats
- exfat-spec re-read 2026-10-23 for the Stream Extension field table, section 7.6.5 and the 256 MB directory limit.
- linux-inode re-read 2026-10-23 as fs/exfat/inode.c at tag v6.12 from the kernel.org plain-text copy, for exfat_get_block, exfat_readahead, exfat_direct_IO and the valid_size fixup.
- The posix-fallocate entry links here because both reserve file space for a byte range without writing data into it, and this field records how much of such an allocation holds written data.