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] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 3 Jul 2015 19:44:16 +0000
From:	Long Li <longli@...rosoft.com>
To:	KY Srinivasan <kys@...rosoft.com>,
	Vitaly Kuznetsov <vkuznets@...hat.com>,
	"linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>
CC:	Haiyang Zhang <haiyangz@...rosoft.com>,
	"James E.J. Bottomley" <JBottomley@...n.com>,
	"devel@...uxdriverproject.org" <devel@...uxdriverproject.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] scsi: storvsc: use shost_for_each_device() instead of
 open coding



> -----Original Message-----
> From: KY Srinivasan
> Sent: Friday, July 03, 2015 11:35 AM
> To: Vitaly Kuznetsov; linux-scsi@...r.kernel.org
> Cc: Long Li; Haiyang Zhang; James E.J. Bottomley; devel@...uxdriverproject.org;
> linux-kernel@...r.kernel.org
> Subject: RE: [PATCH] scsi: storvsc: use shost_for_each_device() instead of open
> coding
> 
> 
> 
> > -----Original Message-----
> > From: Vitaly Kuznetsov [mailto:vkuznets@...hat.com]
> > Sent: Wednesday, July 1, 2015 2:31 AM
> > To: linux-scsi@...r.kernel.org
> > Cc: Long Li; KY Srinivasan; Haiyang Zhang; James E.J. Bottomley;
> > devel@...uxdriverproject.org; linux-kernel@...r.kernel.org
> > Subject: [PATCH] scsi: storvsc: use shost_for_each_device() instead of
> > open coding
> >
> > Comment in struct Scsi_Host says that drivers are not supposed to
> > access __devices directly. storvsc_host_scan() doesn't happen in irq
> > context so we can just use shost_for_each_device().
> >
> > Signed-off-by: Vitaly Kuznetsov <vkuznets@...hat.com>
> 
> Signed-off-by: K. Y. Srinivasan <kys@...rosoft.com>
Reviewed-by: Long Li <longli@...rosoft.com>
> > ---
> >  drivers/scsi/storvsc_drv.c | 9 +--------
> >  1 file changed, 1 insertion(+), 8 deletions(-)
> >
> > diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
> > index 3c6584f..9ea912b 100644
> > --- a/drivers/scsi/storvsc_drv.c
> > +++ b/drivers/scsi/storvsc_drv.c
> > @@ -426,7 +426,6 @@ 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;
> > @@ -443,14 +442,8 @@ static void storvsc_host_scan(struct work_struct
> > *work)
> >  	 * 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);
> > +	shost_for_each_device(sdev, host)
> >  		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.
> > --
> > 2.4.3

--
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