Commit Graph

1145 Commits

Author SHA1 Message Date
NeilBrown 40bc78f5cd Release mdadm-3.1.1
bugfix over 3.1, but changes to some significant defaults.
2009-11-19 16:10:58 +11:00
NeilBrown c588115aa5 Merge branch 'master' into devel-3.1 2009-11-19 16:10:07 +11:00
NeilBrown cd77ac4eaf Assemble: fix testing of 'verbose' flag.
The 'verbose' flag can be negative, meaning 'quiet'.
So never check for != 0.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-11-19 15:55:59 +11:00
NeilBrown a0962fe959 Create: warn when creating a raid1 using default metadata.
As a some/most bootloaders don't understand md metadata, it might
be difficult to boot off an array with the default 1.0 metadata.
So if this is used for a RAID1, ask for confirmation.

Signed-Off-By: NeilBrown <neilb@suse.de>
2009-11-19 15:54:49 +11:00
NeilBrown 751fd6c093 Don't silently map --re-add to --add
As --add can destroy important data on a disk, and
--re-add is not suppose to, it is wrong to silently
try --add if --re-add fails.
So print a message and abort instead.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-11-17 13:15:34 +11:00
NeilBrown b42f577a0d Improve error messages when metadata handler does not support request.
->validate_geometry is called to validate overall parameters,
and to validate each individual device.
If it ever fails, it needs to report the reason, as common code
cannot possible know.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-11-17 13:15:34 +11:00
NeilBrown b8ab2a50ab Set default bitmap-chunksize for internal bitmaps to at least 64Meg
A small bitmap-chunksize hurts performance without helping
resync speed much - particularly on internal bitmaps.

So set the default to at least 64Meg.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-11-17 13:15:34 +11:00
NeilBrown ff94fb86fd Grow: various fixes to recent breakages.
- I forgot to write the send backup-super-block on spares.
- I wasn't adding the data_offset to an offset

Signed-off-by: NeilBrown <neilb@suse.de>
2009-11-17 13:15:33 +11:00
NeilBrown 7d5c3964cc Change default metadata from 0.90 to 1.1
1.1 is more flexible in a number of ways and is safer.
0.90 is still fully supported.
1.0 should possibly be used for RAID1 arrays that you
want to boot off, depending on your boot loader.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-11-17 13:15:32 +11:00
NeilBrown 5f175898de Increase default chunk size to 512K
This seems more appropriate for current (and recent) model drives than
64K.
64K is still the default for '--build' as changing that could corrupt
data.
64K is also the default rounding for 'linear' on kernels older than
2.6.16.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-11-17 13:08:55 +11:00
NeilBrown df0d4ea04e Replace all relevant occurrences of -4 with LEVEL_MULTIPATH
Also -1 -> LEVEL_LINEAR.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-11-17 12:31:12 +11:00
NeilBrown 672ca1b727 Assemble/super0: allow non-in-sync devices to be assembled without complaint.
Other metadata formats already did not worry about whether 'sync' was
missing or not.  super0 needs that now, but only for 0.91 metadata
that is undergoing reshape.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-11-17 12:31:10 +11:00
NeilBrown f22385f982 Assemble: include ACTIVE but not in-sync devices as non-spares.
Previously such things did not exist: ACTIVE and SYNC were either both
set or both clear.   Recent changes with reshape means that a device
can be ACTIVE but not yet fully in-sync, so they need to be handled
and included in the array as active devices.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-11-17 12:30:54 +11:00
NeilBrown 14e5b4d72b Grow: data_offset is in sectors, offsets[] is in bytes - convert
Another missed sectors->bytes conversion.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-11-16 11:06:44 +11:00
NeilBrown 9ce510be9c Grow: do not allow size changes with other changes.
A change the reduces the size of an array always happens
before any other change.  So it can cause data to be lost.
By themselves these changes are reversible.  But once another
change has started, the data would be permanently lost.
So recommend data integrity be checked between a size change
and any other change.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-11-06 17:26:47 +11:00
NeilBrown b5ea446ae7 Grow: goto release rather than just return
otherwise we exit with the array frozen.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-11-06 15:22:14 +11:00
NeilBrown d2505cff5a Grow: restrict to 2.6.32
2.6.31 has a bug which can lead to unsafe reshaping.
So only allow a reshape with 2.6.32.
When the required fixed get into 2.6.31.y, this can be relaxed
slightly

Signed-off-by: NeilBrown <neilb@suse.de>
2009-11-06 15:19:39 +11:00
NeilBrown 1b13faf757 Grow: use large block count and make sure stripe cache can hold it.
The bigger the backup is, the fast it goes to some extend.

16Meg is fairly arbitrary

Signed-off-by: NeilBrown <neilb@suse.de>
2009-11-06 14:48:10 +11:00
NeilBrown e380d3be42 Grow: get component_size before using it.
We were using ->component_size while it hadn't been set.
This effectively meant that 'blocks' wasn't multiplied by
16 and reshape was even slower than it should have been.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-11-06 14:18:49 +11:00
NeilBrown d44453876e Grow: handle array going degraded during reshape.
If an array goes degraded during reshape, we need to
adjust the devices we read from so as not to back up
stale data.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-11-06 13:56:05 +11:00
NeilBrown 92dcdf7c01 Grow: restore backup to proper location.
The 'arraystart' is in sectors while restore_stripes requires
bytes, so we need a conversion.

Without this, backups get restored to the wrong offset.

Reported-by: "KueiHuan Chen" <kueihuan.chen@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2009-11-06 13:38:43 +11:00
Marco d'Itri 5bac0443e0 vol_id was removed by the udev upstream maintainer in May 2009.
One should use
  /sbin/blkid -o udev -p ...
(from util-linux >> 2.16) instead of
  vol_id --export ...

Author: Marco d'Itri <md@linux.it>
Bug-Debian: http://bugs.debian.org/541884
Reviewed-by: martin f. krafft <madduck@debian.org>
Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-29 10:14:43 +11:00
NeilBrown d1302dd801 Remove bogus warnings from man page.
LANG=C man --warnings -l mdadm.8 > /dev/null

complains that '.XX' is an invalid macro.
This is not correct.  The sequence

   .ig XX
   anything can go here
   .XX

is correct and is ignored (see 'info groff' and the 'ig' index
entry).

However the same can be achieved with
   .ig
   anything can go there
   ..

and this produces no warnings, so use that instead.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-29 10:11:01 +11:00
NeilBrown dab54dcb04 Detail: report new-layout for RAID6 arrays
We were only reporting it for RAID5 and RAID10.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-29 10:02:24 +11:00
NeilBrown 7f0066ba71 Release 3.1
New functionality in --grow.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-22 14:07:05 +11:00
NeilBrown d6d5656bd5 Merge branch 'master' into devel-3.1 2009-10-22 13:57:54 +11:00
NeilBrown d28c1a7383 Release 3.0.3
Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-22 12:05:22 +11:00
NeilBrown 4a997737a1 Merge branch 'master' into devel-3.1 2009-10-22 11:13:13 +11:00
NeilBrown 0eb26465c0 Free some malloced memory that wasn't being freed.
As mdadm is normally a short-lived program it isn't always necessary
to free memory that was allocated, as the 'exit()' call will
automatically free everything.  But it is more obviously correct if
the 'free' is there.
So this patch add a few calls to 'free'

Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-22 11:00:56 +11:00
NeilBrown 9739642288 Grow: update backup-metadata mtime every time we write it.
Originally the backup-metadata was only written once at the
start of a raid5 reshape that made the array bigger.  So we only
set the mtime once.

Now that we can be writing metadata continually during an in-place
reshape, we need to update the mtime more often.

Also, allow the metadata mtime to be slightly in advance of the
array mtime.  Normally the difference will be less than a second,
so 10 minutes should be plenty.  This guards against an old backup
file being used to restart an array.  but starting two reshapes in the
10 minutes is sufficiently unlikely, and the possibility of an
accident is already sufficiently small, that 10 minutes is probably
fine.

Thanks to Guy Martin <gmsoft@tuxicoman.be> for discovering and
reporting that .mtime wasn't being updated properly.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-22 10:42:06 +11:00
NeilBrown eb3929a47f Compile fixes for mdassemble
Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-20 16:53:43 +11:00
NeilBrown 24d40069d7 Grow: reject raid-disks reduction in RAID5 etc before 2.6.32
2.6.31 has some bugs with restarting a RAID5 reduction, so
refuse to try unless at least 2.6.32.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-20 16:36:03 +11:00
NeilBrown ea0ebe9685 Assemble: print more verbose messages about restarting a reshape
Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-20 16:23:45 +11:00
NeilBrown 22e305169f Add missing 'continue' in Grow_restart.
Thus we weren't checking the uuid properly.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-20 15:36:49 +11:00
NeilBrown 1799c9e8f8 super-intel: Fix compilation of mdassemble.
Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-20 13:50:23 +11:00
NeilBrown 1dfcc211b1 testreshape5 fixes.
We seem to need a 'udevadm settle', and possibly the 'sync'..

Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-20 08:02:53 +11:00
NeilBrown 151ea1a33d tests/imsm: allow for rounding of array size.
IMSM rounds array size to a multiple of 1024K, so our tests must
assume this.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-20 08:00:35 +11:00
NeilBrown 5ac6db12f9 mdopen: only use 'dev' as chosen name if it is a full path.
Otherwise using names like "r0" causes problem.  They are
handled sufficiently by other paths in the code.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-19 17:11:15 +11:00
NeilBrown 8a0a0ded4a Assemble: handle container members better
When looking for a specific member, don't accept a
different member, but step on to the next one.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-19 17:08:04 +11:00
NeilBrown 7636b5a8bb Assemble: print verbose messages when finding members in containers
.. so that "-Av" gives more hints at what is going on.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-19 17:04:12 +11:00
NeilBrown 8f1b2bbbb9 Detail: list containers before members.
To allow "--assemble --scan" to have a chance, list
containers before members in --detail --scan output.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-19 17:00:52 +11:00
NeilBrown 00eb571675 test/ddf: don't insist that mdadm.conf is always in the same order.
When created by different process, the order could reasonably
be different.  So sort before compare

Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-19 16:58:38 +11:00
NeilBrown 453e3b41d0 test/raid6integ: correct type
ddf-zero-restart was misspelled.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-19 16:57:16 +11:00
NeilBrown 2e48e34945 test: udev-settle before testing device.
I think we sometime get way ahead of udev and devices disappear
and appear almost at random.  So add some settling.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-19 16:56:13 +11:00
Mike Frysinger d16c7af6d8 mdadm(8): fix spurious space after -e header
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-19 13:15:48 +11:00
Zdenek Behan 9a36a9b713 Monitor: add option to specify rebuild increments
ie. the percent increments after which RebuildNN event is generated

This is particulary useful when using --program option, rather than
(only) syslog for alerts.

Signed-off-by: Zdenek Behan <rain@matfyz.cz>
Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-19 13:13:58 +11:00
NeilBrown 1373b07d75 mdmon: lock current memory as well as future memory.
mlockall(MCL_FUTURE) only locks mappings that have not yet
been created.  To lock all memory used by the process, we need
 MCL_CURRENT | MCL_FUTURE

Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-19 13:04:16 +11:00
NeilBrown 5d504f4278 Merge git://github.com/djbw/mdadm 2009-10-19 12:52:58 +11:00
NeilBrown 6636f0efb3 tests/imsm: allow for rounding of array size.
IMSM rounds array size to a multiple of 1024K, so our tests must
assume this.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-16 17:57:28 +11:00
NeilBrown ba6241244b Test different r5/r6 layouts.
Make sure kernel and restripe agree on all different layouts.

Signed-off-by: NeilBrown <neilb@suse.de>
2009-10-16 17:50:07 +11:00