]> git.baikalelectronics.ru Git - kernel.git/commit
audit: Replace chunk attached to mark instead of replacing mark
authorJan Kara <jack@suse.cz>
Mon, 12 Nov 2018 14:55:16 +0000 (09:55 -0500)
committerPaul Moore <paul@paul-moore.com>
Mon, 12 Nov 2018 14:55:16 +0000 (09:55 -0500)
commit9a69c7c0e5df4764012f7a5755d54643aff5b0b0
tree0be4159cb4611eb3ddaaa6c690d2609407412acf
parent1d12d6ac674ae34bfc179df0191388b77837a2e3
audit: Replace chunk attached to mark instead of replacing mark

Audit tree code currently associates new fsnotify mark with each new
chunk. As chunk attached to an inode is replaced when new tag is added /
removed, we also need to remove old fsnotify mark and add a new one on
such occasion.  This is cumbersome and makes locking rules somewhat
difficult to follow.

Fix these problems by allocating fsnotify mark independently of chunk
and keeping it all the time while there is some chunk attached to an
inode. Also add documentation about the locking rules so that things are
easier to follow.

Signed-off-by: Jan Kara <jack@suse.cz>
Reviewed-by: Richard Guy Briggs <rgb@redhat.com>
[PM: minor merge fuzz due to updated patches previously in the series]
Signed-off-by: Paul Moore <paul@paul-moore.com>
kernel/audit_tree.c