HardenedBSD/sys
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
..
amd64 Forcibly shut up clang warning about NULL pointer dereference. 2012-07-23 19:16:31 +00:00
arm Commit the dci (gadget) support to the one ATMEL kernel config where 2012-07-29 04:28:29 +00:00
boot Pull the tier-2 card and change the sparc64 ZFS loader to no longer probe 2012-07-27 18:23:11 +00:00
bsm
cam Implement media change notification for DA and CD removable media devices. 2012-07-29 11:51:48 +00:00
cddl Make ZVOL resizing ('zfs set volsize') properly resize the GEOM provider. 2012-07-20 16:56:34 +00:00
compat Cosmetics: define FREEBSD32_MINUSER and AOUT32_MINUSER for struct 2012-07-22 13:41:45 +00:00
conf Refactor enclosure manegement support in ahci(4). Move it out into separate 2012-07-26 13:44:48 +00:00
contrib Update to latest git version of dtc to get new dtsv2 support, 2012-07-24 16:29:33 +00:00
crypto
ddb
dev Shuffle the rate control call to be consistent with non-aggregate TX. 2012-07-29 09:23:32 +00:00
fs Use NULL instead of 0 for pointers 2012-07-22 15:40:31 +00:00
gdb
geom Implement media change notification for DA and CD removable media devices. 2012-07-29 11:51:48 +00:00
gnu/fs
i386 MFamd64 r238623: 2012-07-26 09:11:37 +00:00
ia64
isa
kern Add F_DUP2FD_CLOEXEC. Apparently Solaris 11 already did this. 2012-07-27 10:41:10 +00:00
kgssapi
libkern
mips Merge FreeBSD/beri Perforce change @211945 to head: 2012-07-28 11:09:03 +00:00
modules Refactor enclosure manegement support in ahci(4). Move it out into separate 2012-07-26 13:44:48 +00:00
net Hardcode the loopback rx/tx checkum options for IPv6 to on without 2012-07-28 20:31:39 +00:00
net80211
netatalk
netgraph Add version so others can depend on this module 2012-07-27 13:57:28 +00:00
netinet Fix the sctp_sockstore union such that userland programs don't depend 2012-07-26 08:10:29 +00:00
netinet6 For consistency put the IPsec comment iside the #fidef section. 2012-07-29 00:45:24 +00:00
netipsec Fix a bug introduced in r221129 that leads to a panic wen using bundled 2012-07-22 17:46:05 +00:00
netipx
netnatm
netncp
netsmb Change a duplicated check to clarify that we really want to set a 2012-07-10 21:02:59 +00:00
nfs
nfsclient
nfsserver
nlm
ofed
opencrypto
pc98 Partially revert r217515 so that the mem_range_softc variable is always 2012-07-09 20:42:08 +00:00
pci
powerpc Avoid recursion on the pvh global lock in the aim oea pmap. 2012-07-10 22:10:21 +00:00
rpc
security
sparc64
sys Add F_DUP2FD_CLOEXEC. Apparently Solaris 11 already did this. 2012-07-27 10:41:10 +00:00
teken
tools
ufs Use NULL instead of 0 for pointers 2012-07-22 15:40:31 +00:00
vm Do not requeue held page or page for which locking failed, just leave 2012-07-26 09:06:48 +00:00
x86 Add rmb() to tsc_read_##x to enforce serialization of rdtsc captures. 2012-07-24 22:10:11 +00:00
xdr
xen
Makefile