]> git.ipfire.org Git - thirdparty/mdadm.git/log
thirdparty/mdadm.git
12 years agosuper1.c: use ROUND_UP/ROUND_UP_PTR
Jes Sorensen [Tue, 20 Mar 2012 21:06:35 +0000 (08:06 +1100)] 
super1.c: use ROUND_UP/ROUND_UP_PTR

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoGeneralize ROUND_UP() macro and introduce matching ROUND_UP_PTR()
Jes Sorensen [Tue, 20 Mar 2012 21:04:24 +0000 (08:04 +1100)] 
Generalize ROUND_UP() macro and introduce matching ROUND_UP_PTR()

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomatch_metadata_desc0(): Use calloc instead of malloc+memset
Jes Sorensen [Tue, 20 Mar 2012 21:04:14 +0000 (08:04 +1100)] 
match_metadata_desc0(): Use calloc instead of malloc+memset

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoUse struct align_fd to cache fd's block size for aligned reads/writes
Jes Sorensen [Tue, 20 Mar 2012 21:01:20 +0000 (08:01 +1100)] 
Use struct align_fd to cache fd's block size for aligned reads/writes

This uses a struct to cache the block size for aligned reads/writes,
to avoid repeated ioctl(BLKSSZGET) calls.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoUse 4K buffer alignment for superblock allocations
Jes Sorensen [Tue, 20 Mar 2012 21:01:04 +0000 (08:01 +1100)] 
Use 4K buffer alignment for superblock allocations

To better accommodate 4K sector drives, use 4K buffer alignment for
superblock buffers.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomatch_metadata_desc1(): Use calloc instead of malloc+memset
Jes Sorensen [Tue, 20 Mar 2012 21:00:50 +0000 (08:00 +1100)] 
match_metadata_desc1(): Use calloc instead of malloc+memset

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoinit_super1() memset full buffer allocated for superblock
Jes Sorensen [Tue, 20 Mar 2012 21:00:26 +0000 (08:00 +1100)] 
init_super1() memset full buffer allocated for superblock

Avoid possibly using stale data in bitmap and misc area of superblock.
In addition, remove superfluous memsets already covered by memset of
full superblock.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoDefine and use SUPER1_SIZE for allocations
Jes Sorensen [Tue, 20 Mar 2012 21:00:07 +0000 (08:00 +1100)] 
Define and use SUPER1_SIZE for allocations

Use a #define rather than calculate the size of the superblock buffer
on every allocation.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agosuper1.c don't keep recalculating bitmap pointer
Jes Sorensen [Tue, 20 Mar 2012 16:54:06 +0000 (17:54 +0100)] 
super1.c don't keep recalculating bitmap pointer

We just calculated the pointer to the bitmap, so use it instead of
recalculating.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoCreate: reduce the verbosity of 'default_layout'.
NeilBrown [Thu, 8 Mar 2012 04:40:54 +0000 (15:40 +1100)] 
Create: reduce the verbosity of 'default_layout'.

We only need this the first couple of times.  Reporting it for
every device is not necessary.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agosuper1: support superblocks up to 4K.
NeilBrown [Thu, 8 Mar 2012 04:40:52 +0000 (15:40 +1100)] 
super1: support superblocks up to 4K.

The current 1024 byte limit on 1.x superblocks limits us to
384 devices.  Sometimes people want more.

The kernel is already prepared for superblocks up to 4K,
so enable that in mdadm  allowing up to
   (4096-256)/2 == 1920
devices (active plus spare).

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoReset bad flag on map update
Czarnowska, Anna [Wed, 7 Mar 2012 12:51:30 +0000 (12:51 +0000)] 
Reset bad flag on map update

Map file may miss an entry if bad flag is not cleared on update.

This happens for example when an old entry exists in map that
has no mdstat counterpart and we create a new array with the same devnum.
Newly created array will not appear in map if update doesnt clear bad flag.

Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoManage: allow --re-add to failed array.
NeilBrown [Wed, 7 Mar 2012 04:25:57 +0000 (15:25 +1100)] 
Manage: allow --re-add to failed array.

If both "legs" of a RAID1 (or equivalent in RAID10) fail, then one
of the becomes available again it maybe appropriate to re-add the
failed device(s).
So remove the restriction that an array must has 'enough' devices
before being re-added, and if there is no-where to read a superblock
from for matching, then assume the kernel will do necessary checks.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoAssemble: support assembling of a RAID0 being reshaped.
NeilBrown [Tue, 6 Mar 2012 23:47:34 +0000 (10:47 +1100)] 
Assemble: support assembling of a RAID0 being reshaped.

This is a bit of a hack and the code need to be made more
general.  But this adds the special case of a RAID0 being
reshaped which looks like a RAID4 but doesn't need as many
devices.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoAssemble: don't use O_EXCL until we have checked device content.
NeilBrown [Tue, 6 Mar 2012 23:41:24 +0000 (10:41 +1100)] 
Assemble: don't use O_EXCL until we have checked device content.

If we open with O_EXCL before checking that the device is one that
we really want, then that could cause some other process to think
the device is busy when it isn't really.

This particularly affects running "mdadm -A devname" in parallel for
different arrays.  One might be looking at a device that it won't
end up using while another trys and fails to look at a device that
it needs.

So delay the O_EXCL until after all identity checks.

Multiple "mdadm -As" will still have races, but that is fundamentally
racy anyway.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoUse MDMON_DIR for pid files created in Monitor.c
Jes Sorensen [Thu, 2 Feb 2012 11:45:02 +0000 (12:45 +0100)] 
Use MDMON_DIR for pid files created in Monitor.c

Other parts of mdadm/mdmon place .pid/.sock files in MDMON_DIR. This
makes Monitor.c consistent with the rest.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoPrint error message if failing to write super for 1.x metadata
Jes Sorensen [Wed, 22 Feb 2012 21:55:19 +0000 (08:55 +1100)] 
Print error message if failing to write super for 1.x metadata

In addition remove attempt to print an error message if
write_init_super() fails, as this is handled in the various
write_init_super() functions. This avoids a segfault on error.

Reported by Jim Meyering in
https://bugzilla.redhat.com/show_bug.cgi?id=795461

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoavoid double-free upon "old buggy kernel" sysfs_read failure
Jim Meyering [Tue, 21 Feb 2012 12:02:22 +0000 (13:02 +0100)] 
avoid double-free upon "old buggy kernel" sysfs_read failure

* Incremental.c (Incremental): On sysfs_read failure, don't call
sysfs_free(sra) just before "goto out_unlock", since that very
same "sra" is freed the same way by the clean-up code below.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoFIX: Changes in '0' case for reshape position verification
Adam Kwolek [Thu, 16 Feb 2012 13:16:04 +0000 (14:16 +0100)] 
FIX: Changes in '0' case for reshape position verification

Reading sysfs entry that is '0' long should cause an error.
Reshape position cannot be empty.

Absence of reshape position should be ignored. It is possible
that we are about raid0 reshape continuation and it is before takeover.
This means that according metadata (changed by mdmon) it should be reshaped
but md knows nothing about it at this moment. Reshape continuation
in reshape_array() will change it to raid4 and reshape position appears
in sysfs.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoUse posix_memalign() for memory used to write bitmaps
Jes Sorensen [Tue, 14 Feb 2012 10:52:13 +0000 (11:52 +0100)] 
Use posix_memalign() for memory used to write bitmaps

This makes super[01].c properly align buffers used for the bitmap
using posix_memalign() to make sure the writes don't fail in case the
bitmap is opened using O_DIRECT.

This is based on https://bugzilla.redhat.com/show_bug.cgi?id=789898
and an initial patch by Alexander Murashkin.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoconfig: conf_match should ignore devname when not set.
NeilBrown [Thu, 16 Feb 2012 03:11:57 +0000 (14:11 +1100)] 
config: conf_match should ignore devname when not set.

mapfile:RebuildMap calls conf_match with no devname, so we must be
careful not to use it.

Reported-by: Arkadiusz Miƛkiewicz <arekm@maven.pl>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoFIX: Do not try to (continue) reshape using inactive array
Adam Kwolek [Thu, 9 Feb 2012 01:38:15 +0000 (12:38 +1100)] 
FIX: Do not try to (continue) reshape using inactive array

When one of arrays is inactive, do not try to continue reshape
on this array. Just skip it.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoFIX: restart reshape when reshape process is stopped just between 2 reshapes
Adam Kwolek [Thu, 9 Feb 2012 01:37:40 +0000 (12:37 +1100)] 
FIX: restart reshape when reshape process is stopped just between 2 reshapes

When reshape is restarted from '0', very begin of array
it is possible that for external metadata reshape and array
configuration doesn't happen.
Check if md has the same opinion, and reshape is restarted
from 0. If so, this is regular reshape start after reshape
switch in metadata to next array only.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Clear migration record when migration switches to next volume.
Adam Kwolek [Thu, 9 Feb 2012 01:37:04 +0000 (12:37 +1100)] 
imsm: FIX: Clear migration record when migration switches to next volume.

When OLCE is in progress, checkpoint steps are getting bigger due to added space during process.
When mdadm fails after saving "max" to sync_max, mdmon will monitor process
and switch reshape to next array. At this moment we have got information
inconsistency between metadata and migration record.
To avoid this, clear migration record by mdmon /exception from the rule
that migration record is maintained by mdadm/ when reshape switches
to next array.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: use md position to reshape restart
Adam Kwolek [Thu, 9 Feb 2012 01:36:42 +0000 (12:36 +1100)] 
imsm: FIX: use md position to reshape restart

When reshape is broken it can occur that metadata is not saved properly.
This can cause that reshape process is farther in md than metadata states.

On restart save checkpoint to store current position /probably farther/
that can be read from md.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoFIX: use md position to reshape restart
Adam Kwolek [Thu, 9 Feb 2012 01:36:41 +0000 (12:36 +1100)] 
FIX: use md position to reshape restart

When reshape is broken, it can occur that metadata is not saved properly.
This can cause that reshape process is farther in md than metadata states.

On reshape restart use md position as start position, if it is farther than
position specified in metadata. Opposite situation treat as error.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Chunk size migration problem
Adam Kwolek [Tue, 7 Feb 2012 14:03:51 +0000 (15:03 +0100)] 
imsm: FIX: Chunk size migration problem

When chunk size migration occurs (e.g. 128k->4k) first checkpoint cannot
be set in md due to too small step. Correct migration record initialization
to allow whole copy area usage and increase migration checkpoint step.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoFlush mdmon before next reshape step during container operation
Adam Kwolek [Tue, 7 Feb 2012 14:03:43 +0000 (15:03 +0100)] 
Flush mdmon before next reshape step during container operation

Using takeover operation for grow purposes, mdadm has to be sure
that mdmon processes all updates, and if necessary it will be closed
at takeover to raid0 operation. If mdmon is late, next array in container
is processed and due to race condition mdmon closes itself instead to monitor
next reshape operation.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoFix: Sometimes mdmon throws core dump during reshape
Adam Kwolek [Tue, 7 Feb 2012 14:03:35 +0000 (15:03 +0100)] 
Fix: Sometimes mdmon throws core dump during reshape

Problem was found during reshaping 2 volumes /raid0 and raid5/ in container.
Sometimes mdmon throws core dump due to NULL pointer exception.

Problem occurs in scenario:
- managemon: is about spare activation (degraded raid4 volume == raid0 under takeover)
- managemon: detect level change and signals monitor (manage_member() calls replace_array())
- monitor: detects transition raid4/5->raid0 and sets a->container to NULL
           to indicate array deactivation
- managemon : continues his work and tries to activate spare (a->check_degraded is set).
              NULL pointer is passed to metadata handler activate_spare()
              Core dump is generated.

To resolve this situation managemon (after monitor kick) checks again
a->container pointer to learn if current array is not to be deactivated.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: imsm_get_allowed_degradation() doesn't count degradation for raid1
Adam Kwolek [Tue, 7 Feb 2012 14:03:27 +0000 (15:03 +0100)] 
imsm: FIX: imsm_get_allowed_degradation() doesn't count degradation for raid1

Missing case raid1 added to function.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoFIX: Array is not run when expansion disks are added
Adam Kwolek [Tue, 7 Feb 2012 14:03:19 +0000 (15:03 +0100)] 
FIX: Array is not run when expansion disks are added

When added disk is disk added by expansion and this is last disk added
to array, assemble_container_content() will not even try to run such array.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: No new missing disks are allowed during general migration
Adam Kwolek [Tue, 7 Feb 2012 14:03:11 +0000 (15:03 +0100)] 
imsm: FIX: No new missing disks are allowed during general migration

When during incremental assembly general migration is in progress,
starting degraded array causes that no more disks (even present)
can be added later as array is already started.

Request all previously present disks during general migration for assembly.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoFIX: NULL pointer to strdup() can be passed
Adam Kwolek [Tue, 7 Feb 2012 14:03:03 +0000 (15:03 +0100)] 
FIX: NULL pointer to strdup() can be passed

When result from strchr() is NULL and it is assigned to subarray,
NULL pointer can be passed to strdup() function and coredump file
is generated.

Subarray is checked for NULL pointer, so it is assumed that it can
be NULL at this moment.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoconfig: fix handing of 'homehost' in AUTO line.
NeilBrown [Thu, 9 Feb 2012 00:44:38 +0000 (11:44 +1100)] 
config: fix handing of 'homehost' in AUTO line.

We should be looking for the policy "auto=homehost", not
"auto=auto".

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoAssemble: fix --force assemble during reshape.
NeilBrown [Tue, 7 Feb 2012 03:06:44 +0000 (14:06 +1100)] 
Assemble: fix --force assemble during reshape.

If we have to --force assembly during reshape, we need to
check by the 'before' and 'after' cases to make sure there
are enough devices.

Reported-by: Richard Herd <2001oddity@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoRemove avail_disks arg from 'enough'.
NeilBrown [Tue, 7 Feb 2012 03:04:47 +0000 (14:04 +1100)] 
Remove avail_disks arg from 'enough'.

It can easily be calculated from 'avail' and  'raid_disks', and we
will soon have a case where we don't have it easily available to pass
in.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agosuper1: make aread/awrite always use an aligned buffer.
NeilBrown [Tue, 7 Feb 2012 00:55:18 +0000 (11:55 +1100)] 
super1: make aread/awrite always use an aligned buffer.

A recently change to write_bitmap1 meant awrite would sometimes
write from a non-aligned buffer which of course break.

So change awrite (and aread) to always use their own aligned
buffer to ensure safety.

Reported-by: Alexander Lyakas <alex.bolshoy@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agogetinfo_super1: Use MaxSector in place of sb->size
Alexander Lyakas [Mon, 6 Feb 2012 23:15:20 +0000 (10:15 +1100)] 
getinfo_super1: Use MaxSector in place of sb->size

when deciding whether the array is clean or dirty, compare
sb->resync_offset against MaxSector and not against sb->size

With RAID6 resyncing and subsequent drive failures, it is possible to
reach the case, in which sb->resync_offset==sb->size. This happens
when resync is aborted due to drive failures, and immediately a
rebuild of a spare starts. In this case, mdadm was considered the
array as clean, while kernel was considering the array as dirty. It is
better for mdadm also to consider the array as dirty in this case.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: fix, the second array need to have the whole available space on devices
Labun, Marcin [Fri, 27 Jan 2012 15:28:36 +0000 (15:28 +0000)] 
imsm: fix, the second array need to have the whole available space on devices

Fix the case with creating an array with given container in command line
instead of real devices:
mdadm -CR /dev/md/raid0 -l 0 -n 2 -z5G /dev/md/imsm

Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoSpawn mdmon with --offroot if mdadm was launched with --offroot
Jes Sorensen [Wed, 25 Jan 2012 14:18:04 +0000 (15:18 +0100)] 
Spawn mdmon with --offroot if mdadm was launched with --offroot

Acked-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoAdd --offroot argument to mdmon
Jes Sorensen [Wed, 25 Jan 2012 14:18:03 +0000 (15:18 +0100)] 
Add --offroot argument to mdmon

Acked-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoAdd --offroot argument to mdadm
Jes Sorensen [Wed, 25 Jan 2012 14:18:02 +0000 (15:18 +0100)] 
Add --offroot argument to mdadm

When --offroot is specified, mdadm will change the first character of
argv[0] to '@'. This is used to signal to systemd that mdadm was
launched from initramfs and should not be shut down before returning
to the initramfs.

Acked-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomdmon: Use getopt_long() to parse command line options
Jes Sorensen [Wed, 25 Jan 2012 14:18:01 +0000 (15:18 +0100)] 
mdmon: Use getopt_long() to parse command line options

This changes mdmon over to use getopt_long() for option parsing,
making it easier to add new options. In addition this patch introduces
a short version -t for --takeover and adds -h/--help.

Acked-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: display fd in error trace when when store_imsm_mpb failes
Labun, Marcin [Mon, 30 Jan 2012 01:00:43 +0000 (12:00 +1100)] 
imsm: display fd in error trace when when store_imsm_mpb failes

Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: validate the number of imsm volumes per controller
Labun, Marcin [Mon, 30 Jan 2012 01:00:10 +0000 (12:00 +1100)] 
imsm: validate the number of imsm volumes per controller

IMSM OROM limits number of volumes per controller. Volumes
above the limit are blocked in OROM. mdadm should follow OROM limitations
in this area. Therefore we need to count number of volumes on the devices
attached to SATA (ahci driver) or SAS (isci) controller.  Adding a new volume
must be blocked if the number of volumes on devices attached to the given
controller is exceeded.

Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: load_imsm_super_all supports loading metadata from the device list
Labun, Marcin [Mon, 30 Jan 2012 00:57:23 +0000 (11:57 +1100)] 
imsm: load_imsm_super_all supports loading metadata from the device list

This option is going to be used to load and analyse the metadata from
devices. This is needed to count the number of volumes on devcies attached
to particular Intel controller (SATA or SAS). It shall be done without
activation of container and volumes on the devices.

Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: load_super_imsm_all function refactoring
Labun, Marcin [Mon, 30 Jan 2012 00:56:58 +0000 (11:56 +1100)] 
imsm: load_super_imsm_all function refactoring

Prepare function for subsequent changes related to
loading metadata from devices list.

Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoFIX: Typo error in fprint command
Adam Kwolek [Thu, 12 Jan 2012 07:12:55 +0000 (08:12 +0100)] 
FIX: Typo error in fprint command

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoFIX: mdmon check in reshape_container() can cause a problem
Adam Kwolek [Thu, 12 Jan 2012 07:12:47 +0000 (08:12 +0100)] 
FIX: mdmon check in reshape_container() can cause a problem

When raid0 reshape is executed mdmon can dissappear due to raid level
takeover operation. If this happen before mdmon check, mdadm would treat
it as error condition. It is not true for this case.

Remove mdmon check from reshape_container() function.
Error condition check will remain using reshape_array() reentry test
for the same array (line 2577).

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoFIX: External metadata sometimes is not updated
Adam Kwolek [Thu, 12 Jan 2012 07:12:39 +0000 (08:12 +0100)] 
FIX: External metadata sometimes is not updated

External metadata sometimes is not updated.
It can be observed during 2 raid0 arrays Capacity Expansion.
New array size is not set, because metadata is not updated and on the reshape
end mdadm doesn't read new array size from metadata.
This happens when mdmon finishes his work (due to takeover to raid0),
before all metadata updates are processed.

Make sure that all updates are flushed to disk before executing takeover.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agofix: container creation with --incremental used.
Lukasz Dorau [Wed, 11 Jan 2012 23:57:20 +0000 (10:57 +1100)] 
fix: container creation with --incremental used.

If there is no name provided for a container by the metadata it is
always appropriate to use the metadata version name.  create_mddev
will still add a uniquifying digit to the end so there is little risk
of confusion.
This makes the --incremental code behave the same as the --assemble code.

Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoWork around gcc-4.7's strict aliasing checks
Jes Sorensen [Thu, 5 Jan 2012 11:16:41 +0000 (12:16 +0100)] 
Work around gcc-4.7's strict aliasing checks

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agofix: Monitor sometimes crashes
Lukasz Dorau [Wed, 11 Jan 2012 23:40:00 +0000 (10:40 +1100)] 
fix: Monitor sometimes crashes

The "char cnt [40]" buffer is sometimes too small to hold all message
- in such case monitor crashes.
The buffer must be larger to be able to hold all message.

Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomonitor: ensure we retry soon when 'remove' fails.
NeilBrown [Mon, 2 Jan 2012 13:36:23 +0000 (00:36 +1100)] 
monitor: ensure we retry soon when 'remove' fails.

If a 'remove' fails there is no certainty that another event will
happen soon, so make sure we retry soon anyway.

Reported-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomonitor: make return from read_and_act more symbolic.
NeilBrown [Tue, 3 Jan 2012 00:18:59 +0000 (11:18 +1100)] 
monitor: make return from read_and_act more symbolic.

Rather than just a number, use a named flag.

This makes the code easier to understand and allows room for returning
more flags later.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoRelease mdadm-3.2.3 mdadm-3.2.3
NeilBrown [Fri, 23 Dec 2011 03:32:44 +0000 (14:32 +1100)] 
Release mdadm-3.2.3

Bug fix release.

12 years agoGrow/bitmap: support adding bitmap via sysfs.
NeilBrown [Fri, 23 Dec 2011 03:10:41 +0000 (14:10 +1100)] 
Grow/bitmap: support adding bitmap via sysfs.

Adding a bitmap via ioctl can only add it at a fixed location.
That location is not suitable for 4K-block devices.

So allow setting the bitmap location via sysfs if kernel supports it
and aim to always use 4K alignments.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agosuper1: use awrite when writing a new bitmap.
NeilBrown [Fri, 23 Dec 2011 03:09:56 +0000 (14:09 +1100)] 
super1: use awrite when writing a new bitmap.

This ensures it will succeed on 4K block devices like DASD.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoSubject: bitmap: used 4K aligned buffers when reading the bitmap.
NeilBrown [Fri, 23 Dec 2011 03:09:29 +0000 (14:09 +1100)] 
Subject: bitmap: used 4K aligned buffers when reading the bitmap.

This is needed on 4K block devices such as DASD as we do O_DIRECT
reads.

Do the same alignment for gpt just to be safe.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agosuper1 - fix for bigendian machines.
NeilBrown [Fri, 23 Dec 2011 03:07:47 +0000 (14:07 +1100)] 
super1 - fix for bigendian machines.

devflags is a single byte so endian conversions are now wanted.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoAssemble: fix count in "assembled with .. but not started".
NeilBrown [Thu, 22 Dec 2011 23:49:07 +0000 (10:49 +1100)] 
Assemble: fix count in "assembled with .. but not started".

We need to include the count of pre-existing devices here.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoAssemble: make some plurals conditional.
NeilBrown [Thu, 22 Dec 2011 23:49:07 +0000 (10:49 +1100)] 
Assemble: make some plurals conditional.

"1 devices" is ugly.  Fix it.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoIncremental: make sure container name appears in /dev
NeilBrown [Thu, 22 Dec 2011 23:47:07 +0000 (10:47 +1100)] 
Incremental: make sure container name appears in /dev

We need to send a "change" event just like we do when
creating an array.

This reverts commit 382afe49b10cf3e5a4764cee74649d1cd8c91813

The problem is that we need udev to create the file in /dev
for us.
It might be unnecessary for udev to consider assembling things
in this array, but it shouldn't cause a problem.  If it did that
would be a different bug which we probably need locking to fix.

Or maybe udev shouldn't trigger a "-I" for containers appearing.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agobitmap: print correct percentage of bitmap in use.
NeilBrown [Thu, 22 Dec 2011 22:07:14 +0000 (09:07 +1100)] 
bitmap: print correct percentage of bitmap in use.

We were adding 1, presumably to avoid div-by-zero possibilities.
It is better to only substitute '1' if the value actually is zero,
else for small numbers of bits the difference is visible.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoddf: fix auto-allocation problem.
NeilBrown [Thu, 22 Dec 2011 22:04:59 +0000 (09:04 +1100)] 
ddf: fix auto-allocation problem.

We need to check every disk to see if it has a particular amount of
space spare, not just every subsequent disk.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoallow --monitor to be run by non-privileged use.
NeilBrown [Thu, 22 Dec 2011 20:42:23 +0000 (07:42 +1100)] 
allow --monitor to be run by non-privileged use.

Providing --no-sharing is given, monitoring should be permitted.

Unfortunately the kernel current rejects GET_DISK_INFO and
GET_ARRAY_INFO for non-privileged users which is unjustified.
The info is available in sysfs and we could get it from there,
but for now, require the kernel to be fixed.

Reported-by: Raphael Hertzog <hertzog@debian.org>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoFIX: Verify if array name doesn't exist already
Adam Kwolek [Thu, 22 Dec 2011 20:13:55 +0000 (07:13 +1100)] 
FIX: Verify if array name doesn't exist already

When e.g. array name (an) is correct and it is the same as container name (cn),
file element creation /dev/md/an will replace /dev/md/cn.
This can cause that user cannot access container using /dev/md/cn.

Verify during array creation if chosen name is not already existing
one.

[Changed to use map_by_name() rather than stat() to determine prior
 existence - NeilBrown]

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoGrow.c: fix lots of white-space issues.
NeilBrown [Thu, 22 Dec 2011 19:59:51 +0000 (06:59 +1100)] 
Grow.c: fix lots of white-space issues.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoGrow: fix reshape-array for shrinking reshapes.
NeilBrown [Thu, 22 Dec 2011 19:59:48 +0000 (06:59 +1100)] 
Grow: fix reshape-array for shrinking reshapes.

The value in info->array.raid_disks is the total number of
devices, which is the 'after' number when the number is increasing,
and the 'before' number when the number is decreasing.

The code currently assumes it is always the 'after' number - so fix
that.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoGrow: fix start_reshape for shrinking arrays.
NeilBrown [Thu, 22 Dec 2011 19:59:45 +0000 (06:59 +1100)] 
Grow: fix start_reshape for shrinking arrays.

When an array is being reshaped to fewer data devices the relationship
between sync_max and reshape_progress is different to when the number
of devices increases - we need to allow for that when setting
sync_max/sync_min.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agotests/03r5assemV1 - slow down recovery a bit more.
NeilBrown [Thu, 22 Dec 2011 19:41:52 +0000 (06:41 +1100)] 
tests/03r5assemV1 - slow down recovery a bit more.

In this test we stop and restart an array that is being recovered,
and we do that several times.  Sometimes it completes the recovery
before we expect and test results are wrong.

So slow it down a bit more.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agosuper1: getinfo_super should set write-mostly flag.
NeilBrown [Tue, 20 Dec 2011 04:01:53 +0000 (15:01 +1100)] 
super1: getinfo_super should set write-mostly flag.

Otherwise it is not preserved when you re-add a device to
an array.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: make messages more understandable
Lukasz Dorau [Fri, 16 Dec 2011 13:04:53 +0000 (14:04 +0100)] 
imsm: make messages more understandable

The printed messages should be more appropriate and understandable
for user. If maxsize is equal 0, this means there is no free space left
on device. If size is greater than maxsize, this means there is not enough
space to create a new volume of given size.

Acked-by: Dan Williams <dan.j.williams@intel.com>
Acked-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: UT '08imsm-overlap' fails
Williams, Dan J [Thu, 15 Dec 2011 02:21:07 +0000 (18:21 -0800)] 
imsm: FIX: UT '08imsm-overlap' fails

Make test for all sub arrays having the same number of devices
dependant on the option ROM requirements being checked.
08imsm-overlap disables the OROM check but then fails because this
test causes it to.

Reported-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoRemove update_private
NeilBrown [Mon, 19 Dec 2011 23:30:34 +0000 (10:30 +1100)] 
Remove update_private

This fields doesn't work any more as ->getinfo_super clears the info
structure at an awkward time.  So get rid of it and do it differently.

The issue is that the metadata handler cannot tell if the uuid it has
was randomly generated or explicitly requested, except on the first
call.
And we don't want to accept explicit requests for IMSM.
So when it was auto-generated, make it look distinctive by having the
same int copied in all 4 positions.  If someone requests a uuid like
that, I guess they get away with it.

Reported-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Chunk size migration is not possible
Adam Kwolek [Thu, 15 Dec 2011 03:35:00 +0000 (14:35 +1100)] 
imsm: FIX: Chunk size migration is not possible

Chunk size only migration for raid0 and raid5 is not possible.
(mdadm UT 15* fails). Mdadm exits with information:
   mdadm: imsm unknown layout 0xffffffff for this raid level 0

Problem was introduced in patch (2011-11-16):
   imsm: platform capabilities are not validated during level migration

During chunk size migration layout variable is not set correctly.
Set it correctly for this migration type.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: return correct status from load_imsm_migr_rec()
Adam Kwolek [Thu, 15 Dec 2011 03:34:51 +0000 (14:34 +1100)] 
imsm: FIX: return correct status from load_imsm_migr_rec()

load_imsm_migr_rec() should see difference between no migration record due
to no migration in progress and loading migration record error.
Additional return value (-2) was introduced to this function.

Using new status load_super_imsm_all() can correctly check loading
migration record status.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoFIX: Add error message in container_reshape()
Adam Kwolek [Thu, 15 Dec 2011 03:34:46 +0000 (14:34 +1100)] 
FIX: Add error message in container_reshape()

Add proper error message for container reshape when device cannot be opened.
fd variable operation is moved down to display information what particular
device cannot be opened.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoFIX: Do not allow for multiple reshape_array() execution during reshape_container...
Adam Kwolek [Thu, 15 Dec 2011 03:34:36 +0000 (14:34 +1100)] 
FIX: Do not allow for multiple reshape_array() execution during reshape_container() call

It can happen during reshape restart that reshape_array() can exit without
error (e.g. Grow.c:1915) and reshape is not moved to next array.
reshape_array() is called again for the same device.
Do not allow for such execution and check if last reshaped array is not
the current one.
This patch can be treat not as solution, but it allows for such errors
detection.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoResolve some more warnings
NeilBrown [Tue, 13 Dec 2011 02:24:52 +0000 (13:24 +1100)] 
Resolve some more warnings

unused variables when MDASSEMBLE is defined, and a typo in mdadm.8

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Correct make everything and variable initialization
Adam Kwolek [Thu, 8 Dec 2011 13:47:17 +0000 (14:47 +0100)] 
imsm: FIX: Correct make everything and variable initialization

make everything doesn't compile (again) due to not used function warning
and uninitialized variable.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Use definitions for migration record disk operations
Adam Kwolek [Tue, 13 Dec 2011 01:54:18 +0000 (12:54 +1100)] 
imsm: FIX: Use definitions for migration record disk operations

Add definition:
  MIGR_REC_BUF_SIZE
  MIGR_REC_POSITION
to super-intel.c and do not use magic numbers

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Use first map only in migration record disk operations
Adam Kwolek [Mon, 12 Dec 2011 11:07:53 +0000 (12:07 +0100)] 
imsm: FIX: Use first map only in migration record disk operations

This patch is addition to patch:
    "imsm: FIX: Limit migration record operation by disk slot not by index"
Location of migration record (2 first slots) should be taken on up to date
information. It is in first map.
Change slot verification to use first map only.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Limit migration record operation by disk slot not by index
Adam Kwolek [Mon, 12 Dec 2011 11:07:45 +0000 (12:07 +0100)] 
imsm: FIX: Limit migration record operation by disk slot not by index

imsm should store migration record in to 2 first disks in array.
This should be evaluated based on disk slots, not on disks index.
It is not guaranteed that indexes are equal to slots.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Use defines for device map access
Adam Kwolek [Wed, 7 Dec 2011 12:58:46 +0000 (13:58 +0100)] 
imsm: FIX: Use defines for device map access

Maps should not be accessed using "magic numbers" /0, 1,-1/.
Add proper definitions and change all map access to use them.
Change present definitions /MAP_0/MAP_1/ to values already used
in code /0, 1, -1//

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Check correct slots on disk failure
Adam Kwolek [Wed, 7 Dec 2011 12:58:38 +0000 (13:58 +0100)] 
imsm: FIX: Check correct slots on disk failure

When changes are made to 2nd map, slot in second map should be tested
instead first one /as change will be applied to second map).

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Finish rebuild and initialization when missing drive is handled
Adam Kwolek [Wed, 7 Dec 2011 12:58:30 +0000 (13:58 +0100)] 
imsm: FIX: Finish rebuild and initialization when missing drive is handled

When missing device is handled for rebuild or initialization
end_migration() should be called to merge ords in case additional
degradation.

I've removed this call to end_migration() as it was called
for migration also.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Mark failure for rebuild
Adam Kwolek [Wed, 7 Dec 2011 12:58:22 +0000 (13:58 +0100)] 
imsm: FIX: Mark failure for rebuild

Allow for marking failures in second map during rebuild and initialization
also (not during migration only)

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Add array map state transition for failures during initialization
Adam Kwolek [Wed, 7 Dec 2011 12:58:15 +0000 (13:58 +0100)] 
imsm: FIX: Add array map state transition for failures during initialization

During initialization disk failure can occur also. Add code for such case
in imsm_set_disk() to support such event.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Do not allow spare activation during rebuild
Adam Kwolek [Wed, 7 Dec 2011 12:58:07 +0000 (13:58 +0100)] 
imsm: FIX: Do not allow spare activation during rebuild

Do not allow for spare device activation while rebuild is in progress,
when additional degradation occur.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: Function imsm_set_disk() rework
Adam Kwolek [Wed, 7 Dec 2011 12:57:59 +0000 (13:57 +0100)] 
imsm: Function imsm_set_disk() rework

Rework is needed to map state transition part to allow easier code reading.
After rework it is easy to find out what can happen in what map state
transition.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Correct ords merging in end_migration()
Adam Kwolek [Wed, 7 Dec 2011 12:57:51 +0000 (13:57 +0100)] 
imsm: FIX: Correct ords merging in end_migration()

Ord's merging should occur when rebuild finishes and final state is other
than expected only /additional failures occur during rebuild/.
Exclude array initialization.
Merging ords on migration finish should never happen.
Any failure during migration should be immediately placed in first
/current/ map, so no merge is necessary.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Remove longer map request
Adam Kwolek [Wed, 7 Dec 2011 12:57:43 +0000 (13:57 +0100)] 
imsm: FIX: Remove longer map request

We shouldn't use longer map. mdadm should know what map is accessed
at the moment.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agofix: imsm: validate strip size - tuned up
Hawrylewicz Czarnowski, Przemyslaw [Wed, 7 Dec 2011 01:15:55 +0000 (12:15 +1100)] 
fix: imsm: validate strip size - tuned up

Neil's proposal seems more reasonable and shows what is really going on
here.

Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoReport raid level type to syslog on RebuildFinished event.
Sergey B Kirpichev [Tue, 6 Dec 2011 21:41:57 +0000 (08:41 +1100)] 
Report raid level type to syslog on RebuildFinished event.

Thus, for RAID1/RAID10 this can be filtered out in logcheck.

Relates-to: Debian bug 599821
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomonitor: don't unblock a device that isn't blocked.
NeilBrown [Tue, 6 Dec 2011 21:39:39 +0000 (08:39 +1100)] 
monitor: don't unblock a device that isn't blocked.

When we see a failed device, we both unblock and remove it (after
updating the metadata).
However it might not be blocked as there can be a delay between
unblocking and the device being free to be removed.

If this happens the clearing of 'blocked' succeeds so md sends a sysfs
notification and mdmon checks again and tries to clear 'blocked'
again.
Thus it enters a busy-loop until the 'remove' succeeds.

To avoid this, only try to unblock if the device was blocked.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoFIX: resolve make everything compilation error
Adam Kwolek [Tue, 6 Dec 2011 00:44:46 +0000 (11:44 +1100)] 
FIX: resolve make everything compilation error

When mdadm is compiled using e.g. 'everything' option, mdasseble
compilation is broken.

Change code to enable mdasseble compilation

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Just created redundant array is not in uninitialized state
Adam Kwolek [Tue, 6 Dec 2011 00:44:07 +0000 (11:44 +1100)] 
imsm: FIX: Just created redundant array is not in uninitialized state

When redundant array (e.g. raid5) is created metadata shows it is in
normal state. Initialization process is showed in metadata as rebuild from normal
to normal state. Redundant array should be initially in uninitialized state
before it's initialization.

Add code to put array in uninitialized state upon array creation.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: fix: does not allow to use invalid chunk size
Przemyslaw Czarnowski [Tue, 6 Dec 2011 00:41:27 +0000 (11:41 +1100)] 
imsm: fix: does not allow to use invalid chunk size

Only least significant bit of chunk size provided by user has been used
in test with OROM capabilities. This way user could pass value which is
not a power of 2.

Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Check maximum allowed degradation level in recover_backup_imsm()
Adam Kwolek [Tue, 6 Dec 2011 00:40:58 +0000 (11:40 +1100)] 
imsm: FIX: Check maximum allowed degradation level in recover_backup_imsm()

Any degradation during backup recovery causes error and array assembly
failure.

Allow for degradation during backup recovery.
This allows for degraded array assembly.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>