summaryrefslogtreecommitdiffstats
path: root/sg_io.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2014-05-21DDF: add data-offset information to --examine output.NeilBrown1-0/+1
Raid Devices[1] : 5 (4@20000K 3@20000K 2@0K 1@0K 0@0K) The data offsets are 200000K and 0K. Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-21DDF: split up ddf_process_updateNeilBrown1-264/+297
Function was way too big, make several smaller functions. Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-21tests: handle change to DDF assembly.NeilBrown1-10/+13
When a DDF array is assembled with missing devices, those devices are now alway marked as 'missing' and cannot just re-appear in the array and be working again. test must be changed to acknowledge this. Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-21tests: handle new raid10/ddf geometries.NeilBrown1-12/+12
Recent changes to support more ddf geometries using raid1e requires updates to tests. Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-21DDF: add support of --data-offset when creating array.NeilBrown2-12/+16
Infrastructure is there, so use it. This requires making sure that ->data_offset is correctly set, even for containers. Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-21DDF: factor out common code for search through extents.NeilBrown1-90/+62
Each place the uses "get_extents" has slightly different search code to look through the result. Factor this out into a single find_space() function. This is will make it easier to add --data-offset support. Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-21DDF: allow for unused slots when creating map list for getinfo_super_ddf.NeilBrown1-4/+8
Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-21DDF: DDF_Missing devices should not be reported as 'working' by ↵NeilBrown1-1/+2
getinfo_super_ddf Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-21DDF: remove old and wrong comment about settinig raid_disk.NeilBrown1-1/+1
Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-21DDF: provide simple detail_super() implementation.NeilBrown1-6/+8
Just print the GUID, Seq and number of VDs in the container. Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-21DDF: support more RAID10 levels.NeilBrown1-3/+31
The DDF "RAID1E" level is similar to md "raid10". So use raid10 to support RAID1E, and create RAID1E for raid10 configs not already supported. Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-21DDF: explain why spare_refs are ignored.NeilBrown1-1/+4
Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-21DDF: use array_size from metadata.NeilBrown1-1/+1
If some other controller sets a number smaller than a calculation would give us, we really should honour it. Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-21DDF: set utime for container from timestamp is superblock.NeilBrown1-2/+2
Also be more consistent about setting events from seq in superblock. Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-21DDF: don't assume the anchor is fully up-to-date.NeilBrown1-1/+1
We currently copy the anchor to both primary and secondary blocks. This assumes that the anchor is uptodate, but it might not be. We should trust the 'active' block and copy from there. Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-21DDF: update timestamp/seqnum for virtual disks when config changes.NeilBrown1-20/+26
- we weren't updating this timestamp at all - the 'vd_config' seqnum was updated on every write of the metadata, which is excessive. Just update it when there is a change. Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-21DDF: update timestamp in DDF header.NeilBrown1-0/+1
Doco says: Header update timestamp. MUST be set when the DDF header is updated. So I guess we should. Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-21DDF: avoid ref outside array in getinfo_super_ddf_bvdNeilBrown1-4/+4
As we are range-checking 'cd', there is a chance that it is not in-range. In that case we should include all array indexes with 'cd' inside the range-tested branch. Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-21DDF: examine_pds to also list devices that aren't in the metadata.NeilBrown1-0/+20
The phys disks table should list all disks, but if the metadata is corrupt, it might not even list the disk it was read from. So check for and report any known disks that aren't listed. Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-21DDF: fix usage of ->used_pdesNeilBrown1-7/+14
The "used_pdes" value counts the number of physdisk entries that are in used. It may not be the last one in use as there may be unused slots in the middle. So when were are iterating over phys disks, we need to use max_pdes and skip unused entries. Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-21DDF: more guards against pdnum being negative.NeilBrown1-3/+3
With consistent metdata, pdnum should never be negative, but it is better to be safe than sorry. Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-20Reshape: use systemd to continue containers as well as native arrays.NeilBrown1-0/+4
Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-20Grow: split continue_via_systemd into a separate function.NeilBrown1-47/+48
This allows it to be used for containers too. Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-20Grow: add 'forked' option to reshape_container.NeilBrown1-7/+7
This is a better match for reshape_array() and means that "mdadm --grow --continue" will run in the foreground, which makes more sense. Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-15Grow: try to let "--grow --continue" from systemd complete a reshape.NeilBrown3-2/+76
If "--assemble" or "--incremental" is started by udev, then monitoring the reshape in the background won't work. So try asking systemd to start a grow-continue. If that fails, just do it the old way. Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-15Grow: store a link to current backup file in /run/mdadm or similar.NeilBrown3-4/+59
Subsequent patch will allow the background part of "mdadm --grow" to be run from systemd. This can require the passing of a backup file name. To do this, store that name as a symlink in /run/mdadm (or MAP_DIR) and look for it when appropriate. It might be useful to also store the name across reboot, but that would be a different patch. We would need to use the uuid to identify it, and store it in stable storage. Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-01Create: don't default to bitmap=internal when it is not supportedArtur Paszkiewicz1-0/+1
For large arrays (component size > 100GB) if write-intent bitmap is not enabled, then it is set by default to "internal", even if the metadata format does support internal bitmaps, which causes Create to fail. This patch adds checking if add_internal_bitmap is set in the superswitch before setting bitmap_file to "internal". Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-01Fix race between --create and --incrementalArtur Paszkiewicz1-14/+15
This modifies locking in Create to eliminate a situation where --incremental can assemble a device between write_init_super() and add_disk(), which causes Create to fail. It sporadically occurs e.g. when metadata is written on a device, causing an udev change event which triggers mdadm --incremental. Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
2014-04-08systemd: various fixes for boot with container-arrays.NeilBrown4-2/+19
1/ Add systemd shutdown script to ensure DDF and IMSM are clean before we actually shutdown 2/ Get udev to tell systemd to run the mdmon@mdXXX.service units when a member array appears. If we boot off a member array (with dracut at least), the mdmon started in the initramfs will lose track of /sys etc, so we need to restart it. systemd will try to forget about it too (but not actually kill it because we said not to do this). Having udev tell it to start it will allow a new mdmon to run which can see /sys, and systemd will know about it. 3/ Always use --offroot and --takeover when starting mdmon with systemd --offroot is needed else shutdown will hang. --takeover is needed incase an mdmon was started earlier (e.g. in initramfs). Neither hurt if they aren't actually needed. Signed-off-by: NeilBrown <neilb@suse.de>
2014-04-02DDF: Don't fail compare_super_ddf due to re-configure changes.NeilBrown1-33/+11
It is possible that one device has seem some reconfig but the other hasn't. In that case they are still the "same" DDF, even though one might be older. Such age will be detected by 'seq' differences. If A is new and B is old, then it is import that mdadm -I B mdadm -I A doesn't get confused because A has the same uuid as B, but compare_super fails. So: if the seq numbers are different, then just accept as two different superblocks. If they are the same, then look to copy data from new to old. Signed-off-by: NeilBrown <neilb@suse.de>
2014-04-02DDF: fix possible mdmon crash when updating metadata.NeilBrown1-1/+1
Testing 'c' and then using 'vdc' assumes that the two are in sync, but sometimes they aren't. Testing 'vdc' is safer. This avoids a crash in some cases when failing/removing/added devices to a DDF. Signed-off-by: NeilBrown <neilb@suse.de>
2014-04-02DDF: guard against ->pdnum being negative.NeilBrown1-6/+16
It is conceivable that ->pdnum could be -1, though only if the metadata is corrupt. We should be careful not to use it if it is. Also remove an assignment for pdnum to ->container_member. This is never used and cannot possibly mean anything. Signed-off-by: NeilBrown <neilb@suse.de>
2014-04-01DDF: mark missing-on-assembly device properly.NeilBrown1-3/+28
As well as removing from the array we really should mark it is 'failed', and mark the array as degraded. Signed-off-by: NeilBrown <neilb@suse.de>
2014-04-01DDF: Fix assorted typos and do some reformatting.NeilBrown2-142/+151
..because it is more fun when new patches are harder to apply to old version :-) Signed-off-by: NeilBrown <neilb@suse.de>
2014-03-31raid6check.c: move manual repair code to separate functionPiergiorgio Sartor1-84/+110
This patch cleans up a bit the code by moving the second repair mode, that is the manual repair, to a separate function. Signed off: piergiorgio.sartor@nexgo.de Signed-off-by: NeilBrown <neilb@suse.de>
2014-03-31raid6check.c: move autorepair code to separate functionPiergiorgio Sartor1-49/+65
This patch cleans up a bit the code by moving the autorepair part into a separate function. Signed off: piergiorgio.sartor@nexgo.de Signed-off-by: NeilBrown <neilb@suse.de>
2014-03-31raid6check.c: lock the stripe until necessaryPiergiorgio Sartor1-58/+58
The stripe locking mechanism must be atomic between the check and the, potential, autorepair. For this reason, the autorepair code needs to be just after the check and both parts (check and autorepair) must be excuted under stripe lock. Of course, the manual repair can operate as before. This patch reorganize the code and provides the single, atomic, stripe lock. It should be confirmed that this new locking is not too demanding. In case it is, some other solutions will be required (suggestions wellcome). Signed off: piergiorgio.sartor@nexgo.de Signed-off-by: NeilBrown <neilb@suse.de>
2014-03-26ddf-sudden-degraded test fix.NeilBrown1-1/+2
Change how sudden-degraded devices should appear. We don't record failure, we record that the device isn't there. Signed-off-by: NeilBrown <neilb@suse.de>
2014-03-26DDF: when first activating an array, record any missing devices.NeilBrown1-0/+28
We must remember they are missing so that if they re-appear we don't get confused. Signed-off-by: NeilBrown <neilb@suse.de>
2014-03-26DDF: report seq counter as events.NeilBrown1-7/+4
Also don't treat two devices with different seq numbers as completely unrelated. This allows split-brain detection to work properly for ddf. Signed-off-by: NeilBrown <neilb@suse.de>
2014-03-19Work around architectures having statfs.f_type defined as longJes Sorensen1-1/+5
Having RAMFS_MAGIC defined as 0x858458f6 causing problems when trying to compare it directly against statfs.f_type being cast from long to unsigned long. This hack is extremly ugly, but it should at least do the right thing for every situation. Thanks to Arnd Bergmann for suggesting the fix. Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>