Reattach/redetect allways connected umass device - is it
possible ?
Bernd Walter
ticso at cicely12.cicely.de
Thu Mar 24 13:27:12 PST 2005
On Thu, Mar 24, 2005 at 01:10:46PM -0700, Scott Long wrote:
> Dan Nelson wrote:
> >In the last episode (Mar 24), Julian Elischer said:
> >
> >>John Baldwin wrote:
> >>
> >>>On Mar 23, 2005, at 9:00 PM, Matthew N. Dodd wrote:
> >>>
> >>>>On Wed, 23 Mar 2005, Julian Elischer wrote:
> >>>>
> >>>>>eject should imply a detach..
> >>>>>i.e. I think your patch should call the detach code from the eject
> >>>>>code.
> >>>>
> >>>>Eject is for devices that support removable media.
> >>
> >>that doesn't mean that an eject shouldn't do all teh work for a
> >>detach as well.
> >
> >
> >I would be extremely surprised if a "camcontrol eject cd0" removed
> >/dev/cd0 :) Eject is for devices whose media can be removed, but the
> >device itself stays.
> >
> >Or are you just saying detach should do an eject (possibly a stop also)
> >first?
> >
>
> Let me reinforce this since there seems to be quite a bit of confusion.
> The 'stop' and 'eject' actions of camcontrol operate in the context of
> how they are defined in the SCSI world. That is, they send a particular
> command to the target that makes the target do the intended action.
> They do __not__ imply that CAM will detach the logical device, flush the
> buffer-cache, etc. There is a whole lot less magic here than I think
> that everyone is hoping for.
I asume the confusion is what people think of removeable media these
days.
In traditional cases such as MO, Syquest, ZIP and CD things were clear.
The media is a cartridge or just a disk and the drive is a physical
think that holds the media and make noise when accessing it.
Today many people use USB flash memory sticks were they think to just
remove the media, but in fact remove the whole drive containing an
unremoveable media in the same way they would do when unplugging
an USB HDD.
But the problem is not with USB memory sticks, the problem is with
USB flash card readers, where in fact the media itself is changeable
and the problem is not related to USB but with removeable disk media
in general.
GEOM just don't rereads the media unless you explizitly trigger this.
Of course a freshly attached drive is enough to inpect the media in it.
If you forget and use outdated cached data you even risk data
corruption.
I don't have a good idea on how to handle the whole story.
Disk drive have a way to tell about a media change, but GEOM seem to
ignores this and many flash card readers don't even tell.
--
B.Walter BWCT http://www.bwct.de
bernd at bwct.de info at bwct.de
More information about the freebsd-mobile
mailing list