Age | Commit message (Collapse) | Author |
|
allocation is clearly spelled out as ptr = malloc(sizeof(*ptr), ...)
|
|
|
|
ok tedu@ deraadt@
|
|
|
|
after discussions with beck deraadt kettenis.
|
|
%u for u_int32_t d_secsize.
|
|
variables. Some random whitespace/knf repairs encountered on the way.
ok miod@ on inspection, feedback & more suggestions from millert@
|
|
test period; i think 3 years ago the last bugs fell out.
ok otto beck others
|
|
identify bad distrib scripts/tools.
ok deraadt@
|
|
Verified by deraadt@ to fix distrib/sgi/iso.
|
|
they do not get integer truncated on 64-bit machines.
ok matthew
|
|
32-bit on 32-bit architectures; we need off_t to support >4GB vnd(4)
images.
Discovered by, tested, and ok bluhm@
|
|
structs and calling vn_lock+VOP_READ/WRITE+VOP_UNLOCK.
|
|
xxstrategy() methods, and punt in validating it in vndread() and
vndwrite() (also like we do in other xx{read,write}() methods...).
|
|
use it instead.
|
|
anymore.
|
|
ok krw@
|
|
bounds_check_with_label().
|
|
the logic slightly and makes vnd(4) more like any other disk driver.
To avoid races, this means vndopen() can only set VNF_HAVELABEL if
dk_openmask == 0. Otherwise, it's possible for userspace to open
rvnd0c, call VNDIOCSET, open vnd0a, then while vndreaddisklabel() (via
vndstrategy) is waiting for VOP_READ() to finish, you could issue a
read or write on the still open rvnd0c and have VNF_HAVELABEL set but
the disklabel might be in a weird state.
Note that this makes VNF_HAVELABEL nicely analogous to sd(4)/cd(4)'s
SDEV_MEDIA_LOADED flag, which is handled similarly in
{sd,cd}{open,close,strategy}.
ok dlg@, krw@, deraadt@
|
|
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@
|
|
|
|
uses standard disk device numbering.
ok deraadt@
|
|
before closing the vnode, because VNDRW() checks for the VNF_READONLY
bit and the vnode layer doesn't like it when you close a read-only
vnode with FREAD|FWRITE.
ok deraadt@
|
|
subr_disk.c. For now just the MI disk drivers.
ok deraadt@, krw@; jsing@ liked the approach too
|
|
|
|
|
|
we have problems with instantiating new disks
ok matthew
|
|
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
|
|
|
|
|
|
ok matthew
|
|
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@
|
|
ok thib matthew
|
|
Spotted by matthew, verified by me.
|
|
this work later. Since the disk always has the same name (the different
between svnd and vnd went away), we don't need to do this late anymore.
Spotted with matthew.
|
|
is stupid (verified to be the case). Other flag bits might have lived
longer than they should as well, with unknown consequences.
Spotted with matthew, too.
|
|
we were probably only ever reading labels off vnd0. Oops.
Spotted by matthew
|
|
rw_lock and the device_ref
Discussed with thib and matthew
|
|
through config_attach()
ok matthew jsing
|
|
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@
|
|
``sure'' deraadt@
|
|
vnd devices nodes, which impliment svnd functionality -- that being the only
thing which vnd now supports. Confused? Don't worry, it is documented.
ok krw thib
|
|
|
|
both simple and non-simple mode. Restore this behaviour by removing the
openmask check.
|
|
|
|
|
|
this will treat vndX the same as svndX.
ok and gcc2 fixes from deraadt@
|
|
backing the vnd also has a bufq. So the buf is just passed
between the vnd bufq and the disk bufq (almost immediately).
Also see previous revision for more insight.
OK deraadt@, dlg@
|