Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 16f93bd

Browse files
aalexandrovichgregkh
authored andcommitted
fs/ntfs3: Do not call file_modified if collapse range failed
[ Upstream commit 2db86f7 ] Fixes: 4342306 ("fs/ntfs3: Add file operations and implementation") Signed-off-by: Konstantin Komarov <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 939b4b2 commit 16f93bd

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
@@ -418,7 +418,7 @@ static int ntfs_truncate(struct inode *inode, loff_t new_size)
418418
}
419419

420420
/*
421-
* ntfs_fallocate
421+
* ntfs_fallocate - file_operations::ntfs_fallocate
422422
*
423423
* Preallocate space for a file. This implements ntfs's fallocate file
424424
* operation, which gets called from sys_fallocate system call. User
@@ -553,6 +553,8 @@ static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len)
553553
ni_lock(ni);
554554
err = attr_collapse_range(ni, vbo, len);
555555
ni_unlock(ni);
556+
if (err)
557+
goto out;
556558
} else if (mode & FALLOC_FL_INSERT_RANGE) {
557559
/* Check new size. */
558560
err = inode_newsize_ok(inode, new_size);

0 commit comments

Comments
 (0)