Commit 67194e9d authored by John Johansen's avatar John Johansen Committed by Tim Gardner

Revert "UBUNTU: SAUCE: fix: replacedby forwarding is not being properly update...

Revert "UBUNTU: SAUCE: fix: replacedby forwarding is not being properly update when ns is destroyed"

BugLink: http://bugs.launchpad.net/bugs/1379535

This reverts commit 3945d2ba547424551dac4801150b33016519f648.
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
parent 98be286f
......@@ -333,16 +333,13 @@ struct aa_label *aa_label_alloc(int size, gfp_t gfp)
return NULL;
}
static bool __aa_label_remove(struct aa_labelset *ls, struct aa_label *label,
struct aa_label *new)
static bool __aa_label_remove(struct aa_labelset *ls, struct aa_label *label)
{
AA_BUG(!ls);
AA_BUG(!label);
AA_BUG(!write_is_locked(&ls->lock));
AA_BUG(labels_set(label) != ls);
if (new)
__aa_update_replacedby(label, new);
if (label_invalid(label))
labelstats_dec(invalid_intree);
else
......@@ -372,7 +369,8 @@ bool aa_label_remove(struct aa_labelset *ls, struct aa_label *l)
bool res;
write_lock_irqsave(&ls->lock, flags);
res = __aa_label_remove(ls, l, &labels_ns(l)->unconfined->label);
__aa_update_replacedby(l, &labels_ns(l)->unconfined->label);
res = __aa_label_remove(ls, l);
write_unlock_irqrestore(&ls->lock, flags);
return res;
......@@ -421,7 +419,7 @@ static struct aa_label *__aa_label_remove_and_insert(struct aa_labelset *ls,
AA_BUG(labels_set(remove) != ls);
AA_BUG(insert->flags & FLAG_IN_TREE);
__aa_label_remove(ls, remove, insert);
__aa_label_remove(ls, remove);
return __aa_label_insert(ls, insert, replace);
}
......@@ -464,7 +462,8 @@ bool aa_label_replace(struct aa_label *old, struct aa_label *new)
struct aa_label *l;
struct aa_labelset *ls = labels_set(old);
write_lock_irqsave(&ls->lock, flags);
res = __aa_label_remove(ls, old, new);
__aa_update_replacedby(old, new);
res = __aa_label_remove(ls, old);
if (labels_ns(old) != labels_ns(new)) {
write_unlock_irqrestore(&ls->lock, flags);
ls = labels_set(new);
......@@ -1725,11 +1724,7 @@ void aa_labelset_destroy(struct aa_labelset *ls)
write_lock_irqsave(&ls->lock, flags);
for (node = rb_first(&ls->root); node; node = rb_first(&ls->root)) {
struct aa_label *this = rb_entry(node, struct aa_label, node);
if (ls != &root_ns->labels)
__aa_label_remove(ls, this,
&labels_ns(this)->parent->unconfined->label);
else
__aa_label_remove(ls, this, NULL);
__aa_label_remove(ls, this);
}
write_unlock_irqrestore(&ls->lock, flags);
}
......
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