Commit Graph

887 Commits

Author SHA1 Message Date
yamt 33d93c8dcc rf_ReconstructInPlace: don't leave a vnode open on errors.
fixes a part of PR/44972.
2011-05-28 00:53:04 +00:00
yamt c44faaeacb don't forget to destroy mutex. 2011-05-27 22:48:24 +00:00
buhrow 463102d28a Suggested to oster@ and approved via private e-mail as a help to
people who are getting reconstruction failures.
2011-05-24 07:33:41 +00:00
joerg f62ac60184 rf_panicbuf is already format, so don't pass it as format string to
panic()
2011-05-23 21:49:35 +00:00
mrg 8c36bb4b69 convert the main raidPtr mutex to a kmutex, and add a couple of cv's to
cover the old sleep/wakeup points for adding_hot_spare and waitForReconCond.
convert all remaining simple_lock's to kmutexes (they're not used or compiled
right now... even with all options enabled) and remove the support for them.

this leaves just a pair of tsleep()/wakeup() calls using old scheduling APIs.
2011-05-11 18:13:12 +00:00
mrg 30308cb715 convert regionBufferPool.mutex/cond and parityBufferPool.mutex/cond
to kmutex/cv.
2011-05-11 06:20:33 +00:00
mrg c57ca1d4fb convert parityLogPool.mutex to a kmutex. 2011-05-11 06:03:06 +00:00
mrg 662e58c786 convert regionInfo[regionID].mutex to a kmutex. 2011-05-11 05:14:07 +00:00
mrg 3dd617695f convert reintMutex to a kmutex. 2011-05-11 03:38:32 +00:00
mrg 32ab76b94a convert parityLogDiskQueue.mutex to a kmutex/cv.
XXX: some splbio() usage to clean up here
2011-05-11 03:23:26 +00:00
mrg 1c0dbcb69c convert RF_CommonLogData_s/RF_ReconMap_s mutex to a kmutex/cv. 2011-05-10 07:04:17 +00:00
mrg de9a772ed6 print "raidN: detached" when unconfiguring a raid device. 2011-05-10 05:08:51 +00:00
mrg a8b7159c16 convert stripelocks to kmutex. 2011-05-05 08:21:29 +00:00
mrg c4fdb0522f RF_BROADCAST_COND() is no more. 2011-05-05 08:21:09 +00:00
mrg 710e439b0e convert access_suspend_mutex to a kmutex/cv. 2011-05-05 07:12:58 +00:00
mrg ec1c557b57 convert the diskqueue mutex into a kmutex 2011-05-05 06:04:09 +00:00
mrg 50fe584a38 finish porting mcpair users to kmutex, and fix a couple of declarations
in rf_netbsdkintf.c.  fixes i386/conf/ALL build.
2011-05-05 04:20:51 +00:00
mrg 15d13d88fa convert the pssTable mutex into a kmutex/cv. 2011-05-03 08:18:43 +00:00
mrg 02d186e1e2 convert rb_mutex to a kmutex/cv. 2011-05-02 07:29:18 +00:00
mrg 05ec7078b4 use a unique wchan identifier for node_queue_cv than the old default. 2011-05-02 01:14:06 +00:00
mrg 70f1be105d re-apply the reverted previous, after fixing the missed wakeup:
convert eq_mutex to a kmutex/cv.
convert ltsleep() used for plain timeout into kpause().
2011-05-02 01:07:24 +00:00
mrg a0ccbf8109 rever the previous for now; it hangs reconstruction. 2011-05-02 00:39:37 +00:00
mrg 393bf63659 convert eq_mutex to a kmutex.
convert ltsleep() used for plain timeout into kpause().
2011-05-01 10:01:01 +00:00
mrg 44be382b63 convert rf_debug_mem_mutex to a kmutex, and fix RF_DEBUG_MEM option. 2011-05-01 06:49:43 +00:00
mrg 14b1a44c1b convert rf_tracing_mutex to a kmutex. 2011-05-01 06:22:54 +00:00
mrg 480f8c7b98 convert the (unused) rf_sparet_wait_mutex to a real mutex/cv. 2011-05-01 05:44:47 +00:00
mrg 14a4134463 convert mcpair to kmutex. 2011-05-01 01:09:05 +00:00
mrg 2b448af86b - convert rf_printf_mutex to a kmutex
- convert rf_rad_lock and the per-raid "cv" to per-raid kmutex/and real cv
- use rf_mutex_init() in places, and move it with the similar definitions
2011-04-30 01:44:36 +00:00
mrg 4f6a431a93 prepare to convert more raidframe old lock/sleep APIs to mutex/condvar:
- remove RF_DECLARE_EXTERN_MUTEX and RF_DECLARE_STATIC_MUTEX, the qualifier
  can be provided at the use point with the normal define
- rename the *LGMGR_MUTEX() macros to *mutex2() names, and add some more
  defines for use:
	rf_declare_mutex2()
	rf_declare_cond2()
	rf_lock_mutex2()
	rf_unlock_mutex2()
	rf_init_mutex2()
	rf_destroy_mutex2()
	rf_init_cond2()
	rf_destroy_cond2()
	rf_wait_cond2()
	rf_signal_cond2()
	rf_broadcast_cond2()
- use the new names for the configureMutex(), which previous used some combo
  of direct mutex* calls and macros
- convert the node_queue to use a mutex/cv combo
- in rf_ShutdownEngine() and DAGExecutionThread(), also signal the former from
  the latter when it is done and about to exit
- convert iodone_lock to use the new macros
2011-04-27 07:55:14 +00:00
mrg d9a6814d47 move the iodone setup and tear down into rf_engine.c. this fixes
"raidctl -u" and should also help the case where we fail to setup
a device part of the way through.
2011-04-23 22:22:46 +00:00
mrg b19ce40796 convert the iodone_lock to a mutex, and use a condvar for signalling.
this only handles the smallest use of old simple_lock/tsleep/wakeup
APIs inside raidframe, and it points out that cv(9)'s have only one
wait channel per cv, whereas each tsleep() caller can specify a
different wait channel.  this change removes the difference between
normal raidio and waiting for IO during shutdown.

i've tested this one 3 systems, ran atf, and had mlelstv and rmind
review the change.
2011-04-23 06:29:05 +00:00
mrg d85d9a6541 apply the fix_label hack to partitionSizeHi as well. it's needed there.
to do so, move the call to fix the label inside of rf_reasonable_label()
itself, so we can fix the partition sizes before calling
rf_component_label_partitionsize() itself.

fixes the failure mode where i had garbage not in numBlocksHi but in
partitionSizeHi, and the check against rf_component_label_partitionsize()
would fail and my raid would not auto-configure.
2011-03-18 23:53:26 +00:00
oster 01b117db0c Remove bogus RF_ASSERT that must have crept in by accident.
Thanks to Jan-Hinrich Fessel for reporting the issue.
2011-03-04 17:45:17 +00:00
riz 213d0d6de1 Always return at least one parity region. Fixes PR#44239.
Fix from oster@, code (such as it is) by me.
2011-03-01 22:51:14 +00:00
enami ec02ea412c Define accessors for number of blocks and partition size in the
component label and use them where appropriate.  Disscussed on tech-kern.
2011-02-19 07:11:09 +00:00
enami 3e0d3a901e Remove one of trailing whitespace which adds unnecessary difference
against netbsd-5 branch.
2011-02-13 06:17:35 +00:00
rmind 9b6bd2d968 Remove clause 3 (UCB advertising clause) from the University of Utah
copyright.  Confirmed by Mike Hibler, mike at cs.utah.edu - thanks!
Also, merge UCB and Utah copyright texts back into one, as they
originally were.

Extra verification by snj@.
2011-02-08 20:20:06 +00:00
christos b9d27ca2f7 PR/44340: Brian Buhrow: Raid sets containing wedges cannot be unconfigured
and reconfigured without a reboot.
2011-01-07 19:52:18 +00:00
christos 77f905cbb0 print the error code for writing parity. 2010-12-22 05:51:19 +00:00
mrg cad3665385 add a hack to fix up old labels that do not have zero's in numBlocksHi:
if the total sectors reported (via disklabel or otherwise) is smaller
than 2^32, but numBlocksHi is set, zero it out instead.

tested by myself and christos, should fix reports of weirdness seen.
2010-12-11 03:12:10 +00:00
christos 157bda91a0 PR/44207: Wolfgang.Stukenbrock:
memory-leak in raid-ioctl(RAIDFRAME_GET_COMPONENT_LAB
2010-12-08 16:18:06 +00:00
mrg 1812d0a239 apply my patch to support non-512K sector disks (at least, upto 16KB
sector disks..)  from my tech-kern post:


the following patch let's me access both 512 byte and 4K
sector disks at the same time, as long as they are in
separate raids.  the existing rf code assumes/enforces
this part, i just made it support other sets concurrently.

the main change is moving the parity bitmap to the sector
after the component label sector(s), instead of being
immediately after the label, which meant it was on the same
sector as the label for >1024 byte devices.

i'm a little annoyed at having to add a 2nd call to
getdisksize() to enable auto-configure to work, but i
don't see another way that wasn't much uglier.
2010-12-04 10:01:16 +00:00
dholland 8f6ed30d57 Introduce struct pathbuf. This is an abstraction to hold a pathname
and the metadata required to interpret it. Callers of namei must now
create a pathbuf and pass it to NDINIT (instead of a string and a
uio_seg), then destroy the pathbuf after the namei session is
complete.

Update all namei call sites accordingly. Add a pathbuf(9) man page and
update namei(9).

The pathbuf interface also now appears in a couple of related
additional places that were passing string/uio_seg pairs that were
later fed into NDINIT. Update other call sites accordingly.
2010-11-19 06:44:33 +00:00
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