| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| |
| |
| | |
Conflicts:
Create.c
Manage.c
|
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
|\|
| |
| |
| |
| |
| | |
Conflicts:
Manage.c
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When adding a device to an array, we check that it is large enough.
Currently the check makes sure there is also room for a reasonably
sized bitmap. But if the array doesn't have a bitmap, then this test
might be too restrictive.
So when adding, only insist there is enough space for the current
bitmap.
When Creating, still require room for the standard sized bitmap.
This resolved Debian Bug 500309
|
| |
| |
| |
| | |
Now 'make everything' works again.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
It is currently possible to remove a device and re-add it without the
manager noticing, i.e. without detecting a mdstat->devcnt
container->devcnt mismatch. Introduce ping_manager() to arrange for
mdmon to run manage_container() prior to mdadm dropping the exclusive
open() on the container. Despite these precautions sysfs_read() may
still fail. If this happens invalidate container->devcnt to ensure
manage_container() runs at the next event.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The action we are waiting for may not be complete until the monitor has
had a chance to take action on the result.
The following script can now remove the device on the first attempt,
versus a few attempts with the original Wait():
#!/bin/bash
#export MDADM_NO_MDMON=1
export IMSM_DEVNAME_AS_SERIAL=1
./mdadm -Ss
./mdadm --zero-superblock /dev/loop[0-3]
echo 2 > /proc/sys/dev/raid/speed_limit_max
./mdadm --create /dev/imsm /dev/loop[0-3] -n 4 -e imsm -a md
./mdadm --create /dev/md/r1 /dev/loop[0-3] -n 4 -l 5 --force -a mdp
./mdadm --fail /dev/md/r1 /dev/loop3
./mdadm --wait /dev/md/r1
x=0
while ! ./mdadm --remove /dev/imsm /dev/loop3 > /dev/null 2>&1
do
x=$((x+1))
done
echo "removed after $x attempts"
./mdadm --add /dev/imsm /dev/loop3
Include 2 small cleanups:
* remove the almost open coded fd2devnum() in Wait() by introducing a
new utility routine stat2devnum()
* teach connect_monitor() to parse the container device from a subarray
string
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If the metadata_version is
-mdXXX/whatever
rather than
/mdXXX/whatever
then the array is readonly and should be left alone by mdmon.
Signed-off-by: NeilBrown <neilb@suse.de>
|
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Adding a device updates the container and then mdmon takes action upon
noticing a change in devices. This reuses the container version of
add_to_super to create a new record for the device.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: NeilBrown <neilb@suse.de>
|
|\|
| |
| |
| |
| |
| |
| | |
Conflicts:
Create.c
Manage.c
|
| |
| |
| |
| | |
Signed-off-by: Neil Brown <neilb@suse.de>
|
| |
| |
| |
| |
| |
| |
| | |
mdmon sometimes opens the container. That will prevent 'stop'
from working. So sync with mdmon first.
Signed-off-by: Neil Brown <neilb@suse.de>
|
| |
| |
| |
| |
| |
| |
| | |
Explain the meaning of 'quiet' explicitly, and fix some grammar
and formatting.
Signed-off-by: Neil Brown <neilb@suse.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| | |
This really should be done in mdadm, not mdmon.
We ensure the device won't be suddenly commited as a hot-spare
using O_EXCL, then check the 'holders' sysfs directory
to make sure it is only in use once.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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].
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
From: Dan Williams <dan.j.williams@intel.com>
1/ Block attempts to add/remove devices from container members
2/ Forward add/remove requests to containers
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The current model for creating arrays involves writing
a superblock to each device in the array.
With containers (as with DDF), that model doesn't work.
Every device in the container may need to be updated
for an array made from just some the devices in a container.
So instead of calling write_init_super for each device,
we call it once for the array and have it iterate over
all the devices in the array.
To help with this, ->add_to_super now passes in an 'fd' and name for
the device. These get saved for use by write_init_super. So
add_to_super takes ownership of the fd, and write_init_super will
close it.
This information is stored in the new 'info' field of supertype.
As part of this, write_init_super now removes any old traces of raid
metadata rather than doing this in common code.
|
|
|
|
|
|
|
|
|
|
|
| |
array.size is 32bits and counts K. So for arrays with
more than 4Terrabytes, it can overflow.
The correct number can be read from sysfs, but there are still
a few places that use array.size and risk truncation. What is worse.
they compare a number of kilobytes with a number of sectors !!
So use get_component_size() to read the sysfs information, and be
more consistent about units.
|
|
|
|
|
| |
We used to use the major/minor numbers, but that isn't sufficient
any more, so pass the fd, and possibly check 'text' version.
|
|
|
|
| |
It is now in the 'supertype'
|
|
|
|
| |
The 'superblock' will be moved into this structure soon.
|
| |
|
|
|
|
|
| |
The 'remove_partitions' call is in the wrong place and applying
to the wrong file.
|
|
|
|
|
|
|
|
|
| |
Fixes Debian Bug 442874
When we discover that we can 're-add' a drive, we forget to check the
write-mostly flag.
This highlights the fact that you cannot turn 'off' the write-mostly
flag at this point. I wonder if that is a problem...
|
|
|
|
| |
This is equivalent to raidautorun that some distros provide.
|
|
|
|
|
| |
This if you unplug a device and udev removes the entry from /dev,
you can still remove the device.
|
|
|
|
|
| |
--incremental allows arrays to be assembled one device at a time.
This is expected to be used with udev.
|
|
|
|
| |
Instead of opencoding the same thing everywhere.
|
|
|
|
| |
This improves quality of error message.
|
|
|
|
|
|
|
|
|
| |
From: Luca Berra <bluca@comedia.it>
- Fix a bug where mdassemble didn't close a filedescriptor and so couldn't assembele
stacked arrays.
- Allow mdassemble, when run a second time, to mark all arrays as writable.
This is useful if they are started read-only as is best at boot-time.
|
|
|
|
| |
They do nothing but cause confusion.
|
|
|
|
|
|
|
|
|
| |
In 2.6.17 (and prior), the dev_number is ignored when a device
is added to an active array. Rather the first free number is used.
So we work around this by making sure we use the first free
number for dev_number.
Description...
|
|
|
|
|
|
|
| |
And as a side effect, if --quiet isn't given, stopped devices are
reported.
Signed-off-by: Neil Brown <neilb@suse.de>
|
|
|
|
| |
Signed-off-by: Neil Brown <neilb@suse.de>
|
|
|
|
|
|
|
|
|
| |
The following patch makes it possible to tag a device as write-mostly on
--add and --re-add with a non-persistent superblock array. Previously,
this was not working.
Signed-Off-By: Paul Clements <paul.clements@steeleye.com>
Signed-off-by: Neil Brown <neilb@suse.de>
|
|
|
|
|
|
|
| |
Whenever we need a device file to open, if one cannot be found in /dev,
create a temporary one.
Signed-off-by: Neil Brown <neilb@suse.de>
|
|
|
|
|
|
| |
Add a 'name' field to 'info' to compensate.
Signed-off-by: Neil Brown <neilb@suse.de>
|
|
|
|
|
|
|
| |
As spared don't have a position in the raid array with verion-1 superblocks,
we need to handle them a bit differently.
Signed-off-by: Neil Brown <neilb@suse.de>
|
|
|
|
| |
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
|
|
|
|
| |
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
|
|
|
|
|
|
|
|
|
| |
Support "--build"ing arrays with bitmaps.
hot-removal of bitmaps
--re-add of drives recently removed.
assorted extra tests
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
|
|
|
|
| |
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
|
|
|
|
|
|
|
|
| |
Currently this includes
--write-behind to set level of write-behind supported
--write-mostly to flag devices as write-mostly.
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
|
|
|
|
|
|
|
| |
Assemble would crash, or just not work.
A few other problem found by a new test-suite.
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
|
|
|
|
|
|
| |
Just some carelessness
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
|
|
|
|
| |
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
|
|
|
|
|
|
| |
This is needed to reliably stop stacked arrays
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
|