mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-09 07:23:14 +00:00
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: 4342306f0f
("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>
This commit is contained in:
parent
e589f9b707
commit
e95113ed4d
@ -494,7 +494,7 @@ static int ntfs_truncate(struct inode *inode, loff_t new_size)
|
||||
|
||||
down_write(&ni->file.run_lock);
|
||||
err = attr_set_size(ni, ATTR_DATA, NULL, 0, &ni->file.run, new_size,
|
||||
&new_valid, true, NULL);
|
||||
&new_valid, ni->mi.sbi->options->prealloc, NULL);
|
||||
up_write(&ni->file.run_lock);
|
||||
|
||||
if (new_valid < ni->i_valid)
|
||||
|
Loading…
Reference in New Issue
Block a user