| Commit message (Collapse) | Author | Files | Lines |
|
A metadata update may modify the data structure of the metadata
including freeing things, so it is not safe of the manager to touch
the metadata while an update is pending in the monitor.
So When an update has been submitted, don't do anything else in the
manager until it is complete.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
When we first start an array, it might be good to start recovery
straight away. That requires setting the array to 'dirty', but
only the metadata handler can know if that is required or not.
So have a third possible 'consistent' option to set_array_state.
Either 'no' or 'yes' or 'you choose'.
Return value indicates what was chosen.
'1' (no) should be chosen unless there is a good reason.
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
Transition readauto arrays to active before failing drives.
Hmm... why do we keep reblocking / renotifying in the readonly case?
Need to bottom out on this, but not right now.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
manage_new is too strict in the face of failed devices. Teach it to
monitor degraded arrays.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
1/ Do not assemble !in_sync or failed devices in container_content.
2/ Prevent activation of failed or configured devices in activate_spare.
3/ Be sure to avoid dirty degraded if the array was shutdown cleanly.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
imsm_dev dynamically grows, so dev_idx needs to be moved up in the
definition to avoid getting clobbered.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
With dev->vol.map and mpb->disk entries entering and leaving the parameter
block write_super_imsm needs to update the size before writeback.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
Disks that are not in-sync or failed are not assembled into member
arrays by mdadm. Teach mdmon to resolve this situation by checking for
spares at start. imsm_activate_spare() is updated to prefer devices
that can be re-added versus new spares.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
The option-rom and the Matrix driver mark resyncs/rebuilds with the
migrate state bits. Update sizeof_imsm_dev to allow allocation of
imsm_dev entries large enough to grow if migr_state is later set.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
retrieve map entries from a imsm_dev, and cleanup imsm_copy_dev
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
This poses a small problem for the case of handling multiple raid1 arrays
across separate disk pairs i.e. 2 mirrors on 4 disks. The option-ROM will
configure this as two containers. We may need the capability for one
container to ask for an unused spare in another container. For now spares
will just maintain the affinity established at assemble time.
To support this configuration spare devices must be allowed to be assembled
into the container even though the metadata indicates the disk belongs to a
different family.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
removes the need to lookup the disk by index in a few cases and is a
preparation step for tracking spares outside the current anchor.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
Repair sets MD_RECOVERY_REQUESTED in md which may not result in the
spare device being recovered.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
This is the initial defensive implementation of bad block management
support. It simply precludes assembly if there are entries in the bad
block logs. This is sufficient for now as the conditions that lead to
an entry in the bad block log would cause the array to be failed by MD
(as of 2.6.27).
[dan.j.williams@intel.com: general cleanups]
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
While mdadm is constructing an array mdmon may see an intermediate state
(some disks not yet added / redundancy attributes like sync_action not
available). Waiting for mdstat->active == true ensures that the array
is ready to be handled. This fixes a bug in create array via mdmon
update whereby failures are not detected in the new array.
Introduce aa_ready() to catch cases where the active_array is not
correctly initialized. Barring a kernel bug this should never trigger,
nonetheless it precludes a class of bugs like the one mentioned above
from triggering.
Cleanup the exit paths and only call replace_array when the new array is
ready to be inserted into container->arrays.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
e.g. --raid-disks is preferred over --raid-devices.
Thanks to "Jon Nelson" <jnelson-linux-raid@jamponi.net>
Signed-off-by: NeilBrown <neilb@suse.de>
|
|
drop the previously loaded data as load_imsm_super_all loops through the
disks.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
Maintaining a single global buffer is unwieldly when extending/rewriting
sections of the metadata. Parse the metadata into component data
structures upon reading and coalesce to a coherent buffer before
writing.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
|
|
Also kill setting ->array.size as nothing appears to be using it.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
The cmd_filter patch merged for 2.6.27 broke retrieving the serial
number via an ioctl to /dev/sgN. In debugging this I found that other
utilities like sdparm simply run the ioctl on /dev/sdX. So just convert
to that for protection in numbers, but scream on the mailing list for
the inconvenience grr...
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
Facilitate using loopback devices for the imsm regression suite
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
limp along after seeing mismatched serial numbers
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
Removes the need for the call to ->set_array_state when sync_action
transitions from 'recover' to 'idle'.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
|
|
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>
|
|
Signed-off-by: Doug Ledford <dledford@redhat.com>
|
|
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
Neil rightly points out that imsm_activate_spare may skip valid free space
on a spare, fix this up.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
|
Though it should never bee needed, having a timeout in ping_monitor is
a sensible safeguard.
Signed-off-by: Neil Brown <neilb@suse.de>
|
|
If the array is shutdown as soon as resync finishes, we might not
notice the resync finish. So on array shutdown, check for current
resync pos.
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>
|
|
start_mdmon now waits for mdmon to complete initialisation and,
importantly, listen on the socket, before continuing.
Signed-off-by: Neil Brown <neilb@suse.de>
|
|
Don't retry to remove a newline from the end of an empty string.
Signed-off-by: Neil Brown <neilb@suse.de>
|
|
readlink doesn't nul-terminate the returned string, so we must
be sure to do that.
Signed-off-by: Neil Brown <neilb@suse.de>
|
|
Rather, assume that it is in the same directory from which
mdadm was run. If not, then maybe /sbin or current directory.
Signed-off-by: Neil Brown <neilb@suse.de>
|