Commit Graph

57 Commits

Author SHA1 Message Date
Lukas Ertl
cf01c54cda Remove test for zero sectorsize when tasting. This check doesn't
seem to be necessary anymore, and it prevents tasting a valid drive
when booting with geom_vinum already loaded, since SCSI disks set their
sectorsize not until first opening them.
2005-03-07 19:58:58 +00:00
Lukas Ertl
9954331c23 Don't allow to synchronize a plex that is already sychronizing.
Reset the 'syncing' flag in case of errors, too.

Some cosmetics.
2005-03-04 16:43:40 +00:00
Lukas Ertl
d8688e1117 Correctly calculate what to do and how to retry a request to a plex when
the previous one failed and there are more than one plex in the volume.

This could have led to a flood of error messages on the console and
probably a deadlock in certain situations.
2005-02-23 14:59:14 +00:00
Lukas Ertl
3608f72533 In case of drive errors, don't close the associated consumer and
detach it, but instead let the geom wither away.

Bump copyright year.
2005-02-17 16:08:36 +00:00
Lukas Ertl
f9b7569c09 Only report state changes of subdisks and plexes when there's
really a state change.

Reword the info a bit.
2005-01-21 18:27:23 +00:00
Lukas Ertl
0d93122102 Don't initialize error with ENXIO as we might end up here when
the plex has no more consumers (e.g. orphaning).
2005-01-21 18:24:20 +00:00
Lukas Ertl
eba5b9dfce Rename synchronization and initialization threads and prefix them
with 'gv_' for consistency.
2005-01-19 14:49:26 +00:00
Lukas Ertl
f11c507c45 Although an object may already be known in the configuration, it's
worker thread may have been destroyed (e.g. during orphaning).

Make sure that objects get back their worker threads when they get a
new geom.
2005-01-19 14:08:16 +00:00
Lukas Ertl
3b6cdf438a Reset object flags after killing off an object's worker thread. 2005-01-19 13:57:09 +00:00
Warner Losh
fa521b0366 /* -> /*- for copyright notices, minor format tweaks as necessary 2005-01-06 18:27:30 +00:00
Lukas Ertl
997337fd20 Implement 'setstate' to allow setting the state of drives and subdisks
for debugging and emergency purposes.
2004-11-26 12:31:36 +00:00
Lukas Ertl
fb5885af37 Implement checkparity/rebuildparity. 2004-11-26 12:01:00 +00:00
Lukas Ertl
fb4e65d035 Move RAID5 offset calculation into a separate function to avoid
code duplication.
2004-11-15 13:04:55 +00:00
Lukas Ertl
94175098f1 Share gv_roughlength() between kernel and userland, as we will need it
there later.
2004-11-15 12:30:59 +00:00
Lukas Ertl
6c39d46363 Give each plex a separate queue where held back bios are put on.
This lowers the CPU usage of the worker thread and prevents a
possible live lock on non-SMP machines.

MFC candidate.
2004-10-26 21:01:42 +00:00
Lukas Ertl
4cb1b18827 Don't allow to create a drive that already exists. 2004-10-02 20:50:21 +00:00
Lukas Ertl
d9d3a74c87 Correctly skip the '/dev/' part when creating new drives and prefix
a drive's provider with '/dev/' when printing the config.

Reported by:  will@
2004-10-02 20:12:20 +00:00
Lukas Ertl
c3aadfb9d6 Make it possible to rebuild degraded RAID5 plexes. Note that it is
currently not possible to do this while the volume is mounted.

MFC in:  1 week
2004-09-30 12:57:35 +00:00
Lukas Ertl
b916fcec4d Single concat or striped plexes don't need no special initialization
if their subdisks are all available, so let them be brought up.
2004-09-18 18:03:20 +00:00
Lukas Ertl
67e3ab6ee5 Re-vamp how I/O is handled in volumes and plexes.
Analogous to the drive level, give each volume and plex a worker thread
that picks up and processes incoming and completed BIOs.

This should fix the data corruption issues that have come up a few
weeks ago and improve performance, especially of RAID5 plexes.

The volume level needs a little work, though.
2004-09-18 13:44:43 +00:00
Lukas Ertl
12653dec9d Give the DRIVE geom a worker thread that picks up incoming bios,
sends them down, and takes care of the finished bios.  This makes it
easier to handle I/O errors at drive level.
2004-09-13 21:01:36 +00:00
Lukas Ertl
fce2deb197 Rename gv_kill_thread() to gv_kill_plex_thread(), since there are more
threads to come.
2004-09-13 17:44:47 +00:00
Lukas Ertl
a0781b98f3 Save the config back to disk when a drive goes down. 2004-09-13 17:33:52 +00:00
Lukas Ertl
ea29a30466 Read a whole sector instead of GV_HDR_LEN, since a sector might be
bigger (i.e. on CD-ROMs).
2004-09-13 17:27:58 +00:00
Lukas Ertl
5bad268cdc Move config_new_drive() to the correct place and rename it to
gv_config_new_drive().
2004-08-27 21:32:18 +00:00
Lukas Ertl
4328802ce9 When attaching a consumer from a volume to a plex, check if the
volume already has a plex attached and adjust the access counts
of the new consumer accordingly.
2004-08-26 21:04:41 +00:00
Lukas Ertl
a3423d4c6f Compare the addresses of two RAID5 work packets directly instead
of the addresses of their related bios when locking one out, since
they could share a bio and this could lead to parity corruption.
2004-08-23 17:50:18 +00:00
Lukas Ertl
c4bdc6fc32 Implement the possibility to remove drives. 2004-08-22 17:07:55 +00:00
Lukas Ertl
45d0fdcda9 Add forgotten format specifier in a KASSERT and shut up the compiler.
Submitted by: Gavin Atkinson <gavin.atkinson@ury.york.ac.uk>
2004-08-22 13:34:24 +00:00
Lukas Ertl
83bfcb1092 A volume can be up if it has a degraded RAID5 plex. 2004-08-19 12:03:27 +00:00
Lukas Ertl
9a8bd51965 Pretty print some informational messages. 2004-08-18 20:43:56 +00:00
Lukas Ertl
d30f29867e Fix a stupid bug in the drive taste function: when checking if a
drive is known to the configuration check also if it already has a geom.
Without this check several needless geoms are created and valid
configuration data was overwritten.

This change obsoletes the need for a separate geom to taste an
offered provider and the consumer doesn't need to be opened with the
exclusive bit set.
2004-08-18 20:34:45 +00:00
Lukas Ertl
71fd4f60da Make informational output look less like an accident. 2004-08-14 09:56:17 +00:00
Lukas Ertl
92f49a969d If we kill the worklist thread of a RAID5 plex we can destroy
the worklist mutex at the same time, so move the mtx_destroy() call
to gv_kill_thread().
2004-08-10 20:51:48 +00:00
Lukas Ertl
ecffb8e64b Lock the topology before calling gv_parse_config, not afterwards. 2004-08-10 20:15:12 +00:00
Poul-Henning Kamp
5721c9c76a Tag all geom classes in the tree with a version number. 2004-08-08 07:57:53 +00:00
Lukas Ertl
4b017d0d93 Propagate size changes upwards. 2004-07-31 21:34:21 +00:00
Lukas Ertl
663e5a3311 Set the access counts of a subdisk correctly when attaching it
to a plex that already has subdisks.
2004-07-30 23:40:38 +00:00
Lukas Ertl
07c424cdaf Shut up the compiler and temporarily '#if 0' gv_destroy_geom(),
until we need it again.
2004-07-29 11:32:09 +00:00
Lukas Ertl
d8a720f9ec Save the vinum config back to disk after syncing two plexes. 2004-07-26 07:30:21 +00:00
Lukas Ertl
3242376072 There's a chance that the VINUMDRIVE class tastes before the
VINUM class, so let the VINUMDRIVE class parse the on-disk
configuration, too.
2004-07-25 23:01:09 +00:00
Lukas Ertl
c291a77678 Use a temporary geom when tasting vinumdrives and lock the 'real'
vinumdrive geom with an exclusive bit.  This should fix the problem
when underlying partitions overlap (i.e. the 'a' partition is at
the same offset as the 'c' partition).

Ideas borrowed from pjd@, quite a bit of testing by
Matthias Schuendehuette <msch@snafu.de>.
2004-07-24 22:26:40 +00:00
Lukas Ertl
6db345b90e Disable kldunloading of geom_vinum temporarily until I figured out
how to do it correctly.
2004-07-24 19:04:24 +00:00
Pawel Jakub Dawidek
1b39b2f671 g_clone_bio() can fail, be ready for this.
Approved by:	le
2004-07-05 13:24:22 +00:00
Lukas Ertl
865897c9f1 Mark a plex as 'newborn' when it is created. This is used to indicate
that new RAID5 plexes need to be initialized first.
2004-06-25 18:04:33 +00:00
Christian S.J. Peron
d7af790b0d Currently, if the drives specified for volume creation are
not active GEOM providers, it will result in a kernel panic.

If the GEOM provider or disk goes away before the volume
configuration data gets written to the disk, it will result
in another kernel panic.

o Make sure that the drives specified for volume creation
  are active GEOM providers.

o When writing out volume configuration data to associated drives,
  make sure that the GEOM provider is active, otherwise continue
  to the next drive in the volume.

Approved by:	le, bmilekic (mentor)
2004-06-24 02:40:34 +00:00
Lukas Ertl
3a1e11b485 Add a function to clean up RAID5 packets and use it when I/O has
finished or when building the complete packet fails.
2004-06-23 23:52:55 +00:00
Lukas Ertl
c3dba6d0e0 Remove two debugging printfs that are currently rather disturbing
than helpful.
2004-06-23 22:32:01 +00:00
Lukas Ertl
b950fbe67b Accept "sd len 0" and auto-size the subdisk correctly.
Spotted by: csjp
2004-06-23 21:15:55 +00:00
Lukas Ertl
1b699be2e1 No need to free the softc, because it wasn't allocated. 2004-06-22 18:13:43 +00:00