summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | Honor safemode_delay at Create() and Incremental() timeDan Williams2008-09-154-0/+18
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: use ->getinfo_super() in ->container_content()Dan Williams2008-09-151-30/+16
| | | | | | | | | | | | | | | | * allows container_content() to pick up the safemode_delay * removes some duplicate code * fixes an endian bug setting info->array.chunk_size Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Allow metadata handlers to communicate desired safemode delay via mdinfoDan Williams2008-09-155-0/+7
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Makefile: Add mdmon header dependenciesDan Williams2008-09-151-1/+2
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: fix up serial handlingDan Williams2008-09-151-20/+34
| | | | | | | | | | | | | | * Trim trailing and leading whitespace * Allow unterminated serial numbers up to MAX_RAID_SERIAL_LEN Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: only use the device name as a fallback when IMSM_DEVNAME_AS_SERIAL=1Dan Williams2008-09-151-7/+5
| | | | | | | | | | | | Also ensure that the serial buffer is initialized. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: rectify map handlingDan Williams2008-09-151-62/+132
| | | | | | | | | | | | | | | | | | | | The secondary map is used to reflect the migration state of the array i.e. from dev->vol.map[1] to dev->vol.map[0]. Ensure a rebuilding / initializing array is marked in the second map, while normal status is reflected in the first map. Also mark rebuilding drives with IMSM_ORD_REBUILD. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: fix imsm_delete()Dan Williams2008-09-151-20/+30
| | | | | | | | | | | | | | * fix breakage from last merge (infinite loop in imsm_process_update()) * add ability to delete by index Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: use IMSM_ORD_REBUILD instead of USABLE flagDan Williams2008-09-151-16/+21
| | | | | | | | | | | | | | IMSM_ORD_REBUILD is the 'insync' flag in MD terms. USABLE is a flag to opt-in disks for use with the Windows driver. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: introduce set_imsm_ord_tbl_ent()Dan Williams2008-09-151-4/+9
| | | | | | | | | | | | Collapse all the open coded occurrences. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: cleanup arguments to imsm_check_degradedDan Williams2008-09-151-5/+4
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: cleanup get_imsm_disk_idx(), unify with get_imsm_ord_tbl_ent()Dan Williams2008-09-151-32/+33
| | | | | | | | | | | | | | Save some unnecessary calls to get_imsm_map() by teaching get_imsm_disk_idx() to retrieve the map. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: fix up compare_super_imsm() to match family_num for populated mpb'sDan Williams2008-09-151-0/+9
| | | | | | | | | | | | | | This allows spares to be associated with any family while not allowing disks from different families to be assembled. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: fix up spare handling holdover in update_create_arrayDan Williams2008-09-151-5/+3
| | | | | | | | | | | | | | We used to leave SPARE_DISK unset to indicate it was available to be assimilated into other arrays. Now we explicitly check the size. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: mark failures like the Matrix driverDan Williams2008-09-151-28/+19
| | | | | | | | | | | | | | | | | | | | * Truncate the first character of the serial number * Set 'scsi_id' to all f's * Expect to find disk entries with unmatchable serial numbers, i.e. expect get_imsm_disk() to return NULL in some situations * Allow discrepencies between mpb->num_disks and len(super->disks) Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: provide for a larger mpb buffer when necessaryDan Williams2008-09-151-18/+76
| | | | | | | | | | | | | | Ensure that the mpb buffer is large enough to hold the extra imsm_map's of migrating arrays and dynamically created raid devices. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: fix logic inversion in get_imsm_ord_tbl_ent()Dan Williams2008-09-151-2/+2
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Fix alignment for backup of reshape data.NeilBrown2008-08-192-8/+9
| | | | | | | | | | | | | | | | Since we introduced O_DIRECT for device access we need properly aligned buffers and IO requests. The reshape code missed out on the conversion. Signed-off-by: NeilBrown <neilb@suse.de>
* | Allow an externally managed array to be marked readonlyNeilBrown2008-08-195-9/+67
| | | | | | | | | | | | | | | | | | | | | | If the metadata_version is -mdXXX/whatever rather than /mdXXX/whatever then the array is readonly and should be left alone by mdmon. Signed-off-by: NeilBrown <neilb@suse.de>
* | Factor out test for subarray version string.NeilBrown2008-08-195-5/+11
| | | | | | | | | | | | | | We are about to change the syntax of the version string for 'subarray's. So factor out the test into a single function. Signed-off-by: NeilBrown <neilb@suse.de>
* | imsm: allow container assembly in the presence of failed disksDan Williams2008-08-191-21/+10
| | | | | | | | | | | | | | | | | | For example, this allows one to still say mdadm -A /dev/sd[b-e] even though /dev/sde has replaced /dev/sdd. Otherwise mdadm will say: mdadm: superblock on /dev/sdd doesn't match others - assembly aborted Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Fix bug with ddf if devices have different sizes.NeilBrown2008-08-191-0/+1
| | | | | | | | | | | | | | | | We cannot use the header of the 'best' device to find the sections on the other devices!! Signed-off-by: NeilBrown <neilb@suse.de>
* | Provide ddf support for adding a device to an active container.NeilBrown2008-08-191-6/+53
| | | | | | | | Signed-off-by: NeilBrown <neilb@suse.de>
* | mdadm: add device to a containerDan Williams2008-08-193-37/+208
| | | | | | | | | | | | | | | | | | Adding a device updates the container and then mdmon takes action upon noticing a change in devices. This reuses the container version of add_to_super to create a new record for the device. Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | mdmon: remove devices from containerDan Williams2008-08-192-2/+25
| | | | | | | | | | | | | | | | Once the monitor thread has kicked a drive from all managed arrays mdadm -r is permitted. We are guaranteed that the drive is marked failed at this point, so allow the drive to be re-added as a spare. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: delete kicked disksDan Williams2008-08-191-11/+57
| | | | | | | | | | | | | | | | | | When we have determined that a disk is no longer of any value, remove it from the data structure. This is now safe because the manager will back off while any metadata update is pending in the monitor. Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* | Fix mdstat_wait_fdNeilBrown2008-08-191-3/+9
| | | | | | | | | | | | It didn't necessarily wait for the fd. Signed-off-by: NeilBrown <neilb@suse.de>
* | Make metadata updates from manage to monitor 'synchronous'NeilBrown2008-08-191-18/+25
| | | | | | | | | | | | | | | | | | | | A metadata update may modify the data structure of the metadata including freeing things, so it is not safe of the manager to touch the metadata while an update is pending in the monitor. So When an update has been submitted, don't do anything else in the manager until it is complete. Signed-off-by: NeilBrown <neilb@suse.de>
* | Extra option for set_array_state: you choose dirty or clean.NeilBrown2008-08-194-15/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When we first start an array, it might be good to start recovery straight away. That requires setting the array to 'dirty', but only the metadata handler can know if that is required or not. So have a third possible 'consistent' option to set_array_state. Either 'no' or 'yes' or 'you choose'. Return value indicates what was chosen. '1' (no) should be chosen unless there is a good reason. Signed-off-by: NeilBrown <neilb@suse.de>
* | mdmon: handle failures versus readauto arraysDan Williams2008-08-152-4/+21
| | | | | | | | | | | | | | | | | | Transition readauto arrays to active before failing drives. Hmm... why do we keep reblocking / renotifying in the readonly case? Need to bottom out on this, but not right now. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | mdmon: allow degraded arrays to be monitoredDan Williams2008-08-153-3/+15
| | | | | | | | | | | | | | manage_new is too strict in the face of failed devices. Teach it to monitor degraded arrays. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: include not synced disks in imsm_count_failedDan Williams2008-08-151-0/+2
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: use disk_ord_tbl to identify rebuilding disksDan Williams2008-08-151-2/+22
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: fix up assembly of disks that are not in-syncDan Williams2008-08-121-10/+41
| | | | | | | | | | | | | | | | 1/ Do not assemble !in_sync or failed devices in container_content. 2/ Prevent activation of failed or configured devices in activate_spare. 3/ Be sure to avoid dirty degraded if the array was shutdown cleanly. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: fix create by mdmon-updateDan Williams2008-08-121-3/+3
| | | | | | | | | | | | | | imsm_dev dynamically grows, so dev_idx needs to be moved up in the definition to avoid getting clobbered. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: write_super return 0 on successDan Williams2008-08-121-5/+5
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: update mpb_size in write_super_imsmDan Williams2008-08-121-0/+5
| | | | | | | | | | | | | | With dev->vol.map and mpb->disk entries entering and leaving the parameter block write_super_imsm needs to update the size before writeback. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | mdmon: use activate spare for re-addDan Williams2008-08-122-92/+139
| | | | | | | | | | | | | | | | | | Disks that are not in-sync or failed are not assembled into member arrays by mdadm. Teach mdmon to resolve this situation by checking for spares at start. imsm_activate_spare() is updated to prefer devices that can be re-added versus new spares. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: fix handling of the 'migr_state' and 'migr_type' bitsDan Williams2008-08-121-23/+54
| | | | | | | | | | | | | | | | The option-rom and the Matrix driver mark resyncs/rebuilds with the migrate state bits. Update sizeof_imsm_dev to allow allocation of imsm_dev entries large enough to grow if migr_state is later set. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: add get_imsm_map and sizeof_imsm_mapDan Williams2008-08-111-37/+41
| | | | | | | | | | | | retrieve map entries from a imsm_dev, and cleanup imsm_copy_dev Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: drop 'external' from imsm_examine_briefDan Williams2008-08-111-4/+1
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: ensure 'usable' remains clear until the disk is in_syncDan Williams2008-08-111-1/+7
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: spare devices are represented as single disk containersDan Williams2008-08-091-116/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This poses a small problem for the case of handling multiple raid1 arrays across separate disk pairs i.e. 2 mirrors on 4 disks. The option-ROM will configure this as two containers. We may need the capability for one container to ask for an unused spare in another container. For now spares will just maintain the affinity established at assemble time. To support this configuration spare devices must be allowed to be assembled into the container even though the metadata indicates the disk belongs to a different family. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: store imsm_disk entries in the super->disks listDan Williams2008-08-091-56/+25
| | | | | | | | | | | | | | removes the need to lookup the disk by index in a few cases and is a preparation step for tracking spares outside the current anchor. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | mdmon: use 'recover' instead of 'repair' when activating a spareDan Williams2008-08-071-1/+1
| | | | | | | | | | | | | | Repair sets MD_RECOVERY_REQUESTED in md which may not result in the spare device being recovered. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Merge branch 'devel' of ↵NeilBrown2008-08-072-33/+137
|\ \ | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/djbw/mdadm into dan
| * | imsm: bad block management (phase1)Jacek Danecki2008-08-061-4/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the initial defensive implementation of bad block management support. It simply precludes assembly if there are entries in the bad block logs. This is sufficient for now as the conditions that lead to an entry in the bad block log would cause the array to be failed by MD (as of 2.6.27). [dan.j.williams@intel.com: general cleanups] Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * | imsm: do not mark arrays 'clean' if resync still in progressDan Williams2008-08-061-5/+13
| | | | | | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * | imsm: raid5 layout is left-asymmetricDan Williams2008-08-061-1/+1
| | | | | | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * | mdmon: ignore inactive arrays and other manage_new() cleanupsDan Williams2008-08-041-23/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While mdadm is constructing an array mdmon may see an intermediate state (some disks not yet added / redundancy attributes like sync_action not available). Waiting for mdstat->active == true ensures that the array is ready to be handled. This fixes a bug in create array via mdmon update whereby failures are not detected in the new array. Introduce aa_ready() to catch cases where the active_array is not correctly initialized. Barring a kernel bug this should never trigger, nonetheless it precludes a class of bugs like the one mentioned above from triggering. Cleanup the exit paths and only call replace_array when the new array is ready to be inserted into container->arrays. Signed-off-by: Dan Williams <dan.j.williams@intel.com>