This is a note to let you know that I've just added the patch titled

    aoe: remove vestigial request queue allocation

to the 3.7-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     aoe-remove-vestigial-request-queue-allocation.patch
and it can be found in the queue-3.7 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <[email protected]> know about it.


>From 0a41409c518083133e79015092585d68915865be Mon Sep 17 00:00:00 2001
From: Ed Cashin <[email protected]>
Date: Mon, 17 Dec 2012 16:03:58 -0800
Subject: aoe: remove vestigial request queue allocation

From: Ed Cashin <[email protected]>

commit 0a41409c518083133e79015092585d68915865be upstream.

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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>

---
 drivers/block/aoe/aoeblk.c |   17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

--- a/drivers/block/aoe/aoeblk.c
+++ b/drivers/block/aoe/aoeblk.c
@@ -231,18 +231,12 @@ aoeblk_gdalloc(void *vp)
        if (q == NULL) {
                pr_err("aoe: cannot allocate block queue for %ld.%d\n",
                        d->aoemajor, d->aoeminor);
-               mempool_destroy(mp);
-               goto err_disk;
+               goto err_mempool;
        }
 
-       d->blkq = blk_alloc_queue(GFP_KERNEL);
-       if (!d->blkq)
-               goto err_mempool;
-       d->blkq->backing_dev_info.name = "aoe";
-       if (bdi_init(&d->blkq->backing_dev_info))
-               goto err_blkq;
        spin_lock_irqsave(&d->lock, flags);
-       blk_queue_max_hw_sectors(d->blkq, BLK_DEF_MAX_SECTORS);
+       blk_queue_max_hw_sectors(q, BLK_DEF_MAX_SECTORS);
+       q->backing_dev_info.name = "aoe";
        q->backing_dev_info.ra_pages = READ_AHEAD / PAGE_CACHE_SIZE;
        d->bufpool = mp;
        d->blkq = gd->queue = q;
@@ -265,11 +259,8 @@ aoeblk_gdalloc(void *vp)
        aoedisk_add_sysfs(d);
        return;
 
-err_blkq:
-       blk_cleanup_queue(d->blkq);
-       d->blkq = NULL;
 err_mempool:
-       mempool_destroy(d->bufpool);
+       mempool_destroy(mp);
 err_disk:
        put_disk(gd);
 err:


Patches currently in stable-queue which might be from [email protected] are

queue-3.7/aoe-remove-vestigial-request-queue-allocation.patch
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to