summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | Updates version numbers for 3.0-devel1 release.NeilBrown2008-09-186-4/+102
| |
* | Don't try to set_array_info when -I find new devices for an array.NeilBrown2008-09-181-2/+10
| | | | | | | | | | | | | | | | | | | | | | When -I get a new device for a container and tries to incrementally assemble the container array, it calls sysfs_set_array to create the array without first checking if it already exists. This produces unpleasant error messages. So check first. Signed-off-by: NeilBrown <neilb@suse.de>
* | Remove .sock file when removing .pid file for mdmonNeilBrown2008-09-181-0/+2
| |
* | Add support for assembling specific subarrays.NeilBrown2008-09-183-3/+58
| | | | | | | | | | This normally isn't needed as --incremental does all the work. But it is needed to recognise member= and container= in mdadm.conf
* | Use common code to report MD_UUID for --detail --exportNeilBrown2008-09-183-21/+10
| | | | | | | | | | | | As we need to be able to extract a UUID from any superblock for matching, use that as the MD_UUID as it will probably be used for array matching too.
* | Report uuid in --detail --brief for ddf and intelNeilBrown2008-09-187-24/+40
| | | | | | | | The uuid is slightly fictitious but needed for array matching.
* | Use uuid as /dev name when assembling array of uncertain origin.NeilBrown2008-09-184-24/+84
| | | | | | | | | | If we aren't sure that the array belongs to 'this' host, use the uuid to choose a name to avoid any conflict.
* | Add uuid support for super-intel.NeilBrown2008-09-182-7/+47
| | | | | | | | | | 'imsm' does not provide any real uuid, so we synthesise one from various stable bits of the superblock.
* | Allow metadata handler to report that it doesn't record homehost.NeilBrown2008-09-184-5/+5
| | | | | | | | | | | | | | For now, this means that the lack of a homehost doesn't always prevent assembly. Soon we will allow assembly anyway, but have different messages if homehost isn't supported.
* | Don't allow spares when creating 'external' arrays.NeilBrown2008-09-181-0/+7
| | | | | | | | | | | | | | | | | | | | It is meaningless when creating the container, and for subarrays, the container is responsible for assigning spares. Also, don't do the 'spare' fiddle for raid5 as we cannot set up a spare at this point yet. Later maybe just create the array degraded and let the container sort it out.
* | Lots of fixes to make incremental assembly of containers work.NeilBrown2008-09-185-75/+121
| | | | | | | | | | | | | | | | So: mdadm -I /dev/whatever will (if appropriate) add whatever to a container, then start any arrays inside the container.
* | Handle incremental assembly of containers.NeilBrown2008-09-184-2/+23
| | | | | | | | | | | | | | | | | | mdadm -I /dev/part-of-container should add that to a container, creating if it needed, and then try to assemble any arrays in the container. Signed-off-by: NeilBrown <neilb@suse.de>
* | Move calls to SET_ARRAY_INFO to common helper.NeilBrown2008-09-188-146/+155
| | | | | | | | | | | | | | | | | | | | When we assemble an array, there are three different approaches depending on whether metadata is internal or external, and on kernel version. Move all this to a common helper instead of duplicating in 3 places. Signed-off-by: NeilBrown <neilb@suse.de>
* | Factor out add-disk codeNeilBrown2008-09-1811-35/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | The variety of approaches to 'add_disk' are factored out into a separate function, and Incremental mode benefits by being closer to supporting the assembly of containers. Also remove the adding-to-array-data-structure out of sysfs_add_disk and into add_disk. And add some tests for --incremental mode to make sure we don't break it. Signed-off-by: NeilBrown <neilb@suse.de>
* | Ignore leading zeros in version number information.NeilBrown2008-09-182-3/+12
| | | | | | | | --detail sometimes generates leading zero which are just noise.
* | Allow --config in --incremental mode.NeilBrown2008-09-181-0/+1
| |
* | Teach --detail about containers and members there-of.NeilBrown2008-09-182-31/+124
| | | | | | | | | | | | | | | | | | | | Make --detail on a container more useful by suppressing irrelevant detail and adding useful detail like a list of member arrays. Ditto for members of a container: report the name of the container array. Signed-off-by: NeilBrown <neilb@suse.de>
* | Compile fixes, particularly moving more stuff under MDASSEMBLENeilBrown2008-09-188-26/+57
| | | | | | | | Now 'make everything' works again.
* | Disable compilation with diet-libcNeilBrown2008-09-181-1/+4
| | | | | | | | | | We need posix_memalign (or something similar) which diet-libc does not provide.
* | Fix compile warning/error.NeilBrown2008-09-181-1/+1
| | | | | | | | | | | | | | gcc said: error: large integer implicitly truncated to unsigned type Signed-off-by: NeilBrown <neilb@suse.de>
* | mdmon: recreate socket/pid file on SIGHUPDan Williams2008-09-154-10/+39
| | | | | | | | | | | | | | | | | | | | Allow mdmon to start while /var/run/mdadm is readonly. Later a SIGHUP can trigger mdmon to drop its pid and socket once /var/run/mdadm is writable. Of course one needs the pid to send a HUP, that can be stored in a distribution specific rw-init directory... For now, rely on a killall -HUP mdmon to get the files dumped. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | ping_manager() to prevent 'add' before 'remove' completesDan Williams2008-09-154-8/+60
| | | | | | | | | | | | | | | | | | | | | | | | It is currently possible to remove a device and re-add it without the manager noticing, i.e. without detecting a mdstat->devcnt container->devcnt mismatch. Introduce ping_manager() to arrange for mdmon to run manage_container() prior to mdadm dropping the exclusive open() on the container. Despite these precautions sysfs_read() may still fail. If this happens invalidate container->devcnt to ensure manage_container() runs at the next event. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | sysfs: detect disks that are in the process of being removedDan Williams2008-09-151-5/+24
| | | | | | | | | | | | | | | | | | When removing a disk there is a window where the 'slot' attribute of md/dev-$name will return -EBUSY to read attempts. When this happens look at the the 'block' link, if it is removed then we can be sure the device has been removed, versus some other error. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | monitor: clean up some debug messagesDan Williams2008-09-151-2/+3
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | mdmon: resume rebuildDan Williams2008-09-151-1/+6
| | | | | | | | | | | | | | | | If we started a degraded array that was previously rebuilding we may have enough information to resume the rebuild without a trip through the monitor. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: allow a failed disk to be readdedDan Williams2008-09-151-17/+12
| | | | | | | | | | | | | | | | | | Allow the following sequence to rebuild the array mdadm --fail /dev/md/r1 /dev/disk mdadm --remove /dev/imsm /dev/disk mdadm --add /dev/imsm /dev/disk Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | 'mdadm --wait-clean' wait for array to be marked cleanDan Williams2008-09-157-32/+166
| | | | | | | | | | | | | | | | | | For use in distro shutdown scripts with a RAID root file system. Returns immediately if the array is 'readonly', or not an externally managed array. It is up to the distro's scripts to make sure no new writes hit the device after this returns 'true'. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Add ping_monitor() to mdadm --waitDan Williams2008-09-155-18/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The action we are waiting for may not be complete until the monitor has had a chance to take action on the result. The following script can now remove the device on the first attempt, versus a few attempts with the original Wait(): #!/bin/bash #export MDADM_NO_MDMON=1 export IMSM_DEVNAME_AS_SERIAL=1 ./mdadm -Ss ./mdadm --zero-superblock /dev/loop[0-3] echo 2 > /proc/sys/dev/raid/speed_limit_max ./mdadm --create /dev/imsm /dev/loop[0-3] -n 4 -e imsm -a md ./mdadm --create /dev/md/r1 /dev/loop[0-3] -n 4 -l 5 --force -a mdp ./mdadm --fail /dev/md/r1 /dev/loop3 ./mdadm --wait /dev/md/r1 x=0 while ! ./mdadm --remove /dev/imsm /dev/loop3 > /dev/null 2>&1 do x=$((x+1)) done echo "removed after $x attempts" ./mdadm --add /dev/imsm /dev/loop3 Include 2 small cleanups: * remove the almost open coded fd2devnum() in Wait() by introducing a new utility routine stat2devnum() * teach connect_monitor() to parse the container device from a subarray string Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | monitor: don't mark dirty on resync completeDan Williams2008-09-151-1/+1
| | | | | | | | | | | | ...instead look at array state to determine if the array is consistent Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | monitor: mark clean on active-idleDan Williams2008-09-151-3/+7
| | | | | | | | | | | | This also handles the case where 'clean' is set directly. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | 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>