Skip to content

Commit

Permalink
md: avoid use of broken kzalloc mempool
Browse files Browse the repository at this point in the history
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.

Acked-by: Neil Brown <neilb@suse.de>
Signed-off-by: Sage Weil <sage@newdream.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Sage Weil authored and Linus Torvalds committed Sep 22, 2009
1 parent 72ff13b commit bbba809
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/md/multipath.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -493,7 +494,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
Expand Down

0 comments on commit bbba809

Please sign in to comment.