CVSROOT: /cvs Module name: src Changes by: matt...@cvs.openbsd.org 2011/05/31 11:35:35
Modified files: sys/scsi : sd.c cd.c sys/dev/ata : wd.c sys/dev : vnd.c ramdisk.c Log message: Change a few of the more common disk drivers (sd, cd, wd, rd, and vnd) to return EBUSY if the user tries to modify an open partition's offset or size. Only sadness can result if a user tries this, and rejecting it prevents a race between sdstart() and sdstrategy(). Curiously, there was already code in the kernel and in disklabel(8) to detect/handle this, but it was effectively disabled because the disk drivers always used something like "/* sc->sc_dk.dk_openmask */ 0", and this commented out code has existed since even r1.1 in NetBSD. I had no problems building a release and messing around with disklabel(8) for a bit with this diff. Canarying the more common MI disk drivers until we gain confidence that there aren't any regressions, then we can switch the remaining drivers. "I am surprised you got me convinced that this stuff is safe" deraadt@ ok krw@