提交 68cee4f1 编写于 作者: P Pavel Emelyanov 提交者: Pekka Enberg

slub: Fix slub_lock down/up imbalance

There are two places, that do not release the slub_lock.

Respective bugs were introduced by sysfs changes ab4d5ed5 (slub: Enable
sysfs support for !CONFIG_SLUB_DEBUG) and 2bce6485 ( slub: Allow removal
of slab caches during boot).
Acked-by: NChristoph Lameter <cl@linux.com>
Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
Signed-off-by: NPekka Enberg <penberg@kernel.org>
上级 c8ddb271
......@@ -3273,9 +3273,9 @@ struct kmem_cache *kmem_cache_create(const char *name, size_t size,
kfree(n);
kfree(s);
}
err:
up_write(&slub_lock);
err:
if (flags & SLAB_PANIC)
panic("Cannot create slabcache %s\n", name);
else
......@@ -3862,6 +3862,7 @@ static ssize_t show_slab_objects(struct kmem_cache *s,
x += sprintf(buf + x, " N%d=%lu",
node, nodes[node]);
#endif
up_read(&slub_lock);
kfree(nodes);
return x + sprintf(buf + x, "\n");
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册