in untag_chunk() we need to do alloc_chunk() a bit earlier
... while we are not holding spinlocks. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
b8800aa5d9
commit
f7a998a949
@ -223,7 +223,7 @@ static void untag_chunk(struct node *p)
|
|||||||
{
|
{
|
||||||
struct audit_chunk *chunk = find_chunk(p);
|
struct audit_chunk *chunk = find_chunk(p);
|
||||||
struct fsnotify_mark *entry = &chunk->mark;
|
struct fsnotify_mark *entry = &chunk->mark;
|
||||||
struct audit_chunk *new;
|
struct audit_chunk *new = NULL;
|
||||||
struct audit_tree *owner;
|
struct audit_tree *owner;
|
||||||
int size = chunk->count - 1;
|
int size = chunk->count - 1;
|
||||||
int i, j;
|
int i, j;
|
||||||
@ -232,9 +232,14 @@ static void untag_chunk(struct node *p)
|
|||||||
|
|
||||||
spin_unlock(&hash_lock);
|
spin_unlock(&hash_lock);
|
||||||
|
|
||||||
|
if (size)
|
||||||
|
new = alloc_chunk(size);
|
||||||
|
|
||||||
spin_lock(&entry->lock);
|
spin_lock(&entry->lock);
|
||||||
if (chunk->dead || !entry->i.inode) {
|
if (chunk->dead || !entry->i.inode) {
|
||||||
spin_unlock(&entry->lock);
|
spin_unlock(&entry->lock);
|
||||||
|
if (new)
|
||||||
|
free_chunk(new);
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -255,9 +260,9 @@ static void untag_chunk(struct node *p)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
new = alloc_chunk(size);
|
|
||||||
if (!new)
|
if (!new)
|
||||||
goto Fallback;
|
goto Fallback;
|
||||||
|
|
||||||
fsnotify_duplicate_mark(&new->mark, entry);
|
fsnotify_duplicate_mark(&new->mark, entry);
|
||||||
if (fsnotify_add_mark(&new->mark, new->mark.group, new->mark.i.inode, NULL, 1)) {
|
if (fsnotify_add_mark(&new->mark, new->mark.group, new->mark.i.inode, NULL, 1)) {
|
||||||
free_chunk(new);
|
free_chunk(new);
|
||||||
|
Loading…
Reference in New Issue
Block a user