linux-stable/fs/overlayfs
Amir Goldstein 6ae654392b fs: move kiocb_start_write() into vfs_iocb_iter_write()
In vfs code, sb_start_write() is usually called after the permission hook
in rw_verify_area().  vfs_iocb_iter_write() is an exception to this rule,
where kiocb_start_write() is called by its callers.

Move kiocb_start_write() from the callers into vfs_iocb_iter_write()
after the rw_verify_area() checks, to make them "start-write-safe".

The semantics of vfs_iocb_iter_write() is changed, so that the caller is
responsible for calling kiocb_end_write() on completion only if async
iocb was queued.  The completion handlers of both callers were adapted
to this semantic change.

This is needed for fanotify "pre content" events.

Suggested-by: Jan Kara <jack@suse.cz>
Suggested-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Link: https://lore.kernel.org/r/20231122122715.2561213-14-amir73il@gmail.com
Reviewed-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>
2023-11-24 10:37:44 +01:00
..
Kconfig ovl: Kconfig: introduce CONFIG_OVERLAY_FS_DEBUG 2023-08-12 19:02:53 +03:00
Makefile ovl: Move xattr support to new xattrs.c file 2023-10-31 00:12:59 +02:00
copy_up.c ovl: add permission hooks outside of do_splice_direct() 2023-11-24 09:22:27 +01:00
dir.c ovl: Add an alternative type of whiteout 2023-10-31 00:12:59 +02:00
export.c ovl: reorder ovl_want_write() after ovl_inode_lock() 2023-10-31 00:12:57 +02:00
file.c fs: move kiocb_start_write() into vfs_iocb_iter_write() 2023-11-24 10:37:44 +01:00
inode.c ovl: Move xattr support to new xattrs.c file 2023-10-31 00:12:59 +02:00
namei.c ovl: Add an alternative type of whiteout 2023-10-31 00:12:59 +02:00
overlayfs.h ovl: Add an alternative type of whiteout 2023-10-31 00:12:59 +02:00
ovl_entry.h ovl: make use of ->layers safe in rcu pathwalk 2023-10-02 17:45:02 +03:00
params.c ovl: add support for appending lowerdirs one by one 2023-10-31 00:13:02 +02:00
params.h ovl: store and show the user provided lowerdir mount option 2023-10-31 00:13:02 +02:00
readdir.c ovl: Add an alternative type of whiteout 2023-10-31 00:12:59 +02:00
super.c overlayfs update for 6.7-rc1 2023-11-07 11:46:31 -08:00
util.c vfs-6.7.fsid 2023-11-07 12:11:26 -08:00
xattrs.c ovl: Support escaped overlay.* xattrs 2023-10-31 00:12:59 +02:00