* [PATCH 0/1] zfcp: patch for 3.2-rc
@ 2011-11-18 19:00 Steffen Maier
2011-11-18 19:00 ` [PATCH 1/1] zfcp: return early from slave_destroy if slave_alloc returned early Steffen Maier
0 siblings, 1 reply; 2+ messages in thread
From: Steffen Maier @ 2011-11-18 19:00 UTC (permalink / raw)
To: James Bottomley
Cc: linux-scsi, linux-s390, schwidefsky, heiko.carstens, stable
James,
here is a zfcp fix for 3.2-rc to apply on top of the current
scsi-rc-fixes-2.6.
This also needs to find its way into all stable versions your 4e6c82b
goes to, so I adopted the #2.6.38+ for stable on CC.
Steffen
Linux on System z Development
IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschaeftsfuehrung: Dirk Wittkopp
Sitz der Gesellschaft: Boeblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH 1/1] zfcp: return early from slave_destroy if slave_alloc returned early
2011-11-18 19:00 [PATCH 0/1] zfcp: patch for 3.2-rc Steffen Maier
@ 2011-11-18 19:00 ` Steffen Maier
0 siblings, 0 replies; 2+ messages in thread
From: Steffen Maier @ 2011-11-18 19:00 UTC (permalink / raw)
To: James Bottomley
Cc: linux-scsi, linux-s390, schwidefsky, heiko.carstens, stable
[-- Attachment #1: 700-zfcp-only-finish-slave_destroy-if-slave_alloc-finished.diff --]
[-- Type: text/plain, Size: 1249 bytes --]
From: Steffen Maier <maier@linux.vnet.ibm.com>
zfcp_scsi_slave_destroy erroneously always tried to finish its task
even if the corresponding previous zfcp_scsi_slave_alloc returned
early. This can lead to kernel page faults on accessing uninitialized
fields of struct zfcp_scsi_dev in zfcp_erp_lun_shutdown_wait. Take the
port field of the struct to determine if slave_alloc returned early.
This zfcp bug is exposed by 4e6c82b (in turn fixing f7c9c6b to be
compatible with 21208ae) which can call slave_destroy for a
corresponding previous slave_alloc that did not finish.
This patch is based on James Bottomley's fix suggestion in
http://www.spinics.net/lists/linux-scsi/msg55449.html.
Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com>
Cc: <stable@kernel.org> #2.6.38+
---
drivers/s390/scsi/zfcp_scsi.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/drivers/s390/scsi/zfcp_scsi.c
+++ b/drivers/s390/scsi/zfcp_scsi.c
@@ -55,6 +55,10 @@ static void zfcp_scsi_slave_destroy(stru
{
struct zfcp_scsi_dev *zfcp_sdev = sdev_to_zfcp(sdev);
+ /* if previous slave_alloc returned early, there is nothing to do */
+ if (!zfcp_sdev->port)
+ return;
+
zfcp_erp_lun_shutdown_wait(sdev, "scssd_1");
put_device(&zfcp_sdev->port->dev);
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-11-18 19:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-18 19:00 [PATCH 0/1] zfcp: patch for 3.2-rc Steffen Maier
2011-11-18 19:00 ` [PATCH 1/1] zfcp: return early from slave_destroy if slave_alloc returned early Steffen Maier
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.