]> git.itanic.dy.fi Git - linux-stable/commit
audit: Simplify locking around untag_chunk()
authorJan Kara <jack@suse.cz>
Mon, 12 Nov 2018 14:54:56 +0000 (09:54 -0500)
committerPaul Moore <paul@paul-moore.com>
Mon, 12 Nov 2018 14:54:56 +0000 (09:54 -0500)
commit8432c70062978d9a57bde6715496d585ec520c3e
treea6f597d61fa86444b8b6a8e043d79480906c88de
parentc22fcde775dcc9f46d73d694061441efdc7bdaad
audit: Simplify locking around untag_chunk()

untag_chunk() has to be called with hash_lock, it drops it and
reacquires it when returning. The unlocking of hash_lock is thus hidden
from the callers of untag_chunk() with is rather error prone. Reorganize
the code so that untag_chunk() is called without hash_lock, only with
mark reference preventing the chunk from going away.

Since this requires some more code in the caller of untag_chunk() to
assure forward progress, factor out loop pruning tree from all chunks
into a common helper function.

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