summaryrefslogtreecommitdiffstats
path: root/udev-md-raid.rules (unfollow)
Commit message (Collapse)AuthorFilesLines
2010-12-01fix: assemble for external metadata generates segfault if invalid device foundHawrylewicz Czarnowski, Przemyslaw1-1/+2
An attempt to invoke super_by_fd() on device that has metadata_version="none" always matches super0 (as test_version is ""). In Assemble() it results in segfault when load_container is invoked (=null for super0). As of now load_container is only started if it points to valid pointer. Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
2010-12-01Create: report failure if array cannot be started.NeilBrown2-4/+12
We weren't checking the result of writing 'active' to array_state Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-30ddf: fail creation of new subarray with same name as old.NeilBrown2-0/+16
Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-30ddf: don't print warning on assembleNeilBrown1-2/+5
Now that we check the error return of 'update_super' better, we much make sure that ddf doesn't incorrectly report that the superblocks are wrong during assemble. Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-30mdmon: don't copy an invalid chunk_sizeNeilBrown3-3/+0
As chunk_size in mdstat_ent is never set, we shouldn't copy it into a->info.array. In fact, it is safest to get rid of the field altogether. Reported-by: "Kwolek, Adam" <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-30Assemble: call remove_partitions later.NeilBrown1-4/+6
We shouldn't call remove_partitions until we have made a really firm decision to include the device into the array. Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-30Assemble: add --update=no-bitmapNeilBrown4-6/+22
This allows an array with a corrupt internal bitmap to be assembled without the bitmap. Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-30Grow: give useful message when adding bitmap gives EBUSY.NeilBrown1-1/+10
If adding a bitmap fails with EBUSY, then it is because the array is currently resyncing/recovering/reshaping. As this is non-obvious, give a message explaining the fact. Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-30Fix warning about host-endian bitmaps.NeilBrown1-4/+4
Hostendian bitmaps should be warned about on all arch's. And fix a speeling mistake. Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-30Allow K,M,G suffix on chunk sizes as well as device/array sizes.NeilBrown2-25/+29
We already allow K,M,G suffixes for --size and --array-size. Allow it for --chunk and --bitmap-chunk as well. Also add this info to man page, and remove the duplication of info about --array-size. Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-30Compute backup blocks in function.Adam Kwolek2-17/+29
number of backup blocks evaluation is put in to function for code reuse. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-30Prepare and free fdlist in functionsAdam Kwolek2-32/+82
fd handles table creation is put in to function for code reuse. In manage_reshape(), child_grow() function from Grow.c will be reused. To prepare parameters for this function, code from Grow.c can be reused also. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-30imsm: Allow multiple spares to be collected.Adam Kwolek1-4/+17
Assumption for spares searching was that after picking new device, it has to be added to array before next search. This causes returning different disk on each call. When creating a spare list during Online Capacity Expansion, we will first collect the devices list and then all devices are added to md. Picked device from spares pool has to be checked against picked devices so far. If not, the same disk will be returned all the time. Already picked devices are stored in the list and this list is used for new devices verification also. So add an extra arg to imsm_add_spare to hold a list of known spares to ignore. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-29imsm: FIX: core dump during imsm metadata writingAdam Kwolek1-9/+18
Wrong number of disks during metadata update causes core dump. New disks number based on internal mdmon information has to used for calculation (not previously read from metadata). Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-29imsm: Add support for general migrationAdam Kwolek1-7/+55
Internal IMSM procedures need to support the General Migration. It is used during operations like: - Online Capacity Expansion, - migration initialization, - finishing migration, - apply changes to raid disks etc. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-29Treat feature as experimentalAdam Kwolek2-0/+11
Due to fact that IMSM Windows compatibility was not tested yet, feature has to be treated as experimental until compatibility verification will be performed. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-29Disk removal support for Raid10->Raid0 takeoverAdam Kwolek1-1/+90
Until now Raid10->Raid0 takeover was possible only if all the mirrors where removed before md starts the takeover. Now mdadm, when performing Raid10->raid0 takeover, will remove all unwanted mirrors from the array before actual md takeover is called. Signed-off-by: Maciej Trela <maciej.trela@intel.com> Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-29Improve comments for block_monitor.NeilBrown2-4/+15
Also not that the leading '-' on the metadata names now simply means that mdmon must not reconfiure the array. Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-28Monitor: array that has disappeared doesn't need sparesAnna Czarnowska1-1/+1
If a degraded array disappears we still have it in statelist with active<raid but it is pointless to look for spares for it. Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-28Monitor: fix writing autorebuild.pidAnna Czarnowska1-10/+16
If /var/run/mdadm doesn't exist we can never succeed writing so we should try to create it first. When we make sure it is there we write pid file as before. Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-28Monitor: reset dev when size too smallAnna Czarnowska1-2/+3
Cc: linux-raid@vger.kernel.org, Williams, Dan J <dan.j.williams@intel.com>, Ciechanowski, Ed <ed.ciechanowski@intel.com> Otherwise spare will be considered good anyway. Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-28Monitor: devid should be dev_tAnna Czarnowska3-9/+9
For consistency with makedev(). int is not sufficient. Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-28Monitor: few bug fixes for spare migrationAnna Czarnowska1-2/+11
1. If array not changed we should still report any degraded - another array may have a new spare that we can move. 2. Array with err=1 can't give a spare. 3. We look for spares in "from" not "st" which is supertype and has devname=NULL. Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-28Spare migration testsAnna Czarnowska4-1/+586
This is a series of tests checking if mdadm Monitor migrates spares according to rules in /etc/mdadm.conf defined by POLICY lines. Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com> Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-28Incremental - avoid including wayward devices.NeilBrown3-18/+79
If a devices - typically in a mirrored set - is assembled independently of the other devices, and then attempted to be brought back into the set, it could contain inconsistent data. It should not be included. So detect this situation by ensuring that the 'most recent' device is believed to be active by every other device. If a device is wayward, it will only consider fellow wayward devices to be active and will think all others are failed or missing. This patches fixes --incremental, --assemble was done in an earlier patch. Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-25Improve opt parsing, and distinguish long from short.NeilBrown3-57/+126
In several cases, two different long options map to the same short option. So e.g. you could give '--brief' and it would be interpreted as '--bitmap'. That isn't really good. So for every shared short option, define an option number and return that for the long option instead. Then always check for both the short and long options. Also give some bugs like " mode == 'G'" which should be '== GROW'. Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-25Incr: reduce the number of times we load data from sysfs.NeilBrown1-13/+24
Rather than calling sysfs_read whenever we want data from sysfs, call it once at the start will all the requests of interest, then just use that, Make sure we free it properly too. Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-25Monitor: choose spare correctly for external metadata.NeilBrown1-1/+62
When metadata is managed externally - probably as a container - we need to examine that metadata to see which devices are spares. So use the getinfo_super_disk message and use the info returned. Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-25Monitor: separate 'choose_spare' out from 'move_spare'NeilBrown1-34/+42
choosing a spare from a container is more complicated that from a native array. So separate out choose_spare to make it easier to use an alternate implementation Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-23External reshape (step 2): Freeze containerDan Williams1-36/+100
When growing the number of raid disks the reshape process will promote container-spares to subarray-spares (later the kernel promotes them to subarray-members in raid5_start_reshape()). The automatic spare promotion that mdmon performs upon seeing a degraded array must be disabled until the reshape process has been initiated. Otherwise, mdmon may start a rebuild before the reshape parameters can be specified. In the external case we arrange for the monitor to be blocked, and turn off the safemode delay. Mdmon is updated to check sync_action is not frozen before initiating recovery. Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
2010-11-23External reshape (step 1): container reshape and ->reshape_super()Dan Williams2-8/+391
In the native metadata case Grow_reshape() and the kernel validate what reshapes are possible / supported and the kernel handles all the metadata updates. In the external case the metadata format may have specific constraints above this baseline. External formats also introduce the constraint of only permitting some reshapes at container scope versus subarray scope. For exmaple imsm changes to 'raiddisks' must be applied to all arrays in the container. This operation assumes that its 'st' parameter has been obtained from super_by_fd() (such that st->subarray is up to date), and that a snapshot of the metadata has been loaded from the container. Why a new method, versus extending an existing one? ->validate_geometry: this routine assumes it is being called from Create(), adding reshape complicates the cases that this routine needs to handle. Where we find that checks can be shared between the two cases those routines refactored into common code internal to the metadata handler, i.e. no need to provide a unified external interface. ->validate_geometry() also does not expect to update the metadata. ->update_super: this is meant to update single fields at Assembly() and only at the container scope. Reshape potentially wants to update multiple fields at either container or subarray scope. Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>