]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
fs: move permission hook out of do_iter_read()
authorAmir Goldstein <amir73il@gmail.com>
Sun, 16 Jul 2023 11:47:14 +0000 (14:47 +0300)
committerChristian Brauner <brauner@kernel.org>
Fri, 24 Nov 2023 09:37:44 +0000 (10:37 +0100)
commitb8e1425bae856b189e2365ff795e30fdd9e77049
tree3f055c84560b8c44d460595993bd5b875c88d92b
parent1c8aa833034a00617866ea4738a40491e3e23902
fs: move permission hook out of do_iter_read()

We recently moved fsnotify hook, rw_verify_area() and other checks from
do_iter_write() out to its two callers.

for consistency, do the same thing for do_iter_read() - move the
rw_verify_area() checks and fsnotify hook to the callers vfs_iter_read()
and vfs_readv().

This aligns those vfs helpers with the pattern used in vfs_read() and
vfs_iocb_iter_read() and the vfs write helpers, where all the checks are
in the vfs helpers and the do_* or call_* helpers do the work.

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-13-amir73il@gmail.com
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Christian Brauner <brauner@kernel.org>
fs/read_write.c