summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAge
* Teach IncrementalRemove about containers.NeilBrown2010-11-22
| | | | | | | When we -I -R a device in a container, we must first fail it from each member array before we can remove it from the container. Signed-off-by: NeilBrown <neilb@suse.de>
* Update of udev rules to support IMSM devicesPrzemyslaw Czarnowski2010-11-22
| | | | | | | | ID_FS_TYPE for IMSM members is set to isw_raid_member, so they must also be handled in udev. Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* added --path <path_id> to give the information on the 'path-id' of removed ↵Przemyslaw Czarnowski2010-11-22
| | | | | | | | | | | | | | | | device <path-id> allows to identify the port to which given device is plugged in. In case of hot-removal, udev can pass this information for future use (eg. write this name as 'cookie' allowing to detect the fact of reinserting device to the same port). --path <path-id> parameter has been added to device removal handle (and char *path has been added to IncrementalRemove() to pass this value) in order to pass path-id to this handler. Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Remove loaded_containerNeilBrown2010-11-22
| | | | | | | | This field is now only set, never used. So remove it. Signed-off-by: NeilBrown <neilb@suse.de>
* imsm: always calculate container_enough in getinfo_super_imsmNeilBrown2010-11-22
| | | | | | | | We are about to lose the loaded_container field, and we don't really need to use it to protect the calculation of container_enough. So drop the test. Signed-off-by: NeilBrown <neilb@suse.de>
* Replace various load_super calls with load_containerNeilBrown2010-11-22
| | | | | | | When we call load_super expecting to find a container, we now just call load_container directly. Signed-off-by: NeilBrown <neilb@suse.de>
* Assemble: use load_containerNeilBrown2010-11-22
| | | | | | | | | | Separate the load_container call from the load_super call, and use different validity tests as appropriate. Add some general code tidying and a bit of indent change to make structure a little clearer. Signed-off-by: NeilBrown <neilb@suse.de>
* Add must_be_container helper.NeilBrown2010-11-22
| | | | | | | This checks a block device to see if it could be a container, and in particular cannot be a member device. Signed-off-by: NeilBrown <neilb@suse.de>
* Assemble: turn next_member goto loop into a for loop.NeilBrown2010-11-22
| | | | | | It becomes much clearer what is happening now. Signed-off-by: NeilBrown <neilb@suse.de>
* Assemble: simplify the handling of is_member_busy.NeilBrown2010-11-22
| | | | | | | | | This is somewhat inconsistent with the last member of a container getting special handling. Just simplify it so the code seems to make sense and important is easy to follow. Signed-of-by: NeilBrown <neilb@suse.de>
* Assemble: remove the skip variable.NeilBrown2010-11-22
| | | | | | it seems we don't need it any more Signed-off-by: NeilBrown <neilb@suse.de>
* Assemble: merge 'member' test into ident_matches.NeilBrown2010-11-22
| | | | | | | This is a more sensible place for it, gathering all the tests together. Signed-off-by: NeilBrown <neilb@suse.de>
* Assemble: change 'skip' label to a variable.NeilBrown2010-11-22
| | | | | | | This gets rid of some gotos which makes the code flow a bit more clear. Signed-off-by: NeilBrown <neilb@suse.de>
* Remove content from mddev_devNeilBrown2010-11-22
| | | | | | | | Now that the next_member loop is much smaller it is easy to just use 'content' rather than stashing it in 'tmpdev->content'. So we can remove the 'content' field from 'struct mddev_dev'. Signed-off-by: NeilBrown <neilb@suse.de>
* Assemble: contract next_member loop.NeilBrown2010-11-22
| | | | | | | | | We have a 'goto next_member' loop which is rather spread-out and confusing. Recent refactoring make it possible to contract that loop significantly. Signed-off-by: NeilBrown <neilb@suse.de>
* Assemble: merge to large 'if' statements.NeilBrown2010-11-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In assemble, we see (inside a 'for' loop): if (condition) { lots of stuff } else something small thing if (same condition) { lots more stuff break; } where 'condition' cannot be changed in the middle. So simplify this to if (condition) { lots of stuff small thing lots more stuff break; } something small thing which duplicates the small thing, but provides much conceptual simplicity. Signed-off-by: NeilBrown <neilb@suse.de>
* Improve type names for mddev_devNeilBrown2010-11-22
| | | | | | | | | Remove the _t pointer typedef and remove the _s suffix for the structure, These things do not help readability. Signed-off-by: NeilBrown <neilb@suse.de>
* Improve mddev_ident type definitions.NeilBrown2010-11-22
| | | | | | | | Remove the _t typedef and remove the _s suffix from the struct name. These things do not help readability. Signed-off-by: NeilBrown <neilb@suse.de>
* Assemble: factor out ident_matchesNeilBrown2010-11-22
| | | | | | | This will help future patch, and we need to make "Assemble()" smaller anyway. Signed-off-by: NeilBrown <neilb@suse.de>
* Assemble: small cleanup of error checking.NeilBrown2010-11-22
| | | | | | | | | | | | | | If we get an early error (e.g. not a block device) we need to not continue through and check e.g. uuid. Also make sure we set used=2 whenever we find an error, and don't bother with ->free_super as 'goto loop' does that. Now that we abort earlier, we can remove lots of tests on tst && tst->sb Signed-off-by: NeilBrown <neilb@suse.de>
* Use load_container in Incremental assembly.NeilBrown2010-11-22
| | | | | | | | | We more clearly separate out -I on a container, and use load_container in that case and load_super only for true members. This removes another use of loaded_container. Signed-off-by: NeilBrown <neilb@suse.de>
* Incremental: Factor out search of mdstatNeilBrown2010-11-22
| | | | | | As we will soon use it in two places. Signed-off-by: NeilBrown <neilb@suse.de>
* Make Incremental_container staticNeilBrown2010-11-22
| | | | | | as it is only used in Incremental.c Signed-off-by: NeilBrown <neilb@suse.de>
* Switch open_subarray to use the new load_containerNeilBrown2010-11-22
| | | | | | This removes another user of loaded_container Signed-off-by: NeilBrown <neilb@suse.de>
* Use new load_container in ExamineNeilBrown2010-11-22
| | | | | | | This makes explicit the two different ways to use Examine And removes a user of container_loaded. Signed-off-by: NeilBrown <neilb@suse.de>
* New method: load_containerNeilBrown2010-11-22
| | | | | | | | This handles the 'container' part of 'load_super', so we can soon make them completely separate - it is just confusing to overload these two. Signed-off-by: NeilBrown <neilb@suse.de>
* Remove keep_fd arg from load_super_XXX_allNeilBrown2010-11-22
| | | | | | It is always set to 1, so we don't need it. Signed-off-by: NeilBrown <neilb@suse.de>
* Remove subarray field in supertype.NeilBrown2010-11-22
| | | | | | | This is now only ever set, never used. So remove it. Signed-off-by: NeilBrown <neilb@suse.de>
* Create: user container_dev rather than subarray for some tests.NeilBrown2010-11-22
| | | | | | | | | It makes more sense to test for container_dev than for subarray for several places in Create where it then uses container_dev. This allows us to subsequently remove subarray. Signed-off-by: NeilBrown <neilb@suse.de>
* Use container_member rather than subarray info ddf getinfo_super.NeilBrown2010-11-22
| | | | | | | We are in the processes of discarding the subarray field, so remove the unnecessary use of it. Signed-off-by: NeilBrown <neilb@suse.de>
* Remove subarray detection from load_super.NeilBrown2010-11-22
| | | | | | Nothing relies on this any more, so remove it. Signed-off-by: NeilBrown <neilb@suse.de>
* Pass subarray arg explicitly to ->update_subarray.NeilBrown2010-11-22
| | | | | | | This is better than hiding it in the supertype structure where we are never quite sure who needs it. Signed-off-by: NeilBrown <neilb@suse.de>
* Use new container_content rather than passing subarray to load_super.NeilBrown2010-11-22
| | | | | | | | Now that we can ask container_content for a specific subarray, we don't need to pass the subarray name to load_super, and have it secretly modify the returned state. Signed-off-by: NeilBrown <neilb@suse.de>
* Add subarray arg to container_content.NeilBrown2010-11-22
| | | | | | | | | | This allows the info for a single array to be extracted, so we don't have to write it into st->subarray. For consistency, implement container_content for super0 and super1, to just return the mdinfo for the single array. Signed-off-by: NeilBrown <neilb@suse.de>
* mapinfo: simplify subarray handling.NeilBrown2010-11-22
| | | | | | | | | We don't need ->container_dev here, and we will soon be passing subarray as an explicit arg to load_super. So simplify extraction of subarray and move the strcpy close to ->load_super. Signed-off-by: NeilBrown <neilb@suse.de>
* super_by_fd: return subarray info explicitly.NeilBrown2010-11-22
| | | | | | | | | Rather than hiding this in the 'st', return it explicitly. In the one case we still need it, copy it into st where needed. This will disappear in a future patch. Signed-off-by: NeilBrown <neilb@suse.de>
* open_subarray: pass subarray name as explicit arg.NeilBrown2010-11-22
| | | | | | | | | | | Rather than hiding this arg in the 'st' structure, pass it explicitly. This is a first step to getting rid of 'subarray' from 'supertype'. The strcpy in open_subarray should have better error checking, but it will disappear soon so there is little point. Signed-off-by: NeilBrown <neilb@suse.de.
* ddf: remove duplicate container_member setting.NeilBrown2010-11-22
| | | | | | | | | | | 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>
* Incremental - fix small bug in count_active.NeilBrown2010-11-22
| | | | | | | | If the first device found has a much smaller event count than a subsequent device, that device will not be entered in the 'avail' array properly. Signed-off-by: NeilBrown <neilb@suse.de>
* Assemble - avoid including wayward devices.NeilBrown2010-11-22
| | | | | | | | | | | | | | | If a device - typically in a mirrored set - is assembled independently of the other devices, and then attempted to be brought back into the set it could contain inconsistent data. It should not be included. So detect this situation by ensuring that the 'most recent' device is believed to be active by every other device. If a device is wayward, it will only consider fellow wayward devices to be active and will think all others are failed or missing. This patch only fixes --assemble, not --incremental Signed-off-by: NeilBrown <neilb@suse.de>
* Assemble: handle devices array better.NeilBrown2010-11-22
| | | | | | Only allocate when it is about to be used, and free it when finished. Signed-off-by: NeilBrown <neilb@suse.de>
* get_info_super: report which other devices are thought to be working/failed.NeilBrown2010-11-22
| | | | | | | | | | | | | | To accurately detect when an array has been split and is now being recombined, we need to track which other devices each thinks is working. We should never include a device in an array if it thinks that the primary device has failed. This patch just allows get_info_super to return a list of devices and whether they are thought to be working or not. Signed-off-by: NeilBrown <neilb@suse.de>
* detail/wait: better handling of monitoring sync action.NeilBrown2010-11-22
| | | | | | | Detail: report reshape and check as well as resync and recovery Wait: if the resync is pending or delayed, wait for that too. Signed-off-by: NeilBrown <neilb@suse.de>
* Manage: be more careful about --add attempts.NeilBrown2010-11-22
| | | | | | | | | 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>
* policy: don't try to get policy when path == NULL.NeilBrown2010-11-22
| | | | | | | config_rules_has_path, we fail if path==NULL, so we should when config_rules doesn't has_path too. Signed-Off-By: NeilBrown <neilb@suse.de>
* Fix error in pol_sort.NeilBrown2010-11-22
| | | | | | | | | pol_sort could go into an infinite loop. The proof of this patch is left as a exercise for the reader :-) Reported-by: "Hawrylewicz Czarnowski, Przemyslaw" <przemyslaw.hawrylewicz.czarnowski@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Report error in --update string is not recognised.NeilBrown2010-11-22
| | | | | | | | If an --update is requested by the relevant metadata doesn't understand it, print a useful message rather than silently ignoring the issue. Signed-off-by: NeilBrown <neilb@suse.de>
* Convert 'auto' config line to policy statementsNeilBrown2010-09-06
|
* Add support for auto-partitioning base devices.NeilBrown2010-09-06
| | | | | | | | If a device is bare and policy suggests that it can be used as a spare for virtual 'partitions' array, find an appropriate partition table and write it to the device. Signed-off-by: NeilBrown <neilb@suse.de>
* Add guess_super_typeNeilBrown2010-09-06
| | | | | | | This can select to only guess array types, or only guess partition types. Signed-off-by: NeilBrown <neilb@suse.de>