summaryrefslogtreecommitdiffstats
path: root/Create.c
Commit message (Collapse)AuthorAgeFilesLines
* wait_for improvement.NeilBrown2009-04-071-2/+2
| | | | | | | | wait not only for the name to appear, but for it to refer to the correct device. Sometimes old symlinks left lying around can be confusing. Signed-off-by: NeilBrown <neilb@suse.de>
* Create: round to chunk sizeNeilBrown2009-04-061-0/+2
| | | | | | | There are probably other places where rounding size to chunksize is needed, or useful, but this is a good start. Signed-off-by: NeilBrown <neilb@suse.de>
* Create: fixup 'insert_point', dependent on 'subdevs', for auto-layoutDan Williams2009-02-241-1/+5
| | | | | | | | | 'subdevs' is read from the container in the auto-layout case so reset subdevs dependent default values. 'insert_point' without this change is always 2 blocking creation of arrays with > 2 raid disks. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Create: wait_for container creationDan Williams2009-02-241-0/+1
| | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Create: warn when a metadata format's platform components are missingDan Williams2009-01-201-0/+8
| | | | | | | | | | | | | | If the metadata handler can not find its platform support components then there is no way for it to verify that the raid configuration will be supported by the option-rom. Provide a generic method for metadata handlers to warn the user that the array they are about to create may not work as intended with a given platform. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Create: allow per-metadata default layoutsDan Williams2009-01-201-25/+48
| | | | | | | | Let handlers specifiy their own defaults, specifically needed for the imsm-raid5 case where mdadm defaults to 'ls' and imsm to 'la'. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Create: support autolayout when creating in a DDFNeilBrown2008-12-041-30/+56
| | | | | | | | | If, when creating an array, a signal target device is given which is a container, then allow the metadata handler to choose which devices to use. This is currently only supported for DDF. Signed-off-by: NeilBrown <neilb@suse.de>
* Change 'size' argument to validate_geometry to be sectors, not KNeilBrown2008-12-041-4/+4
| | | | | | That way it is the same a *freesize, and generally less confusing. Signed-off-by: NeilBrown <neilb@suse.de>
* Create: print message when preparing a container.NeilBrown2008-11-281-1/+2
| | | | | | | | We currently print e.g. "Array /dev/md0 started", but nothing for containers. Fix that. Signed-off-by: NeilBrown <neilb@suse.de>
* Tidy error messages for add_to_super failure.NeilBrown2008-11-271-4/+1
| | | | | | | Make sure every failure from add_to_super prints a suitable error message, and then don't print any error in the caller. Signed-off-by: NeilBrown <neilb@suse.de>
* allow add_to_super to return errorsDan Williams2008-11-271-2/+6
| | | | | | Prepare add_to_super to validate disks against the platform capabilities Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Create: don't wait for device to appear if we didn't actually start the arrayNeilBrown2008-11-071-1/+1
| | | | | | | Otherwise we get an unpleasant 2 second pause when array creation fails. Signed-off-by: NeilBrown <neilb@suse.de>
* Wait for name to appear after create/assemble etc.NeilBrown2008-11-041-0/+1
| | | | | | | We don't really want mdadm to exit until udev has created the names in /dev. So wait. Signed-off-by: NeilBrown <neilb@suse.de>
* Create: make sure chosen_name is used for array name generation in CreateNeilBrown2008-11-041-0/+1
| | | | | | | As with Assemble, one create_mddev has chosen a name, we should always use that rather than the passed 'mddev'. Signed-off-by: NeilBrown <neilb@suse.de>
* Create: Don't optimise resync as recovery when creating raid5 in a container.NeilBrown2008-11-041-1/+2
| | | | | | | | As spares are treated quite differently in containers, we cannot fake-up a spare to optimise initialisation for a raid5 in a container, so disable that code for ->external arrays. Signed-off-by: NeilBrown <neilb@suse.de>
* DDF: report member arrays in examine_brief.NeilBrown2008-11-041-1/+1
| | | | | | Thus an auto-generated config file will list all the arrays. Signed-off-by: NeilBrown <neilb@suse.de>
* Incremental: lock against multiple concurrent additions to an array.NeilBrown2008-11-041-1/+4
| | | | | | | In two devices are added via -I to one array at the same time, mdadm can get badly confused. Signed-off-by: NeilBrown <neilb@suse.de>
* Generate 'change' uevents when arrays change in non-obvious ways.NeilBrown2008-11-041-4/+6
| | | | | | | | | | | When a 'container' gets started, we need udev to notice, but the kernel has no way of knowing that a KOBJ_CHANGE event is needed. So send one directly via the 'uevent' sysfs attribute. Also, uevents don't get generated when md arrays are stopped (prior to 2.6.28) so send 'change' events then too. Signed-off-by: NeilBrown <neilb@suse.de>
* Always update mdadm/map when starting an array.NeilBrown2008-11-041-1/+6
| | | | | | | | We previously only updated /var/run/mdadm/map when starting an array with --incremental. However we now make more use of that file (to pass the dev name to udev) so always update it. Signed-off-by: NeilBrown <neilb@suse.de>
* mdopen: Introduce new rules for creating device name.NeilBrown2008-11-041-1/+2
| | | | MORE CONTENT HERE
* Delay creation of array devices for assemble/build/createNeilBrown2008-11-041-27/+39
| | | | | | | | | | | | | We will shortly be feeding more information into the process of creating array devices, so delay the creation. Still open them early if the device already exists. This involves making sure the autof flag is in the right place so that it can be found at creation time. Also, Assemble, Build, and Create now always close 'mdfd'. Signed-off-by: NeilBrown <neilb@suse.de>
* Merge branch 'master' into devel-3.0NeilBrown2008-10-271-1/+1
|\ | | | | | | | | | | | | Conflicts: Create.c Manage.c
| * Allow WRITEMOSTLY to be cleared on --readd using --readwrite.NeilBrown2008-10-251-1/+1
| | | | | | | | | | | | | | | | Previously it was possible to set the WRITEMOSTLY flag when adding a device to an array, but not to clear the flag when re-adding. This is now possible with --readwrite. Signed-off-by: NeilBrown <neilb@suse.de>
* | 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.
* | Move calls to SET_ARRAY_INFO to common helper.NeilBrown2008-09-181-56/+36
| | | | | | | | | | | | | | | | | | | | 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-181-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Compile fixes, particularly moving more stuff under MDASSEMBLENeilBrown2008-09-181-1/+1
| | | | | | | | Now 'make everything' works again.
* | Honor safemode_delay at Create() and Incremental() timeDan Williams2008-09-151-0/+3
| | | | | | | | Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Factor out test for subarray version string.NeilBrown2008-08-191-1/+1
| | | | | | | | | | | | | | 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>
* | Merge branch 'master' into from-stableNeilBrown2008-08-071-4/+4
|\| | | | | | | | | | | | | Conflicts: Create.c Manage.c
| * Clean up usage of open()Doug Ledford2008-07-241-2/+2
| | | | | | | | | | | | | | | | Fix on call that passed an invalid mode to open Don't pass a third arg unless we also pass O_CREAT Use symbolic args for 2nd and 3rd args Signed-off-by: Doug Ledford <dledford@redhat.com>
* | Factor common code into new "start_mdmon".NeilBrown2008-07-181-22/+4
| | | | | | | | Signed-off-by: Neil Brown <neilb@suse.de>
* | Make sure resync_start is initialised properly and maintained properlyNeil Brown2008-07-181-3/+5
| | | | | | | | Signed-off-by: Neil Brown <neilb@suse.de>
* | mdadm: add an environment variable to prevent auto-launching mdmonDan Williams2008-07-141-1/+1
| | | | | | | | | | | | Useful for attaching gdb to mdmon before any action is taken on the array. 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
* | Pass 'verbose' flag to validate_geometryNeil Brown2008-07-121-4/+6
| | | | | | | | | | 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.
* | Create arrays via metadata-updateNeil Brown2008-07-121-7/+10
| | | | | | | | | | Support creating arrays inside an active ddf container by sending a metadata update over a pipe to mdmon.
* | Remove silly convention that major='-1' means 'zero superblock'.Neil Brown2008-07-121-1/+0
| | | | | | | | Use 'info pointer is NULL' instead.
* | Remove getinfo_super_n and do some other cleaning up.Neil Brown2008-07-121-36/+48
| | | | | | | | | | Getting close to a sensible description of what some of the superswitch methods are supposed to do!
* | Add subarray field to supertype.Neil Brown2008-07-121-3/+3
| | | | | | | | | | | | | | | | | | When loading the metadata for a subarray (super_by_fd), we set ->subarray to be the name read from md/metadata_version so that getinfo_super can return info about the correct array. With this we can differentiate between a container and an array within the container by looking at ->subarray[0].
* | Remove 'major' from superswitch.Neil Brown2008-07-121-10/+15
| | | | | | | | It isn't generally meaningful.
* | Always assume_clean for raid0, linear, multipath, faultyNeil Brown2008-07-111-0/+2
| | | | | | | | | | | | For arrays that don't have redundancy (raid0, linear etc), the clean/dirty distinction doesn't mean anything. So always 'assume clean' for these arrays.
* | Discard st->container_memberNeil Brown2008-05-271-8/+4
| | | | | | | | | | | | 'container_member' isn't really a well defined concept. Each metadata might enumerate members differently, so just let each format /mdX/YYYY as appropriate.
* | Remove st->text_version in favour of info->text_versionNeil Brown2008-05-271-1/+4
| | | | | | | | | | | | | | I want the metadata handler to have more control over the 'version', particularly for arrays which are members of containers. So discard st->text_version and instead use info->text_version which getinfo_super can initialise.
* | auto-start mdmon on --createNeil Brown2008-05-271-0/+53
| | | | | | | | | | | | FIXME uses sill hardcoded path. Need --assemble too.
* | Remove 'fd' arg from sysfs_add_diskNeil Brown2008-05-271-3/+2
| | | | | | | | | | It it never used, and removing means there are several 'open's that can go.
* | imsm: create supportDan Williams2008-05-151-2/+2
| | | | | | | | | | | | | | | | | | From: Dan Williams <dan.j.williams@intel.com> This should probably be made into a generic 'external' capability rather than hardcoding 'ddf' and 'imsm'. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | Create a container memberNeil Brown2008-05-151-1/+9
| | | | | | | | From: Neil Brown <neilb@suse.de>
* | Can now mostly assemble DDF arraysNeil Brown2008-05-151-6/+22
| |
* | More ddf stuffNeil Brown2008-05-151-11/+12
| |