Commit Graph

93 Commits

Author SHA1 Message Date
Neil Brown
2cdb64897d Fix for segfault when reading /proc/mdstat
Some kernel versions don't put a space between 'active' and '(auto-read-only)'
in /proc/mdstat.  This causes a parsing problem leaving 'level' set to
NULL which causes a crash.

So synthesise a space there if it is missing, and check for 'level' to
be NULL and don't de-ref if it is.
2008-04-28 16:29:12 +10:00
Neil Brown
7e0f69790c Replace sysarray with mdinfo
Sure, mdinfo is bigger, but having a uniform structure for lots of things
will make life easier.
2007-12-14 20:14:59 +11:00
Neil Brown
aba69144fd Remove spaces/tabs from ends of lines. 2007-12-14 20:13:43 +11: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
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
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
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
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
3e6944b2cc Fix a bug that was causing incorrect warning from --monitor. 2007-02-22 14:59:13 +11:00
Neil Brown
f8409e5478 Release 2.6 2006-12-21 17:24:38 +11:00
Neil Brown
8382f19bdc Add new mode: --incremental
--incremental allows arrays to be assembled one device at a time.
This is expected to be used with udev.
2006-12-21 17:10:52 +11:00
Neil Brown
ab5303d695 Don't hold md device open for so long in --monitor mode
map_dev can be slow and interferes with trying to stop the array.
2006-12-14 17:32:53 +11:00
Neil Brown
37dfc3d638 When resync finished, report the mismatch count if there is one.
This doesn't get mailed out, but will appear in syslog...
Maybe it should be mailed if it was a 'check' or 'repair' pass...
2006-12-14 17:31:25 +11:00
Neil Brown
b90c0e9a12 --wait or -W will wait for resync activity to finish on the given devices. 2006-12-14 17:31:22 +11:00
Neil Brown
8aec876d2e More consistent honoring of --configfile
Never use /etc/mdadm.conf if --config file is given (previously
some code used one, some used the other).
2006-06-26 15:11:01 +10:00
Neil Brown
8bd2e0c339 Fix user-after-free bug in error path in --monitor mode. 2006-06-26 15:10:55 +10:00
Neil Brown
a524a7ee7e Fix typo in mail message from --monitor
From: martin f krafft <madduck@madduck.net>

Signed-off-by: Neil Brown <neilb@suse.de>
2006-06-02 01:34:30 +00:00
Neil Brown
9fca7d6236 check return status of all write/fwrite functions as required by glibc 2.4
From: Luca Berra <bluca@vodka.it>

glibc 2.4 is pedantic on ignoring return values from fprintf, fwrite and
write, so now we check the rval and actually do something with it.
in the Grow.c case i only print a warning, since i don't think we can do
anything in case we fail invalidating those superblocks (is should never
happen, but then...)

Signed-off-by: Neil Brown <neilb@suse.de>
2006-05-29 02:06:32 +00:00
Neil Brown
e7bb5d23a9 Choose better devnumbers and tidy up some issues with finding names.
Signed-off-by: Neil Brown <neilb@suse.de>
2006-05-26 01:40:53 +00:00
Neil Brown
4f589ad0c5 Just updaqte copyright dates and email address
Signed-off-by: Neil Brown <neilb@suse.de>
2006-05-19 05:25:11 +00:00
Neil Brown
008e1100b8 Add a copy of /proc/mdstat to the mail message send by mdadm --monitor.
Signed-off-by: Neil Brown <neilb@suse.de>
2006-05-19 03:58:45 +00:00
Neil Brown
d1732eebac Arrange that SparesMissing events generate an email too.
Signed-off-by: Neil Brown <neilb@suse.de>
2006-05-15 01:35:47 +00:00
Neil Brown
4948b8f72e Support 'mailfrom' line in mdadm.conf so the From: line in alert emails can be explicitly set.
Signed-off-by: Neil Brown <neilb@suse.de>
2006-05-15 01:27:04 +00:00
Neil Brown
e27d562bcc Reduce dependance on MD_SB_DISKS
--monitor should now work with arrays larger than 28 devices.

Signed-off-by: Neil Brown <neilb@suse.de>
2006-03-28 23:02:45 +00:00
Neil Brown
16c6fa807c Create missing /dev files where needed.
Whenever we need a device file to open, if one cannot be found in /dev,
create a temporary one.

Signed-off-by: Neil Brown <neilb@suse.de>
2006-03-28 06:26:53 +00:00
Neil Brown
22a8899586 Sort mdstat entries so that composites are well-ordered.
This means that "-Ds" lists arrays in an approprate order
for assembly.

Signed-off-by: Neil Brown <neilb@suse.de>
2006-01-31 00:39:50 +00:00
Neil Brown
773135f5bd syslog support for monitor mode
From: ross@jose.lug.udel.edu (Ross Vandegrift)

Hi Neil,

While adding the text message mode, I saw a FIXME asking for syslog
support in monitor mode.

This patch adds exactly that.
Signed-off-by: Neil Brown <neilb@suse.de>
2005-12-05 05:55:56 +00:00
Neil Brown
fe394e5e42 Report which device failed in a Fail message.
Signed-off-by: Neil Brown <neilb@suse.de>
2005-12-05 05:54:59 +00:00
Neil Brown
0df46c2ad8 Change MAJOR() etc to major() etc
This allows for larger device number if glibc supports
it (requires 2.3.3).
Also fail before creating larger device number if glibc
support isn't present.

Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
2005-04-04 05:16:13 +00:00
Neil Brown
b5e6464503 mdadm-1.8.0 2004-11-01 04:49:34 +00:00
Neil Brown
e5329c3747 mdadm-1.7.0 2004-08-11 02:16:01 +00:00
Neil Brown
dd0781e505 mdadm-1.6.0 2004-06-04 12:03:19 +00:00
Neil Brown
98c6faba80 mdadm-1.5.0 2004-01-22 02:10:29 +00:00
Neil Brown
feb716e9c3 mdadm-1.4.0 2003-10-28 23:20:01 +00:00
Neil Brown
aa88f531b4 mdadm-1.3.0 2003-07-28 23:59:00 +00:00
Neil Brown
56eedc1a3f mdadm-1.2.0 2003-03-12 22:24:39 +00:00
Neil Brown
d013a55e94 mdadm-1.1.0 2003-03-02 23:11:38 +00:00
Neil Brown
5787fa4906 mdadm-1.0.9 2003-02-12 00:17:26 +00:00
Neil Brown
b83d95f362 mdadm-0.8.2 2002-04-11 01:36:14 +00:00
Neil Brown
e0d1903663 mdadm-0.8 2002-04-04 01:58:32 +00:00
Neil Brown
9a9dab3670 mdadm-0.7 2002-03-08 00:03:52 +00:00
Neil Brown
cd29a5c835 mdctl-0.6 2002-03-06 23:17:40 +00:00
Neil Brown
5282684628 mdctl-0.5 2001-08-23 02:33:20 +00:00