Commit Graph

445 Commits

Author SHA1 Message Date
Neil Brown 11fcec12ef Add crc32 files.
For ddf.
2008-05-15 16:48:10 +10:00
Neil Brown 974e620d66 Add cpu_to_be convertions functions.
DDF will uses these.
2008-05-15 16:48:09 +10:00
Neil Brown b6e63da496 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.
2008-05-15 16:48:08 +10:00
Neil Brown 17f25ca6fb Add 'container' level and ->validate_geometry method.
These will be used for ddf.
2008-05-15 16:47:41 +10:00
Neil Brown 2270232245 Release 2.6.5 2008-05-15 15:50:59 +10:00
Neil Brown e509e779cd Get Changelog uptodate 2008-05-15 15:50:57 +10:00
Neil Brown ea24acd073 Compiple fixes for mdassemble and diet-libc 2008-05-15 15:50:56 +10:00
Neil Brown 54097ce72b Don't try the auto-detect test when md_mod is a module
....as this cannot work.
2008-05-15 15:50:50 +10:00
Neil Brown ff1f6545db Fix support for --update=swapsuper
The user of dup_super broke it.
2008-05-15 15:50:48 +10:00
Neil Brown 294d6f450f Recent change broken handling of metadata-less arrays.
In particular, failing a device would give a silly
error message.
2008-05-15 15:50:47 +10:00
Neil Brown 3b0896f899 Fix possible NULL dereference in super_by_fd 2008-05-15 15:50:45 +10:00
Neil Brown ddd1a49251 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.
2008-05-15 15:50:42 +10:00
Hans Lambermont 6ac8aac226 Set LOG_PID for syslog
From: Hans Lambermont <hans.lambermont@newtec.eu>
2008-05-12 12:21:56 +10:00
Kay Sievers 0d726f17e1 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>
2008-05-06 10:02:38 +10:00
Neil Brown 9a02c62af9 Make device-special files for partitions when using --incremental 2008-05-05 21:55:39 +10:00
Dan Williams 95b79df03e 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>
2008-05-05 21:55:37 +10:00
Neil Brown 63152c1b33 Unify code into find_free_devnum.
Two places have code to find a free md device number.  Make this
a subroutine.
2008-05-05 21:55:36 +10:00
Dan Williams 5e747af24a 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>
2008-05-05 21:55:35 +10:00
Bill Nottingham 767bd45298 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.
2008-05-05 19:44:04 +10:00
Bill Nottingham 62552fdfcc Create /dev/md if needed and it doesn't exist.
From: Bill Nottingham <notting@redhat.com>
2008-05-05 19:44:01 +10:00
Neil Brown 02b76eeace Fix RAID acronym in man page.
The 'D' in 'RAID' stands for 'DISKS' even it md supports other 'devices'.
2008-05-05 19:43:58 +10:00
Neil Brown 25b05c515e Add a .gitignore file. 2008-04-29 17:14:01 +10:00
Neil Brown e43d0cda22 Use .\" instead of '''
Debian bug 477273
2008-04-29 17:13:59 +10:00
Neil Brown c2c9bb6fe0 diff -ru mdadm-2.6.4-orig/Query.c mdadm-2.6.4/Query.c 2008-04-29 17:13:55 +10:00
Neil Brown 519561f73f 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.
2008-04-29 17:13:53 +10:00
Neil Brown 5f98d3cbd9 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.
2008-04-28 16:30:31 +10:00
Neil Brown 6fb79233b0 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.
2008-04-28 16:30:09 +10:00
Neil Brown 3cdfb6a712 Updates some URLs in the man page.
Particularly, add the wiki on osdl.org
2008-04-28 16:29:53 +10:00
Neil Brown 1486e43fec Print 'Events' more sensibly.
Instead of MSW.LSW, just print it as a 64bit number.
2008-04-28 16:29:45 +10:00
Neil Brown 7a3be72fc6 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.
2008-04-28 16:29:37 +10:00
Neil Brown 2cdb64897d 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.
2008-04-28 16:29:12 +10:00
Neil Brown 142cb9e181 Use sysfs info for metadata version info in Detail and elsewhere. 2007-12-14 20:15:21 +11:00
Neil Brown 7e0f69790c Replace sysarray with mdinfo
Sure, mdinfo is bigger, but having a uniform structure for lots of things
will make life easier.
2007-12-14 20:14:59 +11:00
Neil Brown 06c7f68e40 Use 'mdinfo' instead of special 'sysdev' structure.
there is needless duplicatiion between mdinfo and sysdev, so discard
the latter.
2007-12-14 20:14:57 +11:00
Neil Brown 213ee40bd2 Some tidy up of 'devices' in assemble.
use "mdinfo" in the devices list rather than just copying
ad-hoc fields in.
2007-12-14 20:14:53 +11:00
Neil Brown 61255666e2 Don't record oldmajor/oldminor any more during assemble.
We don't use the information at all (any longer).
2007-12-14 20:14:44 +11:00
Neil Brown 1686dc25ec 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.
2007-12-14 20:14:38 +11:00
Neil Brown 3da92f272d Drop the superblock arg from all metadata methods.
It is now in the 'supertype'
2007-12-14 20:14:33 +11:00
Neil Brown 64557c3391 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.
2007-12-14 20:14:27 +11:00
Neil Brown 68c7d6d790 Add 'supertype' arg to almost all metadata methods.
The 'superblock' will be moved into this structure soon.
2007-12-14 20:14:16 +11:00
Neil Brown df37ffc039 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.
2007-12-14 20:14:00 +11:00
Neil Brown 2faf1f5f63 Make sure sysfs_read never succeeds for a non-MD device.
... just in case.
2007-12-14 20:13:51 +11:00
Neil Brown aba69144fd Remove spaces/tabs from ends of lines. 2007-12-14 20:13:43 +11:00
Neil Brown 08e43379e5 A recent patch broke --create --level=faulty - fix it.
Thanks to Martin Bene.
2007-11-29 14:40:01 +11:00
Neil Brown 7615d98913 Add metadata version information to "--detail --brief" output. 2007-11-13 09:55:29 +11:00
Neil Brown 6a0671608b Release 2.6.4 2007-10-19 14:13:04 +10:00
Neil Brown 25037aa872 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.
2007-10-19 14:03:17 +10:00
Neil Brown 570510ba32 Add some extra consistency checks based on level.
Also use LEVEL_LINEAR, LEVEL_MULTIPATH in place of -1 or -4 in a few places.
2007-10-17 13:08:12 +10:00
Neil Brown 5cda096425 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).
2007-10-17 10:28:38 +10:00
Neil Brown dc2ee6b3e3 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.
2007-10-17 10:00:55 +10:00