audit_tree: Remove mark->lock locking
authorJan Kara <jack@suse.cz>
Wed, 17 Oct 2018 10:14:52 +0000 (12:14 +0200)
committerPaul Moore <paul@paul-moore.com>
Mon, 12 Nov 2018 14:54:29 +0000 (09:54 -0500)
commit9f16d2e6241b2fc664523f17d74adda7489f496b
tree91f476eada4a089ec4d228f9c2aca9f42798c7f2
parentea956d8be91edc702a98b7fe1f9463e7ca8c42ab
audit_tree: Remove mark->lock locking

Currently, audit_tree code uses mark->lock to protect against detaching
of mark from an inode. In most places it however also uses
mark->group->mark_mutex (as we need to atomically replace attached
marks) and this provides protection against mark detaching as well. So
just remove protection with mark->lock from audit tree code and replace
it with mark->group->mark_mutex protection in all the places. It
simplifies the code and gets rid of some ugly catches like calling
fsnotify_add_mark_locked() with mark->lock held (which cannot sleep only
because we hold a reference to another mark attached to the same inode).

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