Commit Graph

2005 Commits

Author SHA1 Message Date
NeilBrown 15537e75b1 Update COPYING file.
Update to latest from http://www.gnu.org/licenses/gpl-2.0.txt
This corrects the address and some other minor details.
No change in the license.

Signed-off-by: NeilBrown <neilb@suse.de>
2011-08-18 12:55:24 +10:00
Piergiorgio Sartor c48d75d38f RAID-6 check standalone man page
Signed-off-by: NeilBrown <neilb@suse.de>
2011-08-09 10:43:58 +10:00
NeilBrown 418f9b368a IMSM: allow some array attribute bits to be ignored.
Some bits are not handled by mdadm, but their presence should not
cause failure.
In particular MPB_ATTRIB_NEVER_USE appears harmless.

Reported-by: Thomas Steinborn <thestonewell@googlemail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-08-09 08:49:34 +10:00
NeilBrown 6218489119 super1: fix spacing for 'Flags' field in --examine.
Signed-off-by: NeilBrown <neilb@suse.de>
2011-08-02 13:36:08 +10:00
Scott Schaefer 9a88e7b6d5 --add incorrectly sets writemostly
Origin: vendor, http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=628667
Bug-Debian: http://bugs.debian.org/628667

Signed-off-by: NeilBrown <neilb@suse.de>
2011-08-02 13:27:32 +10:00
NeilBrown 4a96d9ff4f Add some more settings of ignore_hw_compat
There are some more times when we don't care that the hardware doesn't
support the metadata:
 - when removing old metadata
 - when reporting the metadata present before over-writing it.

So set ignore_hw_compat in these cases.

Signed-off-by: NeilBrown <neilb@suse.de>
2011-08-01 12:21:19 +10:00
NeilBrown 6560987b25 Grow: ensure clean abort if we cannot read the 'completed' file.
If a read of 'completed' returns an error, select will never fail, so
this loop would never exit.

Signed-off-by: NeilBrown <neilb@suse.de>
2011-07-27 17:26:12 +10:00
NeilBrown 656b6b5a55 IMSM: set ->raid_disk correctly in getinfo_super_imsm_volume
The 'raid_disk' can be different to the 'number' and must be
the position of the device in the array, not in the container.

Normally these should not be different, but the test-suite creates a
possibility so it should work.

Signed-off-by: NeilBrown <neilb@suse.de>
2011-07-27 16:11:48 +10:00
NeilBrown 9ab6e80a04 mdadm.8.in: clarify some issues with --size
- explain it's use in guarding against small replacements
- clarify relationship with containers.
- include information about --grow --size not being supported by IMSM metadata.

Reported-by: maciej.naruszewicz <maciej.naruszewicz@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-07-27 14:06:13 +10:00
Namhyung Kim 508ede8621 Grow: fix version number in error message
As the conditional checks, reshape to fewer devices is supported
since Linux kernel 2.6.30 not 2.6.32.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-07-26 14:30:49 +10:00
Dan Williams cd9d1ac715 imsm: fix default chunk in the !orom case
Set a valid default in the !orom case, otherwise we segfault, or
otherwise fail.

Cc: Anna Czarnowska <anna.czarnowska@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-07-19 16:53:08 +10:00
NeilBrown ca0748fa49 imsm: getinfo_super_imsm_volume() doesn't fill all disk information
getinfo_super_imsm_volume doesn't correctly set info.disk fields
because it doesn't know which disk to set them from.
It should be the last disk passed to add_to_super.

So add a field 'current_disk' to record this disk in add_to_super, and
use it in getinfo_super.

This allows us to remove a hack in Create.c

Signed-off-by: NeilBrown <neilb@suse.de>
2011-07-14 15:42:10 +10:00
Milan Broz 19986c721c mdadm: fix build failures (ppc64)
This patch fixes these build issues:

super-intel.c: In function 'getinfo_super_imsm_volume':
super-intel.c:2327:4: error: format '%llu' expects argument of type 'long long
unsigned int', but argument 3 has type '__u64' [-Werror=format]

super-intel.c: In function 'imsm_reshape_super':
super-intel.c:8665:7: error: 'devnum' may be used uninitialized in this function [-Werror=uninitialized]

Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-07-14 13:58:36 +10:00
NeilBrown 664d53258d super-intel: fix buffer overflow in detail-platform.
The serial number is not necessarily nul terminated, so we need to be
sure to only use the allowed number of chars.

Signed-off-by: NeilBrown <neilb@suse.de>
Reported-by: Arvin Schnell <aschnell@novell.com>
2011-07-13 12:38:50 +10:00
Namhyung Kim 1e49aaa069 md.4: fix possible typos
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-06-28 16:36:42 +10:00
Namhyung Kim 2f48b33d1d mdmon.8: fix possible typos
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-06-28 16:36:42 +10:00
Krzysztof Wojcik 2d3603ba0c Show DELAYED, PENDING status of resync process in "--detail"
Initially there is no proper translation mdstat's DELAYED/PENDING processes
to "--detail" output.
For example, if we have recover=DELAYED in mdstat, "--detail"
shows "State: recovering" and "Rebuild Status = 0%".
It was incorrect in case of process waiting on checkpoint different
than 0%. In fact rebuild status is differnt than 0% and user is misled.

The patch fix the problem. Current "--detail" command shows
in the exampe: "State: recovering (DELAYED)" and no information
about precentage.

Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-06-23 12:06:47 +10:00
Andrew Burgess c281a80419 mdadm --detail was incorrect for shrinking reshapes
Since info->delta_disks is signed it doesn't need to be special-cased.

This allowed my 9->8 reshape to display correctly instead of as 8->7

Signed-off-by: NeilBrown <neilb@suse.de>
2011-06-23 11:48:03 +10:00
Namhyung Kim c0672664bf .gitignore: ignore mdadm.8 file
mdadm.8 is auto-generated from mdadm.8.in, so ignore it.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-06-23 11:40:14 +10:00
Namhyung Kim cb77f62076 mdadm.8: fix possible typos
Fix random typos and add a few of missing words/macros.
Also update RAID website URL as it is not accessible anymore.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-06-23 11:40:10 +10:00
Namhyung Kim 3c7efacb7d mdadm.8: move description of --add under Grow mode
It is supposed to be under Grow mode. Since Create/Build/Grow modes
use common options and '-a' is already used for '--auto' in Create/
Build modes, describe it to avoid confusion.

Signed-off-by: NeilBrown <neilb@suse.de>
2011-06-23 11:34:34 +10:00
Namhyung Kim 6cbf8fb8c1 mdadm.8: change linux version 2.6.40 -> 3.0
Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-06-23 11:34:34 +10:00
NeilBrown f161d047ee util: correctly parse shorter linux version numbers.
The next version of Linux might be 3.0.  If it is, get_linux_version
will fail.
So make it more robust.

Reported-by: Namhyung Kim <namhyung@gmail.com>
Reported-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-06-17 22:49:24 +10:00
NeilBrown ef799cdd69 Release mdadm-3.2.2
Stability release
2011-06-17 15:15:37 +10:00
NeilBrown b787bec6bd Don't index past the end of 'best' array in Assemble.
The 'best' array only has 'bestcnt' entries allocated, so 'i' should
always be "< bestcnt", not "<= bestcnt".

Reported-by: "Lawrence, Joe" <Joe.Lawrence@stratus.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-06-17 14:48:33 +10:00
Luca Berra 73e658d8cc Improvements to GPT reading code.
looking at the gpt code in util.c i found i did not like it at all, a
gpt partition entry is currently 128 bytes, but the spec does not say it
is a fixed value, so the code that reads into a buffer with 512bytes
chunk expecting this to be a multiplier of part_size is imho incorrect.
my fix was to read each partition entry directly into a struct
GPT_part_entry, the advantage is that the code is very simple to read,
the disadvantage it is 128 reads of 128 bytes each, which is
sub-optimal, but i believe readahead will mitigate this a lot.

Signed-off-by: NeilBrown <neilb@suse.de>
2011-06-17 14:41:01 +10:00
Luca Berra 3b7e9d0cbe Fix some type-aliasing issues.
Warnings for these are reported with -Wstrict-aliasing=2, and
avoiding the cast is certainly an improvement.

Signed-off-by: NeilBrown <neilb@suse.de>
2011-06-17 14:38:14 +10:00
Luca Berra e4c72d1dc6 Fix some compiler warnings.
Original by Luca, with various changes by Neil

Signed-off-by: NeilBrown <neilb@suse.de>
2011-06-17 14:35:06 +10:00
NeilBrown 9e2d750d4c 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>
2011-06-16 17:13:50 +10:00
NeilBrown 4ccc2562ac More fixes for tests.
Some more fixes to help some tests run properly.

Signed-off-by: NeilBrown <neilb@suse.de>
2011-06-16 14:18:18 +10:00
NeilBrown af538d59c1 test/ddf add a udevadm settle
We need to settle udev before assuming the devices exist.

Signed-off-by: NeilBrown <neilb@suse.de
2011-06-15 16:30:12 +10:00
NeilBrown 67480d7593 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>
2011-06-15 16:30:09 +10:00
NeilBrown d338d8a8e0 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>
2011-06-15 16:06:57 +10:00
NeilBrown fb204fb2e1 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>
2011-06-15 15:49:23 +10:00
Albert Pauw 9ec11d1afd Remove compiler warning about signed/unsigned comparison.
Signed-off-by: NeilBrown <neilb@suse.de>
2011-06-15 14:39:30 +10:00
NeilBrown 17f7da2f42 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>
2011-06-15 14:39:28 +10:00
NeilBrown 47c7a4be14 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>
2011-06-15 12:21:26 +10:00
Adam Kwolek 19482bcc40 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>
2011-06-15 09:58:57 +10:00
Adam Kwolek f8b72ef517 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>
2011-06-15 09:13:49 +10:00
Adam Kwolek 7534230b07 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>
2011-06-14 12:48:58 +10:00
Adam Kwolek 7e45b5504c 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>
2011-06-14 12:48:53 +10:00
Adam Kwolek e1c1d4f442 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>
2011-06-14 12:46:53 +10:00
Adam Kwolek d1877f697d 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>
2011-06-14 12:42:22 +10:00
Adam Kwolek b66e591b14 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>
2011-06-14 12:42:16 +10:00
Adam Kwolek 68eb8bc6ca 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>
2011-06-14 12:42:08 +10:00
Adam Kwolek 80e4abc99c 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>
2011-06-14 12:42:06 +10:00
Adam Kwolek 0de8d44dde MAN: Man update for check-pointing
Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
2011-06-09 13:00:56 +10:00
Adam Kwolek 8016a6d42e 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>
2011-06-09 13:00:56 +10:00
Adam Kwolek a47e44fb96 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>
2011-06-09 13:00:55 +10:00
Adam Kwolek ae9f01f89b 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>
2011-06-09 13:00:55 +10:00