Fix oops on aoe module removal (rhbz 853064)
This commit is contained in:
parent
1c6f1e3b70
commit
3ae631a535
|
@ -0,0 +1,69 @@
|
|||
From 0a41409c518083133e79015092585d68915865be Mon Sep 17 00:00:00 2001
|
||||
From: Ed Cashin <ecashin@coraid.com>
|
||||
Date: Mon, 17 Dec 2012 16:03:58 -0800
|
||||
Subject: [PATCH] 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>
|
||||
---
|
||||
drivers/block/aoe/aoeblk.c | 17 ++++-------------
|
||||
1 file changed, 4 insertions(+), 13 deletions(-)
|
||||
|
||||
diff --git a/drivers/block/aoe/aoeblk.c b/drivers/block/aoe/aoeblk.c
|
||||
index 7ba0fcf..57ac72c 100644
|
||||
--- a/drivers/block/aoe/aoeblk.c
|
||||
+++ b/drivers/block/aoe/aoeblk.c
|
||||
@@ -278,18 +278,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;
|
||||
@@ -314,11 +308,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:
|
||||
--
|
||||
1.8.0.1
|
||||
|
11
kernel.spec
11
kernel.spec
|
@ -62,7 +62,7 @@ Summary: The Linux kernel
|
|||
# For non-released -rc kernels, this will be appended after the rcX and
|
||||
# gitX tags, so a 3 here would become part of release "0.rcX.gitX.3"
|
||||
#
|
||||
%global baserelease 2
|
||||
%global baserelease 3
|
||||
%global fedora_build %{baserelease}
|
||||
|
||||
# base_sublevel is the kernel version we're starting with and patching
|
||||
|
@ -790,6 +790,9 @@ Patch21234: mac80211-fix-ibss-scanning.patch
|
|||
#rhbz 873107
|
||||
Patch21237: 0001-ACPI-sony-laptop-do-proper-memcpy-for-ACPI_TYPE_INTE.patch
|
||||
|
||||
#rhbz 853064
|
||||
Patch21239: aoe-remove-vestigial-request-queue-allocation.patch
|
||||
|
||||
# END OF PATCH DEFINITIONS
|
||||
|
||||
%endif
|
||||
|
@ -1519,6 +1522,9 @@ ApplyPatch mac80211-fix-ibss-scanning.patch
|
|||
#rhbz 873107
|
||||
ApplyPatch 0001-ACPI-sony-laptop-do-proper-memcpy-for-ACPI_TYPE_INTE.patch
|
||||
|
||||
#rhbz 853064
|
||||
ApplyPatch aoe-remove-vestigial-request-queue-allocation.patch
|
||||
|
||||
|
||||
# END OF PATCH APPLICATIONS
|
||||
|
||||
|
@ -2392,6 +2398,9 @@ fi
|
|||
# ||----w |
|
||||
# || ||
|
||||
%changelog
|
||||
* Fri Jan 04 2013 Josh Boyer <jwboyer@redhat.com>
|
||||
- Fix oops on aoe module removal (rhbz 853064)
|
||||
|
||||
* Thu Jan 03 2013 Josh Boyer <jwboyer@redhat.com> - 3.7.1-2
|
||||
- Fixup secure boot patchset for 3.7 rebase
|
||||
- Package bash completion script for perf
|
||||
|
|
Loading…
Reference in New Issue