fs/ntfs3: Add check in ntfs_extend_initialized_size

Check arguments again after lock.

Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
This commit is contained in:
Konstantin Komarov 2024-10-14 13:52:42 +03:00
parent a8f659ce14
commit db1d2b4cc9
No known key found for this signature in database
GPG Key ID: A9B0331F832407B6

View File

@ -182,13 +182,15 @@ static int ntfs_extend_initialized_size(struct file *file,
loff_t pos = valid;
int err;
if (valid >= new_valid)
return 0;
if (is_resident(ni)) {
ni->i_valid = new_valid;
return 0;
}
WARN_ON(is_compressed(ni));
WARN_ON(valid >= new_valid);
for (;;) {
u32 zerofrom, len;