]> git.ipfire.org Git - thirdparty/mdadm.git/log
thirdparty/mdadm.git
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>
13 years agoMonitor: do not move partitions to external container
Czarnowska, Anna [Mon, 31 Jan 2011 23:40:56 +0000 (10:40 +1100)] 
Monitor: do not move partitions to external container

Arrays on partitions are not supported for external metadata
so do not take such spare from native array.

Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: FIX: map coping causes mdmon crash
Adam Kwolek [Mon, 31 Jan 2011 23:40:56 +0000 (10:40 +1100)] 
imsm: FIX: map coping causes mdmon crash

Too big map was copied (outside allocated memory) and this causes
mdmon crash for 2 raid0 arrays in container.
Map of correct (smaller) size should be copied,
to not overwrite any internal data.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: FIX: mdmon crash during 2 raid0 arrays expansion
Adam Kwolek [Mon, 31 Jan 2011 14:25:16 +0000 (15:25 +0100)] 
imsm: FIX: mdmon crash during 2 raid0 arrays expansion

When expansion is run on 2 raid0 arrays in container no update
is sent to mdmon because mdmon is off (mdadm performs update)
Memory size for first reshaped array is allocated to satisfy memory
requirements for expanded maps.
Memory for second device is allocated using old disks number, as in
metadata there is no information about this array reshape.
When mdmon initiates second array reshape it overwrites internal
structures and crashes). There is no place to keep expanded maps.
To avoid this situation during loading metadata, allocated memory
should be performed using the maximum used disks number in particular
container.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: Update metadata for second array
Adam Kwolek [Mon, 31 Jan 2011 07:59:30 +0000 (08:59 +0100)] 
imsm: Update metadata for second array

When second array reshape is about to start external metadata should
be updated by mdmon in imsm_set_array_state().  For this purposes
imsm_progress_container_reshape() is reused.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm:FIX: change arrays reshape order
Adam Kwolek [Mon, 31 Jan 2011 08:59:22 +0000 (09:59 +0100)] 
imsm:FIX: change arrays reshape order

Reshape is started from second array, so it causes imsm incompatibility
and problems during second array start.

Reshape should be started in arrays metadata order.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoGrow: make sure to break out of the backup loop when finished.
NeilBrown [Mon, 31 Jan 2011 23:08:24 +0000 (10:08 +1100)] 
Grow: make sure to break out of the backup loop when finished.

If there is nothing more to backup, then break out of the loop.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoMake sure odisks is consistent between creating and using the fdlist
NeilBrown [Mon, 31 Jan 2011 06:09:20 +0000 (17:09 +1100)] 
Make sure odisks is consistent between creating and using the fdlist

reshape_prepare_fdlist and child_monitor currently have slightly
different ideas of the 'old number of raid devices' which can cause
major confusion.

So settle on one value, and assign it to odisks early and always use
it.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoGrow: round max_progress to old chunk size too.
NeilBrown [Mon, 31 Jan 2011 06:04:37 +0000 (17:04 +1100)] 
Grow: round max_progress to old chunk size too.

kernel requires sync_max to be a multiple of the current
chunk size.  This is not really 'correct', but we need to work
with it.  So round down.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAllow test to detect 'resync=DELAYED' state
NeilBrown [Mon, 31 Jan 2011 05:59:40 +0000 (16:59 +1100)] 
Allow test to detect 'resync=DELAYED' state

There is no space around the '=' when resync is delayed,
so allow for that in pattern matching.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoInitialise all of file when opening backup file for reshape.
NeilBrown [Mon, 31 Jan 2011 05:57:40 +0000 (16:57 +1100)] 
Initialise all of file when opening backup file for reshape.

Due to a miscalculation we didn't initialise the whole file.
There is 4K (8 sectors) for the metadata, then the data.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoGrow: when restarting, do set new details if they are already set.
NeilBrown [Mon, 31 Jan 2011 04:32:19 +0000 (15:32 +1100)] 
Grow: when restarting, do set new details if they are already set.

When restarting a reshape with internal metadata, the new geometry
is already set and the reshape has been start (but has not been
allowed to continue yet).

So in that case, don't set things and don't ask for a reshape.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoGrow:make sure 'array' is up-to-date before SET_ARRAY_INFO
NeilBrown [Mon, 31 Jan 2011 04:30:15 +0000 (15:30 +1100)] 
Grow:make sure 'array' is up-to-date before SET_ARRAY_INFO

The value of 'array' might not be current, so SET_ARRAY_INFO
and fail.  Just refresh it before setting raid_disks.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoGrow: don't try setting new geometry when restarting a native reshape.
NeilBrown [Mon, 31 Jan 2011 04:01:15 +0000 (15:01 +1100)] 
Grow: don't try setting new geometry when restarting a native reshape.

md won't let us change raid_disks in this case, so don't even try.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoopen_mddev: open RDONLY if RDWR doesn't work.
NeilBrown [Mon, 31 Jan 2011 03:49:39 +0000 (14:49 +1100)] 
open_mddev: open RDONLY if RDWR doesn't work.

If an array is read-only then "mdadm -S"
cannot open it to stop it without this fix.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoCall free_super before attempting to add a new device
NeilBrown [Mon, 31 Jan 2011 02:53:35 +0000 (13:53 +1100)] 
Call free_super before attempting to add a new device

Now that write_init_super doesn't close fds any more, we need
to call free_super before the ADD_NEW_DISK ioctl.
Also call free_super before some error returns, for cleanliness.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoMan pages update for policy framework
Przemyslaw Czarnowski [Mon, 31 Jan 2011 00:41:11 +0000 (11:41 +1100)] 
Man pages update for policy framework

Includes description of POLICY line in /etc/mdadm.conf
and of changes in Monitor and Incremental related to autorebuild.

Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>
Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years ago11spare-migration: pass conditions for tests 9 and 12 should be reversed
Labun, Marcin [Fri, 28 Jan 2011 16:48:33 +0000 (16:48 +0000)] 
11spare-migration: pass conditions for tests 9 and 12 should be reversed

Test 9: We do not block spare migration between different metadatas.
test 13: Migrated spare must belong the same domain as destination -
there is no additional condition for action.

Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoenv-11spare-migration: imsm requires IMSM_NO_PLATFORM set with loop devices
Labun, Marcin [Fri, 28 Jan 2011 16:48:27 +0000 (16:48 +0000)] 
env-11spare-migration: imsm requires IMSM_NO_PLATFORM set with loop devices

By default IMSM checks if member device belongs to AHCI or ISCI controller.
When using loop devices one must disable these checks by setting
IMSM_NO_PLATFORM.

Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoCall free_super earlier when creating an array.
NeilBrown [Mon, 31 Jan 2011 00:34:42 +0000 (11:34 +1100)] 
Call free_super earlier when creating an array.

As free_super now closes fds for member devices, rather than
write_init_super doing it, we need to call free_super earlier,
so that the device (on which we hold an O_EXCL open) is closed
before it is added to the array.

So close at the end of pass-1 rather than after pass-2.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agosuper1: fix regression in write_init_super.
NeilBrown [Mon, 31 Jan 2011 00:33:18 +0000 (11:33 +1100)] 
super1: fix regression in write_init_super.

Now that a 'supertype' container more information, the simplistic
copying of 'st' into 'refst' is incorrect and results in closing
some fds when load_super1(refst) calls free_super().

So do it more correctly using dup_super.

Reported-by: "Labun, Marcin" <Marcin.Labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: FIX: not all disks are released in free_imsm_disks()
Adam Kwolek [Fri, 28 Jan 2011 13:37:51 +0000 (14:37 +0100)] 
imsm: FIX: not all disks are released in free_imsm_disks()

Adding spare disks to imsm container fails due to problem with writing
new_dev to sysfs. This problem was caused by not closed handle
(opened exclusively) in Manage.c:803.

Disk handle was not closed by free_imsm().
This is due to not released disk_mgmt_list in free_imsm_disks().

Proper release of imsm metadata allows for spare adding without problems.
Memory leak was fixed also.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoMonitor: avoid adding too many spares to container
Czarnowska, Anna [Mon, 17 Jan 2011 10:06:10 +0000 (10:06 +0000)] 
Monitor: avoid adding too many spares to container

Tests revealed that sometimes there are still more spares taken
than needed. The reason for this is that after adding one spare
to container with degraded subarray
if between ioctl in main loop and load_container in try_spare_migration
mdmon activates the spare we see active<raid but find no spares in parent
container and so add an extra spare.

To prevent such behaviour we count active disks in the list returned
by getinfo_super_disks and compare it with subarray->active.
If the number has increased it means new spare was added and activated
so there is no need for more.

Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: Meet SET_ARRAY_INFO ioctl requirements
Krzysztof Wojcik [Thu, 27 Jan 2011 16:46:58 +0000 (17:46 +0100)] 
FIX: Meet SET_ARRAY_INFO ioctl requirements

Problem has been observed when raid10<->raid0 takeover operation
is executed.
In code updating layout, raid_disks and chunk_size for non-restriping
operations in reshape array functions SET_ARRAY_INFO ioctl call was
not succeeded.
Takeover process finish execution with error, mdadm shows message:
"mdadm: failed to set disks"

Cause is not meeting SET_ARRAY_INFO ioctl requirements:
- only one parameter may be changed at one time
- level of current array info and new info should be the same

Patch introduces solution for this issue.
At the beginning of discussed code we read current information
about array and then compare them with new values should be set.
If particular value is different (and should be set),
we are overwrite only this one in array info and then call ioctl.

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: Remove disks in mdmon for external metadata
Krzysztof Wojcik [Thu, 27 Jan 2011 16:46:50 +0000 (17:46 +0100)] 
FIX: Remove disks in mdmon for external metadata

For raid10 -> raid0 takeover operation we should reject disks
in mirror by marking them as 'failed' and then remove them from
array by writing "remove" to disk state.

For external metadata second action is executed by mdmon.
According the description in monitor.c:175 when monitor detect
"faulty" in device state, it blocks the device, mark it as failed
in metadata, unblocks the device and finally writes "remove"
to device state.
For external case writing "remove" to device state in mdadm
is not necessary and harmful.
It may cause following issues:
1. "remove" operation for external case in mdadm is not finish
with successful result because monitor may block the device or disk
has been already removed by monitor.
2. If disk is removed by mdadm earlier than mdmon catch "failed" state,
metadata is not properly updated- is not marked as failed.

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoWORKAROUND: mdadm hangs during reshape (PART #2)
Adam Kwolek [Thu, 27 Jan 2011 14:44:39 +0000 (15:44 +0100)] 
WORKAROUND: mdadm hangs during reshape (PART #2)

After loop can occurs that due to 0 value reported by kernel
we have 0 in completed variable.
This is wrong. we are interested in real completed point.
0 value means that we reached sync point set in md,
so we can set completed variable to just reached point.
this point value is stored in max_progress variable.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: start_reshape status should be checked
Adam Kwolek [Wed, 26 Jan 2011 15:04:06 +0000 (16:04 +0100)] 
FIX: start_reshape status should be checked

mdadm should verify if reshape is started before it goes
in to check-pointing machine.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: Array after takeover has to be frozen
Adam Kwolek [Wed, 26 Jan 2011 15:03:41 +0000 (16:03 +0100)] 
FIX: Array after takeover has to be frozen

Problem occurs when we want to expand single disk raid0 array.
This is done via degraded 2 disks raid4 array. When new spare
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.
Put array in to frozen state allows 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 agoimsm: FIX: do not allow for container operation for the same disks number
Adam Kwolek [Wed, 26 Jan 2011 15:03:33 +0000 (16:03 +0100)] 
imsm: FIX: do not allow for container operation for the same disks number

imsm_reshape_super() currently allows for expansion when requested
raid_disks number is the same as current.
This is wrong. Existing in code condition is too weak.
We should allow for expansion when new disks_number is greater
than current only.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agofix extended partition detection
Dan Williams [Tue, 25 Jan 2011 02:54:06 +0000 (18:54 -0800)] 
fix extended partition detection

# mdadm --detail --export /dev/md127p1

Before:
MD_LEVEL=raid5
MD_DEVICES=4
MD_METADATA=0.90

After:
MD_LEVEL=raid5
MD_DEVICES=4
MD_CONTAINER=/dev/md0
MD_MEMBER=0
MD_UUID=55746a20:925d24a7:4f9bd7e2:9c9a411f

We parse the symlink target with a format:

../../block/mdXXX/mdXXXpYY

...and need the second '/' from the end of the string to read detect a
'md' device.

Reported-by: Krzysztof Wasilewski <krzysztof.wasilewski@intel.com>
Cc: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoDynamic hot-plug udev rules for policies
Labun, Marcin [Tue, 25 Jan 2011 15:59:32 +0000 (15:59 +0000)] 
Dynamic hot-plug udev rules for policies

Neil,
Please consider this patch that once was discussed and I think agreed with in general direction. It was sent a while ago
but somehow did not merged into your devel3-2. This patch enables hot-plug of so called bare devices (as understand by domain policies rules in mdadm.conf).
Without this patch we do NOT serve hot-plug of bare devices at all.

Thanks,
Marcin Labun

Subject was: FW: Autorebuild, new dynamic udev rules for hot-plugs

>>From c0aecd4dd96691e8bfa6f2dc187261ec8bb2c5a2 Mon Sep 17 00:00:00 2001
From: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Date: Thu, 23 Dec 2010 16:35:01 +0100
Subject: [PATCH] Dynamic hot-plug udev rules for policies
Cc: linux-raid@vger.kernel.org, Williams, Dan J <dan.j.williams@intel.com>, Ciechanowski, Ed <ed.ciechanowski@intel.com>
When introducing policies, new hot-plug rules were added to support
bare disks. Mdadm was started for each hot plugged block device
to determine if it could be used as spare or as a replacement member for
degraded array.
This patch introduces limitation of range of devices that are handled
by mdadm.
It limits them to the ones specified in domains associated with
the actions: spare-same-port, spare and spare-force.
In order to enable hot-plug for bare disks one must update udev rules
with command

        mdadm --activate-domains[=filename]

Above command writes udev rule configuration to stdout. If 'filename'
is given output is written to the file provided as parameter. It is up
to system administrator what should be done later. To make such rule
permanent (i.e. remain after reboot) rule should be writen to
/lib/udev/rules.d directory. Other cases will just need to write it to
/dev/.udev/rules.d directory where temporary rules lies. One should be
aware of the meaning of names/priorities of the udev rules.

After mdadm.conf is changed one is obliged to re-run
"mdadm --activate-domains" command in order to bring the system
configuration up to date.
All hot-plugged disks containing metadata are still handled by existing
rules.

Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoIgnore/don't set data_disks for level=1
NeilBrown [Thu, 27 Jan 2011 00:24:25 +0000 (10:24 +1000)] 
Ignore/don't set data_disks for level=1

When analyse_change sets level=1, data_disks is meaningless
as is layout.
So don't set them, and make sure we ignore them.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoMistake in raid1->raid5 migration
Krzysztof Wojcik [Wed, 26 Jan 2011 21:42:43 +0000 (08:42 +1100)] 
Mistake in raid1->raid5 migration

1. Mistake in target level comparison.
2. Initialize reshape->after.data_disks field
to proper spares_needed calculation

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAdd raid1->raid0 takeover support
Krzysztof Wojcik [Wed, 26 Jan 2011 21:42:41 +0000 (08:42 +1100)] 
Add raid1->raid0 takeover support

Add support for raid1 to raid0 takeover operation in user space.
This patch includes support for native and imsm metadata.

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoWORKAROUND: mdadm hangs during reshape
Adam Kwolek [Wed, 26 Jan 2011 20:56:21 +0000 (07:56 +1100)] 
WORKAROUND: mdadm hangs during reshape

During reshape when reshape is finished in md, progress_reshape() hangs
on select().
This is because 'sync_completed' is reset to zero before 'sync_action'
becomes 'idle', and we don't look for notification on 'sync_action'.

So if completed becomes zero after reshape_progress has made some
progress, then deduce that reshape has finished.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: monitor doesn't handshake with md
Adam Kwolek [Wed, 26 Jan 2011 20:31:25 +0000 (07:31 +1100)] 
FIX: monitor doesn't handshake with md

when in container are present raid0 and raid5 arrays, and reshape order is:
1. raid0 array
2. raid5 array

mdadm cannot set new raid_disks for raid0 array. For this action md has to have
handshake with mdmon. We have the following conditions:
1. Raid0 is not monitored
2. raid0 has been just takeovered to raid4/5 (it has to be monitored
3. monitor has to start monitor new raid4/5 array
4. monitor is not started (it is started to second raid5 array)
In such situation pig_monitor is required to let know to m monitor about new array
(not in the starting monitor case only)

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: support for Intel SAS controller in get_disk_controller_domain handler
Labun Marcin [Tue, 25 Jan 2011 06:44:12 +0000 (17:44 +1100)] 
imsm: support for Intel SAS controller in get_disk_controller_domain handler

get_disk_controller_domain recognizes Intel (R) SAS controller (isci).
The function returns three different strings that differentiate disk attached
to AHCI, ISCI or unknown controller types to create separate domains
for each case.

Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: detail_platform_imsm supports Intel SAS controller (isci driver)
Labun Marcin [Tue, 25 Jan 2011 06:44:11 +0000 (17:44 +1100)] 
imsm: detail_platform_imsm supports Intel SAS controller (isci driver)

Added support in detail_platform_imsm for Intel (R) SAS controller.
Function supports AHCI and ISCI controllers. RAID properties are derived
from common OROM for both types.

Based on code From: Artur Wojcik <artur.wojcik@intel.com>
Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: prepare detail_platform_imsm to support different types of controllers
Labun Marcin [Tue, 25 Jan 2011 06:44:11 +0000 (17:44 +1100)] 
imsm: prepare detail_platform_imsm to support different types of controllers

Pull out the AHCI specific parts of detail_platform_imsm to separate functions.
Introduce support new types of controllers.

Based on code From: Artur Wojcik <artur.wojcik@intel.com>
Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: support for Intel(R) SAS controller in imsm handler
Labun Marcin [Tue, 25 Jan 2011 06:44:11 +0000 (17:44 +1100)] 
imsm: support for Intel(R) SAS controller in imsm handler

add_to_super_imsm handler is able to recognize new type of controller.
It stores the controller information in its structures and blocks
mixing of different controller type in the same container.
In this way it maintains compatibility between Linux and Windows IMSM RAID
stacks. IMSM metadata does not allow arrays to span on devices attached to
different storage controllers.

Based on code From: Artur Wojcik <artur.wojcik@intel.com>
Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm platform: support for Intel(R) SAS controller.
Labun Marcin [Tue, 25 Jan 2011 06:44:11 +0000 (17:44 +1100)] 
imsm platform: support for Intel(R) SAS controller.

This patch adds platform support for SAS controller(s) built in Intel(R) Patsburg
chipset.

Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: Artur Wojcik <artur.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: Reset disk state if disk is missing
Krzysztof Wojcik [Tue, 25 Jan 2011 06:44:11 +0000 (17:44 +1100)] 
FIX: Reset disk state if disk is missing

If we can't read actual disk state, it shoud be initiated
to 0.
Overwise it may be out of date value resulting false action
later in code (e.g. set disk to improper state).

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoCheck number of failed disks durig raid10->raid0 takeover
Krzysztof Wojcik [Tue, 25 Jan 2011 06:44:11 +0000 (17:44 +1100)] 
Check number of failed disks durig raid10->raid0 takeover

Number of failed disks MUST be half of initial number of disks.
If number of failed disks is different we should not update
metadata- data corruption may occur after array reassemlation.

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoraid0->raid10 takeover- process metadata update
Krzysztof Wojcik [Tue, 25 Jan 2011 06:44:10 +0000 (17:44 +1100)] 
raid0->raid10 takeover- process metadata update

Implementation of raid0->raid10 takeover metadata update
at process_update level.
- We are using memory previously allocated in prepare_update to
  create two dummy disks will be inserted in the metadata and
  new imsm_dev structure with expanded disk order table.
- Update indexes in disk list
- Update metadata map
- Update disk order table

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoraid0->raid10 takeover- allocate memory for added disks
Krzysztof Wojcik [Tue, 25 Jan 2011 06:44:10 +0000 (17:44 +1100)] 
raid0->raid10 takeover- allocate memory for added disks

Allocate memory will be used in process_update.
For raid0->raid10 takeover operation number of disks doubles
so we should allocate memory for additional disks
and one imsm_dev structure with extended order table.

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoraid0->raid10 takeover- create metadata update
Krzysztof Wojcik [Tue, 25 Jan 2011 06:44:10 +0000 (17:44 +1100)] 
raid0->raid10 takeover- create metadata update

Create metadata update for raid0 -> raid10 takeover.
Because we have no mdmon running for raid0 we have to
update metadata using local update mechanism

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAdd raid10 -> raid0 takeover support
Krzysztof Wojcik [Tue, 25 Jan 2011 06:49:03 +0000 (17:49 +1100)] 
Add raid10 -> raid0 takeover support

The patch introduces takeover from level 10 to level 0 for imsm
metadata. This patch contains procedures connected with preparing
and applying metadata update during 10 -> 0 takeover.
When performing takeover 10->0 mdmon should update the external
metadata (due to disk slot and level changes).
To achieve that mdadm calls reshape_super() and prepare
the "update_takeover" metadata update type.
Prepared update is processed by mdmon in process_update().

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFix some issues with setting 'new' state of a reshape
NeilBrown [Tue, 25 Jan 2011 22:47:06 +0000 (08:47 +1000)] 
Fix some issues with setting 'new' state of a reshape

- when reshaping a container, ->reshape_active is already set
  even though it isn't really active yet, so we need to set
  the new geometry even when reshape_active is set.  This is safe.

- When restarting a reshape, make sure the reshape_position is set
  appropriately when external metadata is used.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoDon't close fds in write_init_super
NeilBrown [Mon, 24 Jan 2011 20:56:53 +0000 (07:56 +1100)] 
Don't close fds in write_init_super

We previously closed all 'fds' associated with an array in
write_init_super .. sometimes, and sometimes at bad times.
This isn't neat and free_super is a better place to close them.

So make sure free_super always closes the fds that the metadata
manager kept hold of, and stop closing them in write_init_super.

Also add a few more calls to free_super to make sure they really do
get closed.

Reported-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFix up analysis of reshape from RAID1 to RAID5.
NeilBrown [Thu, 20 Jan 2011 22:13:44 +0000 (09:13 +1100)] 
Fix up analysis of reshape from RAID1 to RAID5.

Need to allow raid-disks to change at the same time.

NeilBrown <neilb@suse.de>

13 years agoreindent/reformat some code.
NeilBrown [Thu, 20 Jan 2011 22:06:31 +0000 (09:06 +1100)] 
reindent/reformat some code.

Indenting was all wrong here, so fix it up.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoBe more careful about adjusting reshape_progress based on backup.
NeilBrown [Thu, 20 Jan 2011 22:03:53 +0000 (09:03 +1100)] 
Be more careful about adjusting reshape_progress based on backup.

Only adjust reshape_progress based on the backup that was found
if the backup covered the current reshape_progress point.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoCorrectly initialise backup_point when reshaping backwards.
NeilBrown [Thu, 20 Jan 2011 22:01:09 +0000 (09:01 +1100)] 
Correctly initialise backup_point when reshaping backwards.

When reshaping backwards we only backup from backup_blocks to
the start, so initialise backup_point appropriately.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoerror check reading of 'degraded' from sysfs.
NeilBrown [Thu, 20 Jan 2011 21:59:00 +0000 (08:59 +1100)] 
error check reading of 'degraded' from sysfs.

I'm seen mdadm spinning while failing to read 'degraded'.
This doesn't really fix it, but is a reminder that it needs to be
fixed.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoInitialise reshape_progress properly in reshape_array.
NeilBrown [Thu, 20 Jan 2011 21:56:35 +0000 (08:56 +1100)] 
Initialise reshape_progress properly in reshape_array.

Previously uninitialised.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFix management of backed-up region for hi-to-low reshapes.
NeilBrown [Thu, 20 Jan 2011 20:59:53 +0000 (07:59 +1100)] 
Fix management of backed-up region for hi-to-low reshapes.

When reshaping from the end of the array to the start, for times
when the number of data devices is decreasing, the handling of the
backup area isn't a simple mirror of the handling on low-to-hi
reshapes as the backup areas is always low in the array.

So re-write that to make it work.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: Arrays cannot be opened exclusively
Adam Kwolek [Mon, 17 Jan 2011 04:06:02 +0000 (15:06 +1100)] 
FIX: Arrays cannot be opened exclusively

When reshaping it is correct to open containers exclusively, but not
arrays.  The array could very easily be in use, e.g. by a mounted
filesystem.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoUnfreeze for non re-striping transitions
Krzysztof Wojcik [Mon, 17 Jan 2011 01:56:43 +0000 (12:56 +1100)] 
Unfreeze for non re-striping transitions

For non re-striping transitions array must be unfrozen
before end of processing.
For restriping transitions we normally let the child
unfreeze the array but in this case there is no child.

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoSet reshape.after.data_disks for raid0<->raid10 takeover
Krzysztof Wojcik [Mon, 17 Jan 2011 01:53:31 +0000 (12:53 +1100)] 
Set reshape.after.data_disks for raid0<->raid10 takeover

reshape.after.data_disks field must be initiated
for raid0<->raid10 transition.
Instead calculated spares_needed variable in reshape_array
function has random value.

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoDefine imsm_analyze_change function
Krzysztof Wojcik [Mon, 17 Jan 2011 01:52:36 +0000 (12:52 +1100)] 
Define imsm_analyze_change function

Function intended to use for single volume migration.
Function analyze transition and validate if it is supported.

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agofix: Monitor: min_size must be set to 0
Czarnowska, Anna [Mon, 17 Jan 2011 01:46:14 +0000 (12:46 +1100)] 
fix: Monitor: min_size must be set to 0

Otherwise a random value will be used for comparison later
for native and ddf metadata (until min_acceptable_spare_size is defined).

Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: sync_completed == 0 causes reshape cancellation in metadata
Adam Kwolek [Mon, 17 Jan 2011 01:44:52 +0000 (12:44 +1100)] 
FIX: sync_completed == 0 causes reshape cancellation in metadata

md signals reshape completion (whole area or parts) by setting
sync_completed to 0.  This causes in set_array_state() to rollback
metadata changes (super-intel.c:4977.  To avoid this do not allow for
set last_checkpoint to 0 if reshape is finished.

This was also root cause of my previous fix for finalization reshape
that I agreed earlier is not necessary,

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: mdadm throws coredump on exit in error case
Adam Kwolek [Mon, 17 Jan 2011 01:38:13 +0000 (12:38 +1100)] 
FIX: mdadm throws coredump on exit in error case

When mdadm falls in "reduce size" error on takeovered array it jumps
to release and tries execute backward takeover. This time sra pointer
is not initialized and coredump is generated.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agofix: segfault if subarray is monitored but container is not
Czarnowska, Anna [Thu, 13 Jan 2011 13:22:16 +0000 (13:22 +0000)] 
fix: segfault if subarray is monitored but container is not

In this situation to->parent is null so "to" doesn't change to
parent container and to->metadata is still null.
This results in segmentation fault when checking
to->metadata->ss->external.
We should just skip this array as container is needed to move spares to.

Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoAdd 'restart' arg to various functions used for reshaping.
NeilBrown [Sun, 16 Jan 2011 22:53:56 +0000 (09:53 +1100)] 
Add 'restart' arg to various functions used for reshaping.

When we restart an array in the middle of a reshape, we reuse a lot of
the code for starting the reshape, but it needs to know that
circumstances are slightly different.

So add a 'restart' arg which is used:
 - skip checking and adding spares
 - activate the array (rather than start reshape)
 - allow the backup file to already exist

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoBe more careful checking why reshape has stopped.
NeilBrown [Sun, 16 Jan 2011 22:53:25 +0000 (09:53 +1100)] 
Be more careful checking why reshape has stopped.

If reshape_position reports 'none', check array_state to see if array
is still active.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoIgnore error when setting sync_min
NeilBrown [Sun, 16 Jan 2011 22:51:33 +0000 (09:51 +1100)] 
Ignore error when setting sync_min

When restarting an array that is in the middle of a reshape,
sync_min cannot be set.  So just ignore any errors we get
when trying to set it.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoMake sure child_monitor reliably reports whether reshape completed or aborted.
NeilBrown [Sun, 16 Jan 2011 22:51:25 +0000 (09:51 +1100)] 
Make sure child_monitor reliably reports whether reshape completed or aborted.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoClean up return path for reshape_array.
NeilBrown [Thu, 13 Jan 2011 04:20:21 +0000 (15:20 +1100)] 
Clean up return path for reshape_array.

Particular problem was that we didn't unfreeze if a reshape
wasn't needed.

But all that 'rv' stuff isn't needed and some of it was wrong,
so simplify it all.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: Mistake in delta_disk comparison.
Krzysztof Wojcik [Thu, 13 Jan 2011 02:37:31 +0000 (13:37 +1100)] 
FIX: Mistake in delta_disk comparison.

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoreshape_super reorganization
Krzysztof Wojcik [Thu, 13 Jan 2011 02:02:44 +0000 (13:02 +1100)] 
reshape_super reorganization

Function has been divided into two clear parts:
1. Container operations
2. Volume operations

Prototype of imsm_analyze_change function has been added.

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoClean up exit paths from reshape_array.
NeilBrown [Thu, 13 Jan 2011 01:57:25 +0000 (12:57 +1100)] 
Clean up exit paths from reshape_array.

We only 'goto release' on error, but that branch contained handling
for non-error conditions:  reloading metadata.  Obviously that doesn't
work.

So re-arrange the code to make it more of a straight line that is
easier to follow and reload the metadata if that might be at all
needed.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoreshape_array: move lots of code out of a 'switch'.
NeilBrown [Wed, 12 Jan 2011 23:44:52 +0000 (10:44 +1100)] 
reshape_array: move lots of code out of a 'switch'.

Everything other than the 'child' part of the 'switch(fork)' returns
quickly, so leave them inside the switch but move the other large bit
out so as to make the flow of code more natural.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFix up calls to unfrozen at end of reshape.
NeilBrown [Wed, 12 Jan 2011 23:39:34 +0000 (10:39 +1100)] 
Fix up calls to unfrozen at end of reshape.

1/ don't pass 'frozen' as an arg to unfreeze - just use it
   to conditionally call 'unfreeze'.

2/ Always unfreeze at end of reshape_container

3/ Only unfreeze at end of reshape_array if not 'forked'.  So when
   reshape_array is called from reshape_container it doesn't unfreeze,
   but when called directly.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: FIX: spares are not counted
Adam Kwolek [Wed, 12 Jan 2011 23:16:07 +0000 (10:16 +1100)] 
imsm: FIX: spares are not counted

Field info->array.spare_disks is used on begin of reshape_array() to
check if there is enough number of spares to process reshape.  During
container_content_imsm() call spare disks are not counted.  This
causes that reshape_array() reports that there is not enough spares to
execute reshape.

Patch adds spares counting for reshape process.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: Cannot load container information
Adam Kwolek [Wed, 12 Jan 2011 23:15:54 +0000 (10:15 +1100)] 
FIX: Cannot load container information

When container is passed to grow_reshape(), load_container() function
has to be used to get all required information from metadata.
So load_super is never correct here - in particular, cfd is a
'container fd' so we must 'load_container' on it.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: FIX: old devices memory has to be released
Adam Kwolek [Wed, 12 Jan 2011 23:06:29 +0000 (10:06 +1100)] 
imsm: FIX: old devices memory has to be released

When process_update() replaces memory for bigger devices, old memory
areas are collected in a list and has to be assigned in to pointer in
update for later release.

List created from old devices is created and attached to space_list
for later releasing.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: FIX: local mdadm update shouldn't be done in update creation function.
Adam Kwolek [Wed, 12 Jan 2011 23:05:31 +0000 (10:05 +1100)] 
imsm: FIX: local mdadm update shouldn't be done in update creation function.

Local update is performed based on created update, so this code can broke
local update and it is not necessary as prepare and process update functions
are used.

Code removed.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: FIX: mdadm should process local data
Adam Kwolek [Wed, 12 Jan 2011 23:04:33 +0000 (10:04 +1100)] 
imsm: FIX: mdadm should process local data

When update is created by mdadm, local information should be updated
also.  This makes us to prepare one update for mdmon and second
"update" to maintain local changes.  we can use prepared update for
"local/mdadm" metadata update purposes.

We have 2 cases:
1. when metadata is updated by mdmon, we avoid metadata reloading in
   mdadm.
   we proceed the same updtate 2 times:
- one time in mdadm for "local update"
        - second time in mdmon for real metadat update
2. when metadata is updated by mdadm (no mdmon running) updates are
   processed in the same way.
- one time in mdadm for "local update"
- there is no "second time" update but mdadm just flushes
          metadata to array

   This let us to avoid code duplication by using prepare and process
   update functions as for update via mdmon. This makes update
   preparing mdmon independent and there is no need to maintain the
   same thing in 2 places in code.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: size is passed incorrectly
Kwolek, Adam [Wed, 12 Jan 2011 10:42:44 +0000 (21:42 +1100)] 
FIX: size is passed incorrectly

reshape_super() called from reshape_container() with size set to
info->component_size gives size in reshape_super == -2 due to unsigned
signed conversion (info->component_size is not initializes).

As size is not changed during container reshape '-1' value is passed
to indicate this.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoMake text_version available to reshape_array for subarray processing.
Marcin Labun [Wed, 12 Jan 2011 06:11:56 +0000 (17:11 +1100)] 
Make text_version available to reshape_array for subarray processing.

reshape_array uses text_version to reload the container content,
so make sure it is available.

Signed-off-by: Marcin Labun <marcin.labun@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: FIX: only one spare is passed in update
Adam Kwolek [Tue, 11 Jan 2011 14:04:19 +0000 (15:04 +0100)] 
imsm: FIX: only one spare is passed in update

Only one spare is passed in update.
When more than one disk is added first spare is passed multiple times.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: FIX: set correct slot information in metadata (raid0)
Adam Kwolek [Tue, 11 Jan 2011 14:03:55 +0000 (15:03 +0100)] 
imsm: FIX: set correct slot information in metadata (raid0)

Slot was set based on anchor information.
Disks information was copied outside disk list area.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoload_super should not try to load_container
NeilBrown [Wed, 12 Jan 2011 05:18:04 +0000 (16:18 +1100)] 
load_super  should not try to load_container

Now that load_container is a separate operation, load_super
should not try it first.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoMonitor: skip array if error getting size
Anna Czarnowska [Tue, 11 Jan 2011 10:36:37 +0000 (11:36 +0100)] 
Monitor: skip array if error getting size

load_super tries to load container first anyway but if it fails
eg. after physically removing a disk
then it tries to read metadata from container device.
This will always fail and print confusing errors.
So use load_container instead of load_super on container.

On failure to read metadata we should skip this array.
It will be dealt with the next time round.

Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoFIX: Fill sys_name for disk add
Adam Kwolek [Mon, 10 Jan 2011 11:29:12 +0000 (12:29 +0100)] 
FIX: Fill sys_name for disk add

Add disks fails due to empty sys name field.
sysfs_init fills out required fields for add disk operation.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoDon't complain about missing spares when reshaping a raid0.
NeilBrown [Wed, 12 Jan 2011 04:59:24 +0000 (15:59 +1100)] 
Don't complain about missing spares when reshaping a raid0.

To reshape a RAID0 we convert to RAID4 first.  This makes it look
like it could be degraded and so we are tempted to ensure there are
enough spares.  However this is not appropriate for RAID0, so
explicitly exclude new_level == RAID0 in this check

Reported-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoimsm: FIX: update disks status in container_contents()
Adam Kwolek [Wed, 12 Jan 2011 04:12:44 +0000 (15:12 +1100)] 
imsm: FIX: update disks status in container_contents()

Based on status information disks are added to array during grow (in reshape_array()).
This information currently is not present and all disks (old and new) were added to md.
To avoid adding already present disks, disk.state has to be set.

Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoMake child_monitor a candidate for ->manage_reshape
NeilBrown [Wed, 12 Jan 2011 03:46:17 +0000 (14:46 +1100)] 
Make child_monitor a candidate for ->manage_reshape

Child_monitor was design to perform 'manage_reshape' for native
arrays.  So change the signature for ->manage_reshape to match
child_monitor and move the all to the same place that child_monitor
is called from.

Also give super-intel a manage_reshape handler which simple calls
child_monitor.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoMove setup of backup superblock into child_monitor
NeilBrown [Wed, 12 Jan 2011 03:42:51 +0000 (14:42 +1100)] 
Move setup of backup superblock into child_monitor

child_monitor has overall responsibility for backups using the generic
bsb, so move all handling under it's control.

signed-off-by: NeilBrown <neilb@suse.de>

13 years agoAdd comment about future enhancement
NeilBrown [Wed, 12 Jan 2011 03:04:09 +0000 (14:04 +1100)] 
Add comment about future enhancement

We currently suspend rather large sections of
the array which can take a while to process.
Possibly smaller sections are better.  Possibly it should be
adjusted on a timeout basis.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoCorrectly handle the final partial backup of an in-place reshape.
NeilBrown [Wed, 12 Jan 2011 03:01:36 +0000 (14:01 +1100)] 
Correctly handle the final partial backup of an in-place reshape.

The array might not be a multiple of the chosen backup size, so
the last bit to be backed up might be a bit smaller.  Handle that
correctly.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoHandle edge case with suspend_point updates.
NeilBrown [Tue, 11 Jan 2011 23:51:44 +0000 (10:51 +1100)] 
Handle edge case with suspend_point updates.

If reshape_progress equals suspend_point, it is also appropriate to
update the end of the suspend region.

Signed-off-by: NeilBrown <neilb@suse.de>
13 years agoBe more enthusiastic/flexible in backing up data.
NeilBrown [Tue, 11 Jan 2011 23:44:58 +0000 (10:44 +1100)] 
Be more enthusiastic/flexible in backing up data.

At some points we need to perform 2 backups at once so as to
start the 'double buffering' approach.  So rather than assuming
what the next backup should be, example suspend_point and backup
as much as possible up to there.

Signed-off-by: NeilBrown <neilb@suse.de>