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]
Message-ID: <20110701082136.GE28322@infradead.org>
Date:	Fri, 1 Jul 2011 04:21:36 -0400
From:	Christoph Hellwig <hch@...radead.org>
To:	KY Srinivasan <kys@...rosoft.com>
Cc:	Christoph Hellwig <hch@...radead.org>,
	"gregkh@...e.de" <gregkh@...e.de>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"devel@...uxdriverproject.org" <devel@...uxdriverproject.org>,
	"virtualization@...ts.osdl.org" <virtualization@...ts.osdl.org>
Subject: Re: [PATCH 00/40] Staging: hv: Driver cleanup

On Thu, Jun 30, 2011 at 11:28:27PM +0000, KY Srinivasan wrote:
> > On Wed, Jun 29, 2011 at 07:38:21AM -0700, K. Y. Srinivasan wrote:
> > > Further cleanup of the hv drivers:
> > >
> > > 	1) Cleanup the reference counting mess for both stor and net devices.
> > 
> > I really don't understand the need for reference counting on the storage
> > side, especially now that you only have a SCSI driver.  The SCSI
> > midlayer does proper counting on it's objects (Scsi_Host, scsi_device,
> > scsi_cmnd), so you'll get that for free given that SCSI drivers just
> > piggyback on the midlayer lifetime rules.
> 
> The reference counting allows us to properly deal with messages coming back from the host
> to the guest with a racing remove of the device. I am told these messages could potentially be
> not a response to a message sent from the guest.

To deal with that the scsi subsystem has a two stage teardown for the
SCSI host.  First you call scsi_remove_host, at which point no new I/O
to it can be started.  After that you can wait for all outstanding
messages, and finally you do a scsi_host_put to drop the long-term
reference to it, and eventually free it.
--
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