Skip to content
Snippets Groups Projects
Commit bbba809e authored by Sage Weil's avatar Sage Weil Committed by Linus Torvalds
Browse files

md: avoid use of broken kzalloc mempool


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: default avatarNeil Brown <neilb@suse.de>
Signed-off-by: default avatarSage Weil <sage@newdream.net>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 72ff13b7
No related branches found
No related tags found
No related merge requests found
...@@ -150,6 +150,7 @@ static int multipath_make_request (struct request_queue *q, struct bio * bio) ...@@ -150,6 +150,7 @@ static int multipath_make_request (struct request_queue *q, struct bio * bio)
} }
mp_bh = mempool_alloc(conf->pool, GFP_NOIO); mp_bh = mempool_alloc(conf->pool, GFP_NOIO);
memset(mp_bh, 0, sizeof(*mp_bh));
mp_bh->master_bio = bio; mp_bh->master_bio = bio;
mp_bh->mddev = mddev; mp_bh->mddev = mddev;
...@@ -493,7 +494,7 @@ static int multipath_run (mddev_t *mddev) ...@@ -493,7 +494,7 @@ static int multipath_run (mddev_t *mddev)
} }
mddev->degraded = conf->raid_disks - conf->working_disks; 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)); sizeof(struct multipath_bh));
if (conf->pool == NULL) { if (conf->pool == NULL) {
printk(KERN_ERR printk(KERN_ERR
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment