HardenedBSD/sys/geom
Alexander Motin 3631c6382f Implement media change notification for DA and CD removable media devices.
It includes three parts:
 1) Modifications to CAM to detect media media changes and report them to
disk(9) layer. For modern SATA (and potentially UAS) devices it utilizes
Asynchronous Notification mechanism to receive events from hardware.
Active polling with TEST UNIT READY commands with 3 seconds period is used
for incapable hardware. After that both CD and DA drivers work the same way,
detecting two conditions: "NOT READY: Medium not present" after medium was
detected previously, and "UNIT ATTENTION: Not ready to ready change, medium
may have changed". First one reported to disk(9) as media removal, second
as media insert/change. To reliably receive second event new
AC_UNIT_ATTENTION async added to make UAs broadcasted to all periphs by
generic error handling code in cam_periph_error().
 2) Modifications to GEOM core to handle media remove and change events.
Media removal handled by spoiling all consumers attached to the provider.
Media change event also schedules provider retaste after spoiling to probe
new media. New flag G_CF_ORPHAN was added to consumers to reflect that
consumer is in process of destruction. It allows retaste to create new
geom instance of the same class, while previous one is still dying.
 3) Modifications to some GEOM classes: DEV -- to report media change
events to devd; VFS -- to handle spoiling same as orphan to prevent
accessing replaced media. PART class already handles spoiling alike to
orphan.

Reviewed by:	silence on geom@ and scsi@
Tested by:	avg
Sponsored by:	iXsystems, Inc. / PC-BSD
MFC after:	2 months
2012-07-29 11:51:48 +00:00
..
bde
cache
concat
eli
gate Reorder things in g_gate_create() so at the moment when g_new_geomf() 2012-07-28 16:30:50 +00:00
journal
label
linux_lvm
mirror
mountver Add trivial resize handling to gmountver(8). 2012-07-07 22:20:47 +00:00
multipath
nop Add trivial resize handling to gnop(8). 2012-07-07 22:22:13 +00:00
part Implement media change notification for DA and CD removable media devices. 2012-07-29 11:51:48 +00:00
raid
raid3
sched
shsec
stripe
uncompress
uzip
vinum
virstor
zero
geom_aes.c
geom_bsd_enc.c
geom_bsd.c
geom_ccd.c
geom_ctl.c
geom_ctl.h
geom_dev.c Implement media change notification for DA and CD removable media devices. 2012-07-29 11:51:48 +00:00
geom_disk.c Implement media change notification for DA and CD removable media devices. 2012-07-29 11:51:48 +00:00
geom_disk.h Implement media change notification for DA and CD removable media devices. 2012-07-29 11:51:48 +00:00
geom_dump.c
geom_event.c Implement media change notification for DA and CD removable media devices. 2012-07-29 11:51:48 +00:00
geom_flashmap.c
geom_fox.c
geom_int.h
geom_io.c Implement media change notification for DA and CD removable media devices. 2012-07-29 11:51:48 +00:00
geom_kern.c
geom_map.c
geom_mbr_enc.c
geom_mbr.c
geom_pc98_enc.c
geom_pc98.c
geom_redboot.c
geom_slice.c Implement media change notification for DA and CD removable media devices. 2012-07-29 11:51:48 +00:00
geom_slice.h
geom_subr.c Implement media change notification for DA and CD removable media devices. 2012-07-29 11:51:48 +00:00
geom_sunlabel_enc.c
geom_sunlabel.c
geom_vfs.c Implement media change notification for DA and CD removable media devices. 2012-07-29 11:51:48 +00:00
geom_vfs.h
geom_vol_ffs.c
geom.h Implement media change notification for DA and CD removable media devices. 2012-07-29 11:51:48 +00:00
notes