fs/ntfs3: Keep preallocated only if option prealloc enabled
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Fri, 22 Oct 2021 14:37:52 +0000 (17:37 +0300)
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>
Tue, 23 Nov 2021 15:55:49 +0000 (18:55 +0300)
commite95113ed4d428219e3395044e29f5713fc446720
tree9af8993f8ab72f094db2c5e8b52dfb7df9af825c
parente589f9b7078e1c0191613cd736f598e81d2390de
fs/ntfs3: Keep preallocated only if option prealloc enabled

If size of file was reduced, we still kept allocated blocks.
This commit makes ntfs3 work as other fs like btrfs.
Link: https://bugzilla.kernel.org/show_bug.cgi?id=214719
Fixes: 4342306f0f0d ("fs/ntfs3: Add file operations and implementation")

Reported-by: Ganapathi Kamath <hgkamath@hotmail.com>
Tested-by: Ganapathi Kamath <hgkamath@hotmail.com>
Reviewed-by: Kari Argillander <kari.argillander@gmail.com>
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
fs/ntfs3/file.c