Commit Graph

93 Commits

Author SHA1 Message Date
Greg Lehey
8d2eda6481 VINUM_STARTCONFIG:
Pass the 'data' parameter to start_config, which uses it as the
  parameter 'force.
1999-03-23 04:48:31 +00:00
Greg Lehey
dae797bc58 init_drive:
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
1999-03-23 04:48:05 +00:00
Greg Lehey
b555657ffa Change the declaration of start_config. 1999-03-23 04:47:33 +00:00
Greg Lehey
7c0052fe03 start_config:
Add a flag `force' (VF_FORCECONFIG) to force name changes of
  existing drives.
config_drive:
  If the drive already has a vinum label, and name doesn't match the
  specified drive, do it anyway if the 'force' flag is specified.
finish_config:
  Reset the `force' flag.

Continually-tripped-over-by:  Karl Pielorz <kpielorz@tdx.co.uk>

give_sd_to_drive:
  If the drive is down, take the subdisk down and don't try to fix
  things.

update_plex_config:
  Don't try to update the config parameters of a plex which isn't
  fully configured (state plex_init or plex_unallocated).

  Correctly calculate the amount to trim off a striped or RAID-5 plex
  whose size is not a multiple of the stripe size.
1999-03-23 04:47:09 +00:00
Greg Lehey
3c7e349bca Define two superdevices for vinum(8), depending on whether they are
compiled with or without debugging support.  This enables us to catch
(fatal) mismatches between the kernel and userland.

Coalesce flags VINUM_DISKCONFIG and VINUM_READING_CONFIG.  They did
essentially the same thing.

Add VINUM_BIGDRIVE for pretending we have macho hardware.
1999-03-19 07:19:52 +00:00
Greg Lehey
def602f62b VolState: return an enum volumestate, not a (non-existent) enum volstate.
Strangely, neither gcc nor EGCS noticed this bug.

Eagle-eyed by: arno@heho.snv.jussieu.fr (Arno J. Klaassen)
1999-03-19 07:17:05 +00:00
Greg Lehey
1f3cd6add9 Perform all of vinumstrategy at splbio. This doesn't appear
necessary, but might explain some weird problems that some people have
been getting.
1999-03-19 07:15:24 +00:00
Greg Lehey
82ca4fa74c Use microtime, not getmicrotime, to note the times in the malloc and
free histories.
1999-03-19 07:14:18 +00:00
Greg Lehey
6e6d6dd86e Add debug flags DEBUG_BIGDRIVE, designed for testing only. It
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.
1999-03-19 07:13:31 +00:00
Greg Lehey
9e89208b39 Coalesce flags VINUM_DISKCONFIG and VINUM_READING_CONFIG. They did
essentially the same thing.

Reset flags at the right point at the end of configuration.  The
previous code disabled configuration saving at the end.
1999-03-19 07:10:19 +00:00
Greg Lehey
66c4363288 free_vinum: don't change loop bounds for deleting drives while in the loop.
This solved a problem where 'vinum resetconfig' only reset half
	    the drives.

Reported-by:  Brad Knowles <blk@skynet.be>
	      Karl Pielorz <kpielorz@tdx.co.uk>

Change the super device.  We now have three super devices:

  1.  The normal superdevice used by vinum(8).
  2.  The superdevice used by vinum(8) when compiled with debug support.
  3.  The superdevice used by the daemon.

This method allows vinum(8) to determine debug mismatches.  Also check
correctly for the device type.  The old code did not check all bits of
the minor number.

  Reported-by: a cast of thousands, most recently by Brad Knowles
               <blk@skynet.be>.
1999-03-19 07:08:40 +00:00
Greg Lehey
6f70e1c542 Modify to compile with egcs.
Prodded-by: obrien
1999-03-18 23:26:22 +00:00
Greg Lehey
e21b9d8321 deallocrqg: deallocate the correct object, also check that the object
is really in the chain.
1999-03-14 04:04:23 +00:00
Greg Lehey
017944b921 Change prototype of vinum_inactive. 1999-03-13 07:46:34 +00:00
Greg Lehey
962113a4bf Remove opencount from vinum_conf and struct vol, and disk index from
struct vol.

Add time to struct mc, remove KVA crud.

Add debug flags DEBUG_EOFINFO and DEBUG_MEMFREE.
1999-03-13 07:40:52 +00:00
Greg Lehey
f9976b8861 Part of removing vol->opencount: now we just use a flag. 1999-03-13 07:39:17 +00:00
Greg Lehey
63052eb444 Add DEBUG_EOFINFO log messages. 1999-03-13 07:38:27 +00:00
Greg Lehey
cadf346d84 Remove antique crud.
MMalloc: save the time at which the request was granted, remove more
crud.

FFree: add a circular buffer of the last 64 Free requests if
DEBUG_MEMFREE is set.
1999-03-13 07:37:44 +00:00
Greg Lehey
5c6d2cb543 lock_drive: report on and recover from an obscure situation where the
daemon can deadlock against itself.
1999-03-13 07:35:40 +00:00
Greg Lehey
301851b630 VINUM_RESETCONFIG: do the reset even if the config is open (as it has
to be for us to issue the ioctl :-).  Also remove the opencount
parameter of the config, which just never worked.
1999-03-13 07:34:56 +00:00
Greg Lehey
1a049f96ab Don't frob vp->v_usecount, it scares the hell out of the driver under
certain circumstances.
1999-03-13 07:33:37 +00:00
Greg Lehey
b1356c97c6 Change the way of recognizing whether a plex was given to a volume
after the volume had been fully operational; involves a change in the
use of the VF_NEWBORN flag.  Now if you add a plex to a volume which
is up, the plex will be down and the subdisks stale.  You need to
explicitly start the subdisks, which copies data from the good
subdisks to the uninitialized ones.

Stumbled-over-by: Ludwig Pummer <ludwigp@bigfoot.com>

give_sd_to_drive:
   correct method to give the entire largest chunk of drive to the
   subdisk.  Now it's enough to specify a length, and vinum will give
   you as much as it can.  Not to be recommended except for empty
   drives.

   Correct a bogon which made vinum refuse to give the last sector of
   a drive to a subdisk.

   Last-reported-by: Ludwig Pummer <ludwigp@bigfoot.com>

Change %q formats to %ll before the former go away.  This doesn't make
much difference, since kernel kvprintf currently doesn't support
either, and the messages in question are just error messages.
1999-03-13 07:32:40 +00:00
Greg Lehey
e80e86a302 vinum_inactive: distinguish whether we care whether the config
is open or not.
1999-03-13 07:22:00 +00:00
Greg Lehey
b8d3ec490d Change SAVECONFIG ioctl: it now writes an int parameter. 1999-03-02 22:00:19 +00:00
Greg Lehey
587ce8d9ae Correct some diagrams
Remove pid field from struct sd, struct plex and struct volume

Add flags VF_STOPPING, VF_OPEN and VF_DAEMONOPEN
1999-03-02 06:58:09 +00:00
Greg Lehey
57f9112565 sizespec: allow negative values (which signal error conditions).
catch missing (NULL) parameters.
1999-03-02 06:57:48 +00:00
Greg Lehey
a11c3a2c73 Change the name of drive state "uninit" to "referenced": it only
occurs if we have a dangling pointer to a drive.
1999-03-02 06:57:30 +00:00
Greg Lehey
75fff3fead Change printf() calls to log() calls.
set_sd_state: allow stop command to stop a reborn subdisk.
1999-03-02 06:57:08 +00:00
Greg Lehey
72dec6f286 Change printf() calls to log() calls. 1999-03-02 06:56:39 +00:00
Greg Lehey
80035a4cf1 Add keywords "size", synonym for "length", and "max".
Check for NULL name parameters.
1999-03-02 06:56:05 +00:00
Greg Lehey
39ce6e429e Change printf() calls to log() calls.
expand_table: Zero out newly allocated tables
1999-03-02 06:55:44 +00:00
Greg Lehey
1e14d0037d Add keywords "size", synonym for "length", and "max". 1999-03-02 06:55:18 +00:00
Greg Lehey
33e00380bc Change printf() calls to log() calls.
Change VINUM_SAVECONFIG: it now requires a parameter.  0 means
"configuration updates are finished, please save", and 1 means "please
just save the config".  This second meaning is invoked by the new
"saveconfig" command to vinum(8).
1999-03-02 06:54:57 +00:00
Greg Lehey
f569eff522 Change printf() calls to log() calls.
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.
1999-03-02 06:54:30 +00:00
Greg Lehey
02dbb6666a New function return_drive_space
Add definitions of vinum_inactive and free_vinum, formerly local to
vinum.c

vinum_scandisk now returns int (error number)
1999-03-02 06:53:42 +00:00
Greg Lehey
e0e19a088b change printf() calls to log() calls.
Don't save config while we're reading it from disk.

Change the way we handle the daemon: if we can't communicate with it
for 1 second (which is possible), start a new one.  The daemon saves
its pid in daemonpid; on each iteration of the main loop the daemon
checks whether it's still in favour.  If not, it silently exits.
Also, when trying to communicate with the daemon, check daemonpid
first.  If it's set to 0, don't even try.
1999-03-02 06:53:15 +00:00
Greg Lehey
a0a8b3768e Change printf() calls to log() calls.
Rename the VF_KERNELOP to VF_DISKCONFIG and checkkernel () to
checkdiskconfig (), which better describes their function.

Disable configuration updates if we have an error reading in the
configuration.  This stops a "shoot-in-foot" problem where a mistake
can cause the configuration to be obliterated.

Tidy up some messages, which included superfluous \ns.

Recognize RAID-5 configuration information even in the non-RAID-5
version.  This fixes shoot-in-foot problems where starting the wrong
version of vinum would kill RAID-5 plexes.

Recognize drives that have been referenced, but for which no physical
location is known.  This is part of a modification which will
ultimately allow incrementally reading configurations.  Such drives
will have a device name "unknown".

New function return_drive_space () returns space to a drive.
Previously this was part of free_sd ().

give_sd_to_drive: don't do it if the subdisk needs more space than the
drive has available.

config_sd: if reading config from disk, accept plex offset, drive
offset and length specs of -1 to indicate error conditions.

parse_config: return ENOENT if the "read" command doesn't find any
drives.

remove_sd_entry: don't do it, even by force, if it's open.

If the size of a striped or RAID-5 plex is not an integral multiple of
the stripe size, trim the size until it is.

reinstate update_volume_config, which had atrophied, to recalculate
the size of a volume if a plex has shrunk due to stripe size
considerations.
1999-03-02 06:52:47 +00:00
Greg Lehey
571aa87170 Change printf() calls to log() calls.
vinumattach: Zero out tables after allocating them

Modify procedure at unload: if a vinum(8) has the superdev open, don't
close down.  If only the daemon has it open, send the daemon a stop
request and wait for it to close the superdev, then unload.

In order to do this, create a second superdev which is opened by the
daemon.  The open and close routines set a different bit in
vinum_conf.flags; otherwise the treatment is identical.

Remove opencount field in vol structure; replace by a flag bit, since
we can't count the number of opens.

Remove dead LKM grunge.
1999-03-02 06:52:11 +00:00
Greg Lehey
88c8f9c911 Change the name of drive state "uninit" to "referenced": it only
occurs if we have a dangling pointer to a drive.
1999-03-02 06:51:48 +00:00
Greg Lehey
9e0aa8e9b8 Correct some indentation
Implicitly-desired-by: bde

update_plex_state:  Handle empty RAID-5 plexes correctly
1999-02-11 06:44:46 +00:00
Greg Lehey
e8b3affb8e build_write_request: correct logic for handling writes to volumes with
failed plexes.

allocrqg: Remove dead code
1999-02-11 06:44:12 +00:00
Greg Lehey
8093cf90f1 check_drive: Make sure that we don't open two different drives with
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>
1999-02-11 06:43:15 +00:00
Greg Lehey
cc902735df In some cases, it's possible that I/O errors will cause the daemon to
time out on an operation.  Under these circumstances, vinum(8) will
automatically start another daemon.  Add a pid for the daemon, so that
an overtaken daemon will discover that it's no longer in favour, and
will crawl into a corner and die.
1999-02-11 06:42:39 +00:00
Greg Lehey
3f8d2678bc Remove some dead debug code
build_write_request: get the check for failure right
1999-02-05 05:09:22 +00:00
Greg Lehey
7f1050341c Change multiline comments to start with a lone /* and end with a */,
apparently in accordance with style(9).

Complained-about-by: bde
1999-01-29 01:17:54 +00:00
Greg Lehey
6fe15bff6e Change multiline comments to start with a lone /* and end with a */,
apparently in accordance with style(9).

Complained-about-by: bde

vinumopen: Change check for root user to a call to suser(9)
vinumclose: Remove check for root user.

Nitpicked-by: phk
1999-01-29 01:16:18 +00:00
Greg Lehey
bb1d6cfa3c build_write_request: only fail if all plexes are down, instead of if
any of them are down.

Reported-by: dg
1999-01-28 07:00:55 +00:00
Greg Lehey
a1c1b26d88 Fix some format breakage before bde finds out
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.
1999-01-28 06:59:27 +00:00
Matthew Dillon
b4e36adf1c Fix warnings preparing for -Wall -Wcast-qual
Also disable one usb module in LINT due to fatal compilation errors,
    temporary.
1999-01-27 20:09:21 +00:00
Greg Lehey
ac4cd383ca Correct #include in vinumioctl.c to compile correctly
without VINUMDEBUG

Submitted-by: peter
1999-01-24 05:14:39 +00:00