Commit 43471d15 authored by Jan Kara's avatar Jan Kara

audit_tree: Use mark flags to check whether mark is alive

Currently audit code uses checking of mark->inode to verify whether mark
is still alive. Switch that to checking mark flags as that is more
logical and current way will become unreliable in future.
Reviewed-by: default avatarMiklos Szeredi <mszeredi@redhat.com>
Signed-off-by: default avatarJan Kara <jack@suse.cz>
parent f410ff65
...@@ -190,7 +190,7 @@ static void insert_hash(struct audit_chunk *chunk) ...@@ -190,7 +190,7 @@ static void insert_hash(struct audit_chunk *chunk)
unsigned long key = chunk_to_key(chunk); unsigned long key = chunk_to_key(chunk);
struct list_head *list; struct list_head *list;
if (!key) if (!(chunk->mark.flags & FSNOTIFY_MARK_FLAG_ATTACHED))
return; return;
list = chunk_hash(key); list = chunk_hash(key);
list_add_rcu(&chunk->hash, list); list_add_rcu(&chunk->hash, list);
...@@ -248,7 +248,7 @@ static void untag_chunk(struct node *p) ...@@ -248,7 +248,7 @@ static void untag_chunk(struct node *p)
mutex_lock(&entry->group->mark_mutex); mutex_lock(&entry->group->mark_mutex);
spin_lock(&entry->lock); spin_lock(&entry->lock);
if (chunk->dead || !entry->inode) { if (chunk->dead || !(entry->flags & FSNOTIFY_MARK_FLAG_ATTACHED)) {
spin_unlock(&entry->lock); spin_unlock(&entry->lock);
mutex_unlock(&entry->group->mark_mutex); mutex_unlock(&entry->group->mark_mutex);
if (new) if (new)
...@@ -408,7 +408,7 @@ static int tag_chunk(struct inode *inode, struct audit_tree *tree) ...@@ -408,7 +408,7 @@ static int tag_chunk(struct inode *inode, struct audit_tree *tree)
mutex_lock(&old_entry->group->mark_mutex); mutex_lock(&old_entry->group->mark_mutex);
spin_lock(&old_entry->lock); spin_lock(&old_entry->lock);
if (!old_entry->inode) { if (!(old_entry->flags & FSNOTIFY_MARK_FLAG_ATTACHED)) {
/* old_entry is being shot, lets just lie */ /* old_entry is being shot, lets just lie */
spin_unlock(&old_entry->lock); spin_unlock(&old_entry->lock);
mutex_unlock(&old_entry->group->mark_mutex); mutex_unlock(&old_entry->group->mark_mutex);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment