linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] md: avoid use of broken kzalloc mempool
@ 2009-08-03 20:54 Sage Weil
  2009-08-03 21:13 ` Andi Kleen
  2009-08-03 22:03 ` NeilBrown
  0 siblings, 2 replies; 7+ messages in thread
From: Sage Weil @ 2009-08-03 20:54 UTC (permalink / raw)
  To: linux-kernel; +Cc: Sage Weil, linux-raid, Neil Brown, stable

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 <neilb@suse.de>
CC: <stable@kernel.org>
Signed-off-by: Sage Weil <sage@newdream.net>
---
 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


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

end of thread, other threads:[~2009-08-12 23:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-03 20:54 [PATCH] md: avoid use of broken kzalloc mempool Sage Weil
2009-08-03 21:13 ` Andi Kleen
2009-08-03 21:29   ` Sage Weil
2009-08-03 22:03 ` NeilBrown
2009-08-11 21:52   ` Andrew Morton
2009-08-11 22:03     ` Sage Weil
2009-08-12 23:17     ` Neil Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).