summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Add stub for validation of partition table file during config parsinghotunplugDoug Ledford2010-04-163-0/+13
| | | | Signed-off-by: Doug Ledford <dledford@redhat.com>
* Use the action helper functions in a few more placesDoug Ledford2010-04-161-3/+2
| | | | Signed-off-by: Doug Ledford <dledford@redhat.com>
* Add check_clean() functionDoug Ledford2010-04-163-6/+40
| | | | Signed-off-by: Doug Ledford <dledford@redhat.com>
* Rename *_partition to *_table, fill in a little more meat inDoug Ledford2010-04-163-13/+18
| | | | | | IncrementalNewDisk Signed-off-by: Doug Ledford <dledford@redhat.com>
* Compile fixes for IncrementalNew refactorDoug Ledford2010-04-161-3/+0
| | | | Signed-off-by: Doug Ledford <dledford@redhat.com>
* The new dev_open_check() will be more useable if we pass back theDoug Ledford2010-04-163-7/+8
| | | | | | | stat buffer instead of making callers do a second stat if they need something from the stat buffer Signed-off-by: Doug Ledford <dledford@redhat.com>
* Refactor IncrementalNew into two distinct routines, one for wheneverDoug Ledford2010-04-163-54/+110
| | | | | | | we might need to repartition a device, and one for when we will be using the block device directly. Signed-off-by: Doug Ledford <dledford@redhat.com>
* Add new helper function dev_open_check() that does the most commonDoug Ledford2010-04-162-0/+26
| | | | | | sanity checks for us Signed-off-by: Doug Ledford <dledford@redhat.com>
* Modify config parsing and domain struct to use a partition handlerDoug Ledford2010-04-162-9/+14
| | | | | | entry instead of just a program name. Signed-off-by: Doug Ledford <dledford@redhat.com>
* Stub entries for making partition handling be done via an indirectionDoug Ledford2010-04-162-0/+34
| | | | | | | layer so we can easily support different partitioning methods required for different platforms Signed-off-by: Doug Ledford <dledford@redhat.com>
* Add some helper functions to make code cleaner lookingDoug Ledford2010-04-162-14/+6
| | | | Signed-off-by: Doug Ledford <dledford@redhat.com>
* Add the table and program options for partition action and make themDoug Ledford2010-04-162-1/+55
| | | | | | a requirement. Signed-off-by: Doug Ledford <dledford@redhat.com>
* Don't throw away an entire domain because of one bad path. But if itDoug Ledford2010-04-161-5/+25
| | | | | | turns out there are no good paths, then do throw the domain away. Signed-off-by: Doug Ledford <dledford@redhat.com>
* More sanity testsDoug Ledford2010-04-151-0/+30
| | | | Signed-off-by: Doug Ledford <dledford@redhat.com>
* Initial support for new disk hot plug actions. Nowhere near complete,Doug Ledford2010-04-153-5/+85
| | | | | | | | just the initial stages. Added support for the call to mdadm.c, some sanity checks on how we are called, some of the initial easy sanity checks that kick us out of the new function, etc. Signed-off-by: Doug Ledford <dledford@redhat.com>
* Pass the device name to arrays_in_domain along with the domainDoug Ledford2010-04-152-3/+12
| | | | | | | | | | This allows us to pull the path information for our current device and filter the list of possible matching domains based upon that path information. Since we only support identical partition tables, if an array is comprised of -part1 partitions already, then we know that our new device will only match on -part1 as well. Signed-off-by: Doug Ledford <dledford@redhat.com>
* Added sanity checks on DOMAIN lines, add an action_mask valueDoug Ledford2010-04-152-2/+15
| | | | Signed-off-by: Doug Ledford <dledford@redhat.com>
* Change the argument to arrays_in_domain so we aren't always recheckingDoug Ledford2010-04-152-8/+3
| | | | | | symlinks when we've already got our domain Signed-off-by: Doug Ledford <dledford@redhat.com>
* Null terminate our return value so string functions workDoug Ledford2010-04-151-0/+2
| | | | Signed-off-by: Doug Ledford <dledford@redhat.com>
* In preparation for new incremental --grab support, update Makefile toDoug Ledford2010-04-153-8/+11
| | | | | | | install new udev early rules, update ReadMe.c for new options to pass to incremental mode, update udev rules file for new options. Signed-off-by: Doug Ledford <dledford@redhat.com>
* Refactor code slightly to improve code reuseDoug Ledford2010-04-142-47/+41
| | | | Signed-off-by: Doug Ledford <dledford@redhat.com>
* Initial stab at the config option parsing for new DOMAIN line supportDoug Ledford2010-04-143-1/+304
| | | | Signed-off-by: Doug Ledford <dledford@redhat.com>
* Fix up discrepancy in whether the long option is --rebuild or --rebuild-mapDoug Ledford2010-04-131-12/+14
| | | | Signed-off-by: Doug Ledford <dledford@redhat.com>
* Add flag and help entry for new option to signal we should take a driveDoug Ledford2010-04-131-4/+9
| | | | | | for automatic hot spare/rebuild use. Signed-off-by: Doug Ledford <dledford@redhat.com>
* Sample udev rules file to capture block devices very early in theDoug Ledford2010-04-131-0/+28
| | | | | | | udev hot plug sequence, allowing us to make them our own if they match a proper DOMAIN entry in the mdadm.conf file Signed-off-by: Doug Ledford <dledford@redhat.com>
* The assumption is that if tfd >= 0, then we have a valid major/minor pairDoug Ledford2010-04-131-6/+6
| | | | | | | | | | | | | | | in stb.st_rdev to use in ioctl calls. Therefore, even if we use the sysfs block/dev entry to get our major/minor pair, we should really be using tfd and not sysfd as it changes assumptions made later on. Note: I actually don't like this. I would prefer that in the case of a kernel internal name that we skipped tfd altogether and went strait to sysfs operation exclusively. But that's just my preference. I'm concerned that sometime in the future we'll make the mistake of assuming that tfd >= 0 means dv->devname is a fully qualified path name and not a kernel internal name. We don't now, but I could easily see it happening. Signed-off-by: Doug Ledford <dledford@redhat.com>
* udev rules: imsm arrays are a different ID_FS_TYPE, so check for them asDoug Ledford2010-04-131-1/+3
| | | | | | | | well as regular mdadm arrays. Check to see if we were told on the boot command line to ignore IMSM arrays first though (aka, rd_NO_MDIMSM is not empty). Signed-off-by: Doug Ledford <dledford@redhat.com>
* Minor bug fix to incremental remove supportDoug Ledford2010-04-131-0/+3
| | | | Signed-off-by: Doug Ledford <dledford@redhat.com>
* [hotunplug] we are testing mdstat, not ent which is undefined at thisDoug Ledford2010-04-131-3/+3
| | | | | | point Signed-off-by: Doug Ledford <dledford@redhat.com>
* Local tweaks to speed build/install/test cyclesDoug Ledford2010-04-132-4/+4
| | | | Signed-off-by: Doug Ledford <dledford@redhat.com>
* Fix all the confusion over directories once and for all. We now haveDoug Ledford2010-04-136-65/+46
| | | | | | | | | | | | 3 directory definitions: mdmon directory for its pid and sock files, mdmonitor directory which is for the mdadm monitor mode pid file and can only be passed in via command line, and the directory for the mdadm map file. Only the mdadm map file still hunts multiple locations, and the number of locations has been reduced to /var/run and the compile time specified location. I could see lowering that to just 1 location, but I didn't do that with this patch. Signed-off-by: Doug Ledford <dledford@redhat.com>
* Update udev rules for hotplug support.NeilBrown2010-04-091-6/+6
| | | | | | | | | - split the rules for handling components of array to be clearly separate from rules for handling the arrays themselves. - add call to "-If" when removing a device - uncomment the --incremental call when adding a device. Signed-off-by: NeilBrown <neilb@suse.de>
* Add -fail support to --incrementalNeilBrown2010-04-096-9/+88
| | | | | | | | | | | | | This can be used for hot-unplug. When a device has been remove, udev can call mdadm --incremental --fail sda and mdadm will find the array holding sda and remove sda from the array. Based on code from Doug Ledford <dledford@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Support fail/remove using kernel nameNeilBrown2010-04-091-20/+81
| | | | | | | | | | Allow kernel names like "sda" and "hdb1" to be used to fail/remove devices from an array. This is useful as after a device has been removed it can be difficult to get the major/minor number. Signed-off-by: NeilBrown <neilb@suse.de>
* Add mdstat_by_componentNeilBrown2010-04-092-6/+68
| | | | | | | | | | | | | This allows finding the array which contains a given component. Components are named using the kernel-internal string name such as "sda1" or "hdb". Don't return member arrays, only the contain that contains them. Also tidy up the parsing of 'inactive' arrays in /proc/mdstat. If we see 'inactive' we need to set 'in_devs' immediately as there is no level coming. Signed-off-by: NeilBrown <neilb@suse.de>
* powerpc compile fixDoug Ledford2010-04-071-1/+1
| | | | | Signed-off-by: Doug Ledford <dledford@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Don't attempt to create or read bitmaps where the metadata doesn't support it.NeilBrown2010-04-073-2/+16
| | | | | | | In particular, if the relevant bitmap method is NULL, don't try to call it, print an error instead. Signed-off-by: NeilBrown <neilb@suse.de>
* Merge branch 'HEAD'; commit 'a4b93c9ce4f15217afb8'NeilBrown2010-04-071-0/+46
|\
| * Add ANNOUNCE-3.1.2NeilBrown2010-04-071-0/+46
| | | | | | | | | | | | Forgot to git-add this for the release :-( Signed-off-by: NeilBrown <neil@suse.de>
* | Only signal a udev change event if we actually write a mapfile in RebuildMapDoug Ledford2010-03-241-6/+8
| | | | | | | | Signed-off-by: Doug Ledford <dledford@redhat.com>
* | mapfile: if we putting the mapfile in a custom location via ALT_RUN, allowDoug Ledford2010-03-243-2/+6
| | | | | | | | | | | | a custom filename too. Signed-off-by: Doug Ledford <dledford@redhat.com>
* | Create directory to contain mapfile (Assuming parent exists andDoug Ledford2010-03-242-5/+14
| | | | | | | | | | | | | | | | filesystem is writable). This particularly keeps udev happy if VAR_RUN is set to /dev/md. Signed-off-by: Doug Ledford <dledford@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | (no commit message)NeilBrown2010-03-241-1/+6
|/
* Release mdadm-3.1.2NeilBrown2010-03-107-8/+9
|
* tests: adjust sizes for new defaultsNeilBrown2010-03-1017-33/+38
| | | | | | | Default metadata type is now 1.2, and we sometimes add extra alignment before the data section, so adjust tests for these changes. Signed-off-by: NeilBrown <neilb@suse.de>
* ddf/intel: zero out old metadata before creating a container.NeilBrown2010-03-102-2/+10
| | | | | | | | Matching the functionality already in super0 and super1, when we first create a container, remove any other recognisable metadata to ensure it doesn't cause confusion. Signed-off-by: NeilBrown <neilb@suse.de>
* Grow: fix recent breakage - lseek return status.NeilBrown2010-03-101-3/+8
| | | | | | | | | Recent fix to check lseek64 return status got it badly wrong. It doesn't return 0 on success!! Fix it. Signed-off-by: NeilBrown <neilb@suse.de>
* Assemble: fix some recently introduced bugs.NeilBrown2010-03-101-10/+17
| | | | | | | | Found during testing: - cannot check metadata for homehost before loading metadata. - As 1.x metadata can has a state 'rebuilding' between 'spare' and 'ok', we need to include that in our calculations. Signed-off-by: NeilBrown <neilb@suse.de>
* Merge branch 'master' of git://github.com/djbw/mdadmNeilBrown2010-03-101-10/+5
|\
| * imsm: kill ->creating_imsm flagDan Williams2010-03-031-6/+4
| | | | | | | | | | | | It is an unused holdover from long since removed functionality. Signed-off-by: Dan Williams <dan.j.williams@intel.com>