summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* super1: reserve at least 2 chunks for reshape headroom.r10-reshapeNeilBrown2012-05-091-6/+17
| | | | | | | | sometimes 0.1% isn't enough, though mostly only in testing. We need one chunk for a successful reshape, so reserve 2. Signed-off-by: NeilBrown <neilb@suse.de>
* New RESHAPE_NO_BACKUP flag to track when backup action is needed.NeilBrown2012-05-094-1/+17
| | | | | | | | | | | | Some arrays (raid10) never need a backup file, so during assembly we can avoid the whole Grow_continue check in the case. Achieve this using a flag set by the metadata handler. Also get "mdadm -I" to fail if a backup process would be needed. It currently does fail as the kernel rejects things, but it is nicer to have this explicit. Signed-off-by: NeilBrown <neilb@suse.de>
* Grow: add raid10 reshape.NeilBrown2012-05-091-43/+332
| | | | | | | | RAID10 reshape requires that data_offset be changed. So we only allow it if the new_data_offset attribute is available, and we compute a suitable change in data offset. Signed-off-by: NeilBrown <neilb@suse.de>
* Grow: set new_data_offset if appropriateNeilBrown2012-05-092-0/+6
|
* Add space_before/space_after fields to mdinfoNeilBrown2012-05-092-1/+43
| | | | | | | These will be needed to guide changes to data_offset during reshape. Only set them for super1 for now. Signed-off-by: NeilBrown <neilb@suse.de>
* super1: add new_offset field.NeilBrown2012-05-091-3/+27
| | | | | | | | | The 'new_offset' is used for reshaping to avoid the need for a backup file. For now we only report the value when it is set. Signed-off-by: NeilBrown <neilb@suse.de>
* Add --data-offset flag for Create and GrowNeilBrown2012-05-097-11/+72
| | | | | | | | | | This can be used to over-ride the automatic assignment of data offset. For --create, it is useful to re-create old arrays where different defaults applied. For --grow it may be able to force a reshape in the reverse direction. Signed-off-by: NeilBrown <neilb@suse.de>
* Add data_offset arg to ->init_super and use it in super1.cNeilBrown2012-05-097-44/+72
| | | | | | | So if ->data_offset is already set, use that rather than computing one. Signed-off-by: NeilBrown <neilb@suse.de>
* Add data_offset arg to ->validate_geometry.NeilBrown2012-05-099-16/+37
| | | | | | | This is needed to return correct available size. It isn't really used yet. Signed-off-by: NeilBrown <neilb@suse.de>
* Add data_offset arg to ->avail_sizeNeilBrown2012-05-097-12/+38
| | | | | | | This is currently only useful for 1.x metadata and will allow an explicit --data-offset request on command line. Signed-off-by: NeilBrown <neilb@suse.de>
* Create new release: 3.2.4mdadm-3.2.4NeilBrown2012-05-098-34/+181
| | | | | | Bugfix release Signed-off-by: NeilBrown <neilb@suse.de>
* super-intel.c: Fix resource leak from opendir()Jes Sorensen2012-05-071-0/+1
| | | | | | | | Use closedir() on dirp from opendir() to avoid resource leaking. Acked-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
* super-intel.c: Don't try to close negative fdJes Sorensen2012-05-071-1/+1
| | | | | | | | | This should be harmless, but lets be consistent and not try to close a negative file descripter. Acked-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Grow: failing the set the per-device size is not an error.NeilBrown2012-05-031-1/+3
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* test: don't worry too much about array size.NeilBrown2012-05-031-2/+3
| | | | | | | | With different amounts of space being reserved for metadata it is hard for the script to know how big the array should be. So allow a bit of slack. Signed-off-by: NeilBrown <neilb@suse.de>
* Adjust to new standard of /runNeilBrown2012-05-036-45/+23
| | | | | | | | Now that /run seems to be a good standard, make that the default for storing various run-time files, rather than /var/run or /dev/.mdadm. Signed-off-by: NeilBrown <neilb@suse.de>
* Update test for "is udev active".NeilBrown2012-05-031-1/+1
| | | | | | | | Newer udev doesn't use /dev/.udev any more. it used /run/udev instead. So test for that as well. Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: fix: thunderdome may drop 2tb attributeCzarnowska, Anna2012-04-301-0/+2
| | | | | | | | | | | | Spare superblock doesn't depend on other spares in container. When loading container metadata thunderdome may pick a small disk for the champion. This will result in incorrect interpretation of sizes of other disks in container when joint superblock is returned. If any disk in container has the 2TB attribute set, the result must have it set too. Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Introduce sysfs_set_num_signed() and use it to set bitmap/offsetJes Sorensen2012-04-303-2/+12
| | | | | | | | | | mdinfo->bitmap_offset is a signed long and needs to be treated as such when passed to the kernel. This resolves the problem with adding internal bitmaps to a 1.0 array. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Fix sign extension of bitmap_offset in super1.cJes Sorensen2012-04-301-2/+2
| | | | | | | | | | fbdef49811c9e2b54e2064d9af68cfffa77c6e77 incorrectly tried to fix sign extension of the bitmap offset. However mdinfo->bitmap_offset is a u32 and needs to be converted to a 32 bit signed integer before the sign extension. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
* fix: correct extending size of raid0 arrayLukasz Dorau2012-04-231-1/+1
| | | | | | | | | Setting "sync_action" to "idle" while extending size of raid0 array is racy and sometimes fails. "sync_action" should be set to "frozen" instead. Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: fix: rebuild does not continue after rebootLukasz Dorau2012-04-231-0/+17
| | | | | | | | | | | | | | | | | | If system is rebooted during rebuild, md driver changes sync_action from 'recover' to 'idle' (during stopping all md devices). If mdmon is still running then, it detects the change of sync_action state, finishes rebuild and writes metadata to disks. After computer's restart the RAID volume is in Normal state in OROM and rebuild seems to be finished. After system's start-up RAID volume is in auto-read-only state and metadata is in Dirty state. Rebuild seems to be finished but it is not. Data is inconsistent (out-of-sync). When mdmon detects the change of sync_action from 'recover' to 'idle', it has to check if rebuild is really finished. Appropriate test was added. Now mdmon examines each volume's member if it is being rebuilt. Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Relax restrictions on when --add is permitted.NeilBrown2012-04-181-9/+26
| | | | | | | | | | | | | | | The restriction that --add was not allowed on a device which looked like a recent member of an array was overly harsh. The real requirement was to avoid using --add when the array had failed, and the device being added might contain necessary information which can only be incorporated by stopping and re-assembling with --force. So change the test to reflect the need. Reported-by: Doug Ledford <dledford@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Add --prefer option for --detail and --monitorNeilBrown2012-04-187-20/+68
| | | | | | | | | | | | | | | | | Both --detail and --monitor can report the names of member devices on an array, and do so by searching /dev and finding the shortest name that matches. If --prefer=foo is given, they will instead prefer a name that contain /foo/. So mdadm --detail /dev/md0 --prefer=by-path will list the component devices via their /dev/disk/by-path/xxx names. Signed-off-by: NeilBrown <neilb@suse.de>
* Raid limit of 1024 when scanning for devices.NeilBrown2012-04-183-4/+12
| | | | | | | | When we can for devices using GET_DISK_INFO we currently limit to 1024. But some arrays can have more than this. So raise it to 4096 and make the constant a #define. Signed-off-by: NeilBrown <neilb@suse.de>
* FIX: resolve make everything compilation errorLukasz Dorau2012-04-171-0/+2
| | | | | | | | | | When mdadm is compiled using e.g. 'everything' option, mdassemble compilation is broken. Change code to enable mdassemble compilation. Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* FIX: Assembled second array is in read only state during reshapeAdam Kwolek2012-04-171-8/+21
| | | | | | | | | | | | | When arrays using external metadata are assembled, and one of array in container is under reshape, second array will remain in read only state (not auto read only). It is caused by array fact that array is frozen and mdmon doesn't has opportunity to switch array in r/w mode. Freezing not reshaped array just after it is being assembled allows mdmon to enable it for writing. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* FIX: Size change is possible as standalone change onlyAdam Kwolek2012-04-171-1/+1
| | | | | | | | Size change is possible as standalone change only. To make sure size change is not requested pass '-1' as size parameter. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: FIX: Component size alignment checkAdam Kwolek2012-04-171-20/+48
| | | | | | | | | Put currently existing code for alignment correction in to function imsm_component_size_aligment_check() and use it for align component size to chunk size during volume size expansion operation. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: Support setting max size for size change operationAdam Kwolek2012-04-171-2/+22
| | | | | | | | Add support for setting max size for size change operation using imsm_get_free_size() function for computing maximum available space. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: Add function imsm_get_free_size()Adam Kwolek2012-04-171-1/+24
| | | | | | | | Add function imsm_imsm_get_free_size() using part of code from function reserve_space(). Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* FIX: Detect error and rollback metadataAdam Kwolek2012-04-171-2/+11
| | | | | | | | | Some setting size error cases were not detected. When error occurs, stop setting new size action and rollback metadata changes. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* FIX: Respect metadata size limitationsAdam Kwolek2012-04-171-0/+21
| | | | | | | | | When reshape_super() updates metadata with new size, due to some metadata limitations saved value can be different than requested value by user. Update size (read it from metadata) for setting it in md. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* FIX: Extend size of raid0 arrayAdam Kwolek2012-04-171-0/+35
| | | | | | | | | For raid0, takeover operation is required for size change. Add takeover to degraded raid4 before size change and back to raid0 after. Array information has to be read again from md after takeover. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: FIX: Support metadata changes rollbackAdam Kwolek2012-04-171-18/+38
| | | | | | | | | Add metadata rollback specific code for imsm. Let reshape_super() ability to differentiate metadata apply and rollback actions. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* FIX: Support metadata changes rollbackAdam Kwolek2012-04-173-7/+15
| | | | | | | | | | | | | | Function reshape_super() guards metadata changes. It is used to apply changes rollback in error case also. As change (apply and rollback) can be not bi-directional reshape_super() has to know if current action is metadata change that should be guarded using metadata restrictions, or this is metadata rollback change executed due to error occurrence. In second case change has to be unconditional. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: Execute size change for external metatdataAdam Kwolek2012-04-171-31/+47
| | | | | | | | | For external metatdata ioctl doesn't set new size. Set new size using sysfs. Put code for size change in to function to re-use the same code as during On-line Capacity Expansion Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: Add new metadata update for volume size expansionAdam Kwolek2012-04-171-8/+124
| | | | | | | | Add new meatdata update type imsm_update_size_change, and update metadata for volume size expansion operation. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: FIX: Add volume size expand support to imsm_analyze_change()Adam Kwolek2012-04-171-0/+51
| | | | | | | | | | Patch adds ability to function imsm_analyze_change() for: 1. Detect size change request for volume operation. 2. Check and correct size for change. 3. Set new change kind to CH_ARRAY_SIZE Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: FIX: Update function imsm_num_data_members() for Raid1/10Adam Kwolek2012-04-171-1/+3
| | | | | | | | | Function imsm_num_data_members() returns wrong value for raid 1 and 10. It returns all data member but it should return number of unique data members (excluding mirror devices) Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: display maximum volumes per controller and arrayLabun, Marcin2012-04-171-2/+3
| | | | | | | | Display maximum volumes per array and per controller in --detail-platform command. Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* mdadm man page: fix typoCoolCold2012-04-121-1/+1
| | | | | | | manpage for mdadm(8) contains typo - missing "d" at the end of "describe" word. Signed-off-by: Roman Ovchinnikov <coolthecold@gmail.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Fix two typos in fprintf messagesLukasz Dorau2012-04-101-2/+2
| | | | | Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* super1: leave more space in front of data by default.NeilBrown2012-04-041-6/+21
| | | | | | | | | | | | | | | | | The kernel is growing the ability to avoid the need for a backup file during reshape by being able to change the data offset. For this to be useful we need plenty of free space before the data so the data offset can be reduced. So for v1.1 and v1.2 metadata make the default data_offset much larger. Aim for 128Meg, but keep a power of 2 and don't use more than 0.1% of each device. Don't change v1.0 as that is used when the data_offset is required to be zero. Signed-off-by: NeilBrown <neilb@suse.de>
* Bitmap_offset is a signed numberNeilBrown2012-04-043-4/+4
| | | | | | | As the bitmap can be before the superblock, bitmap_offset is signed. But some of the code didn't honour that :-( Signed-off-by: NeilBrown <neilb@suse.de>
* parse_size: distinguish between 0 and error.NeilBrown2012-04-042-4/+4
| | | | | | | | | | | | It isn't sufficient to use '0' for 'error' as well will later have fields that can validly be '0'. So return "-1" on error. Also fix parsing of --bitmap_check so that '0' is treated as an error: we don't support 512B anyway. Signed-off-by: NeilBrown <neilb@suse.de>
* Fix typo: wan -> wantNeilBrown2012-04-041-1/+1
| | | | Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: set 2tb disk attribute for spareCzarnowska, Anna2012-04-021-0/+3
| | | | | | | This patch ensures metadata attribute is set correctly also for spares. Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* check that no disk over 2TB is used to create container when no supportCzarnowska, Anna2012-04-021-8/+16
| | | | | | | Creation of a container using disks over 2TB should be allowed only when orom supports large disks Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* check volume size in validate_geometry_imsm_oromCzarnowska, Anna2012-04-021-4/+10
| | | | | | | When orom does not support volumes over 2TB the creation should be disallowed Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>