Thread (4 messages) 4 messages, 3 authors, 2009-08-11
STALE6258d

[PATCH] md: avoid use of broken kzalloc mempool

From: Sage Weil <hidden>
Date: 2009-08-03 20:55:08
Also in: lkml
Subsystem: the rest · Maintainer: Linus Torvalds

The kzalloc mempool does not re-zero items that have been used and then
returned to the pool.  Manually zero the allocated multipath_bh instead.

CC: linux-raid@vger.kernel.org
CC: Neil Brown <redacted>
CC: <stable@kernel.org>
Signed-off-by: Sage Weil <redacted>
---
 drivers/md/multipath.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/md/multipath.c b/drivers/md/multipath.c
index 237fe3f..151ce69 100644
--- a/drivers/md/multipath.c
+++ b/drivers/md/multipath.c
@@ -150,6 +150,7 @@ static int multipath_make_request (struct request_queue *q, struct bio * bio)
 	}
 
 	mp_bh = mempool_alloc(conf->pool, GFP_NOIO);
+	memset(mp_bh, 0, sizeof(*mp_bh));
 
 	mp_bh->master_bio = bio;
 	mp_bh->mddev = mddev;
@@ -490,7 +491,7 @@ static int multipath_run (mddev_t *mddev)
 	}
 	mddev->degraded = conf->raid_disks - conf->working_disks;
 
-	conf->pool = mempool_create_kzalloc_pool(NR_RESERVED_BUFS,
+	conf->pool = mempool_create_kmalloc_pool(NR_RESERVED_BUFS,
 						 sizeof(struct multipath_bh));
 	if (conf->pool == NULL) {
 		printk(KERN_ERR 
-- 
1.5.6.5
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help