fsnotify: generalize handle_inode_event()
authorAmir Goldstein <amir73il@gmail.com>
Wed, 2 Dec 2020 12:07:07 +0000 (14:07 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:54:18 +0000 (11:54 +0100)
commitc9be99c8619185e371dc6c0dd748fd1f5760d917
tree1b1164f91b32a11bc328e3d3d946866d7005abe5
parent1aa8e7801ec2355565bda77d025272098270e77d
fsnotify: generalize handle_inode_event()

commit 950cc0d2bef078e1f6459900ca4d4b2a2e0e3c37 upstream.

The handle_inode_event() interface was added as (quoting comment):
"a simple variant of handle_event() for groups that only have inode
marks and don't have ignore mask".

In other words, all backends except fanotify.  The inotify backend
also falls under this category, but because it required extra arguments
it was left out of the initial pass of backends conversion to the
simple interface.

This results in code duplication between the generic helper
fsnotify_handle_event() and the inotify_handle_event() callback
which also happen to be buggy code.

Generalize the handle_inode_event() arguments and add the check for
FS_EXCL_UNLINK flag to the generic helper, so inotify backend could
be converted to use the simple interface.

Link: https://lore.kernel.org/r/20201202120713.702387-2-amir73il@gmail.com
CC: stable@vger.kernel.org
Fixes: b9a1b9772509 ("fsnotify: create method handle_inode_event() in fsnotify_operations")
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/nfsd/filecache.c
fs/notify/dnotify/dnotify.c
fs/notify/fsnotify.c
include/linux/fsnotify_backend.h
kernel/audit_fsnotify.c
kernel/audit_tree.c
kernel/audit_watch.c