Revert two SCSI/block patches from 2.6.38.6; drop now-unneeded followon patches

This commit is contained in:
Chuck Ebbert 2011-07-06 08:35:22 -04:00
parent a9318c93e6
commit 58f6f59b9e
5 changed files with 65 additions and 86 deletions

View File

@ -1,39 +0,0 @@
From d86e0e83b32bc84600adb0b6ea1fce389b266682 Mon Sep 17 00:00:00 2001
From: Jens Axboe <jaxboe@fusionio.com>
Date: Fri, 27 May 2011 07:44:43 +0200
Subject: block: export blk_{get,put}_queue()
From: Jens Axboe <jaxboe@fusionio.com>
commit d86e0e83b32bc84600adb0b6ea1fce389b266682 upstream.
[ backport to 2.6.38 ]
We need them in SCSI to fix a bug, but currently they are not
exported to modules. Export them.
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chuck Ebbert <cebbert@redhat.com>
---
block/blk-core.c | 2 ++
1 file changed, 2 insertions(+)
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -345,6 +345,7 @@ void blk_put_queue(struct request_queue
{
kobject_put(&q->kobj);
}
+EXPORT_SYMBOL(blk_put_queue);
void blk_cleanup_queue(struct request_queue *q)
{
@@ -566,6 +567,7 @@ int blk_get_queue(struct request_queue *
return 1;
}
+EXPORT_SYMBOL(blk_get_queue);
static inline void blk_free_request(struct request_queue *q, struct request *rq)
{

View File

@ -1,43 +0,0 @@
commit e73e079bf128d68284efedeba1fbbc18d78610f9
Author: James Bottomley <James.Bottomley@HansenPartnership.com>
Date: Wed May 25 15:52:14 2011 -0500
[SCSI] Fix oops caused by queue refcounting failure
In certain circumstances, we can get an oops from a torn down device.
Most notably this is from CD roms trying to call scsi_ioctl. The root
cause of the problem is the fact that after scsi_remove_device() has
been called, the queue is fully torn down. This is actually wrong
since the queue can be used until the sdev release function is called.
Therefore, we add an extra reference to the queue which is released in
sdev->release, so the queue always exists.
Reported-by: Parag Warudkar <parag.lkml@gmail.com>
Cc: stable@kernel.org
Signed-off-by: James Bottomley <jbottomley@parallels.com>
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index 58584dc..44e8ca3 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -297,7 +297,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
kfree(sdev);
goto out;
}
-
+ blk_get_queue(sdev->request_queue);
sdev->request_queue->queuedata = sdev;
scsi_adjust_queue_depth(sdev, 0, sdev->host->cmd_per_lun);
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index e639125..e0bd3f7 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -322,6 +322,7 @@ static void scsi_device_dev_release_usercontext(struct work_struct *work)
kfree(evt);
}
+ blk_put_queue(sdev->request_queue);
/* NULL queue means the device can't be used */
sdev->request_queue = NULL;

View File

@ -664,8 +664,8 @@ Patch570: linux-2.6-selinux-mprotect-checks.patch
Patch580: linux-2.6-sparc-selinux-mprotect-checks.patch
# scsi / block
Patch600: block-queue-refcount.patch
Patch601: block-export-blk_-get-put-_queue.patch
Patch600: revert-fix-oops-in-scsi_run_queue.patch
Patch601: revert-put-stricter-guards-on-queue-dead-checks.patch
Patch602: block-blkdev_get-should-access-bd_disk-only-after.patch
Patch603: cfq-iosched-fix-locking-around-ioc-ioc-data-assignment.patch
@ -1313,8 +1313,10 @@ ApplyPatch x86-pci-preserve-existing-pci-bfsort-whitelist-for-dell-systems.patch
#
# SCSI / block Bits.
#
ApplyPatch block-queue-refcount.patch
ApplyPatch block-export-blk_-get-put-_queue.patch
# Revert SCSI patches from 2.6.38.6 that cause more problems thatn they solve
ApplyPatch revert-fix-oops-in-scsi_run_queue.patch
ApplyPatch revert-put-stricter-guards-on-queue-dead-checks.patch
# Fix potential NULL deref in 2.6.38.8
ApplyPatch block-blkdev_get-should-access-bd_disk-only-after.patch
# rhbz#577968
ApplyPatch cfq-iosched-fix-locking-around-ioc-ioc-data-assignment.patch
@ -2065,6 +2067,10 @@ fi
# and build.
%changelog
* Wed Jul 06 2011 Chuck Ebbert <cebbert@redhat.com>
- Revert SCSI/block patches from 2.6.38.6 that caused more problems
than they fixed; drop band-aid patch attempting to fix the fix.
* Mon Jun 27 2011 Dave Jones <davej@redhat.com>
- Disable CONFIG_CRYPTO_MANAGER_DISABLE_TESTS, as this also disables FIPS (rhbz 716942)

View File

@ -0,0 +1,21 @@
revert c055f5b2614b4f758ae6cc86733f31fa4c2c5844 from 2.6.38.6
--- b/drivers/scsi/scsi_lib.c
+++ a/drivers/scsi/scsi_lib.c
@@ -400,15 +400,10 @@
static void scsi_run_queue(struct request_queue *q)
{
struct scsi_device *sdev = q->queuedata;
+ struct Scsi_Host *shost = sdev->host;
- struct Scsi_Host *shost;
LIST_HEAD(starved_list);
unsigned long flags;
- /* if the device is dead, sdev will be NULL, so no queue to run */
- if (!sdev)
- return;
-
- shost = sdev->host;
if (scsi_target(sdev)->single_lun)
scsi_single_lun_run(sdev);

View File

@ -0,0 +1,34 @@
reverte 86cbfb5607d4b81b1a993ff689bbd2addd5d3a9b from 2.6.38.6
--- b/drivers/scsi/scsi_sysfs.c
+++ a/drivers/scsi/scsi_sysfs.c
@@ -322,8 +322,14 @@
kfree(evt);
}
+ if (sdev->request_queue) {
+ sdev->request_queue->queuedata = NULL;
+ /* user context needed to free queue */
+ scsi_free_queue(sdev->request_queue);
+ /* temporary expedient, try to catch use of queue lock
+ * after free of sdev */
+ sdev->request_queue = NULL;
+ }
- /* NULL queue means the device can't be used */
- sdev->request_queue = NULL;
scsi_target_reap(scsi_target(sdev));
@@ -931,12 +937,6 @@
if (sdev->host->hostt->slave_destroy)
sdev->host->hostt->slave_destroy(sdev);
transport_destroy_device(dev);
-
- /* cause the request function to reject all I/O requests */
- sdev->request_queue->queuedata = NULL;
-
- /* Freeing the queue signals to block that we're done */
- scsi_free_queue(sdev->request_queue);
put_device(dev);
}