CAM bugs found in DragonFly
Pedro Giffuni
pfgshield-freebsd at yahoo.com
Fri Jul 18 19:11:22 UTC 2008
(I sent some private mail about this but maybe it is of more general interest)
Hi;
Matt Dillon has been doing some robustness "don't try this at home" experiments with his new filesystem : basically unplugging the USB cord while making use of it.
Our code has diverged a lot but surely some of his enhancements would improve FreeBSD too:
http://leaf.dragonflybsd.org/mailarchive/commits/2008-07/msg00242.html
___________
dillon 2008/07/17 17:07:23 PDT
DragonFly src repository
Modified files:
sys/bus/cam cam_periph.c cam_periph.h cam_sim.c
cam_sim.h cam_xpt.c
sys/bus/cam/scsi scsi_cd.c scsi_ch.c scsi_da.c scsi_sa.c
scsi_target.c
Log:
Fix multiple bugs in CAM related devices which go away unexpectedly. This fixes numerous panics when pulling a USB mass media device in the midst of heavy I/O.
* The SIM lock was being unlocked via the periph->sim path after periph
was unheld. periph can become free and blow up the unlock, so get
the sim into a local variable first, then release periph.
* The code which waits for CCB completion needs to be a while loop, not
an if. It worked anyway, but wasn't very robust.
* Add CAM_SIM_DEREGISTERED to flag when a sim is undergoing deregistration.
* Beef up cam_dead_sim so it works more like a real sim.
* Properly install &cam_dead_sim in the device and periph structures
related to a SCSI bus, when deregistering the bus.
* Disallow the addition of new devices when deregistering a bus.
* NULL out periph->softc when freeing it.
Revision Changes Path
1.41 +13 -6 src/sys/bus/cam/cam_periph.c
1.12 +1 -1 src/sys/bus/cam/cam_periph.h
1.13 +18 -4 src/sys/bus/cam/cam_sim.c
1.9 +2 -0 src/sys/bus/cam/cam_sim.h
1.67 +96 -24 src/sys/bus/cam/cam_xpt.c
1.44 +5 -11 src/sys/bus/cam/scsi/scsi_cd.c
1.28 +4 -6 src/sys/bus/cam/scsi/scsi_ch.c
1.58 +4 -5 src/sys/bus/cam/scsi/scsi_da.c
1.36 +14 -18 src/sys/bus/cam/scsi/scsi_sa.c
1.20 +1 -1 src/sys/bus/cam/scsi/scsi_target.c
Posta, news, sport, oroscopo: tutto in una sola pagina.
Crea l'home page che piace a te!
www.yahoo.it/latuapagina
More information about the freebsd-scsi
mailing list