]> git.baikalelectronics.ru Git - kernel.git/commit
fs/ntfs3: Fix fiemap + fix shrink file size (to remove preallocated space)
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Mon, 25 Oct 2021 15:31:28 +0000 (18:31 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:22:28 +0000 (10:22 +0200)
commit42e5c625175de438948deafbcaa25d715c045c43
treebf1409e382b2060338974affecc700aef9e05df5
parent86af3ef6ced8838e9a5bd829ca94196fb3998256
fs/ntfs3: Fix fiemap + fix shrink file size (to remove preallocated space)

commit 268b99eb8de2fb245b9f3b603ff39a2c998d867a upstream.

Two problems:
1. ntfs3_setattr can't truncate preallocated space;
2. if allocated fragment "cross" valid size, then fragment splits into two parts:
- normal part;
- unwritten part (here we must return FIEMAP_EXTENT_LAST).
Before this commit we returned FIEMAP_EXTENT_LAST for whole fragment.
Fixes xfstest generic/092
Fixes: bce6528b5114 ("fs/ntfs3: Add file operations and implementation")
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ntfs3/file.c
fs/ntfs3/frecord.c