Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 321960
b: refs/heads/master
c: b3e8692
h: refs/heads/master
v: v3
  • Loading branch information
Miklos Szeredi committed Aug 15, 2012
1 parent 9383ddb commit d0f2ef5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a2140fc0cb0325bb6384e788edd27b9a568714e2
refs/heads/master: b3e8692b4dde5cf5fc60e4b95385229a72623182
12 changes: 9 additions & 3 deletions trunk/kernel/audit_tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ static void untag_chunk(struct node *p)
spin_unlock(&hash_lock);
spin_unlock(&entry->lock);
fsnotify_destroy_mark(entry);
fsnotify_put_mark(&new->mark); /* drop initial reference */
goto out;

Fallback:
Expand Down Expand Up @@ -330,7 +331,6 @@ static int create_chunk(struct inode *inode, struct audit_tree *tree)
spin_unlock(&hash_lock);
chunk->dead = 1;
spin_unlock(&entry->lock);
fsnotify_get_mark(entry);
fsnotify_destroy_mark(entry);
fsnotify_put_mark(entry);
return 0;
Expand All @@ -346,6 +346,7 @@ static int create_chunk(struct inode *inode, struct audit_tree *tree)
insert_hash(chunk);
spin_unlock(&hash_lock);
spin_unlock(&entry->lock);
fsnotify_put_mark(entry); /* drop initial reference */
return 0;
}

Expand Down Expand Up @@ -411,7 +412,6 @@ static int tag_chunk(struct inode *inode, struct audit_tree *tree)
spin_unlock(&chunk_entry->lock);
spin_unlock(&old_entry->lock);

fsnotify_get_mark(chunk_entry);
fsnotify_destroy_mark(chunk_entry);

fsnotify_put_mark(chunk_entry);
Expand Down Expand Up @@ -444,6 +444,7 @@ static int tag_chunk(struct inode *inode, struct audit_tree *tree)
spin_unlock(&chunk_entry->lock);
spin_unlock(&old_entry->lock);
fsnotify_destroy_mark(old_entry);
fsnotify_put_mark(chunk_entry); /* drop initial reference */
fsnotify_put_mark(old_entry); /* pair to fsnotify_find mark_entry */
return 0;
}
Expand Down Expand Up @@ -915,7 +916,12 @@ static void audit_tree_freeing_mark(struct fsnotify_mark *entry, struct fsnotify
struct audit_chunk *chunk = container_of(entry, struct audit_chunk, mark);

evict_chunk(chunk);
fsnotify_put_mark(entry);

/*
* We are guaranteed to have at least one reference to the mark from
* either the inode or the caller of fsnotify_destroy_mark().
*/
BUG_ON(atomic_read(&entry->refcnt) < 1);
}

static bool audit_tree_send_event(struct fsnotify_group *group, struct inode *inode,
Expand Down

0 comments on commit d0f2ef5

Please sign in to comment.