freebsd-skq/sys/cam/scsi
jdp 536960dbba Fix a bug that caused some /dev entries to continue to exist after
the underlying drive had been hot-unplugged from the system.  Here
is a specific example.  Filesystem code had opened /dev/da1s1e.
Subsequently, the drive was hot-unplugged.  This (correctly) caused
all of the associated /dev/da1* entries to be deleted.  When the
filesystem later realized that the drive was gone it closed the
device, reducing the write-access counts to 0 on the geom providers
for da1s1e, da1s1, and da1.  This caused geom to re-taste the
providers, resulting in the devices being created again.  When the
drive was hot-plugged back in, it resulted in duplicate /dev entries
for da1s1e, da1s1, and da1.

This fix adds a new disk_gone() function which is called by CAM when a
drive goes away.  It orphans all of the providers associated with the
drive, setting an error condition of ENXIO in each one.  In addition,
we prevent a re-taste on last close for writing if an error condition
has been set in the provider.

Sponsored by:   Isilon Systems
Reviewed by:    phk
MFC after:      1 week
2005-11-18 02:43:49 +00:00
..
scsi_all.c
scsi_all.h
scsi_cd.c
scsi_cd.h
scsi_ch.c
scsi_ch.h
scsi_da.c
scsi_da.h
scsi_dvcfg.h
scsi_iu.h
scsi_low_pisa.c
scsi_low_pisa.h
scsi_low.c
scsi_low.h
scsi_message.h
scsi_pass.c
scsi_pass.h
scsi_pt.c
scsi_pt.h
scsi_sa.c
scsi_sa.h
scsi_ses.c
scsi_ses.h
scsi_targ_bh.c
scsi_target.c
scsi_targetio.h