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.
format_config: code preening.
vinum_scandisk: If we find a partition in the first pass over a drive,
note the fact so we don't grab the compatibility partition as well.
Submitted-by: peter
Introduce BUF_STRATEGY(struct buf *, int flag) macro, and use it throughout.
please see comment in sys/conf.h about the flag argument.
Remove strategy argument from all the diskslice/label/bad144
implementations, it should be found from the dev_t.
Remove bogus and unused strategy1 routines.
Remove open/close arguments from dssize(). Pick them up from dev_t.
Remove unused and unfinished setgeom support from diskslice/label/bad144 code.
Tidy other comments.
open_drive: don't call set_drive_state if we decide to take it down.
This could help avoid some race conditions with the daemon.
init_drive: don't set the drive down, we'll let close_locked_drive do
that.
close_locked_drive: set drive state to down without calling
set_drive_state. This could help avoid some race conditions with the
daemon.
driveio: remove the function, it wasn't being used.
get_volume_label: remove volume dependencies so that we can return a
label for plexes and subdisks as well. What a kludge.
- %q -> %ll.
Fixed nearby errors not reported by gcc -Wformat on i386's:
- don't assume that the promotion of [u_]int64_t is [u_]quad_t.
- don't use signed formats for unsigned args.
will only accept partitions of type 'vinum'.
format_config: Use the new %q format option in kvprintf, thus getting
rid of some of the filthiest code I've written in a long time. Also
remove the lltoa() function.
With-great-thanks-to: peter
format_config: Accept the fact that a subdisk might not be attached to
a plex, and save the config correctly.
vinum_scandisk: Scan all slices on a drive with a Microsoft partition
table. Only look at the compatibility slice if nothing was found in
the Microsoft slices.
This change removes a frequently employed method of shooting
yourself in the foot: people would decide that the Vinum drives
belonged on their own slice, and they wouldn't be able to start the
subsystem after a reboot. Documentation updates to follow.
Correct race condition between caller and daemon.
Tripped-over-by: Zach Heilig <zach@uffdaonline.net>
Bernd Walter <ticso@cicely.de>
Niels Chr. Bank-Pedersen <ncbp@bank-pedersen.dk>
lockmgr locks. This commit should be functionally equivalent to the old
semantics. That is, all buffer locking is done with LK_EXCLUSIVE
requests. Changes to take advantage of LK_SHARED and LK_RECURSIVE will
be done in future commits.
Made a new (inline) function devsw(dev_t dev) and substituted it.
Changed to the BDEV variant to this format as well: bdevsw(dev_t dev)
DEVFS will eventually benefit from this change too.
Virtualize bdevsw[] from cdevsw. bdevsw() is now an (inline)
function.
Join CDEV_MODULE and BDEV_MODULE to DEV_MODULE (please pay attention
to the order of the cmaj/bmaj arguments!)
Join CDEV_DRIVER_MODULE and BDEV_DRIVER_MODULE to DEV_DRIVER_MODULE
(ditto!)
(Next step will be to convert all bdev dev_t's to cdev dev_t's
before they get to do any damage^H^H^H^H^H^Hwork in the kernel.)
If a drive has gone down and has dirty buffers associated with it,
we'll get a panic when we try to vn_close it. Check for this
situation and discard any buffers; they're toast anyway.
Only complain about usage count if DEBUG_WARNINGS is set.
check_drive:
Change parameter name from drivename to devicename.
Get the check for a referenced drive right.
If the partition isn't a vinum drive, set the last error to ENODEV.
vinum_scandisk:
Change parameter name from drivename [] to devicename [].
Fix a potential drive deadlock when saving config to a non-existent
drive.
Add debug calls to catch occasional deadlocks on drives. The problem
(above) is probably gone, but the debug checks remain for a while.
plexes_used and volumes_used. Now these fields are only informative,
and the <object>_allocated count is used for searches, etc. This also
required checking the object state before doing things with the
presumed object.
Problems-reported-by: Kiril Mitev <kiril@ideaglobal.com>
vinum_scandisk: increment drive use count when we find a good one.
Check for partition types FS_VINUM and FS_UNUSED. Accept both, but
complain about FS_UNUSED. At a later date, only FS_VINUM will be
accepted.
Threatened-since: over a year
pretends that each drive is 100 times as large as it really is. Not
for use at home.
Coalesce flags VINUM_DISKCONFIG and VINUM_READING_CONFIG. They did
essentially the same thing.
Recognize "referenced" drives by the lack of a slash in the device
name, not by a NUL character.
vinum_scandisk: return error indication (ENOENT if we can't find any
vinum drive, otherwise 0).
VINUM_SAVECONFIG: change parameters.
the same name. Silently return EEXIST if this happens.
vinum_scandisk: Collect drive numbers, not pointers, to avoid problems
of relocated drives.
Tripped-over-by: Bernd Walter <ticso@cicely.de>
vinum_scandisk: check not only drive error, but also drive state,
before accessing the drive.
drivecmp: Remove warning messages by Backing out overly constant
declarations in revision 1.9.
Remove #ifdefs for FreeBSD 2.c
Change from lkm to kld
correct type of `flags' in calls to set_drive_state.
set_drive_parms: handle anonymous drives correctly (remove them)
drive VOP functions: use the PID of the original opener to fool the
lock manager.
open_drive: be quiet about failures (they're normal when scanning the
partitions).
close_drive: lock drive before closing.
remove_drive: lock drive before deallocating.
read_drive_label: set drive up when all is OK
check_drive:
Complete rewrite. Offload most of the code to the new
vinum_scandisk
format_config:
use snprintf and %qd options to make much less emetic.
Remove old supporting functions.
vinum_scandisk:
Moved here from vinum.c
Almost complete rewrite, incorporating much of what was check_drive.
We still don't have a general way to find the drives on a system, so
get the user to supply the names via the `read' command. For each
device, try each possible compatibility slice name (there's a danger
of finding both /dev/da1h and /dev/da0s1h otherwise). Sort the
partitions found in reverse order of last update time and read them
in, setting the `update' parameter to parse_config and descendents.
save_config: rename to daemon_save_config, since the function is now
called by the daemon. Create a new function save_config which queues
the request with the daemon.
daemon_save_config: some mods to allow for the unfamiliar
environment.
kernel as a pseudo-device. The changes were:
- #ifdef DEBUG -> #ifdef VINUMDEBUG
- opt_vinum.h for holding above config variable
- Fixing up a few stray problems where DEBUG wasn't optional.
- config.c -> vinumconfig.c (there's already a config.o)
- Other *.c -> vinum*.c (wasn't strictly necessary, but done in case we end
up with something else conflicting later on and we might have to have yet
more repository copies of files).
- include file paths fixups.. (ie: get them all from the kernel tree
instead of partly from the kernel and partly from /usr/include/machine)
I've spoken with Greg about this.. I hope this doesn't mess him around
too much..