aboutsummaryrefslogtreecommitdiff
path: root/fs/ntfs3
diff options
context:
space:
mode:
authorKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2024-06-28 18:29:46 +0300
committerKonstantin Komarov <almaz.alexandrovich@paragon-software.com>2024-09-03 16:58:39 +0300
commit2db86f7995fe6b62a4d6fee9f3cdeba3c6d27606 (patch)
tree9929dee3a21817126bddd9f1f3d4b69fe2641d97 /fs/ntfs3
parent9931122d04c6d431b2c11b5bb7b10f28584067f0 (diff)
fs/ntfs3: Do not call file_modified if collapse range failed
Fixes: 4342306f0f0d ("fs/ntfs3: Add file operations and implementation") Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Diffstat (limited to 'fs/ntfs3')
-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 ca1ddc46bd86..cddc51f9a93b 100644
--- a/fs/ntfs3/file.c
+++ b/fs/ntfs3/file.c
@@ -484,7 +484,7 @@ static int ntfs_truncate(struct inode *inode, loff_t new_size)
}
/*
- * ntfs_fallocate
+ * ntfs_fallocate - file_operations::ntfs_fallocate
*
* Preallocate space for a file. This implements ntfs's fallocate file
* operation, which gets called from sys_fallocate system call. User
@@ -619,6 +619,8 @@ static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len)
ni_lock(ni);
err = attr_collapse_range(ni, vbo, len);
ni_unlock(ni);
+ if (err)
+ goto out;
} else if (mode & FALLOC_FL_INSERT_RANGE) {
/* Check new size. */
err = inode_newsize_ok(inode, new_size);