Skip to content

Commit db1d2b4

Browse files
fs/ntfs3: Add check in ntfs_extend_initialized_size
Check arguments again after lock. Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
1 parent a8f659c commit db1d2b4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

fs/ntfs3/file.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,13 +182,15 @@ static int ntfs_extend_initialized_size(struct file *file,
182182
loff_t pos = valid;
183183
int err;
184184

185+
if (valid >= new_valid)
186+
return 0;
187+
185188
if (is_resident(ni)) {
186189
ni->i_valid = new_valid;
187190
return 0;
188191
}
189192

190193
WARN_ON(is_compressed(ni));
191-
WARN_ON(valid >= new_valid);
192194

193195
for (;;) {
194196
u32 zerofrom, len;

0 commit comments

Comments
 (0)