Age | Commit message (Collapse) | Author |
|
that they're implemented consistently in bounds_check_with_label().
Also, per krw's request, change bounds_check_with_label() to return 0
if the checks succeed, and change the drivers to test == -1 instead of
<= 0. (Man page update to follow; intentionally omitting
arch/vax/mba/hp.c from this commit because it doesn't even build
currently and miod@ promises to kill it soon.)
ok krw@
|
|
that's ever used it, and it's long since been changed to use
DVACT_{QUIESCE,SUSPEND,RESUME} instead.
ok deraadt@, dlg@; miod@ also agreed with this idea when I brought it
up a few weeks ago
|
|
subr_disk.c. For now just the MI disk drivers.
ok deraadt@, krw@; jsing@ liked the approach too
|
|
be interrupted.
ok matthew
|
|
rather than using various wrappings. Convert vnd to using the sc_dk
rwlock instead of using one of its own.
ok matthew
|
|
wd(4). They haven't been used for 10+ years, since the drivers were
switched to use disk_lock() and disk_unlock() instead.
No binary change.
|
|
of silly flag twiddling code in various disk drivers.
ok deraadt@, miod@
N.B., users will need a -current disklabel(8) to be able to write new
disklabels to disk now.
|
|
never done anything in OpenBSD and just clutters disk drivers with
silly flag handling.
More cleanup to follow.
ok deraadt@, millert@; no objections krw@
|
|
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@
|
|
to be in the right address space.
help from matthew and krw
|
|
cd(4) did not believe any T_FIXED device was its responsibility.
Thus when a USB CD forgot to mention that it is T_REMOV, it appeared
as uk(4).
Make cd(4) accept even T_FIXED devices that claim to be T_CDROM or
T_WORM.
Noticed and fix tested by Rene Maroufi. Closes PR #6513.
|
|
automatic reading of disklabel on attach.
ok deraadt@ miod@ krw@
|
|
no point in keeping it around.
"i like this" thib@ (a while back); ok krw@ and oga@; reminder to
update the man page and tweaks jmc@
|
|
about the device rather than the contents of whichever disklabel
was read. Tweak whitespace in sd.c to make the code appearance
consistant.
|
|
to deactivate transactions we are currently doing.
ok dlg
|
|
same change as sd.c r1.212. matthew@ pointed out that cd(4) and
st(4) would need the same change.
|
|
rather than 'sc_params'. No change to .o file.
|
|
512 == DEV_BSIZE units and variable-sized physical device 'sectors'.
I hope this reduces confusion a bit more. No change to .o files.
ok for intent miod@, with tweak.
|
|
verifying that the resulting device is present on the disklist. This
avoids a race whereby the disk driver can be accessed as soon as the
softc has been allocated, but before the disk has completed
initialisation and has called disk_attach() (up until this point
dk_label is still a null pointer).
Cut cd(4), sd(4) and wd(4) across to disk_lookup(). All callers of
disk_attach() need to be tested and cut over in due course.
ok deraadt@ krw@
|
|
disk_attach() is called by the device driver. We will be building on
this shortly.
ok deraadt@ krw@
|
|
traversal code to suspend/resume
ok oga kettenis blambert
|
|
(which creates a potential race against cd detach)
discussed with krw and dlg seperately
|
|
rather than it being a pointer to something that needs to be allocated
at attach. since all these devices need a bufq to operate, it makes
sense to have it allocated as part of the softc and get bufq_init
to just initialise all its fields. it also gets rid of the possibility
that you wont be able to allocate the bufq struct during attach,
which is something you dont want to happen.
secondly, it consistently implements a split between wrapper functions
and the per discipline implementation of the bufq handlers. it
consistently does the locking in the wrappers rather than doing
half in the wrappers and the other half in the implementations.
it also consistently handles the outstanding bufq bq pointer in the
wrappers.
this hides most of the implementation inside kern_bufq.c. the only
stuff left in buf.h is for the bits each implementation needs to
put inside struct buf.
tested by thib@ krw@ and me
ok thib@ matthew@
no objection from krw@
|
|
There is a bit of concern that this workq can race against a detach
happening... any solutions from the peanut gallery?
|
|
cmd->opcode through the type casted command pointer rather than
through xs->cmd->opcode.
Requested by deraadt@; ok krw@.
|
|
ok miod@; "please go ahead" jsing@
|
|
xs->datalen and reset xs->data to NULL. This prevents a spurious
attempt to setup (dma map, etc) and possibly attempt data tranfser.
In line with what Linux and FreeBSD do as far as I can tell.
Reduces the delay before my DVD starts playing its movie.
Idea to also set xs->data to NULL from matthew@.
"No objection" matthew@
|
|
confusion. Fixes at least my usb DVD reader and The Blue Tick.
|
|
Symptoms noted by oga@. actual bug spotted by dlg@
|
|
-Wuninitialized.
Silly typo in my first diff noticed by oga@ and krw@; ok krw@
|
|
dvd_auth command. Fixes regression from scsi_scsi_cmd() removal.
ok dlg@
|
|
last bastardized sync and buf call through scsi_scsi_cmd(). Flatten
code to call scsi_xs_sync() directly for all commands.
Airplane typos shaken out by various.
ok dlg@ matthew@ deraadt@
|
|
to interpret sense errors. This is initialized to the basic
interpretation routine, and specific scsi drivers (sd/st/cd) can
replace this with their own. While here kill EJUSTRETURN dance and
make more specialized interpretation routines directly call the
basic routine if desired.
Fixes by matthew@ to my first diff. Most original work by dlg@.
ok matthew@ marco@ dlg@
|
|
ok miod@, krw@
|
|
to better handle detaching.
ok deraadt@
|
|
disk is now ready to handle I/O.
ok krw@ dlg@
|
|
ioctl requests, and dont pass the proc pointers around for any ioctl
requests in scsi land at all. neither were used, so trim the fat.
ok krw@ marco@
|
|
in the great re-write. If the scsi device *_interpret_sense()
function returns 0 that means there was no error.
Fixes restore(8) problems seen on certain tape drives.
Found and fix tested by Percey Piper. Suggestions from Matthew
Dempsky. Thanks!
ok dlg@
|
|
WAITING fix.
tested by sthen@ thib@ sobrado@ krw@ on atapiscsi, atascsi, and real scsi
ok krw@ thib@
|
|
Tested by myself and krw.
ok krw@
|
|
gets rid of #include <sys/dkio.h> in sys/ioctl.h and adds #include
<sys/dkio.h> to the places that actually want and use the disk
ioctls.
this became an issue when krw@'s X build failed when he was testing
a change to dkio.h.
tested by krw@
help from and ok miod@
|
|
identifier, allowing the disk to be identified without relying on the
device name.
ok deraadt@ krw@ beck@ marco@ todd@
|
|
other stuff ive been doing in here. everything that needs protection
inside the midlayer and the scsi device drivers (sd, cd, etc) uses
mutexes now.
this pushes splbio out of the midlayer. splbio is only taken before
biodone is called now.
ok beck@ marco@ krw@ deraadt@. theyre all terrified, but they all
say if we're going to do then now is the right stage of the dev
cycle.
|
|
ok.
Stops cdio(1) from printing bogus TOC info.
ok marco@ beck@
|
|
one place for easier debugging and maintenance. No intended functional
changes.
ok dlg@
|
|
ok dlg@
|
|
ie, dont clear the WAITING flag when restarting the xxstart loops.
|
|
done in sd. Make names consistant across all three.
ok dlg@ tested (cd) & ok beck@
|
|
st's queue manipulations. i.e. ensure b_actb is correctly updated as the
queue becomes empty or has an i/o requeued on it.
Tested on claudio@'s backup crashing box.
ok dlg@ beck@
|
|
by setting flags around the loop. there is a race which can prevent
necessary work being completed by any of the currently running instances
of xxstart.
the caveat with the removal of this code is because multiple xxstarts can
be running at the same time they can cause io reordering, but that is less
of a problem than no io.
found by and fix tested by claudio@
debugged with krw@ claudio@ beck@ deraadt@
|