linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] slub: Fix slub_lock down/up imbalance
@ 2010-10-28  9:50 Pavel Emelyanov
  2010-10-28 13:44 ` Christoph Lameter
  0 siblings, 1 reply; 5+ messages in thread
From: Pavel Emelyanov @ 2010-10-28  9:50 UTC (permalink / raw)
  To: Christoph Lameter, Pekka Enberg, Matt Mackall, Linux MM

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).

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>

---

diff --git a/mm/slub.c b/mm/slub.c
index 8fd5401..981fb73 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -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");
 }

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-11-09 16:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-28  9:50 [PATCH] slub: Fix slub_lock down/up imbalance Pavel Emelyanov
2010-10-28 13:44 ` Christoph Lameter
2010-11-08 14:40   ` Pavel Emelyanov
2010-11-08 17:17     ` Pekka Enberg
2010-11-09 16:03     ` Christoph Lameter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox