| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
The previous method of setting the array_disk variable for a container
would segfault if there were no valid subarrays in the container yet,
which is always true when first using mdadm to create a container.
This made it impossible to create containers using mdadm. So now we
verify that at least one subarray exists before we get the disk
count out of the subarray info. If no subarray exists, then we don't
care about the disk count anyway as there is nothing to be started.
Signed-off-by: Doug Ledford <dledford@redhat.com>
|
|
|
|
|
|
|
| |
are present. This keeps arrays from getting marked as broken in
the superblock and then permanently blocked from being assembled.
Signed-off-by: Doug Ledford <dledford@redhat.com>
|
|
|
|
| |
Signed-off-by: Doug Ledford <dledford@redhat.com>
|
|
|
|
|
|
|
|
|
|
| |
time we'll have it open.
If we weren't able to open the device file, assume the device is gone
already and skip the sysfs_unique_holder test as it is guaranteed to
fail.
Signed-off-by: Doug Ledford <dledford@redhat.com>
|
|
|
|
| |
Signed-off-by: Doug Ledford <dledford@redhat.com>
|
|
|
|
| |
Signed-off-by: Doug Ledford <dledford@redhat.com>
|
|
|
|
| |
Signed-off-by: Doug Ledford <dledford@redhat.com>
|
|
|
|
| |
Signed-off-by: Doug Ledford <dledford@redhat.com>
|
|
|
|
| |
Signed-off-by: Doug Ledford <dledford@redhat.com>
|
|
|
|
| |
Signed-off-by: Doug Ledford <dledford@redhat.com>
|
|
|
|
| |
Signed-off-by: Doug Ledford <dledford@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of overloading different things, create three different directory
definitions: MAP_DIR, MDMON_DIR, and MDMONITOR_DIR. These are the three
places where the respective components will stick their files. There will
no longer be attempts to use more than one place except for the mapfile
which is now limited to only two attempts: MAP_DIR and /var/run.
While fixing this I noticed a couple small bugs that got folded into the
same commit just because I already had most of the edits done by the time
bugs were found:
1) in mdmon.c, we should create the directory with mode 755, not 700.
2) in mdmon.c, don't attempt to remove the MDMON_DIR as it should probably
be on a tmpfs and this is unneeded
3) in mapfile.c, we were attempting to mkdir mapdir[modenum] and that
should have been mapdir[i] as the current filename is indexed by i
Signed-off-by: Doug Ledford <dledford@redhat.com>
|
|
|
|
|
| |
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
| |
In particular, if the relevant bitmap method is NULL, don't try to
call it, print an error instead.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|\ |
|
| |
| |
| |
| |
| |
| | |
Forgot to git-add this for the release :-(
Signed-off-by: NeilBrown <neil@suse.de>
|
| |
| |
| |
| | |
Signed-off-by: Doug Ledford <dledford@redhat.com>
|
| |
| |
| |
| |
| |
| | |
a custom filename too.
Signed-off-by: Doug Ledford <dledford@redhat.com>
|
| |
| |
| |
| |
| |
| |
| |
| | |
filesystem is writable).
This particularly keeps udev happy if VAR_RUN is set to /dev/md.
Signed-off-by: Doug Ledford <dledford@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
|
|/ |
|
| |
|
|
|
|
|
|
|
| |
Default metadata type is now 1.2, and we sometimes
add extra alignment before the data section,
so adjust tests for these changes.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
|
| |
Matching the functionality already in super0 and super1, when
we first create a container, remove any other recognisable metadata to
ensure it doesn't cause confusion.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
|
|
| |
Recent fix to check lseek64 return status got it badly wrong.
It doesn't return 0 on success!!
Fix it.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
|
| |
Found during testing:
- cannot check metadata for homehost before loading metadata.
- As 1.x metadata can has a state 'rebuilding' between
'spare' and 'ok', we need to include that in our calculations.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|\ |
|
| |
| |
| |
| |
| |
| | |
It is an unused holdover from long since removed functionality.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
| |
| |
| |
| |
| |
| |
| | |
This reverts commit 9ef5dbff4adc7979102e71efe8efd83d8e0dc775 as it is
duplicating the check that is done internal to imsm_read_serial().
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
| |
| |
| |
| |
| |
| | |
Doing that is just confusing...
Signed-off-by: NeilBrown <neilb@suse.de>
|
| |
| |
| |
| |
| |
| | |
There were cases where --detail would report phantom reshapes.
Signed-off-by: NeilBrown <neilb@suse.de>
|
| |
| |
| |
| | |
Signed-off-by: NeilBrown <neilb@suse.de>
|
| |
| |
| | |
Signed-off-by: NeilBrown <neilb@suse.de>
|
| |
| |
| |
| |
| |
| |
| | |
When checking if the new chunk size fit in the component size
we were confusing sectors and K, and so getting it wrong.
Signed-off-by: NeilBrown <neilb@suse.de>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Code to check partition tables used some needless casts
and was broken, using a u8 when a u32 was wanted.
So create structure describing the tables rather than using offset,
and read into those tables instead.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|/
|
|
| |
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
For 1.1 and 1.2 metadata where data_offset is not zero,
it is important to align the data_offset to underlying
block size.
We don't currently have access to the particular device
in avail_size so just try to force to a 1Meg boundary.
Also default 1.x metadata to 1.2 as documented.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
| |
This allows basing auto-assembly decisions on whether
the array is recorded as belonging to this host or not.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
| |
If /dev is static, a name may remain there after the
device has been detached from the system.
Using 'mdadm' to remove such a device from the array
should still work (even though "mdadm --remove detached"
might be preferred).
So when processing a device for '-r', don't insist on
being able to open the device.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
| |
having mdmon socket under var is painful at shutdown time
Signed-off-by: Luca Berra <bluca@comedia.it>
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
|
|
|
| |
If mdmon is run without "--takeover", it should still
check both *_RUN directories for a valid 'pid' file
to guard against having two mdmons running at the same time.
Suggested-by: Luca Berra <bluca@comedia.it>
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
|
| |
Check that either VAR_DIR or ALT_DIR is actually writable before
selecting it.
Signed-off-by: Luca Berra <bluca@comedia.it>
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
|
|
|
|
| |
- when we waited for the old mdmon to exit, we didn't look
for the socket in the right place
- when we failed to find a pid file, we returned the wrong
value (code expected <0, but got ==0).
Signed-off-by: Luca Berra <bluca@comedia.it>
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
|
|
|
|
| |
running mdmon --takeover --all resulted in a segfault.
Also allow "--all" to be longer so that e.g. md_d127 can
successfully over-write it in the argument list visible
to 'ps'.
Signed-off-by: Luca Berra <bluca@comedia.it>
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
|
|
|
| |
When building mdadm.O2, set _FORTIFY_SOURCE to get more
warnings, and also build mdmon.O2 to find warnings in that
code too.
Then fix the warnings.
Suggested-by: Luca Berra <bluca@comedia.it>
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
| |
Warning only appears with -O2, but is invalid.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
| |
Original-by: Luca Berra <bluca@comedia.it>
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
| |
If we find we cannot add the requested bitmap file when
assembling the array, then make sure to clean up properly
and don't leave a half-configured array.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Change default - again, sorry.
v1.1 causes problems as the conflicts with a boot sector, whether on
the whole device or in a partition. I guess the rule is they you
aren't allowed to use the first sector in general.
v1.2 is mostly just as good and avoid boot-sector problems so default
to that instead.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
|
|
| |
As backup file has a timestamp which is updated quite separately
from the metadata timestamp. They should be largely in-sync but
sometimes are not.
So be more generous in the check, and allow it to be over-ridden
by an environment variable.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
If --assemble is given a container and some other devices to assemble
an array from, it complains with an error because that doesn't make
sense.
However it currently also complains if the list of devices was extract
from the config file rather than being given on the command line.
That is not appropriate.
So add an '&& inargv' test to ensure that we are really complaining
about the right thing.
Signed-off-by: NeilBrown <neilb@suse.de>
Acked-by: Dan Williams <dan.j.williams@intel.com>
|