summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
* show 2TB volumes/disks support in --detail-platformCzarnowska, Anna2012-04-022-0/+5
| | | | | Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* simplify calculating array_blocksCzarnowska, Anna2012-04-022-4/+3
| | | | | | | | no point calling info_to_blocks_per_member when it just returns size*2 for level==1 calc_array_size can be used for all levels Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* clear hi bits if not used after loading metadata from diskCzarnowska, Anna2012-04-021-1/+27
| | | | | | | | | | | | | | | | Functions retrieving sizes from metadata do not need to check 2TB attribute only when we can guarantee the hi bits are always clear when the MPB_ATTR_2TB_DISK attribute is not set. Therefore the following fields are cleared on metadata load when not in use according to attribute: struct imsm_disk.total_blocks_hi struct imsm_map.pba_of_lba0_hi struct imsm_map.blocks_per_member_hi struct imsm_map.num_data_stripes_hi Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: avoid overflows for disks over 1TBCzarnowska, Anna2012-04-021-67/+131
| | | | | | | | | | | | | | | | | | Calculating array_blocks using info->size causes error on activation of volume using disks over 1 TB. unsigned long long size parameter is used instead. total_blocks, pba_of_lba0, blocks_per_member and num_data_stripes overflow when using disks over 2TB. Part of fillers in metadata is used to contain hi bits of the numbers that are likely to go over 32 bit limit. Functions are added to get and set such fields as the hi bits are not adjacent with low bits in the structures. Acked-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* sysfs: fixed sysfs_freeze_array array to work properly with Manage_subdevs.NeilBrown2012-03-281-3/+4
| | | | | | | | | | | | | If the array is already frozen when Manage_subdevs is called we don't want it to unfreeze the array. This is because Grow calls Manage_subdevs to add devices to an array being reshaped, and the array must stay frozen over this call. So if sysfs_freeze_array find the array to be frozen it returns '0', meaning that it didn't and cannot freeze it. Then the caller will not try to unfreeze, which is good. Signed-off-by: NeilBrown <neilb@suse.de>
* Fix the new ROUND_UP macro.NeilBrown2012-03-221-1/+1
| | | | | | It was missing a "- 1". Signed-off-by: NeilBrown <neilb@suse.de>
* Fix tests/05r1-re-add-nosupperNeilBrown2012-03-221-2/+2
| | | | | | | This shouldn't have been changed when we size of RAID1 arrays was changed, as this uses 'build', not 'create' Signed-off-by: NeilBrown <neilb@suse.de>
* Grow: print useful error when converting RAID1->RAID5 will fail.NeilBrown2012-03-221-0/+4
| | | | | | | | | RAID1 can only be converted to RAID0 or RAID5 if the size is a multiple of 4K as we cannot have chunks smaller than 4K. If this might happen, report a useful error message. Signed-off-by: NeilBrown <neilb@suse.de>
* Create: round off size for RAID1 arrays.NeilBrown2012-03-2218-40/+53
| | | | | | | | | | | RAID1 arrays don't have a chunk size, but if you ever convert one to RAID5 you will need at least a small one >= 4K. So round of size to a multiple of 64K. This only affect Create, not "--grow --size=max". The latter is too hard and with smaller returns. Signed-off-by: NeilBrown <neilb@suse.de>
* Manage: freeze recovery while adding multiple devices.NeilBrown2012-03-221-0/+13
| | | | | | | | If the kernel supports it, freeze recovery over multiple adds, so that they can all be added to the array at the same time and be recovered in parallel. Signed-off-by: NeilBrown <neilb@suse.de>
* Manage: replace 'return 1' with 'goto abort'.NeilBrown2012-03-221-36/+39
| | | | | | This will allow exit processing in next patch Signed-off-by: NeilBrown <neilb@suse.de>
* Incremental: fix adding devices with --incrementalNeilBrown2012-03-221-4/+4
| | | | | | | | | | | | We should use 'info' here, not 'info2'. info2 refers to some other device (There may not even be one).l info is *this* disk. This is particularly important for getting info.disk.state correct, which the kernel depends on to get 're-add' functionality correct. Signed-off-by: NeilBrown <neilb@suse.de>