| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
We probably should pass a flag down saying 'this is auto-assembly',
but for now, if there is no identity information set, it must
be auto-assemble.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
| |
Thus an auto-generated config file will list all the arrays.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
| |
It is only 16 bytes, not 32. And is space padded, not nul terminated.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
|
|
|
| |
Try to treat members of containers much like other arrays for
assembly.
We still look through the list of devices for a match (it will be
the container), then find the relevant 'info' and try to assemble
the array.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
| |
Rather than open-coding a test of 'verbose' and 'inargv' in
multiple places, do it one and set a variable.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Attempting to open(O_EXCL) each candidate device usually filters out all
busy raid components. However, containers do not behave like components
and will return container_content that may describe active member
arrays.
This patch just adds a function that will be used to check if a
container member is busy. It will be used shortly.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
|
|
| |
Factor out, from Incremental_container, the code for assembling an
array based on information extracted from a container. We will
shortly use this from Assemble too.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
| |
I have seen the light.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
|
|
|
|
|
|
| |
In preparation for handling the container case where we may need to handle
a list of potential member arrays.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
| |
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
| |
Add anything that looks like a container in /proc/mdstat to the devlist
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
| |
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
| |
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
| |
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
If there is no metadata (--build was used) then we need to lookup
by devnum, not by uuid, to get the map entry.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
|
|
| |
This only applies if udev isn't installed or is disabled
by MDADM_NO_UDEV
We try to remove partitions too.
We find names to remove by looking in /var/run/mdadm/map
Signed-off-by: NeilBrown <neilb@suse.de>
|
| |
|
|
|
|
| |
I think this is closer to what I want. Fewer surprises anyway.
|
|
|
|
|
|
|
|
| |
Container devices are meant to be named for the metadata type.
That wasn't happening properly for DDF.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
| |
This is based on the rules from openSUSE 11.1-rc3.
|
|
|
|
|
|
|
|
|
|
| |
MD_NAME is the name of the array extracted directly from the metadata.
MD_DEVNAME is the current working name of the array. It should appear
in /dev/md. It is possibly what the user gave when creating the
array.
We extract it from /var/run/mdadm/map.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
| |
The default for 'homehost' is now '<system>' rather than
unspecified.
|
|
|
|
|
| |
Now that mdadm.conf doesn't need an array name, we don't need to
give one if the array cannot reliably provide one.
|
|
|
|
|
|
|
|
|
|
| |
mdadm.conf
When mdadm.conf is automatically generated, we might not know a
suitable /dev/name. But we do know the uuid of the container.
So allow that as an option.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
|
|
|
| |
i.e. in mdadm.conf you can have a line like
ARRAY uuid=whatever
and it will use auto-name-generation to give a name to the array at
assemble-time. The is different from blind auto-assembly in that the
array will be treated as 'local'.
|
|
|
|
|
| |
--incremental now uses exactly the same create_mddev that
other code uses.
|
|
|
|
|
| |
Using the 'new' name scheme we restore the creation of partition
links (in the case the udev isn't used).
|
|
|
|
| |
MORE CONTENT HERE
|
|
|
|
|
|
|
| |
Change the "env_check_mdmon" function to be more generic, accepting
and environment variable name, as soon we will have a new use for it.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
| |
This delays the create_mddev call even further in the case where
an array device name is given for --assemble. It is now delayed
until the 'name' of the array is also available.
|
|
|
|
|
| |
When compile with -Os, the compile doesn't work out that the
variable is always initialised before usage, so we tell it.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When
mdadm --assemble /dev/whatever
is given, mdadm will treat it as though '--scan' were given, even
though it wasn't.
In this case, the code opens /dev/whatever twice, which is pointless.
We already know /dev/whatever is open at this point, so remove the
'open' and the tests, and make sure it is always closed afterwards.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
| |
Some cases we aren't interested in creating the mddev, just opening
it. Make those more explicit.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
| |
This reflect that fact that more often than not it is creating things
in /dev, and allows for a new open_mddev which does just that.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
| |
Now that we are using these values, we need to initialise them
properly.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
|
| |
But sysfs_init and stat2devnum try to convert stat information
into an md devnum. Combine all the value of both pieces of code
into stat2devnum and have sysfs_init call that.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
| |
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
There was a bug. If /var/run/mdadm/ did not exist as a directory,
the map file should have been created in /var/run/mdadm.map, but
due to bug it would never get created.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It doesn't really make sense for the --auto setting to ever over-ride
the setting on an ARRAY line. That could cause failure if the
ARRAY line has a 'standard' now. So revert to the array line having
precedence over command line, then CREATE line last.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|\| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
From 2.6.28, normal md device will be able to have partitions. These
partitions will have a different major number. Sometimes mdadm tests
the major number and so can get confused.
Change these tests to test against get_mdp_major(). mdp does not use
extended minor number and so this test will always be accurate.
Also use /sys/dev links to map major/minor to devnum in sysfs.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|\|
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
Incremental.c
super0.c
super1.c
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If a foreign (i.e. not known to be local) array is discovered
by --incremental assembly, we now assemble it. However we ignore
any name information in the array so as not to potentially create
a name that conflict with a 'local' array.
Also, foreign arrays are always assembled 'read-auto' to avoid writing
anything until the array is actually used.
Signed-off-by: NeilBrown <neilb@suse.de>
|
| |
| |
| |
| |
| |
| |
| | |
When doing auto-assembly, the 'autof' flag from array lines
in mdadm.conf was being ignored.
Signed-off-by: NeilBrown <neilb@suse.de>
|