Commit Graph

844 Commits

Author SHA1 Message Date
uebayasi
8184d5dc03 Don't pull in the whole uvm(9) API to access only PAGE_SIZE and
some other constants.  These are provided by sys/param.h now.
2010-11-13 13:51:57 +00:00
mrg
4de66268a7 add support for >2TB raid devices.
- add two new members to the component label:
     u_int numBlocksHi
     u_int partitionSizeHi
  and store the top 32 bits of the real number of blocks and
  partition size.  modify rf_print_component_label(),
  rf_does_it_fit(), rf_AutoConfigureDisks() and
  rf_ReconstructFailedDiskBasic().

- call disk_blocksize() after disk_attach() [ from mlelstv ]

- shift the block number relative to DEV_BSHIFT in raidstart()
  and InitBP() so that accesses work for non 512-byte devices.
  [ from mlelstv ]

- update rf_getdisksize() to use the new getdisksize() [ from
  mlelstv.  this part needs a separate change for netbsd-5. ]


reviewed by: oster, christos and darrenr
2010-11-01 02:35:24 +00:00
drochner
11eacabe5a comment out an unused static function 2010-09-13 08:43:06 +00:00
chs
ae965fa232 only print the boot-time message if we're being verbose. 2010-08-08 18:25:14 +00:00
oster
69311d1aca Fill in param[3] for succedents for bad disk 'i' rather than '0'. Fortunately, nbad is never > 1, so this bug never showed up anywhere. Bug spotted by Jed Davis. Thanks! 2010-04-15 15:49:00 +00:00
jld
c943cf459a For RAID sets which have no parity (i.e., RAID level 0) and therefore can
never have a parity map, make the parity map ioctls fail with EINVAL.

This makes `raidctl -m` print a scary-looking error on such sets, which
is an improvement over the previous behavior of falsely claiming that
the parity map would be enabled on the next configuration.
2010-03-14 21:11:41 +00:00
oster
0134fbe7d0 Don't attempt to read or write component label stuff from/to 'dead disks'.
Update used spares with the correct parity map bits too.

Addresses PR#42904 by Louis Guillaume.  Fix confirmed by submitter.
Thanks!
2010-03-03 14:23:27 +00:00
jld
b95d388b8c When setting up a non-autoconfigured RAID set, fail a component if the
attempt to read its label fails.  OKed by oster@.
2010-03-01 21:10:26 +00:00
oster
e0010cd0df Don't merge a good parity map with random stuff in the event that the
first component is missing.  (Since the merging just OR's the maps,
this isn't that big of a deal, as it will just over-estimate the
amount of checking that needs to be done.)
2010-03-01 14:51:58 +00:00
dyoung
e3f50d6767 KNF: whitespace. 2009-12-01 01:03:54 +00:00
pooka
3c809c1925 include sys/param.h first, as is the convention 2009-11-26 07:35:39 +00:00
kenh
b4bb3813ef On the ARM platform, sys/param.h needs to be before sys/mutex.h, otherwise
sys/device.h will fail compilation (struct kmutex will not be defined
completely).
2009-11-26 01:23:56 +00:00
christos
a6560122c5 whitespace police 2009-11-21 21:57:47 +00:00
jld
f1a1ad338d Finally commit the RAIDframe parity map Summer Of Code project.
Drastically reduces the amount of time spent rewriting parity after an
unclean shutdown by keeping better track of which regions might have had
outstanding writes.  Enabled by default; can be disabled on a per-set
basis, or tuned, with the new raidctl(8) commands.

Discussed on tech-kern@ to a general air of approval; exhortations to
commit from mrg@, christos@, and others.

Thanks to Google for their sponsorship, oster@ for mentoring the
project, assorted developers for trying very hard to break it, and
probably more I'm forgetting.
2009-11-17 18:54:26 +00:00
dyoung
c6acecde0a Use deviter(9) instead of accessing alldevs directly. Compile-tested,
only.
2009-11-05 17:52:32 +00:00
pooka
2ceb2a6829 raidframe doesn't need sys/user.h (or at least one would hope so ;) 2009-10-13 22:46:28 +00:00
dyoung
60e16c204c Move the RAID shutdown to the raid(4) detachment routine, and use
config_detach(9) to shutdown a RAID.

Detach raid(4) units at shutdown.

Ok by oster@.
2009-07-23 21:58:06 +00:00
pooka
1e115afaf0 Attempt bailout if config_attach_pseudo() fails. Otherwise, a few
moments later, we'll take a fatal plunge because sc_dev is null.
2009-06-10 14:17:13 +00:00
haad
ea2ba1c77b Fix my previous commit. 2009-06-06 08:10:06 +00:00
haad
f5b48500f1 Add support for DIOCGDISKINFO to disk like device drivers. Change
partutil.c::getdiskinfo to use it to get disk geometry info.
Use DIOCGWEDGEINFO ioctl to get information about partition size, if disk
driver doesn't support it use old DIOCGDINFO. This patch adds support for
wedge like devices(lvm logical volumes, ZFS zvol partitions) to newfs and
other tools.

No objections on tech-userlevel@.
2009-06-05 21:52:31 +00:00
cegger
d16a259fe3 struct cfdata * -> cfdata_t, no functional changes intended. 2009-05-12 13:15:24 +00:00
oster
62f6e89480 Fix assignment of SUsPerPU and add SUsPerRU assignment. Reported by
and fix from Anthony Mallet in PR#41328.  Thanks!
2009-05-02 21:11:26 +00:00
dyoung
aaa0eb2937 Use device_t, cfdata_t, device_private(). 2009-05-01 20:43:41 +00:00
sborrill
5547ed1734 Switch various printfs from %ld and %d to PRIu64, etc. to be more consistent
about types (for instance uint32_t was being printed with %d).
2009-04-03 16:23:41 +00:00
oster
e021b3e6a7 Rework/simplify the disk queuing code. A bunch of this was still
holdovers from the simulator and would never be seen/used in-kernel.
2009-03-23 18:38:54 +00:00
cegger
df7f595ecd Ansify function definitions w/o arguments. Generated with sed. 2009-03-18 10:22:21 +00:00
cegger
b8817e4aed ansify function definitions 2009-03-15 17:14:40 +00:00
dsl
82357f6d42 ANSIfy another 1261 function definitions.
The only ones left in sys are beyond by sed script!
(or in sys/dist or sys/external)
Mostly they have function pointer parameters.
2009-03-14 21:04:01 +00:00
dsl
454af1c0e8 Change about 4500 of the K&R function definitions to ANSI ones.
There are still about 1600 left, but they have ',' or /* ... */
in the actual variable definitions - which my awk script doesn't handle.
There are also many that need () -> (void).
(The script does handle misordered arguments.)
2009-03-14 15:35:58 +00:00
ad
0fa70e9b6f 'boot -z' bogons 2009-03-14 11:08:28 +00:00
oster
b39a5d4daa Nuke a DIAGNOSTIC check that is no longer useful, even for DIAGNOSTIC. 2009-02-28 23:11:11 +00:00
oster
d7dbe2c6b8 It seems that some SCSI drivers can block while the spinlock on a given
disk queue is being held.  Work around this by dropping the lock before
bdev_strategy(), and re-grabbing the lock afterwards.  This is a
temporary measure until I get to gutting this queue locking code.

There has been some success with this in addressing PR#39993.
This patch is from Antti Kantee.  Thanks!
2009-02-28 22:02:17 +00:00
oster
f17e8d67c4 If we see a RF_RECON_WRITE_ERROR event we know a write has finished and
we need to account for that.  Failure to do so means we can end up
waiting forever for writes we think are outstanding, but which have
already completed.

Addresses the RAIDframe part of PR#40569.  Thanks to Matthias Scheler
for reporting the issue and verifying the fix.
2009-02-11 23:54:10 +00:00
oster
2240ff3c50 Nuke #define MAXNSTRIPES which is no longer useful. 2009-02-07 20:41:30 +00:00
oster
ce32c4d01e Be consistent with wd.c and don't complain loudly if the underlying
device doesn't support flushing the cache.  Fixes an issue (reported
privately) where ST39120A drives are not capable of flushing the
cache, and RAIDFrame was incessantly complaining.
2009-02-07 20:36:49 +00:00
christos
5dd7ffdfb6 add compat50 ioctls. 2009-01-18 16:37:19 +00:00
yamt
70de973662 g/c BUFQ_FOO() macros and use bufq_foo() directly. 2009-01-13 13:33:58 +00:00
oster
6d132f42c6 Implement DIOCCACHESYNC for RAIDframe too. 2009-01-11 21:58:41 +00:00
oster
73225b15a5 When unconfiguring an array where a reconstruct is in progress, abort
the reconstruct and wait for IOs to drain before pulling the plug.

Should fix the panic reported by der Mouse on tech-kern.
2008-12-20 17:04:51 +00:00
cegger
9b87d582bd kill MALLOC and FREE macros. 2008-12-17 20:51:31 +00:00
ad
54ef467580 _KERNEL_OPT 2008-11-18 14:29:55 +00:00
oster
f29979e70c Undo previous change to an #if 0. The code does belong to the
distributed sparing bits, but no-one has compile-tested the code.
Un-breaks the ALL build.
2008-09-28 16:17:17 +00:00
oster
6658196076 Cleanup some of the spare table stuff. It is not needed in the general
case, and is only needed for parity declustering with distributed
sparing.
2008-09-27 21:58:04 +00:00
oster
c4025116b9 Nuke unneeded printf(). Spotted by pooka@. 2008-09-23 21:36:35 +00:00
reinoud
f6a70673ba Mark a buffer busy in getnewbuf() when it came from the pool_cache since
its not on a free list.

Also change buf_init() to not automatically mark buffers `busy' since this
only makes sense for bufcache buffers.

Mark all buf_init'd buffers 'busy' on the places where they ought to be
flagged as such to not confuse the buffer cache.

Fixes PR 38923.
2008-06-17 14:53:10 +00:00
oster
bd09a31134 We don't care about md devices here. Fixes issue reported by Jukka Salmi
on current-users.  Thanks!
2008-06-16 16:58:26 +00:00
drochner
1f0a423884 use new "defpseudodev" where appropriate, and remove dummy interface
attribute definitions which were only to trick config(8)
2008-06-10 12:49:16 +00:00
oster
ea16b13f64 - Use bdev_strategy() instead of VOP_STRATEGY().
- Don't bother taking the v_interlock or bumping b_vp->v_numoutput --
there won't be any other writers for this bp, and so there's no point
doing this locking song'n'dance.

Patch from Juergen Hannken-Illjes.  Thanks!!!

Addresses PR#38856.  With this change I've been unable to
replicate the hard hangs.
2008-06-07 17:50:34 +00:00
oster
fcd3b36217 Add in a missing "bp->b_resid = bp->b_bcount" in the EIO case.
Spotted by Juergen Hannken-Illjes.  Thanks!
2008-05-20 00:29:54 +00:00
oster
396f9f4598 Re-work some of the guts of the reconstruction code.
Reconmap used to have one pointer for every reconstruction unit.  This
does not scale well in the land of 1TB disks, where some 100MB+ of
"status pointers" are required for typical configurations.  Convert
the reconstruction code to use a "sliding status window" which will
scale nicely regardless of the number of stripes/reconstruction units
in the RAID set.  Convert the main reconstruction loop to rebuild the
array in chunks rather than in one big lump.

As part of these changes, introduce a function to kick any waiters on
the head separation callback list, and use that in the main
reconstruction event queue to wake up the waiters if things have
stalled.  (I believe this may fix a race condition that could occur at
at least at the very end of a disk during reconstruction under heavy
IO load.)

Thanks to Brian Buhrow for all his help, support, and patience in
testing these changes.
2008-05-19 19:49:54 +00:00