summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* | imsm: debug environment variable to use 'device name' as 'serial number'Dan Williams2008-07-241-3/+46
| | | | | | | | | | | | Facilitate using loopback devices for the imsm regression suite Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: allow --examine to succeed with damaged metadataDan Williams2008-07-241-2/+15
| | | | | | | | | | | | limp along after seeing mismatched serial numbers Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: handle degraded->normal transitions in set_diskDan Williams2008-07-242-6/+16
| | | | | | | | | | | | | | Removes the need for the call to ->set_array_state when sync_action transitions from 'recover' to 'idle'. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: create array via update to mdmonDan Williams2008-07-241-1/+168
| |
* | install mdmon to the same location as mdadmJacek Danecki2008-07-211-1/+2
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: remove some castsDan Williams2008-07-211-3/+3
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: activate_spare: fix handling of data_offsetDan Williams2008-07-211-9/+14
| | | | | | | | | | | | | | Neil rightly points out that imsm_activate_spare may skip valid free space on a spare, fix this up. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Document MDADM_NO_MDMONDan Williams2008-07-181-0/+10
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Documentation fixup for stripe_cache_sizeDan Williams2008-07-181-6/+9
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Document preread_bypass_thresholdDan Williams2008-07-181-0/+9
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | msg: add a timeout to ping_monitorNeilBrown2008-07-181-2/+2
| | | | | | | | | | | | | | Though it should never bee needed, having a timeout in ping_monitor is a sensible safeguard. Signed-off-by: Neil Brown <neilb@suse.de>
* | monitor: call get_resync_start on array shutdown.NeilBrown2008-07-181-0/+1
| | | | | | | | | | | | | | | | If the array is shutdown as soon as resync finishes, we might not notice the resync finish. So on array shutdown, check for current resync pos. Signed-off-by: Neil Brown <neilb@suse.de>
* | Manage: sync with mdmon before stopping containers.NeilBrown2008-07-181-0/+9
| | | | | | | | | | | | | | mdmon sometimes opens the container. That will prevent 'stop' from working. So sync with mdmon first. Signed-off-by: Neil Brown <neilb@suse.de>
* | Manage: fixed some error message in --stopNeilBrown2008-07-181-6/+11
| | | | | | | | | | | | | | Explain the meaning of 'quiet' explicitly, and fix some grammar and formatting. Signed-off-by: Neil Brown <neilb@suse.de>
* | mdmon: fork and run as a daemon.NeilBrown2008-07-182-1/+45
| | | | | | | | | | | | | | start_mdmon now waits for mdmon to complete initialisation and, importantly, listen on the socket, before continuing. Signed-off-by: Neil Brown <neilb@suse.de>
* | sysfs: avoid possible data corruption in sys_load.NeilBrown2008-07-181-1/+1
| | | | | | | | | | | | Don't retry to remove a newline from the end of an empty string. Signed-off-by: Neil Brown <neilb@suse.de>
* | Correct readlink usage in sysfs.cNeilBrown2008-07-181-2/+4
| | | | | | | | | | | | | | readlink doesn't nul-terminate the returned string, so we must be sure to do that. Signed-off-by: Neil Brown <neilb@suse.de>
* | Don't assume that mdmon is in the current directory.NeilBrown2008-07-181-4/+27
| | | | | | | | | | | | | | Rather, assume that it is in the same directory from which mdadm was run. If not, then maybe /sbin or current directory. Signed-off-by: Neil Brown <neilb@suse.de>
* | Factor common code into new "start_mdmon".NeilBrown2008-07-184-44/+33
| | | | | | | | Signed-off-by: Neil Brown <neilb@suse.de>
* | Stop managed arrays more carefully.Neil Brown2008-07-182-13/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | If an array is being managed by mdmon, then just write "inactive" to stop it, and let mdmon do the final "clear". This makes sure mdmon has a chance to read the final state and update the metadata properly. After writing "inactive" with use "ping_monitor" to synchronise with mdadm, then STOP the array just in case it is still running, else we will get into an infinite loop in "mdadm -Ss". Signed-off-by: Neil Brown <neilb@suse.de>
* | mdmon: ping will wait for manage_mon to catch up.NeilBrown2008-07-183-0/+13
| | | | | | | | | | | | | | | | | | | | | | When a 'ping' (empty message) is sent to mdmon, we wait for 'monitor' to do a full loop to make sure it has caught up with anything that needs doing. This allows synchronisation between mdadm and mdmon. Maybe monitor should signal managemon rather than managemon polling... Signed-off-by: Neil Brown <neilb@suse.de>
* | Make sure resync_start is initialised properly and maintained properlyNeil Brown2008-07-185-5/+10
| | | | | | | | Signed-off-by: Neil Brown <neilb@suse.de>
* | ddf: endian fixes.Neil Brown2008-07-181-2/+2
| | | | | | | | | | | | | | We forgot to convert endian for lba_offset at one point, and use le32 instead of be32 right nearby!! Signed-off-by: Neil Brown <neilb@suse.de>
* | mdmon: close possibility of re-marking the metadata dirty on shutdownDan Williams2008-07-141-2/+4
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | mdmon: notify metadata of recovery completionDan Williams2008-07-141-0/+4
| | | | | | | | | | | | Array may no longer be degraded. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | mdmon: initialize component_size in manage_newDan Williams2008-07-141-1/+2
| | | | | | | | | | | | | | When we go to activate a spare for an array we expect ->info.component_size is valid. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | mdmon: close small window of invalid mon_tidDan Williams2008-07-141-6/+3
| | | | | | | | | | | | | | There is a small chance that the manager tries to wake the monitor before mon_tid is set. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | mdadm: add an environment variable to prevent auto-launching mdmonDan Williams2008-07-144-2/+13
| | | | | | | | | | | | Useful for attaching gdb to mdmon before any action is taken on the array. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | managemon: don't treat sysfs_add_disk as boolean functionDan Williams2008-07-141-1/+1
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: process updateDan Williams2008-07-141-0/+107
| | | | | | | | Handle 'activate_spare' events
* | imsm: activate_spareDan Williams2008-07-141-0/+175
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: metadata only supports a global 'data_offset'Dan Williams2008-07-141-1/+10
| | | | | | | | | | When creating a volume a drive must have free space starting at the same location as all the other drives in the array.
* | imsm: fix raid1 creationDan Williams2008-07-141-5/+28
| | | | | | | | | | | | Need to supply dummy values for the chunk size and number of data stripes Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: fail ->open_new if container_member is out of rangeDan Williams2008-07-141-0/+9
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: kill obsolete call to fsync() in store_imsm_mpbDan Williams2008-07-141-2/+0
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: fix insufficient mpb buffer allocationDan Williams2008-07-141-0/+19
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: catch posix_memalign allocation failuresDan Williams2008-07-141-4/+11
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: remove extra superswitchesDan Williams2008-07-141-290/+215
| | | | | | | | | | | | | | Following the lead of 75ede16d. This incidentally fixes creation of a second array by gating call to getinfo_super_imsm_volume with a valid ->current_vol. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | imsm: fix store_imsm_mpb() alignment for O_DIRECTDan Williams2008-07-141-1/+1
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Print used message in place of "default metadata" message.Neil Brown2008-07-121-3/+21
| | | | | | | | | | | | | | When creating an array in a container, print e.g. Creating array inside ddf container /dev/whatever rather than Defaulting to version /md127/1 metadata
* | Introduce devname2devnumNeil Brown2008-07-124-16/+15
| | | | | | | | and use it instead of opencoding.
* | Fix fd comparison in IncrementalNeil Brown2008-07-121-1/+1
| | | | | | | | fd==0 is theoretically possible...
* | Pass 'verbose' flag to validate_geometryNeil Brown2008-07-126-87/+131
| | | | | | | | | | That way it can be silent when we are just trying to figure out which metadata to use, and noisy when detecting a real problem.
* | Correct unit conversion for component_size and dev/size in sysfs.Neil Brown2008-07-121-2/+2
| | | | | | | | These are both Kilobytes, so do the conversion to sectors properly.
* | Use O_DIRECT for all IO to devices.Neil Brown2008-07-1210-106/+136
| | | | | | | | | | | | | | | | Using buffered IO risks non-atomic updates to parts of the device that we don't actually want to write to. This isn't in general safe. So switch to O_DIRECT for all that IO and make sure we have properly aligned buffers.
* | Stop all arrays before running each test in regression test driver.Neil Brown2008-07-121-0/+2
| | | | | | | | | | Sometimes I forget to stop arrays at the end of scripts, and that shows errors in the next script, which is confusing.
* | ddf: Set container_member from subarray in getinfo_super.Neil Brown2008-07-121-2/+3
| | | | | | | | Also go direct from subarray to text_version.
* | Reduce the number of metadata updates done by ddf.Neil Brown2008-07-121-7/+43
| | | | | | | | | | | | | | | | | | 1/ track if there are any actual updates pending, and only write metadata when we have changed something. 2/ when writing null virtual-configs, write full blocks, not just the first 4 bytes. This will allow O_DIRECT writes in a subsequent patch.
* | Improve shutdown for container-based arrays.Neil Brown2008-07-122-1/+11
| | | | | | | | | | | | | | 1/ close a race where multiple arrays disappear at once and monitor isn't woken up to find out that the last one has gone. 2/ "mdadm -Ss" needs to pause briefly for mdmon to exit.
* | Keep container device open in monitorNeil Brown2008-07-121-2/+0
| | | | | | | | | | ... so that it cannot be stopped while there are active arrays. I don't know where that second 'close' came from ....