summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Revert change to handling of -empty-string- metadata.NeilBrown2010-05-312-3/+3
| | | | | | | | | | | | | | | | | | If the metadata is an empty string, it means the array in question does not use metadata. This comes from sysfs_read finding "none" in "metadata_version", then super_by_fd noticing the vers == -1, and so just using the ->text_version (which is empty). In this case we want to use the super0 metadata handler routines because that is what we always used to do before commit 7d5c3964ccfaace123f7b75e15d38c2650e013d8 And that commit was wrong because "" doesn't mean "default" and so should not have been changed at the same time. Reported-by: martin f. krafft <madduck@debian.org> Signed-off-by: NeilBrown <neilb@suse.de>
*-. Merge commit '3288b419b988b20a53a2b12eb8e5f9f536228db4'; commit ↵NeilBrown2010-05-313-26/+33
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '4363fd80bcc9f85ed824228dee5e6350a8d73e18'; commit '63b4aae33ebf00d443378daf313622630f2336c0' * commit '3288b419b988b20a53a2b12eb8e5f9f536228db4': Revert "Incremental: honor --no-degraded to delay assembly" Incremental: honor an 'enough' flag from external handlers * commit '4363fd80bcc9f85ed824228dee5e6350a8d73e18': imsm: robustify recovery-start detection fix: memory leak in mdmon_pid() * commit '63b4aae33ebf00d443378daf313622630f2336c0': mdmon: fix missing open of md/<dev>/recovery_start
| | * mdmon: fix missing open of md/<dev>/recovery_startDan Williams2010-04-291-25/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | When activating a spare we neglect to open recovery_start and as such do not see checkpoint events. Move disk initialization to common routine to mitigate recurrence. Reported-by: Adam Kwolek <adam.kwolek@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * | imsm: robustify recovery-start detectionDan Williams2010-05-261-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | update_recovery_start() assumed that the out-of-sync disk would always be marked as IMSM_ORD_REBUILD in the disk_ord_tbl, but the segmentation fault reported by Andy proves otherwise. This might also be explained by an interrupted rebuild and the disk has not yet been marked missing. https://bugzilla.redhat.com/show_bug.cgi?id=592030 Reported-by: Andy Lutomirski <luto@mit.edu> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * | fix: memory leak in mdmon_pid()Przemyslaw Hawrylewicz Czarnowski2010-05-171-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | devnum2devname() returns pointer to memory allocated with strdup. It must be released to prevent memory leak. Signed-off-by: Przemyslaw Czarnowski <przemyslaw.hawrylewicz.czarnowski@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | | Revert "Incremental: honor --no-degraded to delay assembly"Dan Williams2010-05-263-10/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit fdb482f99b9ad2ef8cd1724902fdfeedaa8796a1. Now that containers can report state for ->container_enough we can automatically determine when the array can be started, and no longer need the --no-degraded hammer. Conflicts: Incremental.c Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | | Incremental: honor an 'enough' flag from external handlersDan Williams2010-05-264-21/+92
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is needed for imsm where: 1/ we want to report raid_disks as zero to allow mdadm -As to incorporate all spares 2/ we can't determine stale disks by looking at the event counts. 3/ we can't see per-subarray expectations with the info returned from the container level ->getinfo_super() Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* | | Monitor: don't report the disappearance of a faulty device as SpareActive.NeilBrown2010-05-181-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Normally Monitor doesn't see faulty devices in active slots - they get moved away too quickly. But if it does, it reports the "faulty device disappeared" event (when it finally does get moved away) as SpareActive due to insufficient checking. So add a better check. Reported-by: Pierre Vignéras <pierre@vigneras.name>
* | | Grow: move error message closer to error cause.NeilBrown2010-05-181-7/+7
|/ / | | | | | | | | | | | | | | A recent change move the sysfs_read call away from the check that it succeeded. This patch moves the check back next to the sysfs_read call. Signed-off-by: NeilBrown <neilb@suse.de>
* | Grow: avoid overflow of chunk sizes.NeilBrown2010-04-291-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | Chunks aren't particularly big, but when you could them in bytes and multiply them together (as we do for calculating the backup size for 'grow') they can overflow a 32bit int. So group the division by 512 more closely with the chunk size so were would need 30Meg chunks to come close to overflowing 32bits. Signed-off-by: NeilBrown <neilb@suse.de>
* | IMSM/DDF: don't recognised these metadata on partitions.NeilBrown2010-04-294-0/+34
|/ | | | | | | | | | | These metadata are not expected on partitions, and they have no way of differentiation whether which is correct if they are found both on the device and on the last partition. So if the device is a partition, refuse to read the metadata. Signed-off-by: NeilBrown <neilb@suse.de>
* Create: cleanup after failed create in duplicated array member caseDan Williams2010-04-195-8/+32
| | | | | | | | | | | | | | | | mdadm prevents creation when device names are duplicated on the command line, but leaves the partially created array intact. Detect this case in the error code from add_to_super() and cleanup the partially created array. The imsm handler is updated to report this conflict in add_to_super_imsm_volume(). Note that since neither mdmon, nor userspace for that matter, ever saw an active array we only need to perform a subset of the cleanup actions. So call ioctl(STOP_ARRAY) directly and arrange for Create() to cleanup the map file rather than calling Manage_runstop(). Reported-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
* Fixup default definitions of VAR_RUN and ALT_RUNDan Williams2010-04-151-2/+2
| | | | | | | | | I suspect commit c132678b wanted VAR_RUN and ALT_RUN to be suffixed by '/mdadm' to match the defaults in mdadm.h. Cc: Luca Berra <bluca@comedia.it> Signed-off-by: Dan Williams <dan.j.williams@intel.com> Signed-off-by: NeilBrown <neilb@suse.de>
* powerpc compile fixDoug Ledford2010-04-071-1/+1
| | | | | Signed-off-by: Doug Ledford <dledford@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
* Don't attempt to create or read bitmaps where the metadata doesn't support it.NeilBrown2010-04-073-2/+16
| | | | | | | 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>
* Merge branch 'HEAD'; commit 'a4b93c9ce4f15217afb8'NeilBrown2010-04-071-0/+46
|\
| * Add ANNOUNCE-3.1.2NeilBrown2010-04-071-0/+46
| | | | | | | | | | | | Forgot to git-add this for the release :-( Signed-off-by: NeilBrown <neil@suse.de>
* | Only signal a udev change event if we actually write a mapfile in RebuildMapDoug Ledford2010-03-241-6/+8
| | | | | | | | Signed-off-by: Doug Ledford <dledford@redhat.com>
* | mapfile: if we putting the mapfile in a custom location via ALT_RUN, allowDoug Ledford2010-03-243-2/+6
| | | | | | | | | | | | a custom filename too. Signed-off-by: Doug Ledford <dledford@redhat.com>
* | Create directory to contain mapfile (Assuming parent exists andDoug Ledford2010-03-242-5/+14
| | | | | | | | | | | | | | | | 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>
* | (no commit message)NeilBrown2010-03-241-1/+6
|/
* Release mdadm-3.1.2NeilBrown2010-03-107-8/+9
|
* tests: adjust sizes for new defaultsNeilBrown2010-03-1017-33/+38
| | | | | | | 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>
* ddf/intel: zero out old metadata before creating a container.NeilBrown2010-03-102-2/+10
| | | | | | | | 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>
* Grow: fix recent breakage - lseek return status.NeilBrown2010-03-101-3/+8
| | | | | | | | | 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>
* Assemble: fix some recently introduced bugs.NeilBrown2010-03-101-10/+17
| | | | | | | | 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>
* Merge branch 'master' of git://github.com/djbw/mdadmNeilBrown2010-03-101-10/+5
|\
| * imsm: kill ->creating_imsm flagDan Williams2010-03-031-6/+4
| | | | | | | | | | | | It is an unused holdover from long since removed functionality. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
| * Revert "Make the IMSM_DEVNAME_AS_SERIAL option work when creating containers."Dan Williams2010-03-031-4/+1
| | | | | | | | | | | | | | 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>
* | Stop: done stop a container which still have members active.NeilBrown2010-03-091-0/+21
| | | | | | | | | | | | Doing that is just confusing... Signed-off-by: NeilBrown <neilb@suse.de>
* | Make sure reshape_active is cleared by getinfo_superNeilBrown2010-03-092-0/+2
| | | | | | | | | | | | There were cases where --detail would report phantom reshapes. Signed-off-by: NeilBrown <neilb@suse.de>
* | mdmon.8: minor manpage updateNeilBrown2010-03-091-0/+5
| | | | | | | | Signed-off-by: NeilBrown <neilb@suse.de>
* | mdadm.8: improve hosthost documentationNeilBrown2010-03-091-0/+19
| | | | | | Signed-off-by: NeilBrown <neilb@suse.de>
* | Grow: fix problem with validating chunk sizeNeilBrown2010-03-091-2/+2
| | | | | | | | | | | | | | 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>
* | Improve partition table code.NeilBrown2010-03-091-21/+49
| | | | | | | | | | | | | | | | | | | | 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>
* | mdadm.8: correct typo: pairtyRyo Fujita2010-03-081-1/+1
|/ | | | Signed-off-by: NeilBrown <neilb@suse.de>
* super1: encourage data alignment on 1Meg boundaryNeilBrown2010-03-031-12/+40
| | | | | | | | | | | | | 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>
* config: add 'homehost' option to 'AUTO' line.NeilBrown2010-03-037-24/+70
| | | | | | 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>
* Manage: fix regression on removing detached devices.NeilBrown2010-03-031-7/+15
| | | | | | | | | | | | 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>
* allow redefinition of VAR_RUNLuca Berra2010-03-032-1/+14
| | | | | | | 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>
* mdmon: Check both RUN directories to find running mdmonNeilBrown2010-03-031-12/+9
| | | | | | | | | | 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>
* mdmon: check select a writable pid_dirLuca Berra2010-03-031-13/+12
| | | | | | | | 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>
* fix mdmon takeoverLuca Berra2010-03-032-3/+3
| | | | | | | | | | | - 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>
* fix mdmon option parsingLuca Berra2010-03-032-7/+19
| | | | | | | | | | | 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>
* Add _FORTIFY_SOURCE to mdadm.O2 build.NeilBrown2010-03-034-20/+44
| | | | | | | | | | 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>
* Fix warning about unused variable.NeilBrown2010-03-031-1/+4
| | | | | | Warning only appears with -O2, but is invalid. Signed-off-by: NeilBrown <neilb@suse.de>
* fix gcc warnings about strict-aliasing rulesNeilBrown2010-03-031-2/+5
| | | | | Original-by: Luca Berra <bluca@comedia.it> Signed-off-by: NeilBrown <neilb@suse.de>
* Assemble: clean up properly if we cannot add the bitmap file.NeilBrown2010-02-241-0/+4
| | | | | | | 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>
* Create: change default metadata type to 1.2NeilBrown2010-02-242-3/+3
| | | | | | | | | | | | | 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>
* Grow: be more relaxed about timestamp mismatches on backup file.NeilBrown2010-02-241-4/+16
| | | | | | | | | 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>