]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
fs/ntfs3: implement llseek SEEK_DATA/SEEK_HOLE by scanning data runs
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Fri, 26 Dec 2025 12:59:47 +0000 (15:59 +0300)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Mon, 29 Dec 2025 13:33:31 +0000 (13:33 +0000)
commitc61326967728392931f8a2240cb2cf4c81b523c1
tree35fab35f7a5acf9a600f7c385c7ca8b5d0582134
parent356fa248168be90109b66f32a61b8eaedc98424a
fs/ntfs3: implement llseek SEEK_DATA/SEEK_HOLE by scanning data runs

The generic llseek implementation does not understand ntfs data runs,
sparse regions, or compression semantics, and therefore cannot correctly
locate data or holes in files.

Add a filesystem-specific llseek handler that scans attribute data runs
to find the next data or hole starting at the given offset. Handle
resident attributes, sparse runs, compressed holes, and the implicit hole
at end-of-file.

Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3/attrib.c
fs/ntfs3/file.c
fs/ntfs3/frecord.c
fs/ntfs3/ntfs.h
fs/ntfs3/ntfs_fs.h