Date: Tue, 9 Aug 2011 13:39:49 -0600 From: "Kenneth D. Merry" <ken@kdm.org> To: Matthew Jacob <mj@feral.com> Cc: freebsd-scsi@freebsd.org Subject: Re: some changes to xpt to help make unloading sim modules safer Message-ID: <20110809193949.GA93077@nargothrond.kdm.org> In-Reply-To: <4E3F0332.7030004@feral.com> References: <4E3F0332.7030004@feral.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Aug 07, 2011 at 14:27:14 -0700, Matthew Jacob wrote: > > See http://people.freebsd.org/~mjacob/xpt_patches.txt > > The first one come from a coworker (Chuck Tuffli) who found a hole > xpt_create_path_unlocked. This looks fine. > I added a few after that to guard against overrunning some counters so > that they would wrap. Just out of curiosity, have you seen instances where the counters have gone negative? > It helped me find out what was going on much easier by adding the > function described here: > http://people.freebsd.org/~mjacob/xpt_path_counts.txt > > Finally, http://people.freebsd.org/~mjacob/isp_patches.txt makes isp > safe for unload as a module. > > There's some ambiguity over whether it's safe to unload when a periph is > open. Using xpt_path_counts to check with the bus reference count is > 3 > for each scsibus attached to each isp sim is a way to avoid that. > > Comments? I would think you'd want to wait until the periph is closed, but perhaps there is a way to get away with it if there aren't any commands outstanding in the SIM. You could send async notifications that all of the devices on the bus have gone away, and then once everything disappears, you could finish the unload. Ken -- Kenneth Merry ken@kdm.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20110809193949.GA93077>