GEOM weirdness with SD flash reader?

Nate Lawson nate at root.org
Mon Jul 2 04:03:49 UTC 2007


M. Warner Losh wrote:
> In message: <46880F1C.3020602 at root.org>
>             Nate Lawson <nate at root.org> writes:
> : Yes, you're exactly right.  However, shouldn't a read from a device
> : trigger a re-taste if the media is removable?
> 
> I don't think it does.  The driver is expected to poll, however...
> 
> : So the fdisk of da2
> : should have caused it to re-read the MBR and create /dev/da2s1.  I think
> : maybe there should be a flag set for devices with removable media that
> : causes the device to be re-tasted on every mount request.
> 
> Is there even a removable flag to disks?

In SCSI there is, removable flag combined with medium not present:

da2 at umass-sim1 bus 1 target 0 lun 2
da2: <Generic STORAGE DEVICE 0001> Removable Direct Access SCSI-0 device
                                   ^^^^^^^^^
da2: 40.000MB/s transfers
da2: Attempt to query device size failed: NOT READY, Medium not present

What if we kicked off a thread to run every 3 seconds that did a quick
poll of such devices and sent a devd notify if they arrived (i.e. medium
present)?  It wouldn't work for floppy drives, but we could make this
part of the da driver or something in usermode like devd itself calling
camcontrol?

-- 
Nate


More information about the freebsd-current mailing list