lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 07 Mar 2008 12:11:50 +0900
From:	Tejun Heo <htejun@...il.com>
To:	Jeff Garzik <jeff@...zik.org>,
	James Bottomley <James.Bottomley@...senPartnership.com>
CC:	Mark Lord <liml@....ca>, Matthew Wilcox <matthew@....cx>,
	linux-ide@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH 2/2] libata: kill SCSI devices before detaching ata_host

Kill SCSI devices before detaching port.  This makes drives properly
shut down on driver unload.

Signed-off-by: Tejun Heo <htejun@...il.com>
---
 drivers/ata/libata-core.c |    8 ++++++++
 1 file changed, 8 insertions(+)

Index: work1/drivers/ata/libata-core.c
===================================================================
--- work1.orig/drivers/ata/libata-core.c
+++ work1/drivers/ata/libata-core.c
@@ -7236,6 +7236,14 @@ static void ata_port_detach(struct ata_p
 	if (!ap->ops->error_handler)
 		goto skip_eh;
 
+	/* First, tell all SCSI devices that we're going down.  Note
+	 * that there's a small race window here.  Devices which get
+	 * hotplugged after forget_host but before EH is killed won't
+	 * get shut down by SCSI layer properly and will miss cache
+	 * flush and spin down.
+	 */
+	scsi_forget_host(ap->scsi_host);
+
 	/* tell EH we're leaving & flush EH */
 	spin_lock_irqsave(ap->lock, flags);
 	ap->pflags |= ATA_PFLAG_UNLOADING;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ