aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorEd Cashin <ecashin@coraid.com>2012-12-17 19:03:58 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-17 20:15:25 -0500
commit0a41409c518083133e79015092585d68915865be (patch)
tree41dd1cf2d250d13df2fb2dfae67125c7fff639c7 /drivers/block
parentfe7252bf511d682a977dd096da140accce1b128b (diff)
aoe: remove vestigial request queue allocation
Before the aoe driver was an I/O request handler, it was a make_request-style block driver. Even so, there was a problem where sysfs expected a request queue to exist, so one was provided in commit 7135a71b19be ("aoe: allocate unused request_queue for sysfs"). During the transition to the request-handler style, a patch was merged that was based on a driver without the noop queue, and the noop queue remained in place after the patch was merged, even though a new functional queue was introduced by the patch, allocated through blk_init_queue. The user impact is a memory leak proportional to the number of AoE targets discovered. This patch removes the memory leak and cleans up vestiges of the old do-nothing queue from the aoeblk_gdalloc function. Signed-off-by: Ed Cashin <ecashin@coraid.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/aoe/aoeblk.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c
index 7ba0fcf7b06b..57ac72c1715a 100644
--- a/drivers/block/aoe/aoeblk.c
+++ b/drivers/block/aoe/aoeblk.c
@@ -278,18 +278,12 @@ aoeblk_gdalloc(void *vp)
278 if (q == NULL) { 278 if (q == NULL) {
279 pr_err("aoe: cannot allocate block queue for %ld.%d\n", 279 pr_err("aoe: cannot allocate block queue for %ld.%d\n",
280 d->aoemajor, d->aoeminor); 280 d->aoemajor, d->aoeminor);
281 mempool_destroy(mp); 281 goto err_mempool;
282 goto err_disk;
283 } 282 }
284 283
285 d->blkq = blk_alloc_queue(GFP_KERNEL);
286 if (!d->blkq)
287 goto err_mempool;
288 d->blkq->backing_dev_info.name = "aoe";
289 if (bdi_init(&d->blkq->backing_dev_info))
290 goto err_blkq;
291 spin_lock_irqsave(&d->lock, flags); 284 spin_lock_irqsave(&d->lock, flags);
292 blk_queue_max_hw_sectors(d->blkq, BLK_DEF_MAX_SECTORS); 285 blk_queue_max_hw_sectors(q, BLK_DEF_MAX_SECTORS);
286 q->backing_dev_info.name = "aoe";
293 q->backing_dev_info.ra_pages = READ_AHEAD / PAGE_CACHE_SIZE; 287 q->backing_dev_info.ra_pages = READ_AHEAD / PAGE_CACHE_SIZE;
294 d->bufpool = mp; 288 d->bufpool = mp;
295 d->blkq = gd->queue = q; 289 d->blkq = gd->queue = q;
@@ -314,11 +308,8 @@ aoeblk_gdalloc(void *vp)
314 aoedisk_add_sysfs(d); 308 aoedisk_add_sysfs(d);
315 return; 309 return;
316 310
317err_blkq:
318 blk_cleanup_queue(d->blkq);
319 d->blkq = NULL;
320err_mempool: 311err_mempool:
321 mempool_destroy(d->bufpool); 312 mempool_destroy(mp);
322err_disk: 313err_disk:
323 put_disk(gd); 314 put_disk(gd);
324err: 315err: