Commit Graph

340 Commits

Author SHA1 Message Date
Greg Lehey
7a598eabdd open_drive:
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.
2000-08-16 04:31:37 +00:00
Greg Lehey
6b45806f44 start_object: Set the revive length correctly. 2000-06-07 03:34:18 +00:00
Greg Lehey
fe8b826551 revive_block:
Fix several instances of breakage in RAID-5 revive code.

   Tidy up code.

parityops:
   Don't attempt to do anything if the plex is degraded or worse.

parityrebuild:
   Add comments.
   Perform transfers in correct length.
2000-06-07 03:33:09 +00:00
Greg Lehey
f68de48880 parity ops: Correctly recognize the end of the plex. Previously we
were running off the end and generating worrying but harmless messages
about parity errors that wouldn't go away.
2000-06-05 03:01:07 +00:00
Greg Lehey
b441812ca5 parityrebuild: write the parity block back to the correct subdisk.
HEADS UP: This fixes a serious data corruption bug when using the
userland command 'rebuildparity'.
2000-06-02 04:05:40 +00:00
Greg Lehey
cad166c211 Remove an incorrect comment, adjust white space. 2000-06-02 04:05:05 +00:00
Greg Lehey
fbbcd2e09c Add 'dumpconfig' keyword. 2000-06-02 04:04:31 +00:00
Greg Lehey
762166daca Remove a redundant statement. 2000-06-02 04:03:57 +00:00
Greg Lehey
c9180b28e7 open_drive: Recognize "wd" device type. This is going away, but it's
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.
2000-06-02 04:03:13 +00:00
Greg Lehey
d8c8f72dd9 give_sd_to_plex: Initialize sd->plexno correctly. Previously this was
only being done at plex creation time, and an attach would leave the
value uninitialized.
2000-06-02 04:02:15 +00:00
Greg Lehey
ef033a65c7 Don't forget 'stripe' and 'mirror' commands when we turn off
debugging.

Submitted-by: mdodd
2000-05-20 03:21:50 +00:00
Greg Lehey
de8ac2cfda Allow revive block sizes up to MAXPHYS.
Change struct plex to reflect changes to parity maintenance functions.
2000-05-11 07:27:27 +00:00
Greg Lehey
9b8f5e3c15 Rewrite parity maintenance functions.
revive_block: Correct bug introduced in revision 1.25 which caused
Add fields to vinum_ioctl_msgexcessive concurrent requests followed by
system death.
2000-05-11 07:26:33 +00:00
Greg Lehey
78f25040af Cosmetics. 2000-05-11 07:25:36 +00:00
Greg Lehey
a0f3ae4e0b vinum_scandisk: Correct error recovery if a configuration is munged. 2000-05-11 07:24:41 +00:00
Greg Lehey
ef554da97d Correct a comment. 2000-05-11 07:23:50 +00:00
Greg Lehey
fb4c9c3fa8 Change parity maintenance ioctls.
Add fields to vinum_ioctl_msg.
2000-05-11 07:23:16 +00:00
Greg Lehey
14d0b39e73 Change linkage to parity maintenance operations. 2000-05-11 07:22:18 +00:00
Poul-Henning Kamp
9626b608de Separate the struct bio related stuff out of <sys/buf.h> into
<sys/bio.h>.

<sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall
not be made a nested include according to bdes teachings on the
subject of nested includes.

Diskdrivers and similar stuff below specfs::strategy() should no
longer need to include <sys/buf.> unless they need caching of data.

Still a few bogus uses of struct buf to track down.

Repocopy by:    peter
2000-05-05 09:59:14 +00:00
Greg Lehey
a32d2d99c4 Increase the initial size of a RAID-5 plex lock table to 256 entries,
which seems to correspond better with what a busy plex needs.  This
may also help us avoid race conditions when expanding the table which
may have been contributing to the random corruption, panics and hangs
we've been seeing in RAID-5 plexes, particularly with ata drives.

Eagerly-awaited-by: sos
2000-05-04 07:48:40 +00:00
Greg Lehey
37669c86d4 requeststatus: Correct check for striped plex.
Submitted-by:	Matthew Reimer <mreimer@vpop.net>
2000-05-04 07:46:45 +00:00
Greg Lehey
16a3348dbf Don't hide bio structure behind macros like b_ioflags.
Get counting volume I/Os right.

launch_requests: Be macho, throw away the safety net and walk the
tightrope with no splbio().

Add some comments explaining the smoke and mirrors.

Remove some redundant braces.

sdio: Set the state of an accessed but down subdisk correctly.  This
appears to duplicate an earlier commit that I hadn't seen.
2000-05-04 07:44:23 +00:00
Greg Lehey
bf7dfe61ab expand_table: Avoid a race condition which may have been contributing
to the random corruption, panics and hangs we've been seeing in RAID-5
plexes, particularly with ata drives.

Eagerly-awaited-by: sos
2000-05-04 07:38:47 +00:00
Greg Lehey
9702452a12 lockrange: Avoid a race condition which was causing random corruption,
panics and hangs in RAID-5 plexes, particularly with ata drives.

Original-code-by:   Bernd Walter <ticso@cicely.de>
Eagerly-awaited-by: sos
2000-05-04 07:37:11 +00:00
Greg Lehey
46aebdeaea remove_drive: correctly obliterate the magic number.
Reported-by: 	phk
2000-05-04 07:35:03 +00:00
Greg Lehey
cf53cf132b Don't hide bio structure behind macros like b_ioflags.
Get counting volume I/Os right.

Count buffer sizes correctly for architectures where ints are not 32 bits.

complete_rqe: Move decrementing active count until after call to
complete_raid5_write, thus possibly avoiding a race condition.

Suggested-by:	      dillon

Rename user bp to ubp to avoid confusion.

Tidy up comments.
2000-05-04 07:33:40 +00:00
Greg Lehey
c626587322 Only wake up one process when we're done configuring.
Suggested-by:	msmith
2000-05-04 07:29:55 +00:00
Poul-Henning Kamp
87150cb06d s/biowait/bufwait/g
Prodded by: several.
2000-04-29 16:25:22 +00:00
Greg Lehey
b3fce61714 initsd(): Complete the intention of revision 1.25 and write init data to disk.
Sleuthwork-by:	alfred
2000-04-22 09:05:16 +00:00
Poul-Henning Kamp
ed6aff7387 Remove unneeded <sys/buf.h> includes.
Due to some interesting cpp tricks in lockmgr, the LINT kernel shrinks
by 924 bytes.
2000-04-18 15:15:39 +00:00
Poul-Henning Kamp
896402f402 Make vinum compile again using the "cast to buf" workaround.
Approved by:	grog
2000-04-16 07:18:08 +00:00
Greg Lehey
409875e46d open_drive: Add kludges for vn and md.
Submitted-by:	dillon (vn)
Requested-by:	phk (md)
2000-04-06 07:25:35 +00:00
Greg Lehey
6165ec2aad (finally!) add keywords raid4 and partition. 2000-04-06 07:13:44 +00:00
Greg Lehey
bd131be7d1 complete_rqe: Remove a race condition in RAID-4 and RAID-5 where a
request could be deallocated before the top half had finished
	issuing it.  The problem seems only to happen with IDE drives
	and vn devices, but theoretically it could happen with any
	drive.  This is the most important part of a possible series
	of fixes designed to remove race conditions without locking
	out interrupts for longer than absolutely necessary.

Reported-by:	       sos
Fix-supplied-by:       dillon
2000-04-06 03:03:31 +00:00
Poul-Henning Kamp
c244d2de43 Move B_ERROR flag to b_ioflags and call it BIO_ERROR.
(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.
2000-04-02 15:24:56 +00:00
Alfred Perlstein
4bb4aee894 repair half-Danish b.b_iocmd damage where writes/reads weren't getting
set properly in the struct buf with vinum:

  Fix locations where B_READ was cleared in the old code but
    b.b_iocmd wasn't set to BIO_WRITE
  Fix propogation of b_iocmd
  Correct comments to reflect reality
  Don't compare b_flags with BIO_READ, it's in b_iocmd.

Submitted by: Bernd Walter <ticso@cicely.de>
2000-03-26 23:06:12 +00:00
Alfred Perlstein
fe3f12377c rqe->b.b_flags |= B_READ; became
rqe->b.b_iocmd == BIO_READ instead of
rqe->b.b_iocmd = BIO_READ;
fix it.
2000-03-26 09:20:33 +00:00
Poul-Henning Kamp
b99c307a21 Rename the existing BUF_STRATEGY() to DEV_STRATEGY()
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.
2000-03-20 11:29:10 +00:00
Poul-Henning Kamp
21144e3bf1 Remove B_READ, B_WRITE and B_FREEBUF and replace them with a new
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.
2000-03-20 10:44:49 +00:00
Greg Lehey
b6c7afd32c sdio: If sd I/O fails because of an I/O error, set the sd state
correctly.

Reported-by:	phk
Approved-by:	jkh
2000-03-12 05:05:41 +00:00
Greg Lehey
e7a1a7d809 Fix a problem with device number parsing, which caused da10 to map to
da1, and da11 to da2.

Reported by:  Dan Nelson <dnelson@emsphone.com>

Implicitly-approved-by:	 jkh
2000-03-02 07:46:10 +00:00
Greg Lehey
2903a30d77 Set default revive block size to 64 kB.
Implicitly-sanctioned-by:	jkh
2000-03-01 07:25:46 +00:00
Greg Lehey
c6dd6dd0d0 Tidy up splbio() protection.
Tidy up locking.  Previously we were taking two locks for a parity
block, and only releasing one of them.

Implicitly-sanctioned-by:	jkh
2000-03-01 07:25:07 +00:00
Greg Lehey
bd685df802 vinumstrategy: Don't count the read and written bytes before they're
transferred, do it in complete_rqe instead.

launch_requests: Replace the inadvertently removed splbio() around the
                 main loop.  It may not be necessary, but the biggest
                 test of this stuff are IDE disks, which I'm not
                 using.

                 Remove throttling code, I'm pretty sure it's not
                 needed any more.

		 Don't set B_ORDERED, it's not necessary either.

Objected-to-by: alfred

build_rq_buffer: Don't lose the B_ORDERED bit, it still has some
		 residual meaning.  To do this right, Vinum needs to
		 look at the B_ORDERED bit and order the transfer
		 across all disks involved.  That's an exercise for
		 another day.

Objected-to-by: alfred

Implicitly-sanctioned-by:	jkh
2000-03-01 07:24:26 +00:00
Greg Lehey
38a54177c5 Add keywords raid4 and partition.
Implicitly-sanctioned-by:	jkh
2000-03-01 07:23:40 +00:00
Greg Lehey
7d6abd1af3 complete_rqe: Handle volume read stats here with other objects.
Previously vinumstrategy counted the bytes before they were hatched,
giving rise to strangenesses when a read failed.

Implicitly-sanctioned-by:	jkh
2000-03-01 07:23:13 +00:00
Greg Lehey
2cd253ad0f Replace the preprocessor variable names BDEV_MAJOR and CDEV_MAJOR with
VINUM_BDEV_MAJOR and VINUM_CDEV_MAJOR respectively.

Set DRIVE_MAXACTIVE and VINUM_MAXACTIVE to 30000, effectively
disabling the request limitation code.  This code was added as an
attempt to escape from a bug which seems to have gone away, and it's
very likely I'll remove the code Real Soon Now, but I don't want to do
it just yet.

struct drive: Remove references to vnode pointers, including debug
output.  Vinum now talks directly to the device driver.  Instead, add
a dev_t.

enum plexorg: Add an instance for RAID-4.

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.

Approved-by:  jkh
2000-02-29 06:17:26 +00:00
Greg Lehey
536aceefa2 plex_org: Add case for RAID-4.
Approved-by:  jkh
2000-02-29 06:16:44 +00:00
Greg Lehey
5823cef910 set_drive_state: update subdisk states more correctly.
set_sd_state: update the state of a subdisk in a multi-plex volume
more correctly.

update_plex_state: Bring the plex up correctly when the last subdisk
comes up.

checksdstate: Update comments.

vpstate: Don't return an "up" state on a degraded, unattached plex.

start_object: Return a sensible error message when trying to revive a
subdisk whose drive is down.  Previously it returned EBUSY.

Approved-by:  jkh
2000-02-29 06:16:06 +00:00
Greg Lehey
ea77bd8579 Fix horrible, embarrassing breakage which caused occasional panics and
data corruption.  It's a wonder it worked at all.

Led-on-the-right-path-by:  dillon

revive_block: Add treatment for RAID-4.

Add function parityrebuild, called by revive_block and parityops.

Approved-by:  jkh
2000-02-29 06:15:26 +00:00