|
Description
|
If a caller sends the DKIOCSTATE ioctl() to a sd(7D) device, then
we don't actually correctly detect the DKIO_DEV_GONE state. The reason
is that the un_mediastate is only updated in response to an explicit
test packet. But in sd_check_media(), we never send out the test
packet if DKIO_NONE is specified:
/* is there anything to do? */
if (state == un->un_mediastate || un->un_mediastate == DKIO_NONE) {
This causes DKIO_NONE to return DKIO_INSERTED without noticing that the
drive has been removed. Rather than force an explicit test packet, we
should notice CMD_DEV_GONE in sdintr() and proactively update un_mediastate.
|