]> git.ipfire.org Git - thirdparty/mdadm.git/log
thirdparty/mdadm.git
13 years agoimsm: introduce SAS controller support in imsm metadata handler
Labun, Marcin [Thu, 10 Mar 2011 00:52:15 +0000 (11:52 +1100)] 
imsm: introduce SAS controller support in imsm metadata handler

OROM/EFI capabilities are retrieved based on disk's controller type.
1/ alloc_super no longer retrieves OROM capabilities
2/ find_imsm_capability replaces find_imsm_orom
3/ new function find_intel_hba_capability gets disk's HBA and relevant
capability

Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: move code for retrieving HBA to a function
Labun, Marcin [Thu, 10 Mar 2011 00:50:58 +0000 (11:50 +1100)] 
imsm: move code for retrieving HBA to a function

Function find_intel_hba_capability attaches HBA information
to intel_super structure based on fd of the component disk.

Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: verify that component disks are attached to the same type of HBA
Labun, Marcin [Thu, 10 Mar 2011 00:50:57 +0000 (11:50 +1100)] 
imsm: verify that component disks are attached to the same type of HBA

compare_super_imsm verifies that the component disks use the same type of HBA
in platform dependent environment. Otherwise print-out error message and block
the action.

Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: add maximum number of disk validation in RAID array
Labun, Marcin [Thu, 10 Mar 2011 00:50:54 +0000 (11:50 +1100)] 
imsm: add maximum number of disk validation in RAID array

Arrays exceeding the OROM/EFI maximum number of supported disk are
blocked in validate_geometry_imsm_orom function.

Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: print-out error message when volume validation fails
Labun, Marcin [Thu, 10 Mar 2011 00:50:52 +0000 (11:50 +1100)] 
imsm: print-out error message when volume validation fails

Print-out error message when volume geometry fails to comply with
OROM/EFI controller's capabilities.

Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: do not publish OROM/EFI unsupported arrays
Labun, Marcin [Thu, 10 Mar 2011 00:50:49 +0000 (11:50 +1100)] 
imsm: do not publish OROM/EFI unsupported arrays

Container_content_imsm calls validate_goemtry_imsm_orom to verify that
the array parameters are supported by controller's OROM/EFI.

Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: detail_platform_imsm displays AHCI and SAS controller information
Labun, Marcin [Thu, 10 Mar 2011 00:46:11 +0000 (11:46 +1100)] 
imsm: detail_platform_imsm displays AHCI and SAS controller information

The function uses find_intel_device and find_imsm_capability to present
AHCI and SAS controller capabilities taken from OROM or EFI.

Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: remove unused parameters in function attach_hba_to_super
Labun, Marcin [Thu, 10 Mar 2011 00:45:49 +0000 (11:45 +1100)] 
imsm: remove unused parameters in function attach_hba_to_super

Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoread platform capabilities from EFI
Labun, Marcin [Thu, 10 Mar 2011 00:45:35 +0000 (11:45 +1100)] 
read platform capabilities from EFI

If operating system is installed using efi, IMSM platform capabilities are
 not available via option ROM, but are stored as efi variables. New
 mechanism has been introduced to obtain capabilities by variables.

Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoSome guid manipulation utilities has been added.
Labun, Marcin [Thu, 10 Mar 2011 00:45:15 +0000 (11:45 +1100)] 
Some guid manipulation utilities has been added.

It will be used for reading efi variables with capabilities.

Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoupdate of imsm_orom structure
Labun, Marcin [Thu, 10 Mar 2011 00:45:00 +0000 (11:45 +1100)] 
update of imsm_orom structure

The structure is update according to current specification. These values
are not used right now, but they are not "reserved" anymore.

Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoPlatform-intel: support for OROM SAS and AHCI controller
Labun, Marcin [Thu, 10 Mar 2011 00:44:21 +0000 (11:44 +1100)] 
Platform-intel: support for OROM SAS and AHCI controller

Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoprobe_roms: allow to probe expansion ROMs using vendor and device id.
Labun, Marcin [Thu, 10 Mar 2011 00:41:46 +0000 (11:41 +1100)] 
probe_roms: allow to probe expansion ROMs using vendor and device id.

Adds data offset to PCI expansion ROM Data Structure in resource
describing Expansion ROMs. This allows AHCI OROM scanning function
to identify AHCI OROM by device id 0x2822 and vendor id 0x8086.

Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm : FIX: Assemble dirty array when reshape is in progress
Adam Kwolek [Thu, 10 Mar 2011 00:41:33 +0000 (11:41 +1100)] 
imsm : FIX: Assemble dirty array when reshape is in progress

During reshape for dirty volumes reshape_progress has to be calculated
also.  To keep the same logic for array creation:
  not setting info->resync_start = MaxSector when first condition is
  true,
  resync_start is initialized by MaxSector to allow proper array
  initialization.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: Set 'active' array state before array configuration
Adam Kwolek [Thu, 10 Mar 2011 00:41:28 +0000 (11:41 +1100)] 
FIX: Set 'active' array state before array configuration

For not reshaped array in container during assembly array is in
auto-read-only state.  It is not possible to set disk slot for such
array and later reshape cannot be started also.  To move array from
'auto-read-only' to 'active' state storing 'active' state to sysfs is
added. This allows for disks configuration and reshape.

During reshaped array restart it is disabled by condition on restart
variable.

When reshape is starting, storing 'active' state to already active
array should not matter.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agodev_open should always open read-only.
NeilBrown [Thu, 10 Mar 2011 00:41:21 +0000 (11:41 +1100)] 
dev_open should always open read-only.

When opening an array to manipulate it we never need to write to the
array and  sometimes it might be read-only so the open for write will
fail.
So always open read-only.

Reported-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoRemove incorrect use of open_dev
NeilBrown [Thu, 10 Mar 2011 00:36:47 +0000 (11:36 +1100)] 
Remove incorrect use of open_dev

open_dev can only be used for md array.  To open an
arbitrary device, dev_open must be used.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoGrow: make sure mdmon is running for Grow_continue arrays.
NeilBrown [Thu, 10 Mar 2011 00:36:47 +0000 (11:36 +1100)] 
Grow: make sure mdmon is running for Grow_continue arrays.

when starting an array that is in the middle of a migration,
we need to start mdmon, just as we do for arrays which are not
in the middle of a migration.

Repored-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: Make expansion counter usable
Adam Kwolek [Wed, 9 Mar 2011 22:58:35 +0000 (09:58 +1100)] 
FIX: Make expansion counter usable

Currently whole array geometry is set in sysfs_set_array(),
so none of disks (even for expansion) should fail during sysfs_add_disk()
Due to this expansion counter should be used for reshaped array when
disk slot is bigger than number of disks in array.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: Block reshaped array monitoring
Adam Kwolek [Wed, 9 Mar 2011 22:57:39 +0000 (09:57 +1100)] 
FIX: Block reshaped array monitoring

When array under reshape is assembled it has to be disabled from
monitoring as soon as possible. It can occur that this is i.e second
array in container and mdmon is loaded already.
Lack of blocking monitoring can cause change array state to active,
and reshape continuation will be not possible.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: Load container content for container reshape continuation
Adam Kwolek [Wed, 9 Mar 2011 22:54:56 +0000 (09:54 +1100)] 
FIX: Load container content for container reshape continuation

st->sb is null. This is exception cause.
reshape_container() function expects that super block will be loaded.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoGrow: don't let analyse_change see new level from metadata.
NeilBrown [Wed, 9 Mar 2011 07:53:09 +0000 (18:53 +1100)] 
Grow: don't let analyse_change see new level from metadata.

This is a bit of a hack - probably analyse change needs to be
re-written a bit to handle this properly.

However when the metadata deduced the intermediate state for a
reshaping array, the 'new_level' it sets should not be used to
interpret the 'delta_disks' number.
So in that case, hide the new_level while calling analyse_change.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoGrow: don't try to use 'raid_disks' value for a container.
NeilBrown [Wed, 9 Mar 2011 07:50:59 +0000 (18:50 +1100)] 
Grow: don't try to use 'raid_disks' value for a container.

The 'raid_disks' for a container is zero, so subtracting it
from the given raid_disks to get delta_disks doesn't make sense.

Rather set delta_disks to UnSet and set raid_disks to the requested
number of disks.   This then gets passed to reshape_super() which
can use it as required.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoGrow: only check 'native format' when really needed.
NeilBrown [Wed, 9 Mar 2011 07:47:24 +0000 (18:47 +1100)] 
Grow: only check 'native format' when really needed.

The check that the array info is already in 'native format' is
only relevant when restarting a growth, so only perform it then.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: Check correct 'old' level to see if reshape is needed.
Adam Kwolek [Tue, 8 Mar 2011 12:24:55 +0000 (13:24 +0100)] 
FIX: Check correct 'old' level to see if reshape is needed.

Normally when reshape_array is called with restart == 0,
info->array is the same as the 'array' read from the kernel
(via ioctl) so both have the same level.

However when called from reshape_container, info->array was
generated by the metadata so it will have 'level' set to the
intermediate (or final) level already.

So to test if we need to change the level, we need to compare the
desired level with that which was loaded from the kernel (array.level)
rather than that which was read from metadata (info->array.level).

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoGrow: add check that there are enough devices.
NeilBrown [Wed, 9 Mar 2011 07:37:00 +0000 (18:37 +1100)] 
Grow: add check that there are enough devices.

The check for 'enough spares' doesn't apply to RAID0 as we don't
mind it going degraded.  But add a test that there are enough spares
to actually produce a working array.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoTypo in dprintf
NeilBrown [Wed, 9 Mar 2011 07:31:56 +0000 (18:31 +1100)] 
Typo in dprintf

Canot -> Cannot

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFix comment in progress_reshape
NeilBrown [Wed, 9 Mar 2011 07:31:15 +0000 (18:31 +1100)] 
Fix comment in progress_reshape

The possible return values have changed since that comment.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoGrow: allow a RAID1 to be reshaped directly to 3-drive RAID5
NeilBrown [Wed, 9 Mar 2011 07:30:03 +0000 (18:30 +1100)] 
Grow: allow a RAID1 to be reshaped directly to 3-drive RAID5

Self-tests require this but code didn't allow it any more.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFix chunksize defaulting.
NeilBrown [Wed, 9 Mar 2011 07:27:19 +0000 (18:27 +1100)] 
Fix chunksize defaulting.

the new code for defaulting chunksizes didn't work quite right
 - default was set to late in super1/super0/ddf
 - defaults would over-ride values of '0' imposed by some levels
 - default value wasn't applied to size properly.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoDetail: report subarrays of a container properly.
NeilBrown [Wed, 9 Mar 2011 07:22:27 +0000 (18:22 +1100)] 
Detail: report subarrays of a container properly.

Due to the wrong variable being used, this part of --detail
wasn't working at all.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: FIX: Mark checkpoint and array state clean during reshape
Adam Kwolek [Tue, 8 Mar 2011 22:03:54 +0000 (09:03 +1100)] 
imsm: FIX: Mark checkpoint and array state clean during reshape

Array state has to be managed during reshape based on consistent flag.
To achieve this existing code will be reused. Currently existing code for
blocks_per_unit calculation can be removed
and existing code can be reused also.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAllow Grow_continue for whole container as well as single array.
NeilBrown [Tue, 8 Mar 2011 06:36:40 +0000 (17:36 +1100)] 
Allow Grow_continue for whole container as well as single array.

Some grow operations must be applied to a whole container.  These
are performed one array at a time, so only one array appears to
be reshaping.

When re-assembling such an array, we need to make sure that
when the reshape finished, we move on to the next array.

So require metadata to set ->reshape_active = 2 in that case,
and use reshape_container to complete the reshape.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: FIX: Variables declaration cleanup
Adam Kwolek [Tue, 8 Mar 2011 06:18:44 +0000 (17:18 +1100)] 
imsm: FIX: Variables declaration cleanup

Variables declaration moved a little bit up,
to not mix declaration and code.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoRun Grow_restart/Grow_continue when assembling the content of a container.
NeilBrown [Tue, 8 Mar 2011 06:14:00 +0000 (17:14 +1100)] 
Run Grow_restart/Grow_continue when assembling the content of a container.

As containers can now grow, we need to use both Grow_restart (to
replay any backup-file) and Grow_continue when assembling the content
of a container.

Note that we don't pass a backup-file when doing incremental assembly.
If such is needed in that case, the assembly will fail.

To restart such arrays, explicit assembly is required.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: FIX: Return blocks_per unit for general migration
Adam Kwolek [Tue, 8 Mar 2011 05:10:35 +0000 (16:10 +1100)] 
imsm: FIX: Return blocks_per unit for general migration

For general migration, blocks per unit are required for all disks,
not for per-member.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoChange way that reshaping arrays with external-metadata are assembled.
NeilBrown [Tue, 8 Mar 2011 05:10:29 +0000 (16:10 +1100)] 
Change way that reshaping arrays with external-metadata are assembled.

Now that the external metadata handler must provide an md-compatible
old/new geometry, sys_set_array can do all of the array set-up for
an array that is undergoing reshape.
That leave less for reshape_array to do.

Also clean up how reshape_array tells if the reshape has started or
not.
Don't use ->reshape_active as that doesn't tell us anything consistent
at this stage, only use the 'restart' flag passed in.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: improve getinfo_super when reshape is in progress.
NeilBrown [Tue, 8 Mar 2011 04:59:09 +0000 (15:59 +1100)] 
imsm: improve getinfo_super when reshape is in progress.

If a reshape (migration) is happening, we might need to modify the information
with provide to md so that it can cope with the reshape.
For example, if a migration from 4-device RAID0 to 5-device RAID0 is
happening, we need to tell md that it is reshape from degraded
5-device RAID4 to degraded 6-device RAID4 so md doesn't handle direct
reshape of RAID0.

There may be other migrations supported by IMSM that need special
treatment here.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoEnable error message in case of lack of spares for grow
Krzysztof Wojcik [Wed, 2 Mar 2011 16:33:01 +0000 (17:33 +0100)] 
Enable error message in case of lack of spares for grow

When we cannot find spare devices for grow operation we should
print error message.
This patch changes debug error message to 'stderr' print.

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agofix: generated udev rules does not work due to incorrect line format
Hawrylewicz Czarnowski, Przemyslaw [Mon, 7 Mar 2011 22:51:31 +0000 (09:51 +1100)] 
fix: generated udev rules does not work due to incorrect line format

Problem consists of missing =sign in comparison with SUBSYSTEM and
missing new line character at the end of line. As a result incremental
for hot-plugs of bare disks does not work.

Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoContinue reshape after assembling array
Adam Kwolek [Wed, 2 Mar 2011 01:28:15 +0000 (12:28 +1100)] 
Continue reshape after assembling array

assemble_container_content() cannot close mdfd handle, as it could be
required by reshape continuation.
mdfd handle is closed outside this function, when it is not longer
necessary.
Call to Grow_continue is added for reshape continuation after
assembly.

In the nearest future, simple condition:
    if (content->reshape_active)
before Grow_continue() call will be replaced by check function
for support container operation /reshape/.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAdd block_subarray()
Adam Kwolek [Wed, 2 Mar 2011 01:28:13 +0000 (12:28 +1100)] 
Add block_subarray()

Put code for blocking subarray in to separate function.
This little code/function will be used for blocking arrays from mdmon
monitoring during assembly process. Arrays cannot wait for container
assembly finish, because meanwhile monitor can enable arrays for writing.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: Set readonly state in Grow_continue() when necessary
Adam Kwolek [Mon, 28 Feb 2011 15:07:19 +0000 (16:07 +0100)] 
FIX: Set readonly state in Grow_continue() when necessary

When assembling array using assemble_container_content() for external
metadata case, array is in 'readonly' state already.
There is not necessary to duplicate this operation.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: Pass container name to reshape array for external meta data
Adam Kwolek [Mon, 28 Feb 2011 15:07:11 +0000 (16:07 +0100)] 
FIX: Pass container name to reshape array for external meta data

When calling reshape_array() for external metadata 'container name'
parameter have to be passed.
Find and pass container name in external metadata case.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: Spelling error in dprintf output
Adam Kwolek [Mon, 28 Feb 2011 15:07:03 +0000 (16:07 +0100)] 
FIX: Spelling error in dprintf output

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: disks added beyond array should be counted during reshape
Adam Kwolek [Wed, 23 Feb 2011 13:51:39 +0000 (14:51 +0100)] 
FIX: disks added beyond array should be counted during reshape

During expansion there is more working disks that array can have.
Disks with set raid_disk (not a spare disk) during reshape should be counted
to allow array state transition to read_only state.

Array reconfiguration to new geometry should be done before reshape will
be started.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoPartitions could be meaningful on single-drive RAID0
Krzysztof Wojcik [Fri, 25 Feb 2011 06:30:51 +0000 (07:30 +0100)] 
Partitions could be meaningful on single-drive RAID0

If we create a single-drive RAID0 array on partitioned drive,
we do not lose information about disk structure after operation
(partitions are visible on created array)
Warning message:

mdadm: partition table exists on /dev/sdX but will be lost or
       meaningless after creating array"

is not necessary during creation single-drive RAID0 array.
This patch removes the message.

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: imsm: OROM does not recognize degraded arrays (V2)
Krzysztof Wojcik [Fri, 25 Feb 2011 01:17:18 +0000 (02:17 +0100)] 
FIX: imsm: OROM does not recognize degraded arrays (V2)

Defect description:
When we create an redundant array in mdadm and then degrade it
by disk removing, Option ROM and Windows OS does not detect any array.
Reason:
Metadata created and updated after degrading array is not compatible
with IMSM standard.

This patch synchronizes the metadata according IMSM requirements.
Following inconsistencies have been fixed:
- reset all fields in imsm_dev during creation to avoid random values
- init dev status during creation to proper state
- not reset CONFIGURED_DISK flag when disk is missing
- add ":0" suffix to the serial number for missing/failed disks
- update medatada signature after takeover operation
- mark map state as degraded after raid0->raid10 takeover

Note:
Patch reworked after Dan Willams review.

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: FIX: Report correct array size during reshape
Adam Kwolek [Tue, 22 Feb 2011 14:13:31 +0000 (15:13 +0100)] 
imsm: FIX: Report correct array size during reshape

When reshape is started imsm stores new size in metadata.
mdadm requires "old" size to proper initialization restarted array.

When reshape is in progress getinfo_super_imsm_volume() should report
computed array size value instead array size stored in metatda.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: FIX: initalize reshape progress as it is stored in metatdata
Adam Kwolek [Tue, 22 Feb 2011 14:13:23 +0000 (15:13 +0100)] 
imsm: FIX: initalize reshape progress as it is stored in metatdata

reshape prodess cannot be restarted due to no checkpoint information
in mdinfo.
When metadata is read during reshape process or reshape restart,
rehape_progress (mdinfo field) has to be initialized to value
stored in metadata. This allows start reshape from stored
in metadata checkpoint.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoset default chunk in validate_geometry
Czarnowska, Anna [Tue, 22 Feb 2011 00:25:07 +0000 (11:25 +1100)] 
set default chunk in validate_geometry

When chunk size is not set from command line we need to guess it
depending on metadata given on command line or found on listed devices.

Validate_geometry sets the default for it's metadata if chunk is not set.
For external metadata chunk is set only when creating in a container.
For imsm validate_geometry_imsm_orom is responsible for finding default
chunk depending on container metadata loaded. Container will already know
which controller it is attached to, and have this controllers orom
available.
do_default_chunk indicates that we need to find default chunk and
if validate_geometry fails for some metadata it tells us to reset chunk
that may have been set.

Current solution would set default chunk correctly for imsm only if
container device was given on command line. With the list of devices
chunk was always set to 512.

Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agofix: memory leak in Create
Czarnowska, Anna [Thu, 17 Feb 2011 22:46:00 +0000 (22:46 +0000)] 
fix: memory leak in Create

match_metadata_desc allocates memory for st
which is not needed after validate_geometry fails

Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agomodified message on failure to read metadata in Manage
Czarnowska, Anna [Thu, 17 Feb 2011 22:43:19 +0000 (22:43 +0000)] 
modified message on failure to read metadata in Manage

Loading container may fail if e.g. one of the disks in container
has been detached but udev has not realized the change.
Addition to such array will fail because reading superblock
from one of disks in array fails.
Current message is a bit confusing.

Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: sysfs_disk_to_scsi_id() adapted to current sysfs format
Krzysztof Wojcik [Fri, 18 Feb 2011 12:51:34 +0000 (23:51 +1100)] 
FIX: sysfs_disk_to_scsi_id() adapted to current sysfs format

Problem: sysfs_disk_to_scsi_id() not returns correct scsi_id value.
Reason: sysfs format has been changed

This patch adapt sysfs_disk_to_scsi_id() to new sysfs format.

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoUser space RAID-6 access fix
Piergiorgio Sartor [Fri, 18 Feb 2011 12:51:19 +0000 (23:51 +1100)] 
User space RAID-6 access fix

> I have applied some patch - with some formatting changes to make it consistent
> with the rest of the code.
>
> I don't really have time to look more deeply at it at the moment.
> Maybe someone else will?...

Hi Neil,

thanks for including this in git.

Actually I did it look at it :-) and I already found a
couple of issues, below is a small fix patch.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: Seg Fault in incremental if BBM log detected
Krzysztof Wojcik [Fri, 18 Feb 2011 12:51:17 +0000 (23:51 +1100)] 
FIX: Seg Fault in incremental if BBM log detected

Bug  detected for imsm metadata.
Assembling of array using Incremental switch generate segmentation
fault if BBM log is detected.
Reason: missing return from Incremental_container if BBM is detected
and unnecessary list=NULL assignment.
This patch fix the problem and memory leak in this area.

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agomdadm.man add encouragement to shrink filesystem before shrinking array.
NeilBrown [Tue, 15 Feb 2011 01:40:21 +0000 (12:40 +1100)] 
mdadm.man add encouragement to shrink filesystem before shrinking array.

Before resizing an array with --size or --array-size, then filesystem
should be resized.  mdadm cannot do this so the user should.

Reported-by: Gavin Flower <gavinflower@yahoo.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFix regression with removing 'failed' and 'detached' devices.
NeilBrown [Mon, 14 Feb 2011 23:45:01 +0000 (10:45 +1100)] 
Fix regression with removing 'failed' and 'detached' devices.

If a request to remove all 'failed' or 'detached' devices chooses to
remove the first device, it will not actually try the removal and will
skip any following devices.

This fixes it.

Reported-by: Rémi Rérolle <rrerolle@lacie.com>
Tested-by: Rémi Rérolle <rrerolle@lacie.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoanalyse_change: fix calculation of after.data_disks and ->delta_disks.
NeilBrown [Mon, 14 Feb 2011 01:17:08 +0000 (12:17 +1100)] 
analyse_change: fix calculation of after.data_disks and ->delta_disks.

When changing level when a new number of raid disks was explicitly
specified, we much make sure that the change implied by the
change in level is properly incorporated into the final result.

So explicitly track the change in number of parity disks
(delta_parity) and use it together with delta_disks to determine
final data_disks.
Also set info->delta_disks so other code doesn't need to mirror
this analysis.

And add some errors in cases where a new number of disks was
requested but is not currently supported

Reported-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: Add raid5 to raid0 case to analyse_change()
Adam Kwolek [Mon, 14 Feb 2011 00:15:48 +0000 (11:15 +1100)] 
FIX: Add raid5 to raid0 case to analyse_change()

Transition raid5 to raid0 was not covered in analyse_change()
Missing case added.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: FIX: Add spare disks information to array description
Adam Kwolek [Mon, 14 Feb 2011 00:09:22 +0000 (11:09 +1100)] 
imsm: FIX: Add spare disks information to array description

Spares that are specified on container can be used by any array in container.
this means that for every array in container they should be reported.
This let caller know how many spare devices (not used in any array)
are still available.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: Get spares from external metadata
Adam Kwolek [Mon, 14 Feb 2011 00:06:31 +0000 (11:06 +1100)] 
FIX: Get spares from external metadata

For external metadata cases, information about number of spares cannot
be get via ioctl GET_ARRAY_INFO for particular array
(as info variable is initialized by). In md this information is present
in container object not array one.
This causes need to get spare disks number from external metadata.

This information is required for reshape_array() function to decide
if spare disks number satisfy operation requirements.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: delta_disk can have UnSet value
Adam Kwolek [Mon, 14 Feb 2011 00:04:09 +0000 (11:04 +1100)] 
FIX: delta_disk can have UnSet value

Delta_disk can be set to UnSet value.
This can a cause to pass wrong parameter to reshape_super().
To avoid such situations raid_disks and delta_disks parameters
have to be passed to reshape_super() separately.
It will be up to reshape_super() function validation
and usage of this parameters to avoid not valid values.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agofix: imsm: assemble doesn't restart recovery
Czarnowska, Anna [Sun, 13 Feb 2011 22:27:43 +0000 (09:27 +1100)] 
fix: imsm: assemble doesn't restart recovery

Because IMSM_ORD_REBUILD is set in second map not first.

Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agofix: imsm: size must be in K for rounding to chunk
Czarnowska, Anna [Sun, 13 Feb 2011 22:27:09 +0000 (09:27 +1100)] 
fix: imsm: size must be in K for rounding to chunk

chunk is in K so size must be converted to K before it is rounded.
Otherwise we may get wrong freesize returned
resulting in creation failure.

Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: Add information about failed disk to '-E' option
Adam Kwolek [Sun, 13 Feb 2011 22:25:57 +0000 (09:25 +1100)] 
imsm: Add information about failed disk to '-E' option

During metadata printout in '-E' option failed disk map field
information is missing.  Add this information to mdadm '-E' option
output.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: array after migration should be unfrozen
Adam Kwolek [Sun, 13 Feb 2011 22:23:37 +0000 (09:23 +1100)] 
FIX: array after migration should be unfrozen

After level migration array is left frozen.
When process is not externally forked reshape_array() should
unfreeze array before exit (this is not container operation).

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: Use single migration type for all migrations
Adam Kwolek [Sun, 13 Feb 2011 22:23:36 +0000 (09:23 +1100)] 
imsm: Use single migration type for all migrations

Use single enum definition/migration type for all migrations.
Using separate definitions causes limitation for number of changes
in metadata implementation during single update for migration/reshape.
Single CH_MIGRATION enum allows for many mtadata parameters change
in single update. It will be possible to change i.e. chunk size together
with raid level. In current implementation 2 metadata updates would be
required for such action, one using CH_CHUNK_MIGR and second using
CH_LEVEL_MIGRATION migration type.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: FIX: add raid5 to raid0 case to analyse_change()
Adam Kwolek [Wed, 9 Feb 2011 13:47:37 +0000 (14:47 +0100)] 
imsm: FIX: add raid5 to raid0 case to analyse_change()

Transition raid0 to raid5 is not possible
due to wrong condition in imsm_analyze_change().
Current condition blocks migration possibility instead allow for it.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: Test for raid1 -> raid0 takeover added
Krzysztof Wojcik [Wed, 9 Feb 2011 12:55:18 +0000 (13:55 +0100)] 
imsm: Test for raid1 -> raid0 takeover added

Patch introduces test for raid1 to raid0 takeover operation
verification for imsm metadata format.

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoUT FIX: Pass all UT in suit 13
Adam Kwolek [Wed, 9 Feb 2011 08:31:29 +0000 (09:31 +0100)] 
UT FIX: Pass all UT in suit 13

Parameters in UT suit 13 were wrongly chosen. This causes that
computed number of backup blocks was too big comparing to loop devices
size used in test. Changes in test parameters (chunk, array size)
causes that backup blocks passes mdadm condition for very small
loop devices.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: md runs recovery instead reshape for growing single disk raid0 array
Adam Kwolek [Wed, 9 Feb 2011 03:07:33 +0000 (14:07 +1100)] 
FIX: md runs recovery instead reshape for growing single disk raid0 array

Problem occurs when we want to expand single disk raid0 array.
This is done via degraded 2 disks raid4 array. When new spare disk
for reshape is added to array, md immediately initiates recovery before
mdadm can configure and start reshape. This is due fact that 2 disk
raid4/5 array is special md case.
Mdmon does nothing here because container is blocked.
This is caused because after takeover array is not in frozen state in md.

Put array in to frozen state after takeover to allow mdadm to finish
configuration before reshape is executed in md.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: Container can be left frozen
Adam Kwolek [Wed, 9 Feb 2011 03:07:26 +0000 (14:07 +1100)] 
FIX: Container can be left frozen

When container operation fails before child process starts,
array can be left frozen because container_reshape() doesn't make
unfreeze() operation in all error cases, as it is responsible for.

add unfreeze() operation for error case scenarios in reshape_container()

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoUT FIX: imsm container can have different blocks number
Adam Kwolek [Tue, 8 Feb 2011 13:30:45 +0000 (14:30 +0100)] 
UT FIX: imsm container can have different blocks number

When imsm container is created it have different blocks number
in /proc/mdstat depending on containing array raid level (raid0/raid5).
raid5 case:
md127 : inactive sdd[3](S) sde[2](S) sdc[1](S) sdb[0](S)
      2884 blocks super external:imsm

raid0 case:
md127 : inactive sdd[3](S) sde[2](S) sdc[1](S) sdb[0](S)
      836 blocks super external:imsm

Due to this, it cannot be compared to one value for both cases.

Test imsm container existence before unit test run only.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: FIX: Wrong output string format
Adam Kwolek [Tue, 8 Feb 2011 13:30:37 +0000 (14:30 +0100)] 
imsm: FIX: Wrong output string format

On wrong starting container reshape conditions, mdadm returns information on console:
mdadmimsm: Operation is not allowed on this container

it is changed to:
mdadm: (imsm) Operation is not allowed on this container

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoSpare migration tests updated
Czarnowska, Anna [Tue, 8 Feb 2011 00:44:50 +0000 (11:44 +1100)] 
Spare migration tests updated

Added tests for cases when:
0  - there is no config file at all
0a - config file has no domains defined
9a - spare is in global domain
15 - spare is in global domain for $platform metadata

Test 4 pass condition changed for imsm metadata.

disk_policy only adds controller domain for imsm
when config_rules_has_path=1.
If there are any domains in config then every disk will have also
a controller domain.
As a result the array needing spares has at least
one controller domain even when it doesn't have any other
domains specified explicitly. In this case any spare in the same
controller domain matches when it has no other domains from config.
(This behaviour is different from the case when there is no paths
in config at all as array domain then is null and no spare matches)

Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agofix: array is reassembled inactive if stopped during resync
Czarnowska, Anna [Tue, 8 Feb 2011 00:44:42 +0000 (11:44 +1100)] 
fix: array is reassembled inactive if stopped during resync

If initial resync or recovery of a redundant array is not finished
before it is stopped then during assembly md will start it as inactive.
Writing readonly to array_state in assemble_container_content
fails because md thinks the array is during reshape.

In fact we only have a reshape if both current and previous map
states are the same. Otherwise we may have resync or recovery.
Setting reshape_active in such cases causes the issue.

Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>
Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoUser space RAID-6 access
Piergiorgio Sartor [Tue, 8 Feb 2011 00:44:23 +0000 (11:44 +1100)] 
User space RAID-6 access

> test_stripe assumes that the data starts at the start of each device.
> AS you are using 1.2 metadata (the default), data starts about 1M in to
> the device (I think - you can check with --examine)
>
> You could fix test_stripe to put the right value in the 'offsets' array,
> or you could create the array with 1.0 or 0.90 metadata.

Hi Neil,

thanks for the info, maybe this should be a second patch.

In the meantime, please find attached a patch to restripe.c
of mdadm 3.2 (latest, I hope).

This should add the functionality to detect, in RAID-6,
which of the disks potentially has problems, in case of
parity errors.

Some checks take place in order to avoid false positives,
I hope these are correct and enough.

I'm not 100% happy of the interface (too much redundancy),
but for the time being it could be OK.

Of course, any improvement is welcome.

Please consider to include these changes to the next mdadm
whatever release.

bye,

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: FIX: Size is already set in metadata
Adam Kwolek [Tue, 1 Feb 2011 13:49:20 +0000 (14:49 +0100)] 
imsm: FIX: Size is already set in metadata

In metadata size is set already during migration initialization.
There is no reason for second /the same/ calculation.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: FIX: size have to be calculated based on first map
Adam Kwolek [Tue, 1 Feb 2011 14:24:54 +0000 (15:24 +0100)] 
imsm: FIX: size have to be calculated based on first map

Before reshape finalization migration is still present in metadata.
After patch 'imsm: FIX: crash during getting map'
function get_imsm_map() returns correct value,
this means in our case from second (start) map.

We should calculate map size basing on first (final) map.
For this we should request it by setting second function parameter to '0'

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: move common code for array size calculation to function
Adam Kwolek [Thu, 3 Feb 2011 06:57:25 +0000 (17:57 +1100)] 
imsm: move common code for array size calculation to function

Array size calculation is made in the same way in few places in code.
Make function imsm_set_device_size() for this common code.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: FIX: Debug strings cleanup
Adam Kwolek [Thu, 3 Feb 2011 06:57:10 +0000 (17:57 +1100)] 
imsm: FIX: Debug strings cleanup

Some debug strings remains as they were introduced,
before code was moved to separate function.
Information displayed by debug information in not all cases
was correct.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: fix: imsm_num_data_members() can return error
Adam Kwolek [Thu, 3 Feb 2011 06:47:52 +0000 (17:47 +1100)] 
imsm: fix: imsm_num_data_members() can return error

imsm_num_data_members() can indicate error by returning 0 value
In such case size cannot be set based on 0 value.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: FIX: put expansion finalization in to one place
Adam Kwolek [Thu, 3 Feb 2011 06:46:17 +0000 (17:46 +1100)] 
imsm: FIX: put expansion finalization in to one place

When a->last_checkpoint variable can reach array end,
reshape finalization can be put in to single place.

There is no need to reset migration variables.
imsm_set_disk() will call end_migration() and this sets
all migration variables to required values.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: FIX: array size is wrong
Adam Kwolek [Thu, 3 Feb 2011 06:40:18 +0000 (17:40 +1100)] 
imsm: FIX: array size is wrong

Calculation of size is almost ok, except concept of blocks.
Size for setting in md has to be divided by 2 to be correct.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: Last checkpoint is not set
Adam Kwolek [Thu, 3 Feb 2011 06:34:27 +0000 (17:34 +1100)] 
FIX: Last checkpoint is not set

When reshape is finished monitor has to set last checkpoint
to the array end to allow metatdata for reshape finalization.
Metadata has to know if reshape is finished or it is broken
On reshape finish metadata finalization is required.
When reshape is broken, metadata must remain as is to allow
for reshape restart from checkpoint.

This can be resolved based on reshape_position sysfs entry.
When it is equal to 'none', it means that md finishes work.
In such situation move checkpoint to the end of array.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: FIX: crash during getting map
Adam Kwolek [Thu, 3 Feb 2011 06:02:39 +0000 (17:02 +1100)] 
imsm: FIX: crash during getting map

When get_imsm_map() is called with second_map parameter == '-1'
and array is not in migration state NULL pointer is returned.
This is wrong. '-1' means return map as migration record points.

'-1' can be passed to get_imsm_map() from imsm_num_data_members().
imsm_num_data_members() is called to get current map members based
on migr_state information

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoRelease mdadm-3.2 - developer only release mdadm-3.2
NeilBrown [Tue, 1 Feb 2011 05:11:13 +0000 (16:11 +1100)] 
Release mdadm-3.2 - developer only release

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoVarious compile fixes.
NeilBrown [Tue, 1 Feb 2011 04:48:03 +0000 (15:48 +1100)] 
Various compile fixes.

Make "make everything" succeed.
This fixed some real bugs.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoVarious man page fixes.
NeilBrown [Tue, 1 Feb 2011 04:06:44 +0000 (15:06 +1100)] 
Various man page fixes.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agotests: add IMSM_NO_PLATFORM to some places that were missing it.
NeilBrown [Tue, 1 Feb 2011 03:44:02 +0000 (14:44 +1100)] 
tests: add IMSM_NO_PLATFORM to some places that were missing it.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agomanagemon: don't try to add spares when resync/recovery is happening.
NeilBrown [Tue, 1 Feb 2011 03:44:02 +0000 (14:44 +1100)] 
managemon: don't try to add spares when resync/recovery is happening.

kernel should reject this anyway, and we really should not be trying
as it can only lead to confusion.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAllow explicitly listed spared to be included by default.
NeilBrown [Tue, 1 Feb 2011 03:44:02 +0000 (14:44 +1100)] 
Allow explicitly listed spared to be included by default.

When the metadata doesn't identify which array a spare belongs to
we normally require an explicit domain match to connect a spare
with an array.
However when the spare is explicitly listed in argv, it should be
safe to include as long as there is no domain conflict.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAllow domain_test to report that no domains were found.
NeilBrown [Tue, 1 Feb 2011 03:44:02 +0000 (14:44 +1100)] 
Allow domain_test to report that no domains were found.

Sometime we will need to know the difference between no domains found
and domains didn't match.
So allow domain_test to return different values and fix up all callers
to maintain current behaviour.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agotest: remind where the log file is.
NeilBrown [Tue, 1 Feb 2011 03:44:02 +0000 (14:44 +1100)] 
test: remind where the log file is.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agotest: remove all the environment handling.
NeilBrown [Tue, 1 Feb 2011 03:43:59 +0000 (14:43 +1100)] 
test: remove all the environment handling.

Instead, just include the environ explicitly in the test file
or, where shared, source the shared file.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoIncr: don't exclude 'active' devices from auto inclusion in a container.
NeilBrown [Tue, 1 Feb 2011 02:07:36 +0000 (13:07 +1100)] 
Incr: don't exclude 'active' devices from auto inclusion in a container.

For containers, it is always appropriate to include a device in the
container.
Whether it should then be included in an array is a separate question.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agofree_super after assembling a container
NeilBrown [Tue, 1 Feb 2011 02:07:24 +0000 (13:07 +1100)] 
free_super after assembling a container

Else the devices are held open.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAssemble: ignore unknown devices not listed on command line.
NeilBrown [Tue, 1 Feb 2011 02:07:07 +0000 (13:07 +1100)] 
Assemble: ignore unknown devices not listed on command line.

If we find a device that has not superblock, we currently fail
unless in auto_assem mode.
However we really should only fail if the device was explicitly listed
in the arg list.  So add a test for that.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAssemble: allow to assemble container with uuid=0:0:0:0
Czarnowska, Anna [Mon, 31 Jan 2011 23:40:56 +0000 (10:40 +1100)] 
Assemble: allow to assemble container with uuid=0:0:0:0

When there are any arrays in config file the spares with
domain not matching any array are not assembled because
auto assembly is not attempted.
Addition of ARRAY line with uuid=0:0:0:0 in config will work
with modified condition for gathering spares.

Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>