Commit Graph

445 Commits

Author SHA1 Message Date
Neil Brown 6e9eac4f08 Fix restarting of a reshaping array.
The last release broke the ability to assemble an array that
was in the middle of a reshape.
This patch adds code to test if the critical section needs
to be restored or not so that - if we have failed to restore it,
we know whether to fail or not.
2007-10-16 13:52:35 +10:00
Jérémy Bobbio cc4c7f14b1 Also use &tst instead of st later on when loading v1 superblocks 2007-10-01 09:17:06 +01:00
martin f. krafft cf3370c7a7 Fix segfault on assembly on amd64 with v1 superblocks
Commit a40b4fe introduced a temporary supertype variable tst, instead of
manipulating st directly. However, it was forgotton to pass &tst into the
recursive load_super1 call, causing an infinite recursion.

Signed-off-by: martin f. krafft <madduck@debian.org>
2007-09-30 13:28:56 +01:00
maximilian attems 4450e59ffa Monitor.c s/MAXINT/INT_MAX/g
include limits.h directly instead of values.h

Signed-off-by: maximilian attems <max@stro.at>
Signed-off-by: Neil Brown <neilb@suse.de>
2007-09-27 10:08:30 +10:00
maximilian attems b440882edf mdopen.c don't shadow major() and minor()
s/(major|minor)/\1_num/

Signed-off-by: maximilian attems <max@stro.at>
Signed-off-by: Neil Brown <neilb@suse.de>
2007-09-27 10:08:30 +10:00
maximilian attems 98127a6d4d Monitor.c include signal.h directly
another small step for better klibc support, glibc compile tested.

Signed-off-by: maximilian attems <max@stro.at>
Signed-off-by: Neil Brown <neilb@suse.de>
2007-09-27 10:08:30 +10:00
Neil Brown a039409b1a Add ANNOUNCE-2.6.1 to git
Somehow this missed out of getting into .git even though it is in all
tha tar-balls.
2007-09-24 14:40:23 +10:00
Neil Brown 23dc1ae877 Don't corrupt 'supertype' when speculatively calling load_super1
When load_super1 is trying to see which sub-version of v1 superblock
is present, failure will cause it to clear st->ss, which is not good.

So use a temporary 'super_type' for the 'test if this version works'
calls, then copy that into 'st' on success.
2007-09-24 14:26:44 +10:00
maximilian attems ff7f2ebbe9 config.c include dirent.h instead sys/dir.h
sys/dir.h is an old BSD'ism, include dirent directly.
small step for better klibc support.

compile tested against glibc.

Signed-off-by: maximilian attems <max@stro.at>
Signed-off-by: Neil Brown <neilb@suse.de>
2007-09-24 13:21:38 +10:00
maximilian attems 943eafefca Create.c s/major/major_num/
don't shadow the major() function by int major.

Signed-off-by: maximilian attems <max@stro.at>
Signed-off-by: Neil Brown <neilb@suse.de>
2007-09-24 13:21:38 +10:00
maximilian attems e39b673e48 Add klibc support to mdadm.h
klibc still misses a lot functionality to let mdadm link against,
this small step helps to get to the real trouble.. :)

Signed-off-by: maximilian attems <max@stro.at>
Signed-off-by: Neil Brown <neilb@suse.de>
2007-09-24 13:21:38 +10:00
Neil Brown 4d20d744cb Make "--write-mostly" effective when re-adding a device to an array.
Fixes Debian Bug 442874

When we discover that we can 're-add' a drive, we forget to check the
write-mostly flag.
This highlights the fact that you cannot turn 'off' the write-mostly
flag at this point.  I wonder if that is a problem...
2007-09-24 13:14:13 +10:00
Iustin Pop 3dacb89029 Explain the read-balancing algorithm for RAID1 better in md.4
From: Iustin Pop <iusty@k1024.org>

There are many questions on the mailing list about the RAID1 read
performance profile. This patch adds a new paragraph to the RAID1
section in md.4 that details what kind of speed-up one should expect
from RAID1.

Signed-off-by: Iustin Pop <iusty@k1024.org>
2007-09-11 16:20:19 +02:00
Neil Brown e5bddffd35 Release 2.6.3 2007-08-20 14:22:15 +10:00
Neil Brown e1584dd2c7 Update changelog 2007-08-20 14:14:46 +10:00
Neil Brown 2295250a73 Report error when grow cannot be restarted.
Make sure that if --assemble find an array in the critical region
of a reshape, and cannot find the critical data to restart the
reshape, it gives an error message.
2007-08-20 14:14:42 +10:00
Neil Brown eb6dae9850 Fix error message when adding a device that is too small.
We were multiplying MD_RESERVED_SECTORS by 1024 instead of 512,
so lots of 'is it too small' checks were wrong.
2007-08-20 14:14:28 +10:00
Neil Brown 005debfc11 Fix problem with add a device to a 1.x array created with older mdadm.
When adding new disk to an array, don't reserve so much bitmap
space that the disk cannot store the required data. (Needed when
1.x array was created with older mdadm).
2007-08-20 14:14:25 +10:00
Neil Brown 85375d6de1 Reject '--bitmap none' for build and create.
We don't want to create a file called 'none', and it isn't needed,
so just reject it.
2007-07-23 17:28:44 +10:00
Tim Woods 9bbcc5f7c4 "--export" segfaults with non-persistent super blocks
From: Tim Woods <timwoods@uklinux.net>

	This patch fixes a NULL pointer dereference in Detail.c when running
'mdadm --detail --export' on a device with non-persistent super blocks.
2007-07-23 17:15:52 +10:00
Neil Brown 962a108fb7 In the MISC MODE section in mdadm(8), the names of the options should be
in bold.

  -- AYM 2007-01-14

diff -ur mdadm-2.6/mdadm.8 mdadm-2.6-man1/mdadm.8
2007-07-23 09:32:01 +10:00
Scott Weikart 93e790afef Substantial corrections to man pages.
From: "Scott Weikart" <Scott.W@Benetech.org>

Thanks Scott!
2007-07-13 15:13:43 +10:00
Neil Brown bf40ab857f Typo in man page: Multipath has an L ... 2007-07-11 09:08:49 +10:00
Ian Dall 7d19ad0de3 Allow "--write-behind=" to be done in grow mode.
From: Ian Dall <ian@beware.dropbear.id.au>

I have a small patch to mdadm which allows the write-behind amount to be
set a array grow time (instead of currently only at grow or create
time). I have tested this fairly extensively on some arrays built out of
loop back devices, and once on a real live array.
2007-07-09 11:29:04 +10:00
Doug Ledford 66f8bbbe90 Enhance raid4 support: --assemble and --monitor wasn't quite happy with it.
From: Doug Ledford <dledford@redhat.com>

This one actually does a couple things.  Mainly related to raid4, but
kinda touches other raid levels some.

When creating a raid4 array, treat it like a raid5 array in that we
create it in degraded mode by default and add the last disk as a spare.
Besides speeding things up, this has a second effect that it makes mdadm
more consistent.  In order to create a degraded raid5 array, you need
only passing missing as one of the devices.  For a degraded raid4 array,
prior to this patch, you must pass assume-clean or else it refuses to
create the array.  Even force won't make it work without assume-clean.
With the patch, raid4 behaves identical to raid5.

Separate from that, the monitor functionality completely ignores raid4
arrays.  That seems to stem from the code that checks to see if the
array is part of a long list of types.  It seems easier to check which
array types *aren't* redundant instead of listing the ones that are
redundant and missing some of them.  This makes the monitor service
actually watch raid4 arrays.
2007-07-09 10:00:02 +10:00
Doug Ledford 024768c465 Fix parsing of "-a" in various contexts.
From: Doug Ledford <dledford@redhat.com>

This one fixes a bug where once manage mode is set, the -a short option
is no longer parsed correctly (true of grow mode as well).  This happens
because when you switch the short opts to the bitmap_auto version, it
specifies that the argument must follow a, yet the loop expects to get
an undecorated option and parse it as the disk dev instead of trying to
parse optarg.  So, create a new short opt array that is used for manage
and grow that doesn't list a as having an argument.
2007-07-09 09:59:59 +10:00
Doug Ledford e4dc510628 Mark some files FD_CLOEXEC to protect sendmail from them.
From: Doug Ledford <dledford@redhat.com>

When running with SELinux enabled and using mdadm to monitor devices,
attempts to send emails to an admin will be blocked because mdadm is
holding open /proc/mdstat without setting the FD_CLOEXEC flag.  As a
result, sendmail has an open descriptor to /proc/mdstat after the
popen() call, which SELinux decides isn't really any of sendmail's
business and so sendmail gets denied.
2007-07-09 09:59:54 +10:00
Doug Ledford 32e5a4ee4c Improve error message when trying to create an array that already exists.
From: Doug Ledford <dledford@redhat.com>

Simple bugfix.  If an array already exists and we are asked to create
this array, error out with an error message that makes sense to people
instead of an error that the SET_ARRAY_INFO ioctl had an invalid
argument.  Plus a typo correction.
2007-07-09 09:59:50 +10:00
Doug Ledford a17a3de364 Interpret "--metadata=1" with --assemble to imply any version-1, not just 1.0
From: Doug Ledford <dledford@redhat.com>

OK, this one fixes an issue where people were doing manual array
creation and specifying superblock types other than 1.0 (aka, 1.1, 1.2)
and then using mdadm -Ebs to populate their mdadm.conf file.  The
general problem is that if you specify a superblock type in the ARRAY
line (or on the command line), then you must specify the superblock type
*exactly*, including the minor version.  Unfortunately, mdadm -Ebs
prints out all version 1 superblocks, regardless of minor version, as
just plain old 1.  This breaks the mdadm.conf file for anything other
than plain version 1 superblock devices.

So, since I thought it was basically backwards that the mdadm -E output
was lax on specifying the location of the superblock where as the mdadm
-A input was strict, I reversed that.  With this patch, the mdadm -E
output is now exact for any given superblock.  But, in addition, the
mdadm -A input is now lax for any superblock that doesn't specifically
list the minor version, aka version 1 now means version 1, not version
0.90, but any minor version.  So does default/large.
2007-07-09 09:59:47 +10:00
Neil Brown 01d9299c1a Fix spare migration and other problems with --monitor.
2.6 broke --monitor in various ways, including spare migration
stopped working.  This fixes it.
2007-07-09 09:59:42 +10:00
Neil Brown 5624768a4c Compile with various -O flags for testing.
"make everything" now compiles with -O2 and -Os to increase coverage
for compiler generated warnings.
2007-05-22 09:46:36 +10:00
Neil Brown a328c097ff Fix compile error in Detail.c
'avail' is undefined if '--export', so make sure we don't try to use
it.
2007-05-22 09:46:29 +10:00
Neil Brown fffdbe5ed0 Release 2.6.2 2007-05-21 14:25:53 +10:00
Neil Brown a77be58672 Make return code for "--detail --test" more reliable.
Missing devices as well as failed devices cause an error.
2007-05-21 14:25:50 +10:00
Neil Brown 5b28bd5672 Improve error message for adding bitmap to a level that cannot support it.
Also give error on --build if no devices given.
2007-05-21 14:25:47 +10:00
Neil Brown 1f48664b8e Add --auto-detect for in-kernel autodetect.
This is equivalent to raidautorun that some distros provide.
2007-05-21 14:25:44 +10:00
Neil Brown 69646c1483 Update tests and add linear-add
Update the testing scripts to allow for new space calculations
for space for bitmaps.
Add a test script for adding devices to linear arrays.
2007-05-21 14:25:40 +10:00
Neil Brown f752781f81 Fix --grow --add for linear arrays.
The new superblock needs to have a new disk.number.  This is a bit of a hack...
Fix handling of negative bitmap offsets on 64bit hosts.

The bitmap offset is a signed 32bit number, so casting to (long)
isn't sufficient.  We must cast to (int32_t).
Fix various problems with --grow --add for linear.

The code to add a drive to a live linear array had never
been tested properly and so was buggy.  This tidies it up
and means that the new regression-test passes.
2007-05-21 14:25:37 +10:00
Neil Brown 68754bd17c Fix handling of negative bitmap offsets on 64bit hosts.
The bitmap offset is a signed 32bit number, so casting to (long)
isn't sufficient.  We must cast to (int32_t).
2007-05-21 14:25:30 +10:00
Neil Brown b80da66161 Support failing and removed of detached and faulty devices.
This if you unplug a device and udev removes the entry from /dev,
you can still remove the device.
2007-05-11 16:13:03 +10:00
David Huffman 6f9a21a78f Minor typo in mdadm man page
From: David Huffman <dhuffman@storix.com>
2007-05-11 16:12:54 +10:00
Kay Sievers 54bad3644f Add --export option to --detail to use key=value pairs.
udev likes to get information about a device as key=value pairs so it
can create disk/by-id links etc.  So add --export flag which causes
the output of --detail to easily parsable.

From: Kay Sievers <kay.sievers@novell.com>
2007-05-08 17:17:33 +10:00
Neil Brown 2fb749d1b7 Fix up calculation of bitmap space when creating v1 metadata.
We have the same calculation in multiple places with subtle differences.
So unite it all.

Also fix up and endian problem in --examine.
2007-05-08 17:15:33 +10:00
Neil Brown 0047d254e7 Send help text to stdout rather than stderr.
This helps with piping to a pager for example.
2007-05-08 17:14:00 +10:00
Neil Brown 16c4849bb6 Typo in mdadm.conf man page 2007-05-08 17:13:51 +10:00
Peter Samuelson 7e23fc43c3 Hyphens and Other Manpage Typography, 4/4: literal ASCII hyphens.
From: Peter Samuelson <peter@p12n.org>

nroff formats "-" as the very short hyphen used for hyphenated terms
and for splitting a word across two lines.  When you want a literal
ASCII "-", like for typing on a command line, you're supposed to use
"\-" instead.

Yeah, it sounds pedantic, but it actually makes a difference.  With
modern Unicode-capable terminals, "man" actually renders these with
different characters, so if you try to search for "--create" in your
favorite pager, you won't find it unless the nroff source says
"\-\-create".  This discrepancy doesn't generally show up with
non-Unicode terminals.

Signed-Off-By: Peter Samuelson <peter@p12n.org>
2007-05-08 17:13:44 +10:00
Peter Samuelson 53e8b987bd Hyphens and Other Manpage Typography, 3/4: bold options.
From: Peter Samuelson <peter@p12n.org>

Option names and example command lines seem to be boldface most of the
time, fix up the few that weren't.

Signed-Off-By: Peter Samuelson <peter@p12n.org>
2007-05-08 17:13:36 +10:00
Peter Samuelson b3f1c093b7 Hyphens and Other Manpage Typography, 2/4: proper nroff "em dash".
From: Peter Samuelson <peter@p12n.org>

\(em renders as "--" in ASCII, and a nice em dash (i.e., a dash the
width of the letter "m") in more capable formats like PostScript.

Signed-Off-By: Peter Samuelson <peter@p12n.org>
2007-05-08 17:13:25 +10:00
Peter Samuelson 35cc5be496 Hyphens and Other Manpage Typography, 1/4:
From: Peter Samuelson <peter@p12n.org>

 do not hyphenate terms:
  "override", "therein", "overwrite", "superblock format".

Signed-Off-By: Peter Samuelson <peter@p12n.org>
2007-05-08 17:13:03 +10:00
Neil Brown 1afe1167ae Minor manpage fixes 2007-05-08 17:12:50 +10:00