audit: Remove pointless check in insert_hash()
authorJan Kara <jack@suse.cz>
Mon, 12 Nov 2018 14:54:48 +0000 (09:54 -0500)
committerPaul Moore <paul@paul-moore.com>
Mon, 12 Nov 2018 14:54:48 +0000 (09:54 -0500)
The audit_tree_group->mark_mutex is held all the time while we create
the fsnotify mark, add it to the inode, and insert chunk into the hash.
Hence mark cannot get detached during this time and so the check whether
the mark is attached in insert_hash() is pointless.

Reviewed-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Paul Moore <paul@paul-moore.com>
kernel/audit_tree.c

index d8f6cfa0005b49d99b5346dedd7b1af257f27989..d150514ff15ee007295d05325794ec040032330f 100644 (file)
@@ -184,8 +184,6 @@ static void insert_hash(struct audit_chunk *chunk)
 {
        struct list_head *list;
 
-       if (!(chunk->mark.flags & FSNOTIFY_MARK_FLAG_ATTACHED))
-               return;
        /*
         * Make sure chunk is fully initialized before making it visible in the
         * hash. Pairs with a data dependency barrier in READ_ONCE() in