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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 30 Dec 2014 19:22:52 +0000
From:	Long Li <longli@...rosoft.com>
To:	KY Srinivasan <kys@...rosoft.com>,
	"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"devel@...uxdriverproject.org" <devel@...uxdriverproject.org>,
	"ohering@...e.com" <ohering@...e.com>,
	"jbottomley@...allels.com" <jbottomley@...allels.com>,
	"hch@...radead.org" <hch@...radead.org>,
	"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>
Subject: RE: [PATCH 2/4] Drivers: scsi: storvsc: Force discovery of LUNs that
 may have been removed.



> -----Original Message-----
> From: devel [mailto:driverdev-devel-bounces@...uxdriverproject.org] On
> Behalf Of K. Y. Srinivasan
> Sent: Tuesday, December 16, 2014 1:22 PM
> To: gregkh@...uxfoundation.org; linux-kernel@...r.kernel.org;
> devel@...uxdriverproject.org; ohering@...e.com;
> jbottomley@...allels.com; hch@...radead.org; linux-scsi@...r.kernel.org
> Subject: [PATCH 2/4] Drivers: scsi: storvsc: Force discovery of LUNs that may
> have been removed.
> 
> The host asks the guest to scan when a LUN is removed or added.
> The only way a guest can identify the removed LUN is when an I/O is
> attempted on a removed LUN - the SRB status code indicates that the LUN is
> invalid. We currently handle this SRB status and remove the device.
> 
> Rather than waiting for an I/O to remove the device, force the discovery of
> LUNs that may have been removed prior to discovering LUNs that may have
> been added.
> 
> Signed-off-by: K. Y. Srinivasan <kys@...rosoft.com>
Reviewed-by: Long Li <longli@...rosoft.com>
> ---
>  drivers/scsi/storvsc_drv.c |   26 ++++++++++++++++++++++++++
>  1 files changed, 26 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c index
> 0a96fef..a7163c6 100644
> --- a/drivers/scsi/storvsc_drv.c
> +++ b/drivers/scsi/storvsc_drv.c
> @@ -430,10 +430,36 @@ static void storvsc_host_scan(struct work_struct
> *work)  {
>  	struct storvsc_scan_work *wrk;
>  	struct Scsi_Host *host;
> +	struct scsi_device *sdev;
> +	unsigned long flags;
> 
>  	wrk = container_of(work, struct storvsc_scan_work, work);
>  	host = wrk->host;
> 
> +	/*
> +	 * Before scanning the host, first check to see if any of the
> +	 * currrently known devices have been hot removed. We issue a
> +	 * "unit ready" command against all currently known devices.
> +	 * This I/O will result in an error for devices that have been
> +	 * removed. As part of handling the I/O error, we remove the device.
> +	 *
> +	 * When a LUN is added or removed, the host sends us a signal to
> +	 * scan the host. Thus we are forced to discover the LUNs that
> +	 * may have been removed this way.
> +	 */
> +	mutex_lock(&host->scan_mutex);
> +	spin_lock_irqsave(host->host_lock, flags);
> +	list_for_each_entry(sdev, &host->__devices, siblings) {
> +		spin_unlock_irqrestore(host->host_lock, flags);
> +		scsi_test_unit_ready(sdev, 1, 1, NULL);
> +		spin_lock_irqsave(host->host_lock, flags);
> +		continue;
> +	}
> +	spin_unlock_irqrestore(host->host_lock, flags);
> +	mutex_unlock(&host->scan_mutex);
> +	/*
> +	 * Now scan the host to discover LUNs that may have been added.
> +	 */
>  	scsi_scan_host(host);
> 
>  	kfree(wrk);
> --
> 1.7.4.1
> 
> _______________________________________________
> devel mailing list
> devel@...uxdriverproject.org
> http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
--
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