Correctly handle additional disks without BIOS partition tables.
Previously, vinum_scandisk stopped scanning additional disks for
native partitions after any good partition was found. This applies
to all platforms, but was a particular problem on systems without
BIOS partition tables.
Submitted by: harti
and return NULL.
vinum_scandisk: Don't handle NULL device pointers.
Only look at compatibility partition for i386. This
is a kludge which should go away once I have adequate
documentation for the New World Order.
Together, these fixes remove occasional error messages about
non-existent drives. They may also fix a number of problems that have
been reported without a PR.
PRs: None
Change config format slightly to save plex preferences correctly.
vinum_scandisk: reinitialise volatile pointer after function call.
This is the "deafc0de" bug.
Approved by: re (scottl)
with it.
Finally implement read policies. The previous "implementation" didn't
work because it referred to plexes which were almost invariably when
referred to. Instead, deprecate the "prefer" keyword for volumes
(though it's still there for the moment) and add a keyword "preferred"
to the plex definition. The relationship is like this:
Old:
vol foo ... prefer foo.p3
New:
plex foo.p3 volume foo preferred
print_config: Print "preferred" where appropriate.
No longer print "prefer" on volume config entries.
just return it. Don't try to reinitialize it. This should fix a
number of inconsistencies that some people encountered with "vinum
start".
PR: 30588
PR: 43475
init_drive: Rephrase error message text.
Remove dead code (inside #if 0).
Change name of find_drive_by_dev to the more descriptive
find_drive_by_name.
Tidy up comments.
similar patch has been in 4.x for a while, but is more hacky there.)
For this to work, vinum has to be loaded early (e. g. from
boot/loader), for obvious reasons. If the kernel env variable
(aka. loader variable) "vinum.autostart" is set, vinum then asks the
sysctl kern.disks for all available disks in the system, and scans
them for possible vinum headers.
For statically compiled kernels, this behaviour can be obtained even
without boot/loader by using "options VINUM_AUTOSTART" (though this is
not the recommended way).
Alternatively, the 4.x way to specify "vinum.drives" is also supported.
No further hacks (like the 4.x "vinum.root" variable) are needed,
since in 5.x, mountroot() asks back at the drivers to have them
resolve the name of the root FS into a dev_t (using the dev_clone
eventhandler).
(The MFC reminder below is for a partial MFC for vinum.autostart, the
rest is already there in 4.x.)
Timed out on: grog
MFC after: 2 weeks
(1) Use namei() and devfs to discover devices rather than a hard-coded
MAKEDEV implementation. Once rootfs is in place, this will allow
Vinum to be used for the root file system partition.
(2) Pass FREAD to device opens so that GEOM will return sector size
rather than an error on attempts to read label data.
(3) Avoid clobbering return values from close_drive() and masking this
failure, resulting in a later divide by zero due to not having
updated the Vinum-cached sector size.
(4) Ignore failures from DIOCWLABEL as that appears not to be required
in the GEOM environment.
We've done testing in simple Vinum environments, but those with more
complex environments might want to give this a spin in DP2 and make
sure everything is up to speed.
Fixes in collaboration with: iedowse
Reviewed by: grog
DIOCGMEDIASIZE instead.
The partition type check has been XXX'ed out since we cannot expect
that a BSD disklabel with a type field be available on all platforms.
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.
Sorry john! (your next MFC will be a doosie!)
Reviewed by: peter@freebsd.org, dillon@freebsd.org
X-MFC after: ha ha ha ha
Requested by: bde
Add retryerrors keyword.
vinum_scandisk: Print a different message if an inadvertent start
command did not find any additional drives. The previous message "no
drives found" confused and worried many people.
MFS:
vinum_open: Recognize Mylex devices as storage devices.
not yet been caught), don't save the config with a null drive
name (which causes the drive to be renamed "plex" on the next
start), put in the text "*invalid*" instead.
This is damage control, not a fix.
Experienced by: peter
Break some long format strings so that they fit in style(9)-sized
lines.
Remove some "outdentation".
This should eliminate one case of foot shooting .
vinum_scandisk: If a drive in the partition table is downed, free it.
This duplicates code for the compatibility partition, which for some
reason was omitted here.
Requested by: Bernd Walter <ticso@cicely8.cicely.de>
Cor Bosman <cor@xs4all.net>
Kai Storbeck <kai@xs4all.net>
Joe Greco <jgreco@ns.sol.net>
Add support for Compaq SMART-2 RAID (idad) as storage
device for Vinum subdisks.
Reported by: Aaron Hill <hillaa@hotmail.com>
Add support for AMD RAID controllers as "disks".
Requested-by: Marius Bendiksen <mbendiks@eunet.no>
Remove potential panic when attempting to open non-existent drivers.
init_drive: Return error codes correctly. Previously it would
occasionally return 0. The error was redetected
elsewhere, but this was causing a number of confusing
error messages.
not gone yet.
format_config: print correct text when a volume has a preferred plex.
This is still broken, but not quite as badly.
Reported-by: Phil Regnauld <regnauld@ftf.net>
Change a rather silly comment.
(Much of this done by script)
Move B_ORDERED flag to b_ioflags and call it BIO_ORDERED.
Move b_pblkno and b_iodone_chain to struct bio while we transition, they
will be obsoleted once bio structs chain/stack.
Add bio_queue field for struct bio aware disksort.
Address a lot of stylistic issues brought up by bde.
substitute BUF_WRITE(foo) for VOP_BWRITE(foo->b_vp, foo)
substitute BUF_STRATEGY(foo) for VOP_STRATEGY(foo->b_vp, foo)
This patch is machine generated except for the ccd.c and buf.h parts.
field in struct buf: b_iocmd. The b_iocmd is enforced to have
exactly one bit set.
B_WRITE was bogusly defined as zero giving rise to obvious coding
mistakes.
Also eliminate the redundant struct buf flag B_CALL, it can just
as efficiently be done by comparing b_iodone to NULL.
Should you get a panic or drop into the debugger, complaining about
"b_iocmd", don't continue. It is likely to write on your disk
where it should have been reading.
This change is a step in the direction towards a stackable BIO capability.
A lot of this patch were machine generated (Thanks to style(9) compliance!)
Vinum users: Greg has not had time to test this yet, be careful.
vn_open. This is necessary in order to be able to open drives before
the root file system is mounted. This also involves restructuring the
drive struct, which no longer contains a vnode pointer. Instead,
open_drive sets an open flag. It's a horrible kludge, and I'll gladly
borrow a Danish axe and hack it in little pieces when devfs comes.
read_drive, write_drive, drive_io_done: Replace with driveio. The
function names are now macros.
driveio: Fix horrible, embarrassing breakage which was the reason why
read_drive and write_drive existed in the first place.
Code-torn-to-shreds-by: dillon
format_config: Don't save config of objects in referenced state. They
get rebuilt automatically.
Change checks for striped or RAID-5 plexes to a macro 'isstriped',
which now also includes RAID-4.
Change checks for RAID-5 plexes to a macro 'isparity', which now also
includes RAID-4.
Replace the preprocessor variable names BDEV_MAJOR and CDEV_MAJOR with
VINUM_BDEV_MAJOR and VINUM_CDEV_MAJOR respectively.
vinum_scandisk: Don't free memory twice on error, once is enough.
Approved-by: jkh
on alpha.
Submitted-by: Bernd Walter <ticso@cicely.de>
Remove #include of vm/vm_zone.h.
Submitted-by: Someone, I'm sure, but I seem to have lost the
attribution. Sorry.
Get the check for disk devices correct, and return an appropriate
message if the check fails.
and then doing it itself, resulting in a panic downed drives.
Sleuth-work-by: Christopher Masto <chris@netmonger.net>
Remove dummy function initsd, which is now (implemented) in
vinumrevive.c
vinum_scandisk: Check that a drive is up before reading from it. This
is probably excessive paranoia.
ourselves. This breaks a vicious circle which caused
vinum to dereference a null vp if device nodes were
missing.
Reported-by: Brad Chisholm <sasblc@unx.sas.com>
Alec Wolman <wolman@cs.washington.edu>
check_drive: Don't take a drive down if it's only referenced.
read_drive: Remove unused variable.