[linux] 01/01: Disable asynchronous aborts for SATA devices
debian-kernel at lists.debian.org
debian-kernel at lists.debian.org
Wed Jan 10 20:38:10 UTC 2018
This is an automated email from the git hooks/post-receive script.
carnil pushed a commit to branch sid
in repository linux.
commit d42878a1e5093e9b7b7247d76ad9a0c1a4f872a8
Author: Salvatore Bonaccorso <carnil at debian.org>
Date: Wed Jan 10 13:22:41 2018 +0100
Disable asynchronous aborts for SATA devices
---
debian/changelog | 3 ++
...able-asynchronous-aborts-for-SATA-devices.patch | 57 ++++++++++++++++++++++
.../revert-scsi-libsas-allow-async-aborts.patch | 26 ----------
debian/patches/series | 2 +-
4 files changed, 61 insertions(+), 27 deletions(-)
diff --git a/debian/changelog b/debian/changelog
index 7a1d915..6967ca0 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -42,6 +42,9 @@ linux (4.14.13-1) UNRELEASED; urgency=medium
- [s390x] KVM: fix cmma migration for multiple memory slots
- [s390x] KVM: prevent buffer overrun on memory hotplug during migration
+ [ Salvatore Bonaccorso ]
+ * Disable asynchronous aborts for SATA devices
+
-- Salvatore Bonaccorso <carnil at debian.org> Wed, 10 Jan 2018 09:58:46 +0100
linux (4.14.12-2) unstable; urgency=medium
diff --git a/debian/patches/bugfix/all/Disable-asynchronous-aborts-for-SATA-devices.patch b/debian/patches/bugfix/all/Disable-asynchronous-aborts-for-SATA-devices.patch
new file mode 100644
index 0000000..797c13a
--- /dev/null
+++ b/debian/patches/bugfix/all/Disable-asynchronous-aborts-for-SATA-devices.patch
@@ -0,0 +1,57 @@
+From: Hannes Reinecke <hare at suse.de>
+Date: Wed, 10 Jan 2018 08:34:02 +0100
+Subject: Disable asynchronous aborts for SATA devices
+Origin: https://marc.info/?l=linux-scsi&m=151557324907914
+
+Handling CD-ROM devices from libsas is decidedly odd, as libata
+relies on SCSI EH to be started to figure out that no medium is
+present.
+So we cannot do asynchronous aborts for SATA devices.
+
+Fixes: 909657615d9 ("scsi: libsas: allow async aborts")
+Cc: <stable at vger.kernel.org> # 4.12+
+Signed-off-by: Hannes Reinecke <hare at suse.com>
+Reviewed-by: Christoph Hellwig <hch at lst.de>
+Tested-by: Yves-Alexis Perez <corsac at debian.org>
+---
+ drivers/scsi/libsas/sas_scsi_host.c | 17 +++++++++++++++--
+ 1 file changed, 15 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c
+index 58476b728c57..c9406852c3e9 100644
+--- a/drivers/scsi/libsas/sas_scsi_host.c
++++ b/drivers/scsi/libsas/sas_scsi_host.c
+@@ -486,15 +486,28 @@ static int sas_queue_reset(struct domain_device *dev, int reset_type,
+
+ int sas_eh_abort_handler(struct scsi_cmnd *cmd)
+ {
+- int res;
++ int res = TMF_RESP_FUNC_FAILED;
+ struct sas_task *task = TO_SAS_TASK(cmd);
+ struct Scsi_Host *host = cmd->device->host;
++ struct domain_device *dev = cmd_to_domain_dev(cmd);
+ struct sas_internal *i = to_sas_internal(host->transportt);
++ unsigned long flags;
+
+ if (!i->dft->lldd_abort_task)
+ return FAILED;
+
+- res = i->dft->lldd_abort_task(task);
++ spin_lock_irqsave(host->host_lock, flags);
++ /* We cannot do async aborts for SATA devices */
++ if (dev_is_sata(dev) && !host->host_eh_scheduled) {
++ spin_unlock_irqrestore(host->host_lock, flags);
++ return FAILED;
++ }
++ spin_unlock_irqrestore(host->host_lock, flags);
++
++ if (task)
++ res = i->dft->lldd_abort_task(task);
++ else
++ SAS_DPRINTK("no task to abort\n");
+ if (res == TMF_RESP_FUNC_SUCC || res == TMF_RESP_FUNC_COMPLETE)
+ return SUCCESS;
+
+--
+2.11.0
+
diff --git a/debian/patches/debian/revert-scsi-libsas-allow-async-aborts.patch b/debian/patches/debian/revert-scsi-libsas-allow-async-aborts.patch
deleted file mode 100644
index 1e1468e..0000000
--- a/debian/patches/debian/revert-scsi-libsas-allow-async-aborts.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From: Salvatore Bonaccorso <carnil at debian.org>
-Date: Fri, 5 Jan 2018 13:36:38 +0100
-Subject: Revert "scsi: libsas: allow async aborts"
-Bug-Debian: https://bugs.debian.org/882414
-
----
- drivers/scsi/libsas/sas_scsi_host.c | 3 +++
- 1 file changed, 3 insertions(+)
-
-diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c
-index ea8ad06ff582..e81c8590d254 100644
---- a/drivers/scsi/libsas/sas_scsi_host.c
-+++ b/drivers/scsi/libsas/sas_scsi_host.c
-@@ -491,6 +491,9 @@ int sas_eh_abort_handler(struct scsi_cmnd *cmd)
- struct Scsi_Host *host = cmd->device->host;
- struct sas_internal *i = to_sas_internal(host->transportt);
-
-+ if (current != host->ehandler)
-+ return FAILED;
-+
- if (!i->dft->lldd_abort_task)
- return FAILED;
-
---
-2.11.0
-
diff --git a/debian/patches/series b/debian/patches/series
index d2d154e..738aabf 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -82,7 +82,7 @@ bugfix/all/i40e-i40evf-organize-and-re-number-feature-flags.patch
bugfix/all/i40e-fix-flags-declaration.patch
bugfix/all/xen-time-do-not-decrease-steal-time-after-live-migra.patch
bugfix/all/e1000e-fix-e1000_check_for_copper_link_ich8lan-return-value.patch
-debian/revert-scsi-libsas-allow-async-aborts.patch
+bugfix/all/Disable-asynchronous-aborts-for-SATA-devices.patch
# Miscellaneous features
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/kernel/linux.git
More information about the Kernel-svn-changes
mailing list