diff options
author | Amir Goldstein <amir73il@gmail.com> | 2023-11-22 15:27:09 +0300 |
---|---|---|
committer | Christian Brauner <brauner@kernel.org> | 2023-11-24 12:09:51 +0300 |
commit | 269aed7014b3db9acdbc5a5e163d8a6c62e0e770 (patch) | |
tree | 1bf919e07ef620de322af867dc20b0fc671b33ac /fs/overlayfs | |
parent | e389b76a7ee1b62392ab52c22f9ba81f23145824 (diff) | |
download | linux-269aed7014b3db9acdbc5a5e163d8a6c62e0e770.tar.xz |
fs: move file_start_write() into vfs_iter_write()
All the callers of vfs_iter_write() call file_start_write() just before
calling vfs_iter_write() except for target_core_file's fd_do_rw().
Move file_start_write() from the callers into vfs_iter_write().
fd_do_rw() calls vfs_iter_write() with a non-regular file, so
file_start_write() is a no-op.
This is needed for fanotify "pre content" events.
Suggested-by: Jan Kara <jack@suse.cz>
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Link: https://lore.kernel.org/r/20231122122715.2561213-11-amir73il@gmail.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'fs/overlayfs')
-rw-r--r-- | fs/overlayfs/file.c | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/fs/overlayfs/file.c b/fs/overlayfs/file.c index 131621daeb13..690b173f34fc 100644 --- a/fs/overlayfs/file.c +++ b/fs/overlayfs/file.c @@ -436,9 +436,7 @@ static ssize_t ovl_write_iter(struct kiocb *iocb, struct iov_iter *iter) if (is_sync_kiocb(iocb)) { rwf_t rwf = iocb_to_rw_flags(ifl); - file_start_write(real.file); ret = vfs_iter_write(real.file, iter, &iocb->ki_pos, rwf); - file_end_write(real.file); /* Update size */ ovl_file_modified(file); } else { |