fsnotify: take inode->i_lock inside fsnotify_find_mark_entry()
All callers to fsnotify_find_mark_entry() except one take and release inode->i_lock around the call. Take the lock inside fsnotify_find_mark_entry() instead. Signed-off-by: Andreas Gruenbacher <agruen@suse.de> Signed-off-by: Eric Paris <eparis@redhat.com>
This commit is contained in:
committed by
Eric Paris
parent
ef5e2b785f
commit
3556608709
@@ -360,9 +360,7 @@ static int tag_chunk(struct inode *inode, struct audit_tree *tree)
|
||||
struct node *p;
|
||||
int n;
|
||||
|
||||
spin_lock(&inode->i_lock);
|
||||
old_entry = fsnotify_find_mark(audit_tree_group, inode);
|
||||
spin_unlock(&inode->i_lock);
|
||||
if (!old_entry)
|
||||
return create_chunk(inode, tree);
|
||||
|
||||
|
@@ -101,10 +101,7 @@ static inline struct audit_parent *audit_find_parent(struct inode *inode)
|
||||
struct audit_parent *parent = NULL;
|
||||
struct fsnotify_mark *entry;
|
||||
|
||||
spin_lock(&inode->i_lock);
|
||||
entry = fsnotify_find_mark(audit_watch_group, inode);
|
||||
spin_unlock(&inode->i_lock);
|
||||
|
||||
if (entry)
|
||||
parent = container_of(entry, struct audit_parent, mark);
|
||||
|
||||
@@ -520,9 +517,7 @@ static bool audit_watch_should_send_event(struct fsnotify_group *group, struct i
|
||||
struct fsnotify_mark *entry;
|
||||
bool send;
|
||||
|
||||
spin_lock(&inode->i_lock);
|
||||
entry = fsnotify_find_mark(group, inode);
|
||||
spin_unlock(&inode->i_lock);
|
||||
if (!entry)
|
||||
return false;
|
||||
|
||||
|
Reference in New Issue
Block a user