summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
| * ddf: set vcnum correctly when creating a new virtual device in conflistNeilBrown2011-03-141-0/+8
| | | | | | | | | | | | | | | | | | We weren't setting ->vcnum at all when an array was added. This meant that a subsequent device failure could be assigned to the wrong array. Reported-by: Albert Pauw <albert.pauw@gmail.com> Signed-off-by: NeilBrown <neilb@suse.de>
| * ddf: teach set_disk to cope with new or changed devices.NeilBrown2011-03-141-8/+33
| | | | | | | | | | | | | | When set_disk is called, we need to check if the disk has changed or recently appeared, and update everything properly if it has. Signed-off-by: NeilBrown <neilb@suse.de>
| * ddf: free_super should be add_list as well.NeilBrown2011-03-141-0/+9
| | | | | | | | | | | | | | It is possible there is data and even an open file descriptor on 'add_list' - so it must be freed too. Signed-off-by: NeilBrown <neilb@suse.de>
| * ddf: minor activate_super fixes.NeilBrown2011-03-141-2/+4
| | | | | | | | | | | | | | 1/ ignore devices with "state_fd < 0" as these have been removed. 2/ Set update 'length' properly and clear 'space'. Signed-off-by: NeilBrown <neilb@suse.de>
| * monitor: close recovery_fd when closing state_FdNeilBrown2011-03-141-0/+1
| | | | | | | | | | | | These should be open or closed together. Signed-off-by: NeilBrown <neilb@suse.de>
| * ddf: Failed should suppress Online and others.NeilBrown2011-03-101-0/+3
| | | | | | | | | | | | so the notes say, so make it so. Signed-off-by: NeilBrown <neilb@suse.de>
* | Warn the user about too small array sizeKrzysztof Wojcik2011-03-143-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | If single-disk RAID0 or RAID1 array is created, user may preserve data on disk. If array given size covers all partitions on disk, all data will be available on created array. If array size is too small (not covers all partitions), data will be not accessible. This patch introduces warning message during array creation if given size is too small. User may interrupt creation process to avoid data loss. Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | platfrom_intel: find OROM based on Intel AHCI and SAS driver device idLabun, Marcin2011-03-142-19/+61
| | | | | | | | | | | | | | | | | | | | | | We use PCI device id exposed by AHCI and ISCU drivers (SAS controller) to find OROM version table. In this way there is no need to maintain AHCI and ISCU device id list in mdadm. The consequence is that the OROM properties can be found by mdadm when AHCI or SAS drivers are loaded in the system. Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | imsm: FIX: Store checkpoint in per disk unitsAdam Kwolek2011-03-141-2/+6
| | | | | | | | | | | | | | | | | | | | While last_checkpoint is counter in per disk units, checkpoints should be stored in the same manner. Restoring from checkpoint should should recalculate checkpoint in to array position (reshape_progress). Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | FIX: Last_checkpoint has to be initialized in per disk unitsAdam Kwolek2011-03-141-0/+9
| | | | | | | | | | | | | | | | | | last_checkpoint is variable that tracks sync_complete sysfs entry. sync_complete is per disk counter, so initializing during starting from checkpoint has to have this in mind and convert reshape position properly. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | FIX: Last checkpoint is not initialized on reshape restartAdam Kwolek2011-03-141-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | When reshape is restarted and active array in mdmon is being initialized, mdmon has to know last checkpoint, otherwise reshape will be restarted form '0' position. mdadm when reshaped array is assembled stores reshape_position in sysfs and runs mdmon. Initialize last_checkpoint in active array structure to value present in sysfs for reshaped array start. Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | FIX: Unfreeze array on success onlyAdam Kwolek2011-03-141-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unfreeze array on success only. rv is initialized by restart variable so we have 2 cases. 1. regular reshape start rv == restart == 0 this means that real error (returned by reshape) can cause leaving container frozen If array is not touched by reshape it can be unfrozen 2. During reshape restart even untouched array under reshape is left unfrozen, If reshape is started do not unfreeze array on error also. This allows user for array repair action (mdmon will not change array state). Signed-off-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | Merge branch 'master' into devel-3.2NeilBrown2011-03-104-5/+38
|\ \ | |/ | | | | | | | | | | | | | | Conflicts: Grow.c Manage.c managemon.c mdadm.8.in util.c
| * Manage: be more careful about --add attempts.NeilBrown2011-03-104-9/+59
| | | | | | | | | | | | | | | | | | If an --add is requested and a re-add looks promising but fails or cannot possibly succeed, then don't try the add. This avoids inadvertently turning devices into spares when an array is failed but the devices seem to actually work. Signed-off-by: NeilBrown <neilb@suse.de>
| * ddf: remove duplicate container_member setting.NeilBrown2011-03-101-1/+0
| | | | | | | | | | | | | | | | | | | | | | We were setting ->container_member twice in ddf get_info. Once to currentconf->vcnum, once to atoi(st->subarray). Both should be the same. For consistency with super-intel, use the first. Signed-off-by: NeilBrown <neilb@suse.de>
| * Fix warning about host-endian bitmaps.NeilBrown2011-03-101-4/+4
| | | | | | | | | | | | | | Hostendian bitmaps should be warned about on all arch's. And fix a speeling mistake. Signed-off-by: NeilBrown <neilb@suse.de>
| * Grow: give useful message when adding bitmap gives EBUSY.NeilBrown2011-03-101-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>
| * Assemble: add --update=no-bitmapNeilBrown2011-03-104-6/+22
| | | | | | | | | | | | | | This allows an array with a corrupt internal bitmap to be assembled without the bitmap. Signed-off-by: NeilBrown <neilb@suse.de>
| * Assemble: call remove_partitions later.NeilBrown2011-03-101-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>
| * mdmon: don't copy an invalid chunk_sizeNeilBrown2011-03-103-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>
| * ddf: fail creation of new subarray with same name as old.NeilBrown2011-03-102-0/+16
| | | | | | | | Signed-off-by: NeilBrown <neilb@suse.de>
| * Create: report failure if array cannot be started.NeilBrown2011-03-102-4/+12
| | | | | | | | | | | | We weren't checking the result of writing 'active' to array_state Signed-off-by: NeilBrown <neilb@suse.de>
| * Grow: disallow placing backup file on array being reshaped.NeilBrown2011-03-101-0/+18
| | | | | | | | | | | | the tests here aren't perfect, but they could catch some cases. Signed-off-by: NeilBrown <neilb@suse.de>
| * Create/grow: improve checks on number of devices.NeilBrown2011-03-103-16/+17
| | | | | | | | | | | | | | | | | | | | Check on upper limit of number of devices was in the wrong place. Result was could not create array with more than 27 devices without explicitly setting metadata, even though default metadata allows more. Fixed, and also perform check when growing an array. Signed-off-by: NeilBrown <neilb@suse.de>
| * error check reading of 'degraded' from sysfs.NeilBrown2011-03-101-1/+2
| | | | | | | | | | | | | | | | I'm seen mdadm spinning while failing to read 'degraded'. This doesn't really fix it, but is a reminder that it needs to be fixed. Signed-off-by: NeilBrown <neilb@suse.de>
| * FIX: Reset disk state if disk is missingKrzysztof Wojcik2011-03-101-0/+1
| | | | | | | | | | | | | | | | | | | | If we can't read actual disk state, it shoud be initiated to 0. Overwise it may be out of date value resulting false action later in code (e.g. set disk to improper state). Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
| * open_mddev: open RDONLY if RDWR doesn't work.NeilBrown2011-03-101-0/+2
| | | | | | | | | | | | | | If an array is read-only then "mdadm -S" cannot open it to stop it without this fix. Signed-off-by: NeilBrown <neilb@suse.de>
| * Initialise all of file when opening backup file for reshape.NeilBrown2011-03-101-1/+1
| | | | | | | | | | | | | | Due to a miscalculation we didn't initialise the whole file. There is 4K (8 sectors) for the metadata, then the data. Signed-off-by: NeilBrown <neilb@suse.de>
| * mdadm.man add encouragement to shrink filesystem before shrinking array.NeilBrown2011-03-101-0/+23
| | | | | | | | | | | | | | | | Before resizing an array with --size or --array-size, then filesystem should be resized. mdadm cannot do this so the user should. Reported-by: Gavin Flower <gavinflower@yahoo.com> Signed-off-by: NeilBrown <neilb@suse.de>
| * Detail: report subarrays of a container properly.NeilBrown2011-03-101-1/+1
| | | | | | | | | | | | | | Due to the wrong variable being used, this part of --detail wasn't working at all. Signed-off-by: NeilBrown <neilb@suse.de>
| * dev_open should always open read-only.NeilBrown2011-03-101-1/+1
| | | | | | | | | | | | | | | | | | | | When opening an array to manipulate it we never need to write to the array and sometimes it might be read-only so the open for write will fail. So always open read-only. Reported-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
| * ddf: exclude failed devices from container_contentNeilBrown2011-03-031-2/+7
| | | | | | | | | | | | | | | | If a device is failed, then don't include it in the reported container_content, else it might get included in the array. Reported-by: Albert Pauw <albert.pauw@gmail.com> Signed-off-by: NeilBrown <neilb@suse.de>
| * mdadm.man: remove duplicate documentation for --array-sizeNeilBrown2011-03-021-21/+11
| | | | | | | | | | | | | | | | We somehow got to version of documentation for --array-size. So merge them it one. Reported-by: Ville Skyttä <ville.skytta@iki.fi> Signed-off-by: NeilBrown <neilb@suse.de>
| * FIX: ReadMe.c -Y option missing in short_optionsAlbert Pauw2011-02-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | Hi Neil, I noticed that the -Y option, as in mdadm -D -Y /dev/md0, doesn't work but used as --export it works. So I made a little patch to fix it, but it is simply sticking a Y in the list of short_options in ReadMe.c. Signed-off-by: NeilBrown <neilb@suse.de>
| * Teach --assemble --force to handle reshapes a little better.NeilBrown2011-02-212-0/+28
| | | | | | | | | | | | | | | | | | | | | | When we force-assemble an array which is in the middle of a reshape, we should repeat the reshape of any parts that aren't recorded in the oldest superblock. This is unlikely to make a significant difference, but could make a small difference, and is safer. Signed-off-by: NeilBrown <neilb@suse.de>
| * Fix regression with removing 'failed' and 'detached' devices.NeilBrown2011-02-151-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | If a request to remove all 'failed' or 'detached' devices chooses to remove the first device, it will not actually try the removal and will skip any following devices. This fixes it. Reported-by: Rémi Rérolle <rrerolle@lacie.com> Tested-by: Rémi Rérolle <rrerolle@lacie.com> Signed-off-by: NeilBrown <neilb@suse.de>
| * fix extended partition detectionDan Williams2011-02-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # mdadm --detail --export /dev/md127p1 Before: MD_LEVEL=raid5 MD_DEVICES=4 MD_METADATA=0.90 After: MD_LEVEL=raid5 MD_DEVICES=4 MD_CONTAINER=/dev/md0 MD_MEMBER=0 MD_UUID=55746a20:925d24a7:4f9bd7e2:9c9a411f We parse the symlink target with a format: ../../block/mdXXX/mdXXXpYY ...and need the second '/' from the end of the string to read detect a 'md' device. Reported-by: Krzysztof Wasilewski <krzysztof.wasilewski@intel.com> Cc: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | Man page updates for new --grow options.NeilBrown2011-03-102-20/+61
| | | | | | | | | | | | Describe all the new ways that mdadm can reshape arrays. Signed-off-by: NeilBrown <neilb@suse.de>
* | Grow: allow monitor thread to exit when there is nothing more to do.NeilBrown2011-03-101-0/+5
| | | | | | | | | | | | | | | | | | | | When an array using native metadata is increasing in size, we don't need to keep monitoring it after the initial 'critical section'. So detect that case. If a final level-change is still needed mdadm will wait for that, otherwise it will simply exit. Signed-off-by: NeilBrown <neilb@suse.de>
* | Grow: don't forget_backup when length of backup is zero.NeilBrown2011-03-101-4/+8
| | | | | | | | | | | | This is just a waste of IO Signed-off-by: NeilBrown <neilb@suse.de>
* | Grow: make sure 'info' doesn't have confusing data.NeilBrown2011-03-101-0/+1
| | | | | | | | | | | | | | | | We now test ->reshape_active, but don't set it in a common case. So just zero out the whole structure to be on the safe side. Signed-off-by: NeilBrown <neilb@suse.de>
* | Grow: support reshape of RAID0 arrays.NeilBrown2011-03-103-20/+47
| | | | | | | | | | | | | | | | | | | | This is done via conversion to RAID4 and back. To grow the array, extra devices will be needed which cannot already be present as spares - so allow a list of new devices to be included in grow request which changed the number of devices. Signed-off-by: NeilBrown <neilb@suse.de>
* | Grow: Allow for component_size not being set for RAID0 arrays.NeilBrown2011-03-101-4/+12
| | | | | | | | | | | | | | | | | | | | When an RAID0 is started using SET_ARRAY_INFO ioctl the component_size will be zero. This confused the code for reshaping a RAID0 via RAID4. So if that seems to be the case, fake a believable component_size Signed-off-by: NeilBrown <neilb@suse.de>
* | Make find_intel_hba_capability less verbose.NeilBrown2011-03-101-18/+13
| | | | | | | | | | | | | | | | | | | | | | mdadm has a convention in some areas of passing a device name if error messages about it are interesting, or NULL if not. Follow this convention with find_intel_hba_capability so that it doesn't complain when not appropriate - and so that it doesn't have to go and find a device name that it wasn't given. Signed-off-by: NeilBrown <neilb@suse.de>
* | platform_intel: support for OROM OEM capabilitiesLabun, Marcin2011-03-101-1/+2
| | | | | | | | | | | | | | Scan memory to match $VER and $OEM. Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | imsm: introduce SAS controller support in imsm metadata handlerLabun, Marcin2011-03-101-20/+67
| | | | | | | | | | | | | | | | | | | | | | OROM/EFI capabilities are retrieved based on disk's controller type. 1/ alloc_super no longer retrieves OROM capabilities 2/ find_imsm_capability replaces find_imsm_orom 3/ new function find_intel_hba_capability gets disk's HBA and relevant capability Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | imsm: move code for retrieving HBA to a functionLabun, Marcin2011-03-101-37/+66
| | | | | | | | | | | | | | | | Function find_intel_hba_capability attaches HBA information to intel_super structure based on fd of the component disk. Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | imsm: verify that component disks are attached to the same type of HBALabun, Marcin2011-03-101-0/+12
| | | | | | | | | | | | | | | | | | compare_super_imsm verifies that the component disks use the same type of HBA in platform dependent environment. Otherwise print-out error message and block the action. Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | imsm: add maximum number of disk validation in RAID arrayLabun, Marcin2011-03-101-2/+19
| | | | | | | | | | | | | | | | Arrays exceeding the OROM/EFI maximum number of supported disk are blocked in validate_geometry_imsm_orom function. Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | imsm: print-out error message when volume validation failsLabun, Marcin2011-03-101-3/+6
| | | | | | | | | | | | | | | | Print-out error message when volume geometry fails to comply with OROM/EFI controller's capabilities. Signed-off-by: Marcin Labun <marcin.labun@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>