thirdparty/mdadm.git
11 years agoRemember to close directories when we are finished with them.
Neil Brown [Mon, 26 May 2008 23:18:34 +0000 (09:18 +1000)] 
Remember to close directories when we are finished with them.

11 years agoAlway use a unique file name for opendev
Neil Brown [Mon, 26 May 2008 23:18:33 +0000 (09:18 +1000)] 
Alway use a unique file name for opendev

Else mdadm and mdmon running in parallel can tread on each other.

11 years agoRemove 'fd' arg from sysfs_add_disk
Neil Brown [Mon, 26 May 2008 23:18:32 +0000 (09:18 +1000)] 
Remove 'fd' arg from sysfs_add_disk

It it never used, and removing means there are several 'open's that can
go.

11 years agoRemove stray semicolon
Neil Brown [Mon, 26 May 2008 23:18:31 +0000 (09:18 +1000)] 
Remove stray semicolon

Causes compile error with gcc-2.95

11 years agoFix some initialisations...
Neil Brown [Thu, 15 May 2008 06:48:57 +0000 (16:48 +1000)] 
Fix some initialisations...

11 years agoclose some memory leaks
Dan Williams [Thu, 15 May 2008 06:48:56 +0000 (16:48 +1000)] 
close some memory leaks

From: Dan Williams <dan.j.williams@intel.com>

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
11 years agoadd infrastructure to receive higher order commands, like remove_device
Dan Williams [Thu, 15 May 2008 06:48:54 +0000 (16:48 +1000)] 
add infrastructure to receive higher order commands, like remove_device

From: Dan Williams <dan.j.williams@intel.com>

Each md_message encapsulates a single command.  A command includes an 'action'
member which describes what if any data comes after the action.  Communication
with the monitor involves updating the active_cmd pointer and then writing to
mgr_pipe.  Pass/fail status is returned via mon_pipe.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
11 years agostart fleshing out socket code, ping monitor to see if it is alive
Dan Williams [Thu, 15 May 2008 06:48:52 +0000 (16:48 +1000)] 
start fleshing out socket code, ping monitor to see if it is alive

From: Dan Williams <dan.j.williams@intel.com>

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
11 years agowhen failures happen they should be propagated to all member arrays
Dan Williams [Thu, 15 May 2008 06:48:51 +0000 (16:48 +1000)] 
when failures happen they should be propagated to all member arrays

From: Dan Williams <dan.j.williams@intel.com>

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
11 years agohandle disk failures
Dan Williams [Thu, 15 May 2008 06:48:49 +0000 (16:48 +1000)] 
handle disk failures

From: Dan Williams <dan.j.williams@intel.com>

Added curr_state as a parameter to set_disk.  Handlers look at this to
record components failures, and set global 'degraded' or 'failed'
status.

When reading the state as faulty:
1/ mark the disk failed in the metadata

2/ write '-blocked' to the rdev state to allow the kernel's failure
   mechanism to advance

3/ the kernel will take away the drive's role in remove_and_add_spares()

4/ once the disk no longer has a role writing 'remove' to the rdev state
   will get the disk out of array.

There is a window after writing '-blocked' where the kernel will return
-EBUSY to remove requests.  We rely on the fact that the disk will
continue to show faulty so we lazily wait until the kernel is ready to
remove the disk.  If the manager thread needs to get the disk out of the
way it can ping the monitor and wait, just like the replace_array()
case.

[buglet fix: swap the parameters of attr_match in read_dev_state]

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
11 years agoimsm: update metadata for dirty -> clean or resync -> idle events
Dan Williams [Thu, 15 May 2008 06:48:47 +0000 (16:48 +1000)] 
imsm: update metadata for dirty -> clean or resync -> idle events

From: Dan Williams <dan.j.williams@intel.com>

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
11 years agokeep member disk fd(s) for updates
Dan Williams [Thu, 15 May 2008 06:48:46 +0000 (16:48 +1000)] 
keep member disk fd(s) for updates

From: Dan Williams <dan.j.williams@intel.com>

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
11 years agoFlag arrays for deletion after they have been stopped.
Dan Williams [Thu, 15 May 2008 06:48:44 +0000 (16:48 +1000)] 
Flag arrays for deletion after they have been stopped.

From: Dan Williams <dan.j.williams@intel.com>

If they are later reassembled they will be replaced and deallocated
via replace_array.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
11 years agohandle resync completion
Dan Williams [Thu, 15 May 2008 06:48:42 +0000 (16:48 +1000)] 
handle resync completion

From: Dan Williams <dan.j.williams@intel.com>

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
11 years agoAdd mdmon functions to super-intel.
Neil Brown [Thu, 15 May 2008 06:48:41 +0000 (16:48 +1000)] 
Add mdmon functions to super-intel.

11 years agostart resync when transitioning from initial readonly state
Dan Williams [Thu, 15 May 2008 06:48:39 +0000 (16:48 +1000)] 
start resync when transitioning from initial readonly state

From: Dan Williams <dan.j.williams@intel.com>

mdadm handles setting resync_start, monitor uses this value to determine
whether to set the 'active' or 'readauto' state.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
11 years agoMerge mdmon
Neil Brown [Thu, 15 May 2008 06:48:37 +0000 (16:48 +1000)] 
Merge mdmon

11 years agohandle Manage_subdevs() for 'external' arrays
Dan Williams [Thu, 15 May 2008 06:48:35 +0000 (16:48 +1000)] 
handle Manage_subdevs() for 'external' arrays

From: Dan Williams <dan.j.williams@intel.com>

1/ Block attempts to add/remove devices from container members
2/ Forward add/remove requests to containers

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
11 years agoset resync_start in Incremental_container
Dan Williams [Thu, 15 May 2008 06:48:33 +0000 (16:48 +1000)] 
set resync_start in Incremental_container

From: Dan Williams <dan.j.williams@intel.com>

Metadata handlers set mdinfo.resync_start depending on the state of the
array.  By default mdadm assumes the array is dirty and needs a full
resync.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
11 years agoimsm: create support
Dan Williams [Thu, 15 May 2008 06:48:32 +0000 (16:48 +1000)] 
imsm: create support

From: Dan Williams <dan.j.williams@intel.com>

This should probably be made into a generic 'external' capability rather
than hardcoding 'ddf' and 'imsm'.

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
11 years agoimsm: assemble raid devices
Dan Williams [Thu, 15 May 2008 06:48:27 +0000 (16:48 +1000)] 
imsm: assemble raid devices

From: Dan Williams <dan.j.williams@intel.com>

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
11 years agoSet 'metadata_version' for container_member in Incremental_container
Dan Williams [Thu, 15 May 2008 06:48:25 +0000 (16:48 +1000)] 
Set 'metadata_version' for container_member in Incremental_container

From: Dan Williams <dan.j.williams@intel.com>

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
11 years agoimsm: assemble container support
Dan Williams [Thu, 15 May 2008 06:48:24 +0000 (16:48 +1000)] 
imsm: assemble container support

From: Dan Williams <dan.j.williams@intel.com>

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
11 years agoimsm: initial Intel(R) Matrix Storage Manager support
Dan Williams [Thu, 15 May 2008 06:48:22 +0000 (16:48 +1000)] 
imsm: initial Intel(R) Matrix Storage Manager support

From: Dan Williams <dan.j.williams@intel.com>

The following now work:
--examine
--examine --brief

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
11 years agoCreate a container member
Neil Brown [Thu, 15 May 2008 06:48:21 +0000 (16:48 +1000)] 
Create a container member

From: Neil Brown <neilb@suse.de>

11 years agoCan now mostly assemble DDF arrays
Neil Brown [Thu, 15 May 2008 06:48:19 +0000 (16:48 +1000)] 
Can now mostly assemble DDF arrays

11 years agoStart on --assemble support for DDF
Neil Brown [Thu, 15 May 2008 06:48:18 +0000 (16:48 +1000)] 
Start on --assemble support for DDF

11 years agoMore ddf stuff
Neil Brown [Thu, 15 May 2008 06:48:17 +0000 (16:48 +1000)] 
More ddf stuff

11 years agomore ddf stuff
Neil Brown [Thu, 15 May 2008 06:48:15 +0000 (16:48 +1000)] 
more ddf stuff
Create a BVD in a DDF

Do not actually assemble it yet...

11 years agoInitial DDF support code.
Dan Williams [Thu, 15 May 2008 06:48:14 +0000 (16:48 +1000)] 
Initial DDF support code.

Create a ddf array by naming the device /dev/ddf* or
specifying metadata 'ddf'.

If ddf is specified with no level, assume a container (indeed,
anything else would be wrong).

**Need to use text_Version to set external metadata...

More ddf support

Load a ddf container.  Now
   --examine /dev/ddf
works.
super-ddf: fix compile warning

From: Dan Williams <dan.j.williams@intel.com>

super-ddf.c:723: format %lu expects type long unsigned int, but argument 3 has type unsigned int

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
11 years agoSome support for external metadata.
Neil Brown [Thu, 15 May 2008 06:48:13 +0000 (16:48 +1000)] 
Some support for external metadata.

Allow specifying metadata type when creating arrays etc.

11 years agoChange write_init_super to be called only once.
Neil Brown [Thu, 15 May 2008 06:48:12 +0000 (16:48 +1000)] 
Change write_init_super to be called only once.

The current model for creating arrays involves writing
a superblock to each device in the array.
With containers (as with DDF), that model doesn't work.
Every device in the container may need to be updated
for an array made from just some the devices in a container.

So instead of calling write_init_super for each device,
we call it once for the array and have it iterate over
all the devices in the array.

To help with this, ->add_to_super now passes in an 'fd' and name for
the device.  These get saved for use by write_init_super.  So
add_to_super takes ownership of the fd, and write_init_super will
close it.
This information is stored in the new 'info' field of supertype.

As part of this, write_init_super now removes any old traces of raid
metadata rather than doing this in common code.

11 years agoAdd crc32 files.
Neil Brown [Thu, 15 May 2008 06:48:10 +0000 (16:48 +1000)] 
Add crc32 files.

For ddf.

11 years agoAdd cpu_to_be convertions functions.
Neil Brown [Thu, 15 May 2008 06:48:09 +0000 (16:48 +1000)] 
Add cpu_to_be convertions functions.

DDF will uses these.

11 years agoReduce openning of dev in create.
Neil Brown [Thu, 15 May 2008 06:48:08 +0000 (16:48 +1000)] 
Reduce openning of dev in create.

Now that validate_geometry opens and checks the device,
we don't need to do it as much in top level Create.
We only need it to check for old array or filesystem info.
So only open the device at that place.

11 years agoAdd 'container' level and ->validate_geometry method.
Neil Brown [Thu, 15 May 2008 06:47:41 +0000 (16:47 +1000)] 
Add 'container' level and ->validate_geometry method.

These will be used for ddf.

11 years agoRelease 2.6.5 mdadm-2.6.5
Neil Brown [Thu, 15 May 2008 05:50:59 +0000 (15:50 +1000)] 
Release 2.6.5

11 years agoGet Changelog uptodate
Neil Brown [Thu, 15 May 2008 05:50:57 +0000 (15:50 +1000)] 
Get Changelog uptodate

11 years agoCompiple fixes for mdassemble and diet-libc
Neil Brown [Thu, 15 May 2008 05:50:56 +0000 (15:50 +1000)] 
Compiple fixes for mdassemble and diet-libc

11 years agoDon't try the auto-detect test when md_mod is a module
Neil Brown [Thu, 15 May 2008 05:50:50 +0000 (15:50 +1000)] 
Don't try the auto-detect test when md_mod is a module

....as this cannot work.

11 years agoFix support for --update=swapsuper
Neil Brown [Thu, 15 May 2008 05:50:48 +0000 (15:50 +1000)] 
Fix support for --update=swapsuper

The user of dup_super broke it.

11 years agoRecent change broken handling of metadata-less arrays.
Neil Brown [Thu, 15 May 2008 05:50:47 +0000 (15:50 +1000)] 
Recent change broken handling of metadata-less arrays.

In particular, failing a device would give a silly
error message.

11 years agoFix possible NULL dereference in super_by_fd
Neil Brown [Thu, 15 May 2008 05:50:45 +0000 (15:50 +1000)] 
Fix possible NULL dereference in super_by_fd

11 years agoAvoid possible null dereference in Assemble.
Neil Brown [Thu, 15 May 2008 05:50:42 +0000 (15:50 +1000)] 
Avoid possible null dereference in Assemble.

If the first device we look at has no superblock,
there is no 'st' to free, so don't free it.

11 years agoSet LOG_PID for syslog
Hans Lambermont [Mon, 12 May 2008 02:21:56 +0000 (12:21 +1000)] 
Set LOG_PID for syslog

From: Hans Lambermont <hans.lambermont@newtec.eu>

11 years agoadd --export option to --examine
Kay Sievers [Tue, 6 May 2008 00:02:38 +0000 (10:02 +1000)] 
add --export option to --examine

From: Kay Sievers <kay.sievers@vrfy.org>

Cc: David Zeuthen <david@fubar.dk>
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
11 years agoMake device-special files for partitions when using --incremental
Neil Brown [Mon, 5 May 2008 11:55:39 +0000 (21:55 +1000)] 
Make device-special files for partitions when using --incremental

11 years agolet '-a' be specified for Incremental mode
Dan Williams [Mon, 5 May 2008 11:55:37 +0000 (21:55 +1000)] 
let '-a' be specified for Incremental mode

From: Dan Williams <dan.j.williams@intel.com>

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
11 years agoUnify code into find_free_devnum.
Neil Brown [Mon, 5 May 2008 11:55:36 +0000 (21:55 +1000)] 
Unify code into find_free_devnum.

Two places have code to find a free md device number.  Make this
a subroutine.

11 years agofix load_super/free_super mismatch in util.c
Dan Williams [Mon, 5 May 2008 11:55:35 +0000 (21:55 +1000)] 
fix load_super/free_super mismatch in util.c

From: Dan Williams <dan.j.williams@intel.com>

Signed-off-by: Dan Williams <dan.j.williams@intel.com>
11 years agoSimplistig locking for --incremental.
Bill Nottingham [Mon, 5 May 2008 09:44:04 +0000 (19:44 +1000)] 
Simplistig locking for --incremental.

From: Bill Nottingham <notting@redhat.com>

mdadm --incremental doesn't really do any locking. If you get multiple
events in parallel for the same device (that has not yet started), they
will all go down the path to create the array. One will succeed, the
rest will have SET_ARRAY_INFO die with -EBUSY (md: array mdX already has disks!)
and will exit without adding the disk.

Original bug report is: https://bugzilla.redhat.com/show_bug.cgi?id=433932

This is solved by adding very very rudimentary locking. Incremental() now
opens the device with O_EXCL to ensure only one invocation is frobbing the
array at once. A simple loop just tries to open 5 times a second for 5
seconds. If the array stays locked that long, you probably have bigger
issues.

11 years agoCreate /dev/md if needed and it doesn't exist.
Bill Nottingham [Mon, 5 May 2008 09:44:01 +0000 (19:44 +1000)] 
Create /dev/md if needed and it doesn't exist.

From: Bill Nottingham <notting@redhat.com>

11 years agoFix RAID acronym in man page.
Neil Brown [Mon, 5 May 2008 09:43:58 +0000 (19:43 +1000)] 
Fix RAID acronym in man page.

The 'D' in 'RAID' stands for 'DISKS' even it md supports other 'devices'.

11 years agoAdd a .gitignore file.
Neil Brown [Tue, 29 Apr 2008 07:14:01 +0000 (17:14 +1000)] 
Add a .gitignore file.

11 years agoUse .\" instead of '''
Neil Brown [Tue, 29 Apr 2008 07:13:59 +0000 (17:13 +1000)] 
Use .\" instead of '''

Debian bug 477273

11 years agodiff -ru mdadm-2.6.4-orig/Query.c mdadm-2.6.4/Query.c
Neil Brown [Tue, 29 Apr 2008 07:13:55 +0000 (17:13 +1000)] 
diff -ru mdadm-2.6.4-orig/Query.c mdadm-2.6.4/Query.c

11 years agoFix possible bug with bitmap space allocation with v1.0 metadata
Neil Brown [Tue, 29 Apr 2008 07:13:53 +0000 (17:13 +1000)] 
Fix possible bug with bitmap space allocation with v1.0 metadata

When adding a device to an array, make sure we don't reserve
so much space for the bitmap that there isn't room for the data.

11 years agoSmall improvements to --incremental for arrays that are in the middle of reshape
Neil Brown [Mon, 28 Apr 2008 06:30:31 +0000 (16:30 +1000)] 
Small improvements to --incremental for arrays that are in the middle of reshape

There is still a problem:  If array is partially assembled and started
read-only, the last device doesn't get added properly.  Probably a kernel
problem.

11 years agoAllow creation of a RAID6 with a single missing device.
Neil Brown [Mon, 28 Apr 2008 06:30:09 +0000 (16:30 +1000)] 
Allow creation of a RAID6 with a single missing device.

This did not work before as we couldn't mark it clean as there would
be some parity blocks out of sync, and raid6 will not assemble a
dirty degraded array.
So make such arrays doubly degraded (the last device becomes a spare)
and clean.

11 years agoUpdates some URLs in the man page.
Neil Brown [Mon, 28 Apr 2008 06:29:53 +0000 (16:29 +1000)] 
Updates some URLs in the man page.

Particularly, add the wiki on osdl.org

11 years agoPrint 'Events' more sensibly.
Neil Brown [Mon, 28 Apr 2008 06:29:45 +0000 (16:29 +1000)] 
Print 'Events' more sensibly.

Instead of MSW.LSW, just print it as a 64bit number.

11 years agoFix problems with array.size overflowing on large arrays.
Neil Brown [Mon, 28 Apr 2008 06:29:37 +0000 (16:29 +1000)] 
Fix problems with array.size overflowing on large arrays.

array.size is 32bits and counts K.  So for arrays with
more than 4Terrabytes, it can overflow.
The correct number can be read from sysfs, but there are still
a few places that use array.size and risk truncation.  What is worse.
they compare a number of kilobytes with a number of sectors !!

So use get_component_size() to read the sysfs information, and be
more consistent about units.

11 years agoFix for segfault when reading /proc/mdstat
Neil Brown [Mon, 28 Apr 2008 06:29:12 +0000 (16:29 +1000)] 
Fix for segfault when reading /proc/mdstat

Some kernel versions don't put a space between 'active' and '(auto-read-only)'
in /proc/mdstat.  This causes a parsing problem leaving 'level' set to
NULL which causes a crash.

So synthesise a space there if it is missing, and check for 'level' to
be NULL and don't de-ref if it is.

12 years agoUse sysfs info for metadata version info in Detail and elsewhere.
Neil Brown [Fri, 14 Dec 2007 09:15:21 +0000 (20:15 +1100)] 
Use sysfs info for metadata version info in Detail and elsewhere.

12 years agoReplace sysarray with mdinfo
Neil Brown [Fri, 14 Dec 2007 09:14:59 +0000 (20:14 +1100)] 
Replace sysarray with mdinfo

Sure, mdinfo is bigger, but having a uniform structure for lots of things
will make life easier.

12 years agoUse 'mdinfo' instead of special 'sysdev' structure.
Neil Brown [Fri, 14 Dec 2007 09:14:57 +0000 (20:14 +1100)] 
Use 'mdinfo' instead of special 'sysdev' structure.

there is needless duplicatiion between mdinfo and sysdev, so discard
the latter.

12 years agoSome tidy up of 'devices' in assemble.
Neil Brown [Fri, 14 Dec 2007 09:14:53 +0000 (20:14 +1100)] 
Some tidy up of 'devices' in assemble.

use "mdinfo" in the devices list rather than just copying
ad-hoc fields in.

12 years agoDon't record oldmajor/oldminor any more during assemble.
Neil Brown [Fri, 14 Dec 2007 09:14:44 +0000 (20:14 +1100)] 
Don't record oldmajor/oldminor any more during assemble.

We don't use the information at all (any longer).

12 years agoFind super from fd on an array.
Neil Brown [Fri, 14 Dec 2007 09:14:38 +0000 (20:14 +1100)] 
Find super from fd on an array.

We used to use the major/minor numbers, but that isn't sufficient
any more, so pass the fd, and possibly check 'text' version.

12 years agoDrop the superblock arg from all metadata methods.
Neil Brown [Fri, 14 Dec 2007 09:14:33 +0000 (20:14 +1100)] 
Drop the superblock arg from all metadata methods.

It is now in the 'supertype'

12 years agoFix compare_super to take supertype instead of a superblock.
Neil Brown [Fri, 14 Dec 2007 09:14:27 +0000 (20:14 +1100)] 
Fix compare_super to take supertype instead of a superblock.

As this function takes 2 superblocks, the change is a bit more subtle,
so is done separately.

12 years agoAdd 'supertype' arg to almost all metadata methods.
Neil Brown [Fri, 14 Dec 2007 09:14:16 +0000 (20:14 +1100)] 
Add 'supertype' arg to almost all metadata methods.

The 'superblock' will be moved into this structure soon.

12 years agoAllow metadata handlers to free their own superblock.
Neil Brown [Fri, 14 Dec 2007 09:14:00 +0000 (20:14 +1100)] 
Allow metadata handlers to free their own superblock.

As the metadata handler allocates the superblock, it should free it
too.  DDF will have a more complex 'superblock' which needs more complex
freeing.

12 years agoMake sure sysfs_read never succeeds for a non-MD device.
Neil Brown [Fri, 14 Dec 2007 09:13:51 +0000 (20:13 +1100)] 
Make sure sysfs_read never succeeds for a non-MD device.

... just in case.

12 years agoRemove spaces/tabs from ends of lines.
Neil Brown [Fri, 14 Dec 2007 09:13:43 +0000 (20:13 +1100)] 
Remove spaces/tabs from ends of lines.

12 years agoA recent patch broke --create --level=faulty - fix it.
Neil Brown [Thu, 29 Nov 2007 03:40:01 +0000 (14:40 +1100)] 
A recent patch broke --create --level=faulty - fix it.

Thanks to Martin Bene.

12 years agoAdd metadata version information to "--detail --brief" output.
Neil Brown [Mon, 12 Nov 2007 22:55:29 +0000 (09:55 +1100)] 
Add metadata version information to "--detail --brief" output.

12 years agoRelease 2.6.4 mdadm-2.6.4
Neil Brown [Fri, 19 Oct 2007 04:13:04 +0000 (14:13 +1000)] 
Release 2.6.4

12 years agoRemove partitions from a device before adding it to an array.
Neil Brown [Fri, 19 Oct 2007 04:03:17 +0000 (14:03 +1000)] 
Remove partitions from a device before adding it to an array.

The 'remove_partitions' call is in the wrong place and applying
to the wrong file.

12 years agoAdd some extra consistency checks based on level.
Neil Brown [Wed, 17 Oct 2007 03:08:12 +0000 (13:08 +1000)] 
Add some extra consistency checks based on level.

Also use LEVEL_LINEAR, LEVEL_MULTIPATH in place of -1 or -4 in a few places.

12 years agoClarify the avail/used devices sizes with version1 superblock.
Neil Brown [Wed, 17 Oct 2007 00:28:38 +0000 (10:28 +1000)] 
Clarify the avail/used devices sizes with version1 superblock.

Not all of the device may be available.  Of that, not all may be used
(if devices are of different sizes).

12 years agoMake sure --auto=mdp is honoured properly
Neil Brown [Wed, 17 Oct 2007 00:00:55 +0000 (10:00 +1000)] 
Make sure --auto=mdp is honoured properly

This would only create partitioned devices if the device name was a
'standard' name.  This this patch, any name will work.

12 years agoFix restarting of a reshaping array.
Neil Brown [Tue, 16 Oct 2007 03:52:35 +0000 (13:52 +1000)] 
Fix restarting of a reshaping array.

The last release broke the ability to assemble an array that
was in the middle of a reshape.
This patch adds code to test if the critical section needs
to be restored or not so that - if we have failed to restore it,
we know whether to fail or not.

12 years agoAlso use &tst instead of st later on when loading v1 superblocks
Jérémy Bobbio [Mon, 1 Oct 2007 08:17:06 +0000 (09:17 +0100)] 
Also use &tst instead of st later on when loading v1 superblocks

12 years agoFix segfault on assembly on amd64 with v1 superblocks
martin f. krafft [Sun, 30 Sep 2007 12:22:56 +0000 (13:22 +0100)] 
Fix segfault on assembly on amd64 with v1 superblocks

Commit a40b4fe introduced a temporary supertype variable tst, instead of
manipulating st directly. However, it was forgotton to pass &tst into the
recursive load_super1 call, causing an infinite recursion.

Signed-off-by: martin f. krafft <madduck@debian.org>
12 years agoMonitor.c s/MAXINT/INT_MAX/g
maximilian attems [Wed, 26 Sep 2007 16:12:46 +0000 (18:12 +0200)] 
Monitor.c s/MAXINT/INT_MAX/g

include limits.h directly instead of values.h

Signed-off-by: maximilian attems <max@stro.at>
Signed-off-by: Neil Brown <neilb@suse.de>
12 years agomdopen.c don't shadow major() and minor()
maximilian attems [Wed, 26 Sep 2007 16:12:47 +0000 (18:12 +0200)] 
mdopen.c don't shadow major() and minor()

s/(major|minor)/\1_num/

Signed-off-by: maximilian attems <max@stro.at>
Signed-off-by: Neil Brown <neilb@suse.de>
12 years agoMonitor.c include signal.h directly
maximilian attems [Wed, 26 Sep 2007 16:12:45 +0000 (18:12 +0200)] 
Monitor.c include signal.h directly

another small step for better klibc support, glibc compile tested.

Signed-off-by: maximilian attems <max@stro.at>
Signed-off-by: Neil Brown <neilb@suse.de>
12 years agoAdd ANNOUNCE-2.6.1 to git
Neil Brown [Mon, 24 Sep 2007 04:40:23 +0000 (14:40 +1000)] 
Add ANNOUNCE-2.6.1 to git

Somehow this missed out of getting into .git even though it is in all
tha tar-balls.

12 years agoDon't corrupt 'supertype' when speculatively calling load_super1
Neil Brown [Mon, 24 Sep 2007 04:26:44 +0000 (14:26 +1000)] 
Don't corrupt 'supertype' when speculatively calling load_super1

When load_super1 is trying to see which sub-version of v1 superblock
is present, failure will cause it to clear st->ss, which is not good.

So use a temporary 'super_type' for the 'test if this version works'
calls, then copy that into 'st' on success.

12 years agoconfig.c include dirent.h instead sys/dir.h
maximilian attems [Fri, 21 Sep 2007 17:32:18 +0000 (19:32 +0200)] 
config.c include dirent.h instead sys/dir.h

sys/dir.h is an old BSD'ism, include dirent directly.
small step for better klibc support.

compile tested against glibc.

Signed-off-by: maximilian attems <max@stro.at>
Signed-off-by: Neil Brown <neilb@suse.de>
12 years agoCreate.c s/major/major_num/
maximilian attems [Fri, 21 Sep 2007 17:32:19 +0000 (19:32 +0200)] 
Create.c s/major/major_num/

don't shadow the major() function by int major.

Signed-off-by: maximilian attems <max@stro.at>
Signed-off-by: Neil Brown <neilb@suse.de>
12 years agoAdd klibc support to mdadm.h
maximilian attems [Fri, 21 Sep 2007 17:32:17 +0000 (19:32 +0200)] 
Add klibc support to mdadm.h

klibc still misses a lot functionality to let mdadm link against,
this small step helps to get to the real trouble.. :)

Signed-off-by: maximilian attems <max@stro.at>
Signed-off-by: Neil Brown <neilb@suse.de>
12 years agoMake "--write-mostly" effective when re-adding a device to an array.
Neil Brown [Mon, 24 Sep 2007 03:14:13 +0000 (13:14 +1000)] 
Make "--write-mostly" effective when re-adding a device to an array.

Fixes Debian Bug 442874

When we discover that we can 're-add' a drive, we forget to check the
write-mostly flag.
This highlights the fact that you cannot turn 'off' the write-mostly
flag at this point.  I wonder if that is a problem...

12 years agoExplain the read-balancing algorithm for RAID1 better in md.4
Iustin Pop [Tue, 11 Sep 2007 14:20:19 +0000 (16:20 +0200)] 
Explain the read-balancing algorithm for RAID1 better in md.4

From: Iustin Pop <iusty@k1024.org>

There are many questions on the mailing list about the RAID1 read
performance profile. This patch adds a new paragraph to the RAID1
section in md.4 that details what kind of speed-up one should expect
from RAID1.

Signed-off-by: Iustin Pop <iusty@k1024.org>
12 years agoRelease 2.6.3 mdadm-2.6.3
Neil Brown [Mon, 20 Aug 2007 04:22:15 +0000 (14:22 +1000)] 
Release 2.6.3

12 years agoUpdate changelog
Neil Brown [Mon, 20 Aug 2007 04:14:46 +0000 (14:14 +1000)] 
Update changelog

12 years agoReport error when grow cannot be restarted.
Neil Brown [Mon, 20 Aug 2007 04:14:42 +0000 (14:14 +1000)] 
Report error when grow cannot be restarted.

Make sure that if --assemble find an array in the critical region
of a reshape, and cannot find the critical data to restart the
reshape, it gives an error message.

12 years agoFix error message when adding a device that is too small.
Neil Brown [Mon, 20 Aug 2007 04:14:28 +0000 (14:14 +1000)] 
Fix error message when adding a device that is too small.

We were multiplying MD_RESERVED_SECTORS by 1024 instead of 512,
so lots of 'is it too small' checks were wrong.

12 years agoFix problem with add a device to a 1.x array created with older mdadm.
Neil Brown [Mon, 20 Aug 2007 04:14:25 +0000 (14:14 +1000)] 
Fix problem with add a device to a 1.x array created with older mdadm.

When adding new disk to an array, don't reserve so much bitmap
space that the disk cannot store the required data. (Needed when
1.x array was created with older mdadm).