Skip to content

Commit

Permalink
fs/ntfs3: Add file_modified
Browse files Browse the repository at this point in the history
[ Upstream commit 4dea9cd ]

Signed-off-by: Konstantin Komarov <almaz.alexandrovich@paragon-software.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
aalexandrovich authored and gregkh committed Mar 1, 2024
1 parent 07b9186 commit c28efa8
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions fs/ntfs3/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c28efa8

Please sign in to comment.