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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:22:28 +0000 (10:22 +0200)
commitdc05aa14d311aa8fd0d265d042b86dd277a411f7
treea7581d572314d4c052292b61845246b870e0602a
parent3eb42b847e43aba3066a0375c40cc7c5587fc375
fs/ntfs3: Keep preallocated only if option prealloc enabled

commit e95113ed4d428219e3395044e29f5713fc446720 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ntfs3/file.c