diff options
author | Konstantin Komarov <almaz.alexandrovich@paragon-software.com> | 2023-11-24 12:16:49 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-03-01 15:34:53 +0300 |
commit | c28efa873a2a67a69e5e2b73ccab081d755cd3cc (patch) | |
tree | 1dd5de77a9ebe5bc039a662cca8b791c57a3e4c3 /fs | |
parent | 07b918639367e96bff70fc77e46419b0b86a792a (diff) | |
download | linux-c28efa873a2a67a69e5e2b73ccab081d755cd3cc.tar.xz |
fs/ntfs3: Add file_modified
[ Upstream commit 4dea9cd522424d3002894c20b729c6fbfb6fc22b ]
Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ntfs3/file.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/fs/ntfs3/file.c b/fs/ntfs3/file.c index 1f7a194983c5..6e1c456c9ae7 100644 --- a/fs/ntfs3/file.c +++ b/fs/ntfs3/file.c @@ -632,11 +632,17 @@ static long ntfs_fallocate(struct file *file, int mode, loff_t vbo, loff_t len) &ni->file.run, i_size, &ni->i_valid, true, NULL); ni_unlock(ni); + if (err) + goto out; } else if (new_size > i_size) { inode->i_size = new_size; } } + err = file_modified(file); + if (err) + goto out; + out: if (map_locked) filemap_invalidate_unlock(mapping); @@ -1040,6 +1046,7 @@ static ssize_t ntfs_file_write_iter(struct kiocb *iocb, struct iov_iter *from) struct address_space *mapping = file->f_mapping; struct inode *inode = mapping->host; ssize_t ret; + int err; struct ntfs_inode *ni = ntfs_i(inode); if (is_encrypted(ni)) { @@ -1067,6 +1074,12 @@ static ssize_t ntfs_file_write_iter(struct kiocb *iocb, struct iov_iter *from) if (ret <= 0) goto out; + err = file_modified(iocb->ki_filp); + if (err) { + ret = err; + goto out; + } + if (WARN_ON(ni->ni_flags & NI_FLAG_COMPRESSED_MASK)) { /* Should never be here, see ntfs_file_open(). */ ret = -EOPNOTSUPP; |