]> git.ipfire.org Git - thirdparty/mdadm.git/log
thirdparty/mdadm.git
12 years agoFix some compiler warnings.
Luca Berra [Fri, 17 Jun 2011 04:35:06 +0000 (14:35 +1000)] 
Fix some compiler warnings.

Original by Luca, with various changes by Neil

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoVarious fixes so that "make everything" works.
NeilBrown [Thu, 16 Jun 2011 07:13:50 +0000 (17:13 +1000)] 
Various fixes so that "make everything" works.

In particular: protect some stuff from MDASSEMBLE and report and error
from 'write'.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoMore fixes for tests.
NeilBrown [Thu, 16 Jun 2011 04:18:18 +0000 (14:18 +1000)] 
More fixes for tests.

Some more fixes to help some tests run properly.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agotest/ddf add a udevadm settle
NeilBrown [Wed, 15 Jun 2011 06:30:12 +0000 (16:30 +1000)] 
test/ddf  add a udevadm settle

We need to settle udev before assuming the devices exist.

Signed-off-by: NeilBrown <neilb@suse.de
12 years agoRemove more duplicated code
NeilBrown [Wed, 15 Jun 2011 06:30:09 +0000 (16:30 +1000)] 
Remove more duplicated code

Code from env-imsm-template is also in 09imsm-create-fail-rebuild,
so remove it from there.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agotests/08imsm-overlap - remove duplicated code
NeilBrown [Wed, 15 Jun 2011 06:06:57 +0000 (16:06 +1000)] 
tests/08imsm-overlap - remove duplicated code

This test contains a lot of code that is also in env-imsm-template.
So remove it and simple source the other.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoddf: fix up getinfo_super_bvd
NeilBrown [Wed, 15 Jun 2011 05:49:23 +0000 (15:49 +1000)] 
ddf: fix up getinfo_super_bvd

Now that getinfo_super clears the info structure, we need
to make sure the correct values are filled in to info->dev.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoRemove compiler warning about signed/unsigned comparison.
Albert Pauw [Wed, 15 Jun 2011 04:39:30 +0000 (14:39 +1000)] 
Remove compiler warning about signed/unsigned comparison.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoFix imsm-overlap test.
NeilBrown [Wed, 15 Jun 2011 04:39:28 +0000 (14:39 +1000)] 
Fix imsm-overlap test.

Now that we reserve space for migration buffer devices are a little
bit smaller so we need to allow for that in the test suite.

Also add a 'udevadm settle' - it seems to help

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoIncr: fix breakage in count_active.
NeilBrown [Wed, 15 Jun 2011 02:21:26 +0000 (12:21 +1000)] 
Incr: fix breakage in count_active.

If the second device is much newer than the first, but has a lower
raid_disk number, we clear 'avail' badly and don't set up
'best' properly.

Fix these things.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: Metadata Attributes compatibility support
Adam Kwolek [Tue, 14 Jun 2011 13:59:18 +0000 (15:59 +0200)] 
imsm: Metadata Attributes compatibility support

IMSM's meta data contains Attributes field that contains information about
supported features.
To assembly an array mdadm has to support all features specified by attributes.

The patch introduces new attributes support and validation of the attribuses
during an array assembly.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Sometimes reshape cannot be finished
Adam Kwolek [Tue, 14 Jun 2011 23:13:49 +0000 (09:13 +1000)] 
imsm: FIX: Sometimes reshape cannot be finished

When array size is not aligned to copy area, number of migration unit
is increased in init_migr_record_imsm():7665 to reshape whole array.
During calculation of last migration unit, this should be in mind also,
otherwise checkpoint (max-1) is always written and reshape
is never finished in mdadm.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: klocwork: passed dev pointer to is_gen_migration() can be NULL
Adam Kwolek [Tue, 14 Jun 2011 02:48:58 +0000 (12:48 +1000)] 
imsm: FIX: klocwork: passed dev pointer to is_gen_migration() can be NULL

Pointer dev2 passed in write_super_imsm():4451 can be equal to NULL.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: Fix: klocwork: targets variable can be used uninitialized
Adam Kwolek [Tue, 14 Jun 2011 02:48:53 +0000 (12:48 +1000)] 
imsm: Fix: klocwork: targets variable can be used uninitialized

When target_offsets allocation fails execution goes to abort label,
where elements from targets table are closed.

Initialize targets table after allocation.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Migration Raid0->Raid5 cannot be restarted correctly
Adam Kwolek [Tue, 14 Jun 2011 02:46:53 +0000 (12:46 +1000)] 
imsm: FIX: Migration Raid0->Raid5 cannot be restarted correctly

When array raid0 is migrated to raid5, reshape cannot be continued
correctly due to wrong array parameters settings.
Raid disks number is set too big.

There is no need, during raid0->raid5 migration to increase
info->array.raid_disks, it is already set to final value using
designation map information.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Raid5 data corruption data recovering from backup
Adam Kwolek [Tue, 14 Jun 2011 02:42:22 +0000 (12:42 +1000)] 
imsm: FIX: Raid5 data corruption data recovering from backup

Sporadicaly when Raid5's data are restored from backup area,
corruption occurs.
It doesn't happen if reshape process is beyond critical section.

Root cause of the problem is passing wrong starting point in
restore_stripes(). It was hard coded to 0 so far.
This causes that parity disks position in first stripe was always set
to the last raid disk. This position should depend on data position in array.

Proper start position was set and pointer for restoring data
(copy area address) is adjusted to passed start parameter.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Disable automatic metadata rollback for broken reshape
Adam Kwolek [Tue, 14 Jun 2011 02:42:16 +0000 (12:42 +1000)] 
imsm: FIX: Disable automatic metadata rollback for broken reshape

mdmon cannot rollback metadata changes automatically.
It can break reshape process in the way that in case of reshape break
user will not be able to deal with broken reshape due to lack of information
about reshape geometry.

mdadm (process that invokes reshape) doesn't make any rollback to allow
for user action. mdmon should not do this either unless it knows for sure
it is save. such knowledge is not available for automatic rollback.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Use function to obtain array layout
Adam Kwolek [Tue, 14 Jun 2011 02:42:08 +0000 (12:42 +1000)] 
imsm: FIX: Use function to obtain array layout

Function imsm_level_to_layout() should be use to get array layout.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoFIX: Cannot create volume
Adam Kwolek [Tue, 14 Jun 2011 02:42:06 +0000 (12:42 +1000)] 
FIX: Cannot create volume

getinfo_super() can clear entire 'inf' structure before filling with new
information. Disk number required later is lost.

Restore disk number information after getinfo_super() call.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoMAN: Man update for check-pointing
Adam Kwolek [Thu, 9 Jun 2011 03:00:56 +0000 (13:00 +1000)] 
MAN: Man update for check-pointing

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: Optimize expansion speed when no backup is required
Adam Kwolek [Thu, 9 Jun 2011 03:00:56 +0000 (13:00 +1000)] 
imsm: Optimize expansion speed when no backup is required

When no reshape backup is required (e.g. OLCE after critical section),
check-pointing can use bigger steps than backup space allows for.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Remove timeout from wait_for_reshape_imsm()
Adam Kwolek [Thu, 9 Jun 2011 03:00:55 +0000 (13:00 +1000)] 
imsm: FIX: Remove timeout from wait_for_reshape_imsm()

Timeout should not be used for select function in wait_for_reshape_imsm().

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: wait_for_reshape_imsm() cleanup
Adam Kwolek [Thu, 9 Jun 2011 03:00:55 +0000 (13:00 +1000)] 
imsm: FIX: wait_for_reshape_imsm() cleanup

This function needs to be corrected.
It should check sysfs operations status and it should not interpret
0 reshape position special meaning.

Unused input parameter is removed also.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Do not continue reshape when backup exists
Adam Kwolek [Thu, 9 Jun 2011 03:00:55 +0000 (13:00 +1000)] 
imsm: FIX: Do not continue reshape when backup exists

When backup exists in copy area reshape cannot be continued.
In such situation, array is in unstable state.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoFIX: Move buffer to next location
Adam Kwolek [Thu, 9 Jun 2011 03:00:55 +0000 (13:00 +1000)] 
FIX: Move buffer to next location

When no output file is given save_stripes() should collect amount of stripes
in passed buffer. Currently all stripes are saved in the same area in passed
buffer. This causes that last stripe is returned on buffer begin only.
Increase buffer (buf) pointer when save_stripes() is about switch to next
stripe operation. This allows for proper buffer filling as input parameter
length directs.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Remove unused variables and code
Adam Kwolek [Thu, 9 Jun 2011 03:00:55 +0000 (13:00 +1000)] 
imsm: FIX: Remove unused variables and code

Unused variables and code can be removed from imsm_manage_reshape()

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Move reshape_progress forward
Adam Kwolek [Thu, 9 Jun 2011 03:00:55 +0000 (13:00 +1000)] 
imsm: FIX: Move reshape_progress forward

When array under reshape is assembled, reshape position used in sysfs_set_array()
should be set to position after recovered from backup area.
This avoids data corruption due to reshape the same array area again.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Detect failed devices during recover_backup_imsm()
Adam Kwolek [Thu, 9 Jun 2011 03:00:55 +0000 (13:00 +1000)] 
imsm: FIX: Detect failed devices during recover_backup_imsm()

Detect in recover_backup_imsm() if not opened disks number is smaller
than allowed degradation for given raid level. This allows for reshape restart
on degraded array.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Use metadata information for restore_stripes() and save_stripes()
Adam Kwolek [Thu, 9 Jun 2011 03:00:55 +0000 (13:00 +1000)] 
imsm: FIX: Use metadata information for restore_stripes() and save_stripes()

For raid0 reshape imsm uses degraded raid4 for this operation.
Using real raid level (raid0) for stripe calculation causes no need
for parity calculation and can speed up reshape process.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Remove unused parameter from save_backup_imsm() interface
Adam Kwolek [Thu, 9 Jun 2011 03:00:55 +0000 (13:00 +1000)] 
imsm: FIX: Remove unused parameter from save_backup_imsm() interface

new_data parameter is not used in save_backup_imsm().
It is removed from function interface.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Do not use pba_of_lba0 for copy position calculation
Adam Kwolek [Thu, 9 Jun 2011 03:00:55 +0000 (13:00 +1000)] 
imsm: FIX: Do not use pba_of_lba0 for copy position calculation

imsm_manage_reshape() should not shift start copy position.
This offset is passed to manage reshape function /and it is used/
as input parameter in offsets table already.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Do not verify unused parameters
Adam Kwolek [Thu, 9 Jun 2011 03:00:55 +0000 (13:00 +1000)] 
imsm: FIX: Do not verify unused parameters

Parameters that are not used by imsm_manage_reshape() should not cause
failure of this function.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Calculate backup location based on metadata information
Adam Kwolek [Thu, 9 Jun 2011 03:00:55 +0000 (13:00 +1000)] 
imsm: FIX: Calculate backup location based on metadata information

Use metadata information to calculate backup write offset.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Use macros to data access
Adam Kwolek [Thu, 9 Jun 2011 03:00:55 +0000 (13:00 +1000)] 
imsm: FIX: Use macros to data access

Metadata fields has to be accessed using proper macros.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Check layout for level migration
Adam Kwolek [Thu, 9 Jun 2011 03:00:55 +0000 (13:00 +1000)] 
imsm: FIX: Check layout for level migration

When user doesn't specify raid 5 layout for raid0->rai5 migration,
layout structure member is uninitialized. Earlier it cannot be determined
if it is correct or not.
In metadata handle proper verification is placed.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Max position could not be rounded to MB
Adam Kwolek [Thu, 9 Jun 2011 03:00:55 +0000 (13:00 +1000)] 
imsm: FIX: Max position could not be rounded to MB

When rounded array size information from metadata is used for number
of migration units calculation it can occurs that result of units
can be smaller (-1) than required due to used (rounded) array size).

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Detect migration end during migration record saving
Adam Kwolek [Thu, 9 Jun 2011 03:00:55 +0000 (13:00 +1000)] 
imsm: FIX: Detect migration end during migration record saving

Checkpoint should be saved when migration is in progress only.
End of reshape (based on passes status) should be detected and it should
not cause abort of reshape/check-pointing/ operation.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Verify if migration record is loaded correctly
Adam Kwolek [Thu, 9 Jun 2011 03:00:54 +0000 (13:00 +1000)] 
imsm: FIX: Verify if migration record is loaded correctly

Migration compatibility can be checked when general migration record
is present.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: FIX: Opened handle is not closed
Adam Kwolek [Thu, 9 Jun 2011 03:00:54 +0000 (13:00 +1000)] 
imsm: FIX: Opened handle is not closed

Opened file handle should be closed before function exit.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agorestripe: fix compile error in stand-alone program.
NeilBrown [Thu, 9 Jun 2011 03:00:46 +0000 (13:00 +1000)] 
restripe: fix compile error in stand-alone program.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoFix some fall-out from recent memset-zero for getinfo_super
NeilBrown [Thu, 9 Jun 2011 02:42:02 +0000 (12:42 +1000)] 
Fix some fall-out from recent memset-zero for getinfo_super

container_content_imsm was setting info->next before calling
getinfo_super_imsm_container which now zeros everything.
So move that assignment to afterwards.

So both imsm and ddf were assuming info->disk.raid_disk means
something but it doesn't.  So fix those.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: Unit Tests - remove backup-file during grow command
Adam Kwolek [Wed, 8 Jun 2011 07:15:04 +0000 (17:15 +1000)] 
imsm: Unit Tests - remove backup-file during grow command

Update reshape/migration unit tests to not to use backup file.
Imsm native check-pointing has to be used (internally) instead.

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: Remove user warning before reshape start
Adam Kwolek [Wed, 8 Jun 2011 07:14:33 +0000 (17:14 +1000)] 
imsm: Remove user warning before reshape start

imsm's arrays supports imsm native check-pointing now.
User warning is no longer required.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoDo not use backup file for external metadata
Adam Kwolek [Wed, 8 Jun 2011 07:13:30 +0000 (17:13 +1000)] 
Do not use backup file for external metadata

When external metatdata handler supports manage_reshape()
and recover_backup() functions in super switch backup file is not required
and can be omitted. For backup purposes metadata specific mechanisms
are used.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoFIX: Enable metadata updates for raid0
Adam Kwolek [Wed, 8 Jun 2011 07:13:26 +0000 (17:13 +1000)] 
FIX: Enable metadata updates for raid0

When raid0 is takeovered to degraded raid4, metadata updates has to be
applied via mdmon (raid4 has to be monitored).
It is not possible due to no update_tail pointer initialization
in supertype structure.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: Apply checkpoint metadata update for general migration
Adam Kwolek [Wed, 8 Jun 2011 07:13:21 +0000 (17:13 +1000)] 
imsm: Apply checkpoint metadata update for general migration

mdmon has to update checkpoint information in metadata during
general migration according to received metadata update.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: Prepare checkpoint update for general migration
Adam Kwolek [Wed, 8 Jun 2011 07:12:48 +0000 (17:12 +1000)] 
imsm: Prepare checkpoint update for general migration

mdadm has to prepare checkpoint information update and send it to mdmon.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: Add metadata update type for general migration check-pointing
Adam Kwolek [Wed, 8 Jun 2011 07:12:39 +0000 (17:12 +1000)] 
imsm: Add metadata update type for general migration check-pointing

There are 2 places for keeping checkpoint information:
- metadata (per volume information used during volume
  initialization and rebuilding).
- migration record (per container information used during
  migration/reshape)

During reshape both checkpoints has to contains the same information.
To do this mdadm will send metadta update with checkpoint information.

Note: Checkpoint information consistence is not critical. During general
      migration restart, information from migration record is used only.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: Disable checkpoint updating by mdmon for general migration
Adam Kwolek [Wed, 8 Jun 2011 07:11:49 +0000 (17:11 +1000)] 
imsm: Disable checkpoint updating by mdmon for general migration

imsm contains 2 check-pointing mechanism. One (per array) is used for
initialization and rebuild and second (per container) is used for general
migration (reshape). First is controlled by mdmon, second by mdadm.
To avoid conflicts disable mdmon checkpoints updating for general
migration.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: Implement recover_backup_imsm() for imsm metadata
Adam Kwolek [Wed, 8 Jun 2011 07:11:23 +0000 (17:11 +1000)] 
imsm: Implement recover_backup_imsm() for imsm metadata

Add ability to restore data backed up in General Migration Copy Area
in case of unexpected reshape interruption.
Function restores data during an array assembly and then reshape
is continues from next checkpoint.

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoAdd reshape restart support for external metadata
Adam Kwolek [Wed, 8 Jun 2011 07:11:11 +0000 (17:11 +1000)] 
Add reshape restart support for external metadata

Patch introduces support for reshape process restart for external metadata
using metadata specific data handling methods.
It introduces recover_backup() function that restores array to stable state
It is equivalent to Grow_restart() functionality for native metadata.

Signed-off-by: Maciej Trela <maciej.trela@intel.com>
Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: update blocks_per_migr_unit() to support migration record
Adam Kwolek [Wed, 8 Jun 2011 07:09:50 +0000 (17:09 +1000)] 
imsm: update blocks_per_migr_unit() to support migration record

blocks_per_migr_unit() has to use information from migration record
for general migration case. This causes to pass intel_super pointer
to this function and some other interfaces changes.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: Add information about migration record to mdadm '-E' option
Adam Kwolek [Wed, 8 Jun 2011 07:09:29 +0000 (17:09 +1000)] 
imsm: Add information about migration record to mdadm '-E' option

Add ability to display information from migration record in examine
option.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: Clear migration record when no migration in progress
Adam Kwolek [Wed, 8 Jun 2011 07:09:16 +0000 (17:09 +1000)] 
imsm: Clear migration record when no migration in progress

When metadata is saved and there is no general migration in progress
/in container/ clear migration record in container.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: Check if array degradation has been changed
Adam Kwolek [Wed, 8 Jun 2011 07:09:09 +0000 (17:09 +1000)] 
imsm: Check if array degradation has been changed

Before reshaping every "migration unit", check if array is still usable.
In failed disks number is greater than allowed degradation level, reshape
has to be aborted.

Signed-off-by: Maciej Trela <maciej.trela@intel.com>
Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: Implement imsm_manage_reshape(), reshape workhorse
Adam Kwolek [Wed, 8 Jun 2011 07:09:08 +0000 (17:09 +1000)] 
imsm: Implement imsm_manage_reshape(), reshape workhorse

Before reshape is started, mdadm should check again if there is only one
array (in container) under reshape. Then function "divides" array in to
"migration units" that can fits migration copy area and enters main loop.
It checks if current "migration unit" requires to be backed up.
If necessary mdadm saves it to copy area and updates migration record.
Then MD-driver is directed to perform reshape step (by "migration unit" size)
and checkpoint is moved forward. In this way reshape is executed until
array ends.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: Add wait_for_reshape_imsm() implementation
Adam Kwolek [Wed, 8 Jun 2011 07:07:10 +0000 (17:07 +1000)] 
imsm: Add wait_for_reshape_imsm() implementation

After each checkpoint mdadm should set new reshaped area and wait
until md finishes reshape. Function wait_for_reshape_imsm() sets
new reshape range and waits for job completion.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoGrow: Add paranoid level checking to analyse_change.
NeilBrown [Wed, 8 Jun 2011 06:56:41 +0000 (16:56 +1000)] 
Grow: Add paranoid level checking to analyse_change.

Just in case array.level is ever something that we don't expect, make
sure we report an error clearly rather than get confused.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: check migration compatibility
Adam Kwolek [Wed, 8 Jun 2011 06:46:37 +0000 (16:46 +1000)] 
imsm: check migration compatibility

Under Windows IMSM can reshape arrays in 2 directions
(ascending and decsending).
Under Linux one (ascending) direction is supported at this moment.
Block loading metadata when decsending reshape is detected

Windows also uses optimalization area during reshaping array.
Linux does not support it.
The patch blocks this operation also.

Signed-off-by: Maciej Trela <maciej.trela@intel.com>
Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: Add support for copy area and backup operations
Adam Kwolek [Wed, 8 Jun 2011 06:46:35 +0000 (16:46 +1000)] 
imsm: Add support for copy area and backup operations

This patch adds methods of manipulating migration record:
init_migr_record_imsm() - initiate migration record at the beginning of
     the reshape process
write_imsm_migr_rec() - saves migration record to array.
     Migration record is stored on 2 first disks in array only.
save_backup_imsm() - saves critical data stripes to Migration Copy Area
     and updates the current migration unit status.
     Uses restore_stripes() to format a destination stripe, and to write it
     to the Migration Copy Area.
save_checkpoint_imsm() - Updates the current unit status in the
     migration record.

Migration record is written to 2 first array disks only (similar to reading
operation).

Signed-off-by: Maciej Trela <maciej.trela@intel.com>
Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoDefine dummy functions to mdmon.c
Adam Kwolek [Wed, 8 Jun 2011 06:28:40 +0000 (16:28 +1000)] 
Define dummy functions to mdmon.c

Definitions are necessary to compile mdmon.
Metadata specific source code is compiled to mdmon.
Functions used for reshape check pointing:
- restore_stripes()
- save_stripes
- abort_reshape
are not used in mdmon, but they are compiled in it.
To enable mdmon compilation, dummy functions are used.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoSupport restore_stripes() from the given buffer
Adam Kwolek [Wed, 8 Jun 2011 06:24:48 +0000 (16:24 +1000)] 
Support restore_stripes() from the given buffer

For external metadata backup location and saving methods depends
on metadata specific implementation details. Currently restore_stripes()
function is able to restore data only from the given backup file handles
and it is used only for assembling partially reshaped arrays.
As this function will be very helpful for external metadata backup
mechanism, add the support for restoring data from the given source buffer.
Add possibility for save_stripes() to work without designation targets.
Save_stripes() can now prepare data for restore_stripes() only.

Signed-off-by: Maciej Trela <maciej.trela@intel.com>
Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: Add migration record to intel_super
Adam Kwolek [Wed, 8 Jun 2011 06:19:06 +0000 (16:19 +1000)] 
imsm: Add migration record to intel_super

IMSM for securing reshape process uses special disk area outside metadata
for reshaped area backup purposes. If just reshaped array area requires
backup, bunch of array stripes prepared for reshape is stored in to
Migration Copy Area. In case of reshape interruption, Option ROM during
restart or mdadm during reshape restart (when no reboot occurs) will
restore Migration Copy Area to designation array. Reshape can be
continued from stable array stable state.

This patch adds support for IMSM migration record structure.
IMSM migration record is stored on the first two disks of IMSM volume
during the migration.

Add function for reading migration record, so mdadm can read (if present)
migration record. Migration record has to be cleared every time
MIGR_GEN_MIGR is started.

Signed-off-by: Maciej Trela <maciej.trela@intel.com>
Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agogetinfo_super now clears the 'info' structure before filling it in.
NeilBrown [Wed, 8 Jun 2011 05:54:13 +0000 (15:54 +1000)] 
getinfo_super now clears the 'info' structure before filling it in.

Some code currently clears 'info' before calling getinfo_super,
some code doesn't.

To be consistent, change it so no caller ever clears 'info',
but ever getinfo_super function must clear it.

Note that ->raid_disk may be meaningful if that 'map' is passed
non-NULL.  In that case it is copied out before the structure
is zeroed.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoRestore ability to create imsm array from specific devices.
NeilBrown [Mon, 23 May 2011 07:21:37 +0000 (17:21 +1000)] 
Restore ability to create imsm array from specific devices.

A recent change to improve error messages make it not possible to
create an array from devices that are 'busy'.  However if they are
made busy by a container, then the create should be allowed.

So move one of the error messages later.

Reported-by: "Wojcik, Krzysztof" <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoRemove unused variable 'superrno' in Query.c
NeilBrown [Mon, 23 May 2011 07:21:36 +0000 (17:21 +1000)] 
Remove unused variable 'superrno' in Query.c

This variable hasn't been used for 5 years!

Reported-by: Mathias Burén <mathias.buren@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoCheck all member devices in enough_fd
NeilBrown [Mon, 23 May 2011 07:21:35 +0000 (17:21 +1000)] 
Check all member devices in enough_fd

The loop over all member devices in enough_fd could easily stop
before it had found all devices.  This would cause --re-add to
fail incorrectly.

So change the loop to be based on the reported number of devices
in the device - with a safe-guard limit of 1024.

Change some other loops to be more careful too.

Reported-by: "Schmidt, Annemarie" <Annemarie.Schmidt@stratus.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agomdmon: Fix crash if /proc/mdstat lists 0.9 superblocks
Michal Marek [Tue, 17 May 2011 01:08:16 +0000 (11:08 +1000)] 
mdmon: Fix crash if /proc/mdstat lists 0.9 superblocks

Signed-off-by: Michal Marek <mmarek@suse.cz>
12 years agoRAID-6 check standalone suspend array
Piergiorgio Sartor [Sun, 15 May 2011 19:15:15 +0000 (21:15 +0200)] 
RAID-6 check standalone suspend array

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoGrow: accept --assume-clean with --grow --size
NeilBrown [Mon, 16 May 2011 07:28:27 +0000 (17:28 +1000)] 
Grow: accept --assume-clean with --grow --size

When an array is resized to have larger members, --assume-clean will
disable any resync if the kernel supports it (2.6.40 and later).

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoCreate: add error checking for 'write_init_super'.
NeilBrown [Wed, 11 May 2011 03:43:27 +0000 (13:43 +1000)] 
Create: add error checking for 'write_init_super'.

If this fails, we really must fail the whole 'create'.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoCreate: give better error message if member device unusable.
NeilBrown [Tue, 10 May 2011 07:58:41 +0000 (17:58 +1000)] 
Create: give better error message if member device unusable.

Rather than just saying "unusable", report if device is busy
or is no a block device.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoCreate: allow chunksize to be non-power-of-2.
NeilBrown [Tue, 10 May 2011 07:35:41 +0000 (17:35 +1000)] 
Create: allow chunksize to be non-power-of-2.

RAID0 has accepted chunksizes that are not a power of 2 since 2.6.30.
So it time mdadm allowed that to be used.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoGive suitable error for mdadm /dev/md0 --stop
NeilBrown [Tue, 10 May 2011 06:30:40 +0000 (16:30 +1000)] 
Give suitable error for mdadm /dev/md0 --stop

Options like --stop must come before the device that is being
stopped.  If (in --misc mode) a  device does not have an option,
nothing will be done to it, which can be confusing.
So report an error in this case.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoManage: minor fix to add/re-add handling.
NeilBrown [Tue, 10 May 2011 06:20:25 +0000 (16:20 +1000)] 
Manage: minor fix to add/re-add handling.

If using an old kernel we should still check if a re-add might be
intended, so we can refuse and require a '--zero' first if it is not
possible.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoconfig: restore the possibility of a NULL homehost
NeilBrown [Tue, 10 May 2011 06:17:12 +0000 (16:17 +1000)] 
config: restore the possibility of a NULL homehost

As homehost defaults to the system name it is not possible to specify
a NULL homehost.

This patch restored this ability with either --homehost="" or
--homehost="<none>".

This allows the creation of v1.x arrays without a "hostname:"
prefix in the name.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoGrow: allow auto-readonly arrays to be reshaped.
NeilBrown [Tue, 10 May 2011 03:09:37 +0000 (13:09 +1000)] 
Grow: allow auto-readonly arrays to be reshaped.

In an array is auto-readonly then a reshape will not start.
But auto-readonly is only wanted until something is explicitly
done to acknowledge that the array is really wanted.
So it is perfectly correct to switch an auto-readonly array to
'clean' if a reshape has been requested.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoGrow: handle abort/restart of grow while being monitored.
NeilBrown [Tue, 10 May 2011 02:53:51 +0000 (12:53 +1000)] 
Grow: handle abort/restart of grow while being monitored.

If a device fails while the grow is being monitored but the array is
still functional, the Grow will appear to abort and then almost
instantly restart from where it was up to.

So if it appears to abort, wait up to 10 seconds for a restart (it
should be much much less than this.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoGrow: restore ability to configure 'faulty' arrays via mdadm.
NeilBrown [Tue, 10 May 2011 02:09:02 +0000 (12:09 +1000)] 
Grow: restore ability to configure 'faulty' arrays via mdadm.

The big 'grow' refactor lost us the ability to configure 'faulty'
arrays through --grow.
So put that back as a special case.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoGrow: report if a --size change has no effect.
NeilBrown [Tue, 10 May 2011 01:56:38 +0000 (11:56 +1000)] 
Grow: report if a --size change has no effect.

e.g. if "--grow --size=max" doesn't actually change anything, it is
useful to report that.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoGrow: check if any changes needed before proceeding to analyse_change.
NeilBrown [Tue, 10 May 2011 01:49:57 +0000 (11:49 +1000)] 
Grow: check if any changes needed before proceeding to analyse_change.

Analyse_change can give unhelpful error messages if nothing was
changed.  This is particularly awkward when only changing --size.

So check and re-introduce a message that was list in commit
5da9ab9874cb

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoGrow: When setting component size make sure components are ready.
NeilBrown [Tue, 10 May 2011 00:44:00 +0000 (10:44 +1000)] 
Grow: When setting component size make sure components are ready.

If you change the size of a member of an array (e.g. it might be a
dm device that can be resized, or on a smart storage device), md
doesn't notice and so the space cannot be used without explicitly
telling md that the device is bigger.

This change causes "mdadm --grow --size=...." to make sure each
component device is making at least that much space available if it
can.

Normally usage of "--size=max" will cause all devices to make max
space available, the md will use as much as it can of that.

Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: add new chunk size to metadata update
Przemyslaw Czarnowski [Wed, 4 May 2011 15:13:22 +0000 (17:13 +0200)] 
imsm: add new chunk size to metadata update

Put information about new chunk size change in to migration metadata
update allowing simultaneous level change and re-striping.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: process update for raid level migrations
Przemyslaw Czarnowski [Wed, 4 May 2011 15:12:48 +0000 (17:12 +0200)] 
imsm: process update for raid level migrations

Received update and prepared memory is processed to update imsm metadata.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: prepare memory for level migration update
Przemyslaw Czarnowski [Wed, 4 May 2011 15:12:14 +0000 (17:12 +0200)] 
imsm: prepare memory for level migration update

When level is changed from raid0 to raid5 memory is required for replace device
smaller device/array object.
This memory is allocated in manager context in prepare_update()

Prepare_update() is called in manager context so memory allocation are
allowed here. This allows us to look for spare devices for meta update.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: fix: disable migration from raid5->raid0
Przemyslaw Czarnowski [Wed, 4 May 2011 15:11:41 +0000 (17:11 +0200)] 
imsm: fix: disable migration from raid5->raid0

it is not supported yet, so start such transition is improper.

Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
12 years agoimsm: prepare update for level migrations reshape
Przemyslaw Czarnowski [Wed, 4 May 2011 15:11:07 +0000 (17:11 +0200)] 
imsm: prepare update for level migrations reshape

Introducing raid0->raid5 level migration metadata update structure
is prepared for future use.

Adding spare device is required to hold additional raid5 parity.
Mdadm just checks for spares, but it is not included in update.
If there are no spares available, abort. Otherwise we will create
degraded array what should be not allowed.
Mdmon will decide what spare device is used for parity.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: FIX: Do not write check-point '0'
Adam Kwolek [Mon, 2 May 2011 06:12:03 +0000 (16:12 +1000)] 
imsm: FIX: Do not write check-point '0'

When 2 arrays are configured in container and arrays are reassembled during
rebuild or initialization, checkpoint for one array can be reset. It depends
on arrays assembly order.

Scenario:
1. Create 2 arrays (e.g. raid5)
2. Add spare to container
3. Degrade arrays /rebuild starts on array #1 and continues to n%/
4. Reassembly arrays
5. Rebuild starts on array #2 /because of assembly order/ from 0%
6. On first checkpoint stored for array #2 (non 0 value), checkpoint
   for array #1 is cleared /it is delayed rebuild in md, so progress is 0/
7. Rebuild on #1 starts from n% /it was configured before checkpoint
   was cleared/.

Any next reassembly during rebuild of #2 array (after p.6) causes
checkpoint information lost for array #1.

Solution is not store checkpoint for progress == 0.
Checkpoint is set to 0 when rebuild/initialization starts.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFinally remove auto-home-host
NeilBrown [Tue, 26 Apr 2011 23:58:49 +0000 (09:58 +1000)] 
Finally remove auto-home-host

This was #if-ed out for 3.0, but it really should go.
Gcc 4.6.0 complains that auto_update_home is set but not used
(which is true).

Reported-by: Tobias Powalowski <t.powa@gmx.de>
13 years agoFIX: Check correctly raid disks during reshape restart
Adam Kwolek [Tue, 19 Apr 2011 07:25:43 +0000 (17:25 +1000)] 
FIX: Check correctly raid disks during reshape restart

During reshape restart info->array.raid_disks contains new raid_disks number
It cannot be compared against old disks number. Such check will always fail.

Check raid disks array field against final disks number for restart.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: Count correctly added devices
Adam Kwolek [Mon, 18 Apr 2011 00:31:43 +0000 (10:31 +1000)] 
FIX: Count correctly added devices

When array is in reshape state raid_disks field contains final disks number.
To know how many disks were added, disk.raid_disk index has to be compared
against old disk number computed using delta_disks.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: Set proper raid disks during migration
Adam Kwolek [Mon, 18 Apr 2011 00:31:15 +0000 (10:31 +1000)] 
FIX: Set proper raid disks during migration

During migration raid_disks field contains new disks number now.
It should be set old disks number first and then new disks number
to allow md to calculate e.g. delta_disks parameter.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: Fiddle raid_disks number when restarting reshape
Adam Kwolek [Mon, 18 Apr 2011 00:31:06 +0000 (10:31 +1000)] 
FIX: Fiddle raid_disks number when restarting reshape

When restarting a reshape, the value of 'raid_disks' is the *new*
value.  The old value is found by subtracting delta_disks.
So before calling analyse_change we must set raid_disks to be the
old value, and then reset it afterwards.

All other fields are cleanly separated with the main field being
the 'old' value and a new_* field available.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: Always report new raid_disks during migration
Adam Kwolek [Fri, 15 Apr 2011 10:30:31 +0000 (12:30 +0200)] 
FIX: Always report new raid_disks during migration

To behave in the similar way as native metadata during migration,
new raid disks number has to be reported by metadata handler.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: Use successfully loaded metadata only
Adam Kwolek [Thu, 14 Apr 2011 07:50:17 +0000 (17:50 +1000)] 
FIX: Use successfully loaded metadata only

Values greater than 0, means error. We exit from loop on error
with empty super-block pointer when sd pointer is valid.
This cannot be detected by check condition as error.
For sure we shouldn't go forward with error condition.
It leads to throwing exception with core file when metadata handler
wants to access non existing super-block.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoRAID-6 check standalone fix component list parsing
Piergiorgio Sartor [Thu, 14 Apr 2011 07:28:31 +0000 (17:28 +1000)] 
RAID-6 check standalone fix component list parsing

Fix the parsing of the component list, i.e. skipping the "spare" one.

I also added a check in case the array is degraded.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoMonitor: avoid NULL dereference with 0.90 metadata
Jonathan Liu [Tue, 12 Apr 2011 08:28:01 +0000 (18:28 +1000)] 
Monitor: avoid NULL dereference with 0.90 metadata

0.90 array do not report the metadata type in /proc/mdstat, so
we cannot assume that mse->metadata_version is non-NULL.

So add an appropriate check.

This adds an additional check missed by commit
eb28e119b03fd5149886ed516fa4bb006ad3602e.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: Raid0 expansion cannot be restarted
Adam Kwolek [Mon, 11 Apr 2011 05:00:13 +0000 (15:00 +1000)] 
FIX: Raid0 expansion cannot be restarted

When raid0 expansion is restarted, mdadm refuses to correctly assemble
array because critical section cannot be restored from backup file.
mdadm exits with information:
mdadm: Failed to restore critical section for reshape - sorry.

For raid0 new level is 0, current array level is 4.
Function Grow_restart() doesn't allow for level change.

Grow_restart really shouldn't be checking for level changes.
As they are always instantaneous they should never appear
in the metadata so it doesn't mean anything to check for them.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agomdadm/mdmon: use CFLAGS when linking
Mike Frysinger [Mon, 11 Apr 2011 04:54:42 +0000 (14:54 +1000)] 
mdadm/mdmon: use CFLAGS when linking

People often put flags that control ABI options into CFLAGS (like -mcpu)
and don't duplicate them in LDFLAGS because most build systems nowadays
(like autotools) use both when linking.  So make that work with mdadm's
custom build system too.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agomdadm: respect --syslog in monitor mode
Mike Frysinger [Mon, 11 Apr 2011 04:54:27 +0000 (14:54 +1000)] 
mdadm: respect --syslog in monitor mode

A few places don't accept syslog as a monitor mode, so fix that.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: NeilBrown <neilb@suse.de>