summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2024-10-14 13:52:42 +0300
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2024-11-01 11:19:52 +0300
commitdb1d2b4cc9c654d18dd17c65a14de2da78bdf998 (patch)
tree70125e6fd94420fdd96c70f140cafcd6e6c10ef3
parenta8f659ce14f8f734894227ba2c5ca78c8451501e (diff)
downloadlinux-db1d2b4cc9c654d18dd17c65a14de2da78bdf998.tar.xz
fs/ntfs3: Add check in ntfs_extend_initialized_size
Check arguments again after lock. Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
-rw-r--r--fs/ntfs3/file.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c
index f704ceef9539..0063e2351aa9 100644
--- a/fs/ntfs3/file.c
+++ b/fs/ntfs3/file.c
@@ -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;