fsnotify: make allow_dups a property of the group
[ Upstream commit f3010343d9 ]
Instead of passing the allow_dups argument to fsnotify_add_mark()
as an argument, define the group flag FSNOTIFY_GROUP_DUPS to express
the allow_dups behavior and set this behavior at group creation time
for all calls of fsnotify_add_mark().
Rename the allow_dups argument to generic add_flags argument for future
use.
Link: https://lore.kernel.org/r/20220422120327.3459282-6-amir73il@gmail.com
Suggested-by: Jan Kara <jack@suse.cz>
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ac51c087ab
commit
cdf89b045b
@@ -100,7 +100,7 @@ struct audit_fsnotify_mark *audit_alloc_mark(struct audit_krule *krule, char *pa
|
||||
audit_update_mark(audit_mark, dentry->d_inode);
|
||||
audit_mark->rule = krule;
|
||||
|
||||
ret = fsnotify_add_inode_mark(&audit_mark->mark, inode, true);
|
||||
ret = fsnotify_add_inode_mark(&audit_mark->mark, inode, 0);
|
||||
if (ret < 0) {
|
||||
audit_mark->path = NULL;
|
||||
fsnotify_put_mark(&audit_mark->mark);
|
||||
@@ -183,7 +183,7 @@ static const struct fsnotify_ops audit_mark_fsnotify_ops = {
|
||||
static int __init audit_fsnotify_init(void)
|
||||
{
|
||||
audit_fsnotify_group = fsnotify_alloc_group(&audit_mark_fsnotify_ops,
|
||||
0);
|
||||
FSNOTIFY_GROUP_DUPS);
|
||||
if (IS_ERR(audit_fsnotify_group)) {
|
||||
audit_fsnotify_group = NULL;
|
||||
audit_panic("cannot create audit fsnotify group");
|
||||
|
||||
Reference in New Issue
Block a user