On Sat, 2005-09-17 at 22:33 -0400, Alan Stern wrote: > > OK, I looked at making this work while reaping the target correctly, but > > I couldn't (basic problem is that the target list keeps the target until > > it has no more devices, a condition that could be made untrue by > > something as simple as an open of the sysfs file). > > Sorry, I'm a bit slow tonight. I thought you _wanted_ the target to hang > around until it had no more devices. (Wasn't that the whole point of > scsi_target_reap?) What's wrong with keeping the target until the sysfs > file is closed? nothing ... that happens regardless (with either patch). > > So, rather than try that, I thought a better approach might be to make > > the host state model work for us. i.e. if we know the host is being > > removed, there's no point allowing target or device removal because at > > some point the host removal will do it for us. This enforcement would > > ensure we're the only legitimate removers of the target and device. > > How does this make things any better? You still face the problem that an > open sysfs file will delay device removal and target reaping, if all the > devices on that target are hot-unplugged and the host remains alive and > active. Actually, since we don't need the target reaping in the host removal (it would be reaped when the device is removed), I agree ... I'll put your original patch in. Thanks, James - : send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html