From 80762580fa5664feb5cd1fb8f5636e52b62401db421c6a39e15e00f801c3bfbd Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Wed, 10 Jan 2007 16:49:57 +0000 Subject: [PATCH 01/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=1 --- 64-md-raid.rules | 35 --- boot.md | 44 ++-- mdadm-2.5.3-infoname.diff | 11 + mdadm-2.5.3.tar.bz2 | 3 + mdadm-3.0.3.tar.bz2 | 3 - mdadm.changes | 480 +------------------------------------- mdadm.spec | 242 ++++++++++++++----- mdadmd | 4 +- mdrun | 147 ++++++++++++ mkinitrd-boot.sh | 88 ------- mkinitrd-setup.sh | 92 -------- raidautorun.c | 16 ++ ready | 0 sysconfig.mdadm | 7 + 14 files changed, 398 insertions(+), 774 deletions(-) delete mode 100644 64-md-raid.rules create mode 100644 mdadm-2.5.3-infoname.diff create mode 100644 mdadm-2.5.3.tar.bz2 delete mode 100644 mdadm-3.0.3.tar.bz2 create mode 100644 mdrun delete mode 100644 mkinitrd-boot.sh delete mode 100644 mkinitrd-setup.sh create mode 100644 raidautorun.c create mode 100644 ready diff --git a/64-md-raid.rules b/64-md-raid.rules deleted file mode 100644 index deccce4..0000000 --- a/64-md-raid.rules +++ /dev/null @@ -1,35 +0,0 @@ -# do not edit this file, it will be overwritten on update - -SUBSYSTEM!="block", GOTO="md_end" -ACTION!="add|change", GOTO="md_end" - -# import data from a raid member and activate it -ENV{ID_FS_TYPE}=="linux_raid_member", PROGRAM="grep -qs '^AUTO -all' /etc/mdadm.conf", IMPORT{program}="/sbin/mdadm --examine --export $tempnode", RUN+="/sbin/mdadm --incremental $env{DEVNAME}" -# import data from a raid set -KERNEL!="md*", GOTO="md_end" - -# container devices have a metadata version of e.g. 'external:ddf' and -# never leave state 'inactive' -ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" -ATTR{md/array_state}=="|clear|inactive", GOTO="md_end" -LABEL="md_ignore_state" - -IMPORT{program}="/sbin/mdadm --detail --export $tempnode" -ENV{DEVTYPE}=="disk", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}", OPTIONS+="string_escape=replace" -ENV{DEVTYPE}=="disk", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}" -ENV{DEVTYPE}=="disk", ENV{MD_DEVNAME}=="?*", SYMLINK+="md/$env{MD_DEVNAME}" - -ENV{DEVTYPE}!="partition", GOTO="md_vol_id" -IMPORT{program}="/sbin/mdadm --detail --export %r/$parent" -ENV{DEVTYPE}=="partition", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}-part%n", OPTIONS+="string_escape=replace" -ENV{DEVTYPE}=="partition", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}-part%n" -ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[^0-9]", SYMLINK+="md/$env{MD_DEVNAME}%n" -ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[0-9]", SYMLINK+="md/$env{MD_DEVNAME}p%n" - -LABEL="md_vol_id" -IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -OPTIONS+="link_priority=100" -ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" -ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" - -LABEL="md_end" diff --git a/boot.md b/boot.md index 5e201e5..be9b8bb 100644 --- a/boot.md +++ b/boot.md @@ -22,9 +22,7 @@ ### BEGIN INIT INFO # Provides: boot.md # Required-Start: boot.udev boot.rootfsck -# Required-Stop: $null -# Should-Start: boot.scsidev boot.multipath -# Should-Stop: boot.scsidev boot.multipath +# X-SUSE-Should-Start: boot.scsidev boot.multipath # Default-Start: B # Default-Stop: # Short-Description: Multiple Device RAID @@ -77,11 +75,13 @@ rc_reset # considered a success. mdadm_BIN=/sbin/mdadm +mdrun_BIN=/sbin/mdrun +raidautorun_BIN=/sbin/raidautorun mdadm_CONFIG="/etc/mdadm.conf" mdadm_SYSCONFIG="/etc/sysconfig/mdadm" # udev integration -if [ -x /sbin/udevadm ] ; then +if [ -x /sbin/udevsettle ] ; then [ -z "$MDADM_DEVICE_TIMEOUT" ] && MDADM_DEVICE_TIMEOUT=60 else MDADM_DEVICE_TIMEOUT=0 @@ -98,14 +98,6 @@ case "$1" in start) echo -n "Starting MD Raid " - # create the /var/run/mdadm symlink if needed - mkdir -p /dev/.mdadm - if test ! /dev/.mdadm -ef /var/run/mdadm; then - rm -rf /var/run/mdadm - ln -s /dev/.mdadm /var/run/mdadm - fi - # restart mdmon (exits silently if there is nothing to monitor) - /sbin/mdmon /proc/mdstat / # Check for existence of needed config file and read it [ -r $mdadm_SYSCONFIG ] || _rc_exit 6 "... $mdadm_SYSCONFIG not existing " @@ -116,25 +108,31 @@ case "$1" in # Check for missing binaries (stale symlinks should not happen) [ -x $mdadm_BIN ] || _rc_exit 5 "... $mdadm_BIN not installed " + [ -x $mdrun_BIN ] || _rc_exit 5 "... $mdrun_BIN not installed " # Try to load md_mod - [ ! -f /proc/mdstat -a -x /sbin/modprobe ] && /sbin/modprobe md_mod + [ ! -f /proc/mdstat -a -x /sbin/modprobe ] && /sbin/modprobe -k md_mod 2>&1 | : [ -f /proc/mdstat ] || _rc_exit 5 "... no MD support in kernel " # Wait for udev to settle if [ "$MDADM_DEVICE_TIMEOUT" -gt 0 ] ; then - /sbin/udevadm settle --timeout="$MDADM_DEVICE_TIMEOUT" + /sbin/udevsettle --timeout="$MDADM_DEVICE_TIMEOUT" fi - if ! grep -qs '^[^#]*[^[:blank:]#]' $mdadm_CONFIG; then - # empty or missing /etc/mdadm.conf, "unused" - rc_status -u - else - $mdadm_BIN -A -s -c $mdadm_CONFIG - # a status of 2 is not an error - test $? -eq 0 -o $? -eq 2 - rc_status -v + # Fallback to raidautorun / mdrun when $mdadm_CONFIG missing + # or mdadm exits with an error + [ "$BOOT_MD_USE_MDADM_CONFIG" = "yes" -a -s "$mdadm_CONFIG" ] + [ $? = 0 ] && { $mdadm_BIN -A -s -c $mdadm_CONFIG || rc_failed 1; } + if [ $? != 0 ]; then + if test -b /dev/md0; then + $raidautorun_BIN + else + $mdrun_BIN + fi fi + + # Remember status and be verbose + rc_status -v ;; stop) echo -n "Shutting down MD Raid " @@ -152,5 +150,3 @@ case "$1" in ;; esac rc_exit - -# vim:ft=sh diff --git a/mdadm-2.5.3-infoname.diff b/mdadm-2.5.3-infoname.diff new file mode 100644 index 0000000..8df4e75 --- /dev/null +++ b/mdadm-2.5.3-infoname.diff @@ -0,0 +1,11 @@ +--- super1.c ++++ super1.c +@@ -538,7 +538,7 @@ + strncpy(info->name, c+1, 31 - (c-sb->set_name)); + else + strncpy(info->name, sb->set_name, 32); +- info->name[33] = 0; ++ info->name[32] = 0; + } + if (strcmp(update, "name") == 0) { + if (info->name[0] == 0) diff --git a/mdadm-2.5.3.tar.bz2 b/mdadm-2.5.3.tar.bz2 new file mode 100644 index 0000000..80125b9 --- /dev/null +++ b/mdadm-2.5.3.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:22e8364dcc528b1e5e4ee8f25ef4a6f0e9c648f1f1d2d7dbe688c929a3369672 +size 135019 diff --git a/mdadm-3.0.3.tar.bz2 b/mdadm-3.0.3.tar.bz2 deleted file mode 100644 index 00e1e12..0000000 --- a/mdadm-3.0.3.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b51a52aebfb83b09ae7faee9eebb4d49a7ad27767bcc9569079df62c7d510599 -size 257554 diff --git a/mdadm.changes b/mdadm.changes index 5b5d3f3..06f97c7 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,472 +1,3 @@ -------------------------------------------------------------------- -Thu Mar 11 10:18:18 CET 2010 - mmarek@suse.cz - -- 64-md-raid.rules: Use blkid instead of vol_id. - -------------------------------------------------------------------- -Thu Mar 11 09:58:21 CET 2010 - mmarek@suse.cz - -- 64-md-raid.rules: Allow --incremental assembly if "AUTO -all" is - given in mdadm.conf (fate#307478). - -------------------------------------------------------------------- -Tue Mar 9 16:15:41 CET 2010 - mmarek@suse.cz - -- Install udev rules in /lib/udev/rules.d (fate#307478). - -------------------------------------------------------------------- -Mon Feb 22 15:14:03 CET 2010 - mmarek@suse.cz - -- mkinitrd-setup.sh: call mdadm --scan only if necessary - (bnc#581769). - -Fri Jan 15 17:37:26 CET 2010 - mmarek@suse.cz - -- fix modprobe invocation in boot.md (bnc#565293). - -------------------------------------------------------------------- -Fri Jan 15 17:04:06 CET 2010 - mmarek@suse.cz - -- store mdmon runtime files in /dev/.mdadm, to make it easier to - transfer mdmon from the initrd to the real root. -- rework the mkinitrd setup script a bit. - -------------------------------------------------------------------- -Wed Jan 6 15:47:03 CET 2010 - mmarek@suse.cz - -- mkinitrd-*.sh: fix booting from partitionable md devices and - from container devices (bnc#565219). - -------------------------------------------------------------------- -Tue Dec 15 20:26:46 CET 2009 - jengelh@medozas.de - -- enable parallel building - -------------------------------------------------------------------- -Fri Dec 4 18:00:40 CET 2009 - mmarek@suse.cz - -- Support for partitionable md devices in mkinitrd scripts - (fate#305883). - -------------------------------------------------------------------- -Tue Nov 3 11:03:54 CET 2009 - mmarek@suse.cz - -- update to 3.0.3 (fate#307159) - * mdmon improvements (needed for fate#306823) - * other fixes - -------------------------------------------------------------------- -Fri Oct 30 16:49:40 CET 2009 - mmarek@suse.cz - -- mkinitrd-boot.sh: add /sbin/mdmon to the initrd (fate#306823). - -------------------------------------------------------------------- -Thu Oct 1 10:51:38 CEST 2009 - mmarek@suse.cz - -- updated to 3.0.2 + 2 patches - * bugfixes only - -------------------------------------------------------------------- -Fri Jun 12 09:43:43 CEST 2009 - mmarek@suse.cz - -- remove static md* device nodes, they should not be needed - anymore. - -------------------------------------------------------------------- -Thu Jun 11 11:32:55 CEST 2009 - mmarek@suse.cz - -- updated to 3.0 final -- dropped all patches - -------------------------------------------------------------------- -Tue Mar 3 10:36:11 CET 2009 - mmarek@suse.cz - -- super0: Do all metadata IO with 4096byte alignment -- super1 - do metadata IO in sector_size units. - (bnc#466172) - - -------------------------------------------------------------------- -Sat Feb 21 15:37:55 CET 2009 - mmarek@suse.cz - -- mkinitrd-setup.sh: filter out duplicate devices (bnc#461673, - patch by Xin Wei Hu) - -------------------------------------------------------------------- -Tue Feb 17 17:01:23 CET 2009 - mmarek@suse.cz - -- disable auto-assemly in boot.md completely as it can collide with - dmraid (bnc#474652). If someone wants to auto-assemble md arrays - in the rescue system, they can run - 'mdadm -Es -c partitions >mdadm.conf && mdadm -As -c mdadm.conf' - manually. - - -------------------------------------------------------------------- -Mon Feb 16 16:00:11 CET 2009 - mmarek@suse.cz - -- fix segfault when stopping imsm arrays - (bnc#473947, patch by Dan Williams) - -------------------------------------------------------------------- -Mon Jan 26 11:47:59 CET 2009 - ro@suse.de - -- change fillup call from "-Y" to "-y" the boot script has - been present in this package for long enough (SLES10-GA) - -------------------------------------------------------------------- -Fri Dec 5 10:21:10 CET 2008 - hare@suse.de - -- Wait for udev to settle before continuing (bnc#435778) - -------------------------------------------------------------------- -Fri Dec 5 06:18:44 CET 2008 - nfbrown@suse.de - -- boot.md : an exit status of '2' from "mdadm --assemble" - should not be seen as failure by boot.md. - It happens if one or more arrays is already - assembled. - (bnc#456028) - -------------------------------------------------------------------- -Thu Nov 20 07:07:06 CET 2008 - nfbrown@suse.de - -- don-t-auto-assemble-if-any-arrays-are-list.patch - Avoid assembling extra arrays during initrd - processing. bnc#445438 - -------------------------------------------------------------------- -Thu Nov 20 04:57:30 CET 2008 - nfbrown@suse.de - -- mdmon-pass-symbolic-name-to-mdmon-instead-of-device.patch - avoid problems if mdmon is run before - udev creates any devices. - -------------------------------------------------------------------- -Fri Nov 14 05:33:41 CET 2008 - nfbrown@suse.de - -- intel.fixes.patch : various fixes from intel for - proper handling of their metadata -- name.fixes.patch : various fixes for new handling - of device names - one could cause a crash. - -------------------------------------------------------------------- -Sun Nov 9 23:38:39 CET 2008 - ro@suse.de - -- fix patch apply depth - -------------------------------------------------------------------- -Fri Nov 7 12:34:30 CET 2008 - nfbrown@suse.de - -- mdadm-auto-assemble.patch - fix various bugs in - auto-assemble -- start-kpartx-for-imsm-devices.patch - IMSM devices - need to be partitioned, and may programs including - YaST don't understand partitioned md devices, - so run kpartx to create 'dm' based partitions which - have a better chance for being understood - This relates to FATE#304220 - -------------------------------------------------------------------- -Fri Nov 7 10:32:35 CET 2008 - ro@suse.de - -- remove udev rule (conflicting with file in udev package) - -------------------------------------------------------------------- -Fri Nov 7 02:58:40 CET 2008 - ro@suse.de - -- buildfix: add missing DESTDIR to Makefile for udev rule -- fix len in snprintf to silence compiler warning about potential - overflow - -------------------------------------------------------------------- -Thu Nov 6 03:22:50 CET 2008 - nfbrown@suse.de - -- Update from mdadm-3.0-devel1 to mdadm-3.0-devel2. - This includes various bug fixes and enhancements to the - extent that DDF and IMSM work reasonably well and can be - auto-assembled much like other arrays. -- Allow BOOT_MD_USE_MDADM_CONFIG to have the value 'part' - that, like 'no', arrays are auto-assembled. However they - get assembled as 'mdp' partitionable arrays where possible. - This currently only affect arrays with v1.x metadata. - This supports FATE#303894 - -------------------------------------------------------------------- -Fri Oct 3 15:28:49 CEST 2008 - mmarek@suse.cz - -- fixed mdmon's clone_monitor on ia64 - -------------------------------------------------------------------- -Fri Oct 3 14:28:55 CEST 2008 - mmarek@suse.cz - -- fixed byte swapping in super-intel.c on big endian. - -------------------------------------------------------------------- -Wed Sep 24 18:24:25 CEST 2008 - ro@suse.de - -- change "udevsettle" to "udevadm settle" - -------------------------------------------------------------------- -Fri Sep 19 11:14:05 CEST 2008 - mmarek@suse.cz - -- added /var/run/mdadm for mdmon -- fixed build - -------------------------------------------------------------------- -Thu Sep 18 09:33:19 CEST 2008 - nfbrown@suse.de - -- update to mdadm-3.0-devel1 - package version number is set to 3.0 to avodi future confusion. - This is a substantial update that provides support for handling - the metadata entirely in userspace and thus making easier to - handle a variety of metadata formats. Support is included for - DDF and for the Intel Matrix metadata used by recent ICH chipsets. - - An extra program 'mdmon' is needed and included. It is run to - monitor any array using 'external' (to the kernel) metadata - and will update the metadata in response to device failures etc. - - This is required for FATE 304219 - - -------------------------------------------------------------------- -Wed Sep 3 11:09:34 CEST 2008 - hare@suse.de - -- Call mkinitrd_setup during %post and %postun (bnc#413709) - -------------------------------------------------------------------- -Sun Aug 17 08:04:26 CEST 2008 - aj@suse.de - -- Fix init scripts. - -------------------------------------------------------------------- -Wed Jul 23 15:21:59 CEST 2008 - hare@suse.de - -- Include mkinitrd scriptlets. - -------------------------------------------------------------------- -Fri Jun 20 14:28:20 CEST 2008 - mmarek@suse.cz - -- updated to 2.6.7 + fixes from git - * Avoid segfault when parsing /proc/mdstat with auto-read-only - arrays. - * For v0.90 superblocks, print the 'Events' count as a real - count, not 2 numbers separated by a dot. - * Allow creation of a RAID6 with exactly one missing device. - * Use LOG_PID for syslog, so you get the pid of mdadm in the - log files. - * --export now works with --examine too (not just --detail) - * Improve auto-creation of device special file when using - --incremental - * Simple locking for --incremental so mdadm doesn't get - confused when run concurrently with itself. - * Make --incremental cope better with arrays that are being - reshaped. - * Fix autoassemble for stack arrays. -- remove /tmp/mdadm.conf in boot.md (bnc#401138) - -------------------------------------------------------------------- -Wed Apr 30 15:57:14 CEST 2008 - mmarek@suse.cz - -- added some fixes from Neil's git repo, fixing bnc#368704 among - others - -------------------------------------------------------------------- -Mon Feb 4 19:24:54 CET 2008 - mmarek@suse.cz - -- correctly display rc_status in boot.md - -------------------------------------------------------------------- -Wed Jan 23 15:55:24 CET 2008 - mmarek@suse.cz - -- fixed auto-assembly part of boot.md - * if /etc/mdadm.conf is empy or only contains whitespace or - comments, no autoassembly is done - * remove /tmp/mdadm.conf even if a directory [#329678] -- dropped mdrun and raidautorun (no longer needed) - -------------------------------------------------------------------- -Wed Oct 24 17:08:11 CEST 2007 - mmarek@suse.cz - -- updated to 2.6.4 - * Make "--create --auto=mdp" work for non-standard device names. - * Fix restarting of a 'reshape' if it was stopped in the middle. - * Fix a segfault when using v1 superblock. - * Make --write-mostly effective when re-adding a device to an - array. - * Various minor fixes -- changes in 2.6.3: - * allow --write-behind to be set for --grow. - * When adding new disk to an array, don't reserve so much bitmap - space that the disk cannot store the required data. (Needed - when 1.x array was created with older mdadm). - * When adding a drive that was a little too small, we did not get - the correct error message. - * Make sure that if --assemble find an array in the critical - region of a reshape, and cannot find the critical data to - restart the reshape, it gives an error message. - * Fix segfault with '--detail --export' and non-persistent - superblocks. - * Various manpage updates. - * Improved 'raid4' support (--assemble, --monitor) - * Option parsing fixes w.r.t -a - * Interpret "--assemble --metadata=1" to allow any version 1.x - metadata, and be more specific in the "metadata=" message - printed with --examine --brief - * Fix spare migration in --monitor. - -------------------------------------------------------------------- -Fri Jul 27 13:01:01 CEST 2007 - mmarek@suse.cz - -- changes to the init script [#288454] - * don't try to autoassemble if /etc/mdadm.conf exists (even an - empty one) - * ony autoassemble partitions found in /proc/partitions - -------------------------------------------------------------------- -Fri Jul 13 15:02:21 CEST 2007 - mmarek@suse.cz - -- updated to 2.6.2 - * --fail detached and --remove faulty can be used to fail and - remove devices that are no longer physically present. - * --export option for --detail or present information in a format - that can be processed by udev. - * fix internal bitmap allocation problems with v1.1, v1.2 - metadata. - * --help now goes to stdout so you can direct it to a pager. - * Various manpage updates. - * Make "--grow --add" for linear arrays really work. - * --auto-detect to trigger in-kernel autodetect. - * Make return code for "--detail --test" more reliable. Missing - devices as well as failed devices cause an error. -- added some fixes from Neil's git repo (mdadm-git-fixes.patch) - -------------------------------------------------------------------- -Thu Jun 21 15:58:37 CEST 2007 - adrian@suse.de - -- fix changelog entry order - -------------------------------------------------------------------- -Mon Apr 2 15:00:10 CEST 2007 - mmarek@suse.cz - -- updated to 2.6.1 - * --monitor was producing some meaningless warnings due to a bug. - * Fix some compiler warnings. - * Fully support --grow for raid6. If a reshape crashed during - the critical period, mdadm wouldn't restore the Q information - properly. - * Update documentation for --grow. - * Report bitmap status in --detail and --examine - * Default to v1 superblocks instead of v0.90 if the array - is too big for 0.90 to handle. - * Sort the output of "mdadm --detail --scan" so that it is - in a suitable order for assembling arrays. i.e. components come - before an array that they are part of. - * Require bitmap files to have a '/' in their name. - * Rewrite 'reshape' support including performing a backup - of the critical region for a raid5 growth, and restoring that - backup after a crash. - * Put a 'canary' at each end of the backup so a corruption - can be more easily detected. - * Support --backup-file for backing-up critical section during - growth. - * Erase old superblocks (of different versions) when creating new - array. - * Allow --monitor to work with arrays with >28 devices - * Report reshape information in --detail - * Handle symlinks in /dev better - * Fix mess in --detail output which a device is missing. - * Support 'bitmap=' in mdadm.conf for auto-assembling arrays with - write-intent bitmaps in separate files. - * Fix alignment problem in version-1 superblocks. - NOTE: This is an incompatable change affecting raid5 reshape. - If you want to reshape a raid5 using version-1 superblocks, - use 2.6.17-rc2 or later, and mdadm-2.4.1 or later. - * Support 'mailfrom' line in mdadm.conf so the From: line in alert - emails can be explicitly set. - * Arrange that SparesMissing (which is similar in import to - DegradedArray) generates an Email. - * Assume "DEVICE partitions" if no DEVICE line is given. - * Support new 'offset' layout for raid10. - * When creating a bitmap file, choose a chunksize to limit number - of bitmap chunks to 2 million. More than this can cause kmalloc - failure. - * New 'CREATE' line in mdadm.conf for defaults such as owner, group, - mode and auto-flag - * --detail checks if array has been started or not and includes that - in report. - * When using --update=uuid on an array with a bitmap, update the - bitmap's uuid too. - * Add a copy of /proc/mdstat to the mail message sent by mdadm - --monitor. - * New flag --no-degraded to avoid starting arrays if there are - fewer devices available than last time the array was started. - This is only needed with --scan, as with --scan, that behaviour - is the default. - * Support for 'homehost' concept. This is a fairly major update. - It includes a configfile option and a command line option for - specifying a homehost, records that host in the superblock, - and reports the homehost where possible. - * Support for Auto Assembly. "mdadm -As" will, if provided with - the name of a homehost, try to assemble all arrays it can find - that were created for that homehost. See man pages for more details. - * Don't try to create devices with --manage or --grow - * allow default metadata (superblock) type to be specified - in mdadm.conf - * Avoid some misdetection of overlapping partitions - * Add 'Array Slot' line to --examine for version-1 superblocks - to make it a bit easier to see what is happening. - * Work around bug in --add handling for version-1 superblocks - in 2.6.17 (and prior). - * Make -assemble a bit more resilient to finding strange - information in superblocks. - * When creating devices in /dev/md/ create matching symlinks - from /dev. e.g. /dev/md0 -> /dev/md/0. - Allow this to be disabled in mdadm.conf or on command line. - * Allow a number (of partitions) after the 'yes' option to --auto= - This is particularly useful in the 'create' line in mdadm.conf. - * Remove partitions from any whole device that is made part of - an md array. This is a work-around for annoying messages - when the first block on some drive accidentally looks like a - partition table. - * Close stray fd in mdassemble so that it can assemble stacked - devices - * If mdassemble finds an array already assembled, it marks it - read-write. - * Remove error in md_open if array is already active. This isn't - needed and gets in the ways if an array was created e.g. in - initramfs, but device doesn't yet exist in /dev. - * When --assemble --scan is run, if all arrays that could be found - have already been started, don't report an error. - * Allow --assemble --force to mark a raid6 clean when it has two - missing devices (which is needed else if won't assemble. - Without this fix it would only assemble if one or zero - missing devices. - * Support --update=devicesize for cases where the underlying device - can change size. - * Default to --auto=yes so the array devices with 'standard' names - get created automatically, as this is almost always what is wanted. - * Give useful message if raid4/5/6 cannot be started because it is - not clean and is also degraded. - * Increase raid456 stripe cache size if needed to --grow the array. - The setting used unfortunately requires intimate knowledge of the - kernel, and it not reset when the reshape finishes. - * Change 'Device Size' to 'Used Dev Size' because it only shows how - much of each device is actually used, not how big they are. - * --wait or -W will wait for resync activity to finish on the given - devices. - * If two drives in a raid5 disappear at the same time, then "-Af" - will add them both in rather than just one and forcing the array - to 'clean'. This is slightly safer in some cases. - * Don't hold md device open for so long in --monitor mode - map_dev - can be slow and interferes with trying to stop the array. - * Support --uuid= with --create to choose your own UUID. - * New major more "--incremental" for incremental assemble of arrays, - intended for use with udev. - * lots of bugfixes - * manpage updates - ------------------------------------------------------------------- Wed Jan 10 11:58:14 CET 2007 - mmarek@suse.cz @@ -724,16 +255,16 @@ Mon Dec 2 11:30:52 CET 2002 - fehr@suse.de - Fix for new glibc/gcc -------------------------------------------------------------------- -Tue Sep 17 17:34:28 CEST 2002 - ro@suse.de - -- removed bogus self-provides - ------------------------------------------------------------------- Mon Sep 13 15:10:00 CEST 2002 - lmb@suse.de - Fix for 64bit arch; ioctl returns long instead of int (#20339) +------------------------------------------------------------------- +Tue Sep 17 17:34:28 CEST 2002 - ro@suse.de + +- removed bogus self-provides + ------------------------------------------------------------------- Fri Aug 23 11:16:51 MEST 2002 - lmb@suse.de @@ -755,3 +286,4 @@ Mon Aug 5 16:05:19 CEST 2002 - fehr@suse.de - make SuSE package from version 1.0.1 of mdadm +------------------------------------------------------------------- diff --git a/mdadm.spec b/mdadm.spec index 2848587..9fc3f1c 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -1,33 +1,25 @@ # -# spec file for package mdadm (Version 3.0.3) +# spec file for package mdadm (Version 2.5.3) # -# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. +# This file and all modifications and additions to the pristine +# package are under the same license as the package itself. # -# All modifications and additions to the file contributed by third parties -# remain the property of their copyright owners, unless otherwise agreed -# upon. The license for this file, and modifications and additions to the -# file, is the same license as for the pristine package itself (unless the -# license for the pristine package is not an Open Source License, in which -# case the license is the MIT License). An "Open Source License" is a -# license that conforms to the Open Source Definition (Version 1.9) -# published by the Open Source Initiative. - # Please submit bugfixes or comments via http://bugs.opensuse.org/ # # norootforbuild - Name: mdadm -Version: 3.0.3 -Release: 3 -BuildRequires: sgmltool +Version: 2.5.3 +Release: 20 +BuildRequires: opensp sgmltool PreReq: %fillup_prereq %insserv_prereq Obsoletes: raidtools -AutoReqProv: on +Autoreqprov: on Group: System/Base -License: GPLv2+ -Url: http://www.kernel.org/pub/linux/utils/raid/mdadm/ +License: GNU General Public License (GPL) +URL: http://www.cse.unsw.edu.au/~neilb/source/mdadm/ Summary: Utility for Configuring MD Setup BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: %{name}-%{version}.tar.bz2 @@ -35,9 +27,9 @@ Source1: Software-RAID.HOWTO.tar.bz2 Source2: sysconfig.mdadm Source3: mdadmd Source4: boot.md -Source5: mkinitrd-setup.sh -Source6: mkinitrd-boot.sh -Source7: 64-md-raid.rules +Source5: mdrun +Source6: raidautorun.c +Patch: %{name}-%{version}-infoname.diff %description Mdadm is a program that can be used to control Linux md devices. It is @@ -48,14 +40,16 @@ programs but with a very different interface. Authors: -------- - Neil Brown + Neil Brown %prep %setup -q -a1 +%patch %build %{suse_update_config -f} -make %{?jobs:-j%jobs} CXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -Wno-error" +make CXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -Wno-error" +gcc $RPM_OPT_FLAGS %{S:6} -o raidautorun cd Software-RAID.HOWTO sgml2html Software-RAID.HOWTO.sgml sgml2txt Software-RAID.HOWTO.sgml @@ -65,35 +59,16 @@ make install DESTDIR=$RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT%{_var}/adm/fillup-templates install -d $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}/init.d} install -d $RPM_BUILD_ROOT/lib/udev/devices +install -m 755 %{S:5} raidautorun $RPM_BUILD_ROOT/sbin/ install -m 755 %{S:4} %{S:3} $RPM_BUILD_ROOT%{_sysconfdir}/init.d/ -install -d $RPM_BUILD_ROOT/lib/mkinitrd/scripts -install -m 755 %{S:5} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/setup-md.sh -install -m 755 %{S:6} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/boot-md.sh install -m 644 %{S:2} $RPM_BUILD_ROOT%{_var}/adm/fillup-templates/ ln -sf ../../etc/init.d/mdadmd $RPM_BUILD_ROOT/%{_sbindir}/rcmdadmd -rm -rf $RPM_BUILD_ROOT/var/run/mdadm -mkdir -p $RPM_BUILD_ROOT/var/run -ln -s mdadm $RPM_BUILD_ROOT/var/run/mdadm -install -d $RPM_BUILD_ROOT/lib/udev/rules.d -install -m 644 %_sourcedir/64-md-raid.rules $RPM_BUILD_ROOT/lib/udev/rules.d %post -[ -x /sbin/mkinitrd_setup ] && mkinitrd_setup -%{fillup_and_insserv -y boot.md} -mkdir -p /dev/.mdadm -# replace the /var/run/mdadm directory (installed by sle11/11.1) with -# a symlink pointing to /dev/.mdadm. Do not do this when /var/run/mdadm is -# not empty, let /etc/init.d/boot.md do it at the next reboot. -if test -e /var/run/mdadm -a ! /var/run/mdadm -ef /dev/.mdadm; then - if ! rmdir /var/run/mdadm 2>/dev/null; then - exit 0 - fi - ln -s /dev/.mdadm /var/run/mdadm -fi +%{fillup_and_insserv -Y boot.md} %postun %restart_on_update mdadmd -[ -x /sbin/mkinitrd_setup ] && mkinitrd_setup %{insserv_cleanup} %preun @@ -105,21 +80,176 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %attr(0755,root,root) %config %{_sysconfdir}/init.d/* -%doc COPYING ChangeLog README.initramfs TODO mdadm.conf-example mkinitramfs +%attr(640,root,disk) %dev(b,9,0) /lib/udev/devices/md0 +%attr(640,root,disk) %dev(b,9,1) /lib/udev/devices/md1 +%attr(640,root,disk) %dev(b,9,2) /lib/udev/devices/md2 +%attr(640,root,disk) %dev(b,9,3) /lib/udev/devices/md3 +%attr(640,root,disk) %dev(b,9,4) /lib/udev/devices/md4 +%attr(640,root,disk) %dev(b,9,5) /lib/udev/devices/md5 +%attr(640,root,disk) %dev(b,9,6) /lib/udev/devices/md6 +%attr(640,root,disk) %dev(b,9,7) /lib/udev/devices/md7 +%attr(640,root,disk) %dev(b,9,8) /lib/udev/devices/md8 +%attr(640,root,disk) %dev(b,9,9) /lib/udev/devices/md9 +%attr(640,root,disk) %dev(b,9,10) /lib/udev/devices/md10 +%attr(640,root,disk) %dev(b,9,11) /lib/udev/devices/md11 +%attr(640,root,disk) %dev(b,9,12) /lib/udev/devices/md12 +%attr(640,root,disk) %dev(b,9,13) /lib/udev/devices/md13 +%attr(640,root,disk) %dev(b,9,14) /lib/udev/devices/md14 +%attr(640,root,disk) %dev(b,9,15) /lib/udev/devices/md15 +%attr(640,root,disk) %dev(b,9,16) /lib/udev/devices/md16 +%attr(640,root,disk) %dev(b,9,17) /lib/udev/devices/md17 +%attr(640,root,disk) %dev(b,9,18) /lib/udev/devices/md18 +%attr(640,root,disk) %dev(b,9,19) /lib/udev/devices/md19 +%attr(640,root,disk) %dev(b,9,20) /lib/udev/devices/md20 +%attr(640,root,disk) %dev(b,9,21) /lib/udev/devices/md21 +%attr(640,root,disk) %dev(b,9,22) /lib/udev/devices/md22 +%attr(640,root,disk) %dev(b,9,23) /lib/udev/devices/md23 +%attr(640,root,disk) %dev(b,9,24) /lib/udev/devices/md24 +%attr(640,root,disk) %dev(b,9,25) /lib/udev/devices/md25 +%attr(640,root,disk) %dev(b,9,26) /lib/udev/devices/md26 +%attr(640,root,disk) %dev(b,9,27) /lib/udev/devices/md27 +%attr(640,root,disk) %dev(b,9,28) /lib/udev/devices/md28 +%attr(640,root,disk) %dev(b,9,29) /lib/udev/devices/md29 +%attr(640,root,disk) %dev(b,9,30) /lib/udev/devices/md30 +%attr(640,root,disk) %dev(b,9,31) /lib/udev/devices/md31 +%doc ANNOUNCE-2.0 ANNOUNCE-2.1 ANNOUNCE-2.2 COPYING ChangeLog README.initramfs TODO mdadm.conf-example mkinitramfs %doc Software-RAID.HOWTO/Software-RAID.HOWTO*{.txt,.html} %doc %{_mandir}/man?/* /sbin/* -%dir /lib/udev -%dir /lib/udev/devices +/lib/udev %{_sbindir}/* %{_var}/adm/fillup-templates/sysconfig.mdadm -%ghost /var/run/mdadm -%dir /lib/mkinitrd -%dir /lib/mkinitrd/scripts -/lib/mkinitrd/scripts/setup-md.sh -/lib/mkinitrd/scripts/boot-md.sh -%dir /lib/udev -%dir /lib/udev/rules.d -/lib/udev/rules.d/64-md-raid.rules -%changelog +%changelog -n mdadm +* Wed Jan 10 2007 - mmarek@suse.cz +- use raidautorun instead of mdrun to autodetect the raid arrays in + boot.md [#230733] +* Wed Nov 08 2006 - prusnak@suse.cz +- fixed subscript out of range [#212697] +* Wed Sep 20 2006 - mjancar@suse.cz +- update to 2.5.3 + * lots bugfixes + * drop all patches (integrated upstream) +* Fri Jul 28 2006 - olh@suse.de +- remove dropped boot.ibmsis from boot.md +- boot.rootfsck should start before boot.md (#181972) +* Fri Jul 21 2006 - olh@suse.de +- remove boot.proc from Required-Start: in boot.md (#178753) +* Wed May 03 2006 - mjancar@suse.cz +- fix false SparesMissing error (#171326) +* Wed Apr 26 2006 - hare@suse.de +- Fix init script dependencies +- Implement MDADM_DEVICE_TIMEOUT to set a timeout for + udevsettle (#149979) +* Tue Apr 25 2006 - mjancar@suse.cz +- add static device nodes for udev (#168824) +* Wed Apr 19 2006 - mjancar@suse.cz +- set $BOOT_MD_USE_MDADM_CONFIG to "yes" by default (#155120) +* Fri Apr 07 2006 - mjancar@suse.cz +- detach mdadmd from tty in rcmdadmd (#160881) +* Mon Apr 03 2006 - mjancar@suse.cz +- fix garbled output with --detail (#160827) +- fix fix write-mostly with --add and --re-add (#162968) +* Fri Mar 24 2006 - mjancar@suse.cz +- add /sbin/raidautorun (#159460) +* Wed Mar 08 2006 - mjancar@suse.cz +- add $BOOT_MD_USE_MDADM_CONFIG sysconfig variable (#155120) +* Thu Feb 09 2006 - mjancar@suse.cz +- round free size to chunk size multiply on --create (#148562) +* Tue Feb 07 2006 - mjancar@suse.cz +- move boot.multipath to Should-Start instead of Required-Start +* Mon Feb 06 2006 - mjancar@suse.cz +- add "Obsoletes: raidtools" +- start boot.md after boot.multipath +- call mdadm without -a from mdrun, an argument is required in 2.2 +* Mon Feb 06 2006 - mjancar@suse.de +- don't start mdadmd by default +* Sun Feb 05 2006 - mjancar@suse.cz +- include option for email to be sent on start (#142105) +- fix missing md autostart due to raidtools dropped (#148234) + * include mdrun script from Debian + * create boot.md initscipt +* Sun Feb 05 2006 - schwab@suse.de +- Fix memset parameters. +* Thu Feb 02 2006 - mjancar@suse.cz +- fix segfault on --assemble (#146514) +* Fri Jan 27 2006 - mls@suse.de +- converted neededforbuild to BuildRequires +* Wed Jan 25 2006 - olh@suse.de +- fix uninitialized variable, memset call and memcmp/memcpy bug + mdadm.bug144647-array.init.patch + mdadm.bug144647-update_super1-memcpy.patch + mdadm.bug144647-add_internal_bitmap0-memcpy.patch +* Wed Jan 11 2006 - mjancar@suse.cz +- update ro 2.2 +* Tue Dec 20 2005 - ro@suse.de +- at least output errors if they occur (instead of ignoring) +* Wed Nov 30 2005 - schwab@suse.de +- Fix broken formats. +* Tue Oct 25 2005 - aj@suse.de +- Build with -fno-strict-aliasing. +* Wed Oct 12 2005 - mjancar@suse.cz +- update to 2.1 +* Thu Jul 28 2005 - anicka@suse.cz +- update to 1.12.0 +* Wed Jun 15 2005 - meissner@suse.de +- use RPM_OPT_FLAGS correctly. +* Tue Apr 19 2005 - postadal@suse.de +- updated to version 1.11.0 +- fixed for gcc 4.0 +- removed obsoleted patch config-fix +* Wed Mar 30 2005 - postadal@suse.cz +- fixed parsing command line option '--config=partions' [#74603] +* Fri Feb 04 2005 - postadal@suse.cz +- updated to version 1.9.0 +* Thu Jan 13 2005 - postadal@suse.cz +- updated to version 1.8.1 +- extended comment in sysconfig.mdadm [#48567] +* Fri Aug 06 2004 - postadal@suse.cz +- updated to version 1.6.0 + * added --auto= and --assume-clean options + * added "degraded" and "recovering" options to the "Status:" entry +* Tue Feb 10 2004 - postadal@suse.cz +- updated to version 1.5.0 + * new commands "mdassemble" + * support for raid6 as found in 2.6.2 + * support partitioned md arrays with a different major number and + naming scheme + * added "SparesMissing" event when --monitor first sees an array and + it doesn't have the enough spare devices. +* Sun Jan 11 2004 - adrian@suse.de +- add %%defattr +* Mon Dec 01 2003 - fehr@suse.de +- fix quoting problem in start script (#33392) +* Fri Aug 29 2003 - fehr@suse.de +- add PreReq for fillup +* Tue Aug 26 2003 - fehr@suse.de +- add %%stop_on_removal and %%restart_on_update +* Thu Aug 14 2003 - fehr@suse.de +- add missing activation metadata in sysconfig (#28901) +* Tue Jul 29 2003 - fehr@suse.de +- update to new version 1.3.0 of package +* Mon Apr 14 2003 - postadal@suse.cz +- fixed init script (added return value for unimplemented reload function) +* Mon Mar 31 2003 - postadal@suse.cz +- added buildroot, init script, sysconfig +- bzip2 sources and cleaned specfile +* Thu Mar 20 2003 - fehr@suse.de +- update to version 1.2.0 of package +* Mon Mar 03 2003 - fehr@suse.de +- update to version 1.1.0 of package +* Mon Dec 02 2002 - fehr@suse.de +- Fix for new glibc/gcc +* Tue Sep 17 2002 - ro@suse.de +- removed bogus self-provides +* Fri Sep 13 2002 - lmb@suse.de +- Fix for 64bit arch; ioctl returns long instead of int (#20339) +* Fri Aug 23 2002 - lmb@suse.de +- Multipath arrays can now be build manually even without a superblock. +- One debugging chunk removed from patch. +* Tue Aug 13 2002 - lmb@suse.de +- Fix for the assembly of multipath arrays. +* Mon Aug 12 2002 - lmb@suse.de +- Added patch to support the enhanced multipath features. +* Mon Aug 05 2002 - fehr@suse.de +- make SuSE package from version 1.0.1 of mdadm diff --git a/mdadmd b/mdadmd index 9975b1a..0c6e7d7 100644 --- a/mdadmd +++ b/mdadmd @@ -13,9 +13,9 @@ ### BEGIN INIT INFO # Provides: mdadmd # Required-Start: $local_fs -# Should-Start: $time sendmail +# X-UnitedLinux-Should-Start: $time sendmail # Required-Stop: $local_fs -# Should-Stop: $time sendmail +# X-UnitedLinux-Should-Stop: $time sendmail # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Short-Description: mdadmd daemon monitoring MD devices diff --git a/mdrun b/mdrun new file mode 100644 index 0000000..f83fe3b --- /dev/null +++ b/mdrun @@ -0,0 +1,147 @@ +#!/bin/sh + +# mdrun, (c) Eduard Bloch 2003 + +# Usage: +# Without arguments: autodetect all RAID partitions and activate MDs +# Arguments: [ DEVDIR ] NUMBER UUID [ ... ] +# a number of number/uuid pairs, where NUMBER is the one from /dev/md/* +# Argument: LIST +# lists all raids in the syntax needed for the pairs (see above) + +# IMPORTANT: create /dev/fs directory if you have devfs support in the kernel +# but do not want to mount it over /dev. Usage of /dev/fs directory will keep +# mdrun away from /dev. + +# If the first argument is a directory, it will be used as a writeable +# temporary directory for device nodes. mdrun needs mknod to create them +# on-the-fly + +# Environment: +# MORERAIDVOLUMES (list of strings) : additional raid disks to scan, +# eg. loop devices + +if ! test -e /proc/partitions ; then + echo "/proc not mounted!" + exit 1 +fi + +DEVDIR=/dev + +if [ -d "$1" ] ; then + AUTOCREATE=true + DEVDIR="$1" + shift +fi + +# For people that compile the kernel with devfs (means: different +# proc/partitions content), but without auto-mounting it +if ! uname -r | grep "^2.6" 1>/dev/null && [ -z "$AUTOCREATE" ] && grep " devfs" /proc/filesystems >/dev/null 2>&1 && ! grep "^devfs" /proc/mounts >/dev/null 2>&1 ; then + + mkdir /dev/fs 2>/dev/null + # if we can do it - good, we will use it. Otherwise, use /dev even if it is ugly + + # mount devfs for now to make the device names match, umount later + if [ -d /dev/fs ] ; then + DEVDIR=/dev/fs + fi + mount none $DEVDIR -tdevfs + UMNTDEVFS="umount $DEVDIR" +fi + +# arr(array, index): return contents in array[index]; as with Bourne shell +# in general, there is no easy way to distinguish between index not +# existing and empty string assigned. +arr() { sa_i=`arr_index $2`; eval "echo \"\$$1_${sa_i}\""; unset sa_i; } + +# seterr(array, index, value): assign the given value to array[index]. +setarr() { sa_i=`arr_index $2`; eval "$1_${sa_i}=\"$3\""; unset sa_i; } + +# arr_index(index): make sure the given index is valid for use. +arr_index() { echo $1 | sed -e 's/:/_/g' | sed 's;/;_;g'; } + + +BASE=$DEVDIR/md +export BASE +#devfs +test -d $BASE && BASE=$BASE/ + +next_free_md() { + for raidnr in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24; do + if ! mdadm -D $BASE$raidnr >/dev/null 2>&1 ; then + echo $BASE$raidnr + return 0 + fi + done + return 1 +} + +listpairs() { + for NUMBER in `cat /proc/mdstat | grep "^md. : active" | sed -e 's/^md\(.\) :.*/\1/'`; do + echo $NUMBER + mdadm -D ${BASE}$NUMBER 2>/dev/null |grep UUID | sed 's/.*: \(.*\)/\1/' + done +} + +if [ "$1" = LIST ] ; then + echo `listpairs` + $UMNTDEVFS + exit 0 +fi + +DEVDIRESC=$(echo $DEVDIR | sed -e 's!/!\\/!g') +if [ "$AUTOCREATE" ] ; then + CREATECMD=$(sed -e "s/.*major.*//; s/.*\ \([:0-9:]\+\)\ \+\ \([:0-9:]\+\)\ \+\ [:0-9:]\+\ \+\([:a-z0-9\/:]\+\).*/mknod \3 b \1 \2 ; / ; s/\//_/g" < /proc/partitions) + export CREATECMD + export DEVDIR + # and we need array nodes, of course + ( + cd $DEVDIR ; + eval $CREATECMD ; + for x in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 ; do + mknod ${BASE}$x b 9 $x + done + ) + PARTLIST=$(sed -e "s/.*major.*//; s/.*\ \([:0-9:]\+\)\ \+\ \([:0-9:]\+\)\ \+\ [:0-9:]\+\ \+\([:a-z0-9\/:]\+\).*/DEVDIR\3 /; s/\//_/g ; s/DEVDIR/$DEVDIRESC\//;" < /proc/partitions) +else + PARTLIST=$(sed -e "s/.*major.*//; s/^[:0-9 :]* \([:a-z:].[:a-z0-9\/:]*\).*/\1/; s/^\([:a-z:].*\)/$DEVDIRESC\/\1/g" < /proc/partitions) +fi + +for SRC in $PARTLIST $MORERAIDVOLUMES ; do + SUM=$(mdadm -E $SRC 2>/dev/null | grep UUID | sed 's/.*: \(.*\)/\1/') + for x in $SUM; do + UUIDS="$UUIDS $SUM" + setarr MDS $SUM "`arr MDS $SUM` $SRC" + done +done + +if [ "$#" -gt 1 ] ; then + NUMBER=${BASE}$1 + MD=$2 + shift ; shift + if [ "`arr MDS $MD`" != "started" ] ; then + mdadm -A $NUMBER -f `arr MDS $MD` && setarr MDS $MD "started" + # just to be sure + ln /dev/md/$NUMBER /dev/md$NUMBER 2>/dev/null + fi +fi + +# and process the rest, if it exists +# do not touch active arrays +#dropactive() { + for NUMBER in `cat /proc/mdstat | grep "^md. : active" | sed -e 's/^md\(.\) :.*/\1/'`; do + setarr MDS `mdadm -D ${BASE}$NUMBER 2>/dev/null |grep UUID | sed 's/.*: \(.*\)/\1/'` "started" + done +#} + + +for MD in $UUIDS; do + if [ "`arr MDS $MD`" != "started" ] ; then + NUMBER=`next_free_md` + mdadm -A $NUMBER -f `arr MDS $MD` && setarr MDS $MD "started" + # just to be sure + ln /dev/md/$NUMBER /dev/md$NUMBER 2>/dev/null + fi +done + +$UMNTDEVFS diff --git a/mkinitrd-boot.sh b/mkinitrd-boot.sh deleted file mode 100644 index a5c7019..0000000 --- a/mkinitrd-boot.sh +++ /dev/null @@ -1,88 +0,0 @@ -#!/bin/bash -#%stage: softraid -#%programs: /sbin/mdadm /sbin/mdmon -#%modules: raid0 raid1 raid10 raid456 -#%if: -n "$need_mdadm" -# -##### MD (Software-)Raid -## -## This activates and waits for an MD software raid. -## -## Command line parameters -## ----------------------- -## -## need_mdadm=1 use MD raid -## md_uuid the uuid of the raid to activate -## - -# load the necessary module before we initialize the raid system -load_modules - -# put the mdmon socked and pid file to /dev/.mdadm -rm -rf /var/run/mdadm -mkdir -p /var/run -ln -s /dev/.mdadm /var/run/mdadm -mkdir -p /dev/.mdadm -[ "$mduuid" ] && md_uuid="$mduuid" - -md_major=$(sed -ne 's/\s*\([0-9]\+\)\s*md$/\1/p' /proc/devices) -if [ -n "$md_major" -a "$md_major" = "$maj" ]; then - md_minor="$min" - md_dev="/dev/md$md_minor" -fi - -# Always start md devices read/only. They will get set to rw as soon -# as the first write occurs. This way we can guarantee that no -# restore occurs before resume. -if [ -f /sys/module/md_mod/parameters/start_ro ]; then - echo 1 > /sys/module/md_mod/parameters/start_ro -fi - -md_assemble() -{ - local dev=$1 mdconf container - - case "$dev" in - /dev/md[0-9]*p[0-9]*) - dev=${dev%p[0-9]*} - esac - if test -f /etc/mdadm.conf; then - mdconf="-c /etc/mdadm.conf" - container=$( \ - sed -rn "s:^ARRAY +$dev .*container=([^ ]*).*:\\1:p" \ - /etc/mdadm.conf) - else - mdconf="-c partitions" - fi - case "$container" in - "") - ;; - /dev/*) - mdadm -A $mdconf $container - ;; - [0-9a-f]*[0-9a-f]) - mdadm -A $mdconf --uuid="$container" /dev/md/container - ;; - *) - echo "unrecognized container for $dev: $container" - ;; - esac - mdadm -A $mdconf $mdarg "$dev" -} - -if [ -n "$need_mdadm" ]; then - - if [ -n "$md_uuid" ] ; then - mdarg="--uuid=$md_uuid" - fi - - case $resumedev in - /dev/md*) - md_assemble "$resumedev" - esac - - if [ -n "$md_dev" ] ; then - md_assemble "$md_dev" - fi - wait_for_events -fi diff --git a/mkinitrd-setup.sh b/mkinitrd-setup.sh deleted file mode 100644 index 5f25c80..0000000 --- a/mkinitrd-setup.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/bash -# -#%stage: softraid -# -mdblockdev= - -# Full mdadm.conf generated by mdadm. -# Contains all created MD RAIDs -mdadm_conf= - -cont_list= -md_devs= - -# blockdev contains real devices (/dev/X) for root, resume, journal, dumb -for bd in $blockdev ; do - is_part_dev=false - case $bd in - /dev/md[0-9]*p[0-9]*) - # Partitionable MD RAID. This is partition on RAID. Get the RAID - bd=${bd%%p[0-9]*} - is_part_dev=true - ;; - /dev/md[0-9]*) - ;; - *) - mdblockdev="$mdblockdev $bd" - continue - ;; - esac - # Check if this device is already added (possible for partitionable). - md_dev=${bd##/dev/} - dup_found=false - for dup in $md_devs; do - if [ x"$dup" = x"$md_dev" ]; then - dup_found=true - break - fi - done - if $dup_found; then - if ! $is_part_dev; then - echo "setup-md.sh: $md_dev found multiple times" >&2 - fi - continue - fi - mdconf=$(mdadm -Db "$bd") - if test -z "$mdconf"; then - mdblockdev="$mdblockdev $bd" - continue - fi - md_tmpblockdev=$(mdadm -Dbv $bd | sed -n "1D;s/,/ /g;s/^ *devices=//p") - mdblockdev="$mdblockdev $md_tmpblockdev" - md_devs="$md_devs $md_dev" - container=$(echo "$mdconf" | sed -rn 's/.* container=([^ ]*) .*/\1/p') - for cnt in $cont_list; do - if [ x"$container"= x"$cnt" ]; then - container= - break - fi - done - case "$container" in - "") - ;; - /dev/*) - mdconf="$(mdadm -Db "$container")\\n$mdconf" - ;; - [0-9a-f]*[0-9a-f]) - if test -z "$mdadm_conf"; then - mdadm_conf=$(mdadm --examine --brief --scan) - fi - mdconf="$(echo "$mdadm_conf" | grep "UUID=$container")\\n$mdconf" - ;; - *) - echo "unrecognized container for $md_dev: $container" - ;; - esac - eval md_conf_${md_dev}=\"$mdconf\" - root_md=1 -done - -# Any 'md' device is replaced by it's component disks. -blockdev="$mdblockdev" - -if [ -n "$root_md" ] ; then - need_mdadm=1 - echo -n "" > $tmp_mnt/etc/mdadm.conf - for md in $md_devs; do - eval echo -e \"\$md_conf_$md\" >> $tmp_mnt/etc/mdadm.conf - done -fi - -save_var need_mdadm -save_var root_md diff --git a/raidautorun.c b/raidautorun.c new file mode 100644 index 0000000..a82ef8a --- /dev/null +++ b/raidautorun.c @@ -0,0 +1,16 @@ +#include +#include +#include +#include +#include + +int main(int argc, char *argv[]) +{ + int fd = open("/dev/md0", O_RDWR); + + if (fd >= 0) { + ioctl(fd, RAID_AUTORUN, 0); + close(fd); + } + return (0); +} diff --git a/ready b/ready new file mode 100644 index 0000000..473a0f4 diff --git a/sysconfig.mdadm b/sysconfig.mdadm index 7cdd682..36324f9 100644 --- a/sysconfig.mdadm +++ b/sysconfig.mdadm @@ -51,6 +51,13 @@ MDADM_CONFIG="/etc/mdadm.conf" # MDADM_SEND_MAIL_ON_START=no +## Type: yesno +## Default: no +# +# "yes" for mdadm.conf to be used for array assembly on boot +# +BOOT_MD_USE_MDADM_CONFIG=yes + ## Type: integer ## Default: 60 # From c469aea3230cf8b646e1ca8072cc74814cad91cc27a1ea297f8a6fd0270bfb99 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Thu, 5 Apr 2007 22:37:00 +0000 Subject: [PATCH 02/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=2 --- mdadm-2.5.3-infoname.diff | 11 ---- mdadm-2.5.3.tar.bz2 | 3 - mdadm-2.6.1.tar.bz2 | 3 + mdadm.changes | 120 +++++++++++++++++++++++++++++++++++ mdadm.spec | 127 ++++++++++++++++++++++++++++++++++++-- 5 files changed, 244 insertions(+), 20 deletions(-) delete mode 100644 mdadm-2.5.3-infoname.diff delete mode 100644 mdadm-2.5.3.tar.bz2 create mode 100644 mdadm-2.6.1.tar.bz2 diff --git a/mdadm-2.5.3-infoname.diff b/mdadm-2.5.3-infoname.diff deleted file mode 100644 index 8df4e75..0000000 --- a/mdadm-2.5.3-infoname.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- super1.c -+++ super1.c -@@ -538,7 +538,7 @@ - strncpy(info->name, c+1, 31 - (c-sb->set_name)); - else - strncpy(info->name, sb->set_name, 32); -- info->name[33] = 0; -+ info->name[32] = 0; - } - if (strcmp(update, "name") == 0) { - if (info->name[0] == 0) diff --git a/mdadm-2.5.3.tar.bz2 b/mdadm-2.5.3.tar.bz2 deleted file mode 100644 index 80125b9..0000000 --- a/mdadm-2.5.3.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:22e8364dcc528b1e5e4ee8f25ef4a6f0e9c648f1f1d2d7dbe688c929a3369672 -size 135019 diff --git a/mdadm-2.6.1.tar.bz2 b/mdadm-2.6.1.tar.bz2 new file mode 100644 index 0000000..c7b05c3 --- /dev/null +++ b/mdadm-2.6.1.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:a9028779f73bcfb55ad0e415de60557f68b2fd9a61d17e3bd07dd0d559f2cf02 +size 149000 diff --git a/mdadm.changes b/mdadm.changes index 06f97c7..07357d9 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,123 @@ +------------------------------------------------------------------- +Mon Apr 2 15:00:10 CEST 2007 - mmarek@suse.cz + +- updated to 2.6.1 + * --monitor was producing some meaningless warnings due to a bug. + * Fix some compiler warnings. + * Fully support --grow for raid6. If a reshape crashed during + the critical period, mdadm wouldn't restore the Q information + properly. + * Update documentation for --grow. + * Report bitmap status in --detail and --examine + * Default to v1 superblocks instead of v0.90 if the array + is too big for 0.90 to handle. + * Sort the output of "mdadm --detail --scan" so that it is + in a suitable order for assembling arrays. i.e. components come + before an array that they are part of. + * Require bitmap files to have a '/' in their name. + * Rewrite 'reshape' support including performing a backup + of the critical region for a raid5 growth, and restoring that + backup after a crash. + * Put a 'canary' at each end of the backup so a corruption + can be more easily detected. + * Support --backup-file for backing-up critical section during + growth. + * Erase old superblocks (of different versions) when creating new + array. + * Allow --monitor to work with arrays with >28 devices + * Report reshape information in --detail + * Handle symlinks in /dev better + * Fix mess in --detail output which a device is missing. + * Support 'bitmap=' in mdadm.conf for auto-assembling arrays with + write-intent bitmaps in separate files. + * Fix alignment problem in version-1 superblocks. + NOTE: This is an incompatable change affecting raid5 reshape. + If you want to reshape a raid5 using version-1 superblocks, + use 2.6.17-rc2 or later, and mdadm-2.4.1 or later. + * Support 'mailfrom' line in mdadm.conf so the From: line in alert + emails can be explicitly set. + * Arrange that SparesMissing (which is similar in import to + DegradedArray) generates an Email. + * Assume "DEVICE partitions" if no DEVICE line is given. + * Support new 'offset' layout for raid10. + * When creating a bitmap file, choose a chunksize to limit number + of bitmap chunks to 2 million. More than this can cause kmalloc + failure. + * New 'CREATE' line in mdadm.conf for defaults such as owner, group, + mode and auto-flag + * --detail checks if array has been started or not and includes that + in report. + * When using --update=uuid on an array with a bitmap, update the + bitmap's uuid too. + * Add a copy of /proc/mdstat to the mail message sent by mdadm + --monitor. + * New flag --no-degraded to avoid starting arrays if there are + fewer devices available than last time the array was started. + This is only needed with --scan, as with --scan, that behaviour + is the default. + * Support for 'homehost' concept. This is a fairly major update. + It includes a configfile option and a command line option for + specifying a homehost, records that host in the superblock, + and reports the homehost where possible. + * Support for Auto Assembly. "mdadm -As" will, if provided with + the name of a homehost, try to assemble all arrays it can find + that were created for that homehost. See man pages for more details. + * Don't try to create devices with --manage or --grow + * allow default metadata (superblock) type to be specified + in mdadm.conf + * Avoid some misdetection of overlapping partitions + * Add 'Array Slot' line to --examine for version-1 superblocks + to make it a bit easier to see what is happening. + * Work around bug in --add handling for version-1 superblocks + in 2.6.17 (and prior). + * Make -assemble a bit more resilient to finding strange + information in superblocks. + * When creating devices in /dev/md/ create matching symlinks + from /dev. e.g. /dev/md0 -> /dev/md/0. + Allow this to be disabled in mdadm.conf or on command line. + * Allow a number (of partitions) after the 'yes' option to --auto= + This is particularly useful in the 'create' line in mdadm.conf. + * Remove partitions from any whole device that is made part of + an md array. This is a work-around for annoying messages + when the first block on some drive accidentally looks like a + partition table. + * Close stray fd in mdassemble so that it can assemble stacked + devices + * If mdassemble finds an array already assembled, it marks it + read-write. + * Remove error in md_open if array is already active. This isn't + needed and gets in the ways if an array was created e.g. in + initramfs, but device doesn't yet exist in /dev. + * When --assemble --scan is run, if all arrays that could be found + have already been started, don't report an error. + * Allow --assemble --force to mark a raid6 clean when it has two + missing devices (which is needed else if won't assemble. + Without this fix it would only assemble if one or zero + missing devices. + * Support --update=devicesize for cases where the underlying device + can change size. + * Default to --auto=yes so the array devices with 'standard' names + get created automatically, as this is almost always what is wanted. + * Give useful message if raid4/5/6 cannot be started because it is + not clean and is also degraded. + * Increase raid456 stripe cache size if needed to --grow the array. + The setting used unfortunately requires intimate knowledge of the + kernel, and it not reset when the reshape finishes. + * Change 'Device Size' to 'Used Dev Size' because it only shows how + much of each device is actually used, not how big they are. + * --wait or -W will wait for resync activity to finish on the given + devices. + * If two drives in a raid5 disappear at the same time, then "-Af" + will add them both in rather than just one and forcing the array + to 'clean'. This is slightly safer in some cases. + * Don't hold md device open for so long in --monitor mode - map_dev + can be slow and interferes with trying to stop the array. + * Support --uuid= with --create to choose your own UUID. + * New major more "--incremental" for incremental assemble of arrays, + intended for use with udev. + * lots of bugfixes + * manpage updates + ------------------------------------------------------------------- Wed Jan 10 11:58:14 CET 2007 - mmarek@suse.cz diff --git a/mdadm.spec b/mdadm.spec index 9fc3f1c..687f00d 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -1,5 +1,5 @@ # -# spec file for package mdadm (Version 2.5.3) +# spec file for package mdadm (Version 2.6.1) # # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -11,8 +11,8 @@ # norootforbuild Name: mdadm -Version: 2.5.3 -Release: 20 +Version: 2.6.1 +Release: 1 BuildRequires: opensp sgmltool PreReq: %fillup_prereq %insserv_prereq Obsoletes: raidtools @@ -29,7 +29,6 @@ Source3: mdadmd Source4: boot.md Source5: mdrun Source6: raidautorun.c -Patch: %{name}-%{version}-infoname.diff %description Mdadm is a program that can be used to control Linux md devices. It is @@ -44,7 +43,6 @@ Authors: %prep %setup -q -a1 -%patch %build %{suse_update_config -f} @@ -120,7 +118,124 @@ rm -rf $RPM_BUILD_ROOT %{_sbindir}/* %{_var}/adm/fillup-templates/sysconfig.mdadm -%changelog -n mdadm +%changelog +* Mon Apr 02 2007 - mmarek@suse.cz +- updated to 2.6.1 + * --monitor was producing some meaningless warnings due to a bug. + * Fix some compiler warnings. + * Fully support --grow for raid6. If a reshape crashed during + the critical period, mdadm wouldn't restore the Q information + properly. + * Update documentation for --grow. + * Report bitmap status in --detail and --examine + * Default to v1 superblocks instead of v0.90 if the array + is too big for 0.90 to handle. + * Sort the output of "mdadm --detail --scan" so that it is + in a suitable order for assembling arrays. i.e. components come + before an array that they are part of. + * Require bitmap files to have a '/' in their name. + * Rewrite 'reshape' support including performing a backup + of the critical region for a raid5 growth, and restoring that + backup after a crash. + * Put a 'canary' at each end of the backup so a corruption + can be more easily detected. + * Support --backup-file for backing-up critical section during + growth. + * Erase old superblocks (of different versions) when creating new + array. + * Allow --monitor to work with arrays with >28 devices + * Report reshape information in --detail + * Handle symlinks in /dev better + * Fix mess in --detail output which a device is missing. + * Support 'bitmap=' in mdadm.conf for auto-assembling arrays with + write-intent bitmaps in separate files. + * Fix alignment problem in version-1 superblocks. + NOTE: This is an incompatable change affecting raid5 reshape. + If you want to reshape a raid5 using version-1 superblocks, + use 2.6.17-rc2 or later, and mdadm-2.4.1 or later. + * Support 'mailfrom' line in mdadm.conf so the From: line in alert + emails can be explicitly set. + * Arrange that SparesMissing (which is similar in import to + DegradedArray) generates an Email. + * Assume "DEVICE partitions" if no DEVICE line is given. + * Support new 'offset' layout for raid10. + * When creating a bitmap file, choose a chunksize to limit number + of bitmap chunks to 2 million. More than this can cause kmalloc + failure. + * New 'CREATE' line in mdadm.conf for defaults such as owner, group, + mode and auto-flag + * --detail checks if array has been started or not and includes that + in report. + * When using --update=uuid on an array with a bitmap, update the + bitmap's uuid too. + * Add a copy of /proc/mdstat to the mail message sent by mdadm + --monitor. + * New flag --no-degraded to avoid starting arrays if there are + fewer devices available than last time the array was started. + This is only needed with --scan, as with --scan, that behaviour + is the default. + * Support for 'homehost' concept. This is a fairly major update. + It includes a configfile option and a command line option for + specifying a homehost, records that host in the superblock, + and reports the homehost where possible. + * Support for Auto Assembly. "mdadm -As" will, if provided with + the name of a homehost, try to assemble all arrays it can find + that were created for that homehost. See man pages for more details. + * Don't try to create devices with --manage or --grow + * allow default metadata (superblock) type to be specified + in mdadm.conf + * Avoid some misdetection of overlapping partitions + * Add 'Array Slot' line to --examine for version-1 superblocks + to make it a bit easier to see what is happening. + * Work around bug in --add handling for version-1 superblocks + in 2.6.17 (and prior). + * Make -assemble a bit more resilient to finding strange + information in superblocks. + * When creating devices in /dev/md/ create matching symlinks + from /dev. e.g. /dev/md0 -> /dev/md/0. + Allow this to be disabled in mdadm.conf or on command line. + * Allow a number (of partitions) after the 'yes' option to --auto= + This is particularly useful in the 'create' line in mdadm.conf. + * Remove partitions from any whole device that is made part of + an md array. This is a work-around for annoying messages + when the first block on some drive accidentally looks like a + partition table. + * Close stray fd in mdassemble so that it can assemble stacked + devices + * If mdassemble finds an array already assembled, it marks it + read-write. + * Remove error in md_open if array is already active. This isn't + needed and gets in the ways if an array was created e.g. in + initramfs, but device doesn't yet exist in /dev. + * When --assemble --scan is run, if all arrays that could be found + have already been started, don't report an error. + * Allow --assemble --force to mark a raid6 clean when it has two + missing devices (which is needed else if won't assemble. + Without this fix it would only assemble if one or zero + missing devices. + * Support --update=devicesize for cases where the underlying device + can change size. + * Default to --auto=yes so the array devices with 'standard' names + get created automatically, as this is almost always what is wanted. + * Give useful message if raid4/5/6 cannot be started because it is + not clean and is also degraded. + * Increase raid456 stripe cache size if needed to --grow the array. + The setting used unfortunately requires intimate knowledge of the + kernel, and it not reset when the reshape finishes. + * Change 'Device Size' to 'Used Dev Size' because it only shows how + much of each device is actually used, not how big they are. + * --wait or -W will wait for resync activity to finish on the given + devices. + * If two drives in a raid5 disappear at the same time, then "-Af" + will add them both in rather than just one and forcing the array + to 'clean'. This is slightly safer in some cases. + * Don't hold md device open for so long in --monitor mode - map_dev + can be slow and interferes with trying to stop the array. + * Support --uuid= with --create to choose your own UUID. + * New major more "--incremental" for incremental assemble of arrays, + intended for use with udev. + * lots of bugfixes + * manpage updates * Wed Jan 10 2007 - mmarek@suse.cz - use raidautorun instead of mdrun to autodetect the raid arrays in boot.md [#230733] From 1697affed4adfd609e70c4ad16902fb3e933c2b4cd2bbdc7fdf861d00297c656 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Thu, 21 Jun 2007 20:43:12 +0000 Subject: [PATCH 03/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=3 --- mdadm.changes | 16 ++++++++++------ mdadm.spec | 4 +++- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/mdadm.changes b/mdadm.changes index 07357d9..2ee20e0 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Jun 21 15:58:37 CEST 2007 - adrian@suse.de + +- fix changelog entry order + ------------------------------------------------------------------- Mon Apr 2 15:00:10 CEST 2007 - mmarek@suse.cz @@ -375,16 +380,16 @@ Mon Dec 2 11:30:52 CET 2002 - fehr@suse.de - Fix for new glibc/gcc -------------------------------------------------------------------- -Mon Sep 13 15:10:00 CEST 2002 - lmb@suse.de - -- Fix for 64bit arch; ioctl returns long instead of int (#20339) - ------------------------------------------------------------------- Tue Sep 17 17:34:28 CEST 2002 - ro@suse.de - removed bogus self-provides +------------------------------------------------------------------- +Mon Sep 13 15:10:00 CEST 2002 - lmb@suse.de + +- Fix for 64bit arch; ioctl returns long instead of int (#20339) + ------------------------------------------------------------------- Fri Aug 23 11:16:51 MEST 2002 - lmb@suse.de @@ -406,4 +411,3 @@ Mon Aug 5 16:05:19 CEST 2002 - fehr@suse.de - make SuSE package from version 1.0.1 of mdadm -------------------------------------------------------------------- diff --git a/mdadm.spec b/mdadm.spec index 687f00d..f10bf3c 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -12,7 +12,7 @@ Name: mdadm Version: 2.6.1 -Release: 1 +Release: 16 BuildRequires: opensp sgmltool PreReq: %fillup_prereq %insserv_prereq Obsoletes: raidtools @@ -119,6 +119,8 @@ rm -rf $RPM_BUILD_ROOT %{_var}/adm/fillup-templates/sysconfig.mdadm %changelog +* Thu Jun 21 2007 - adrian@suse.de +- fix changelog entry order * Mon Apr 02 2007 - mmarek@suse.cz - updated to 2.6.1 * --monitor was producing some meaningless warnings due to a bug. From 322930bb9b685e9a2cabdc8a0666896d7636e4a828d73edfdbf9e16a4502c146 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Fri, 13 Jul 2007 16:13:41 +0000 Subject: [PATCH 04/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=4 --- mdadm-2.6.1.tar.bz2 | 3 -- mdadm-2.6.2.tar.bz2 | 3 ++ mdadm-git-fixes.patch | 79 +++++++++++++++++++++++++++++++++++++++++++ mdadm.changes | 18 ++++++++++ mdadm.spec | 25 +++++++++++--- 5 files changed, 121 insertions(+), 7 deletions(-) delete mode 100644 mdadm-2.6.1.tar.bz2 create mode 100644 mdadm-2.6.2.tar.bz2 create mode 100644 mdadm-git-fixes.patch diff --git a/mdadm-2.6.1.tar.bz2 b/mdadm-2.6.1.tar.bz2 deleted file mode 100644 index c7b05c3..0000000 --- a/mdadm-2.6.1.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:a9028779f73bcfb55ad0e415de60557f68b2fd9a61d17e3bd07dd0d559f2cf02 -size 149000 diff --git a/mdadm-2.6.2.tar.bz2 b/mdadm-2.6.2.tar.bz2 new file mode 100644 index 0000000..3f9cc18 --- /dev/null +++ b/mdadm-2.6.2.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b026731babd23013277d7a0e087d2233ff044deb616c51851dc3adffaae32a55 +size 151082 diff --git a/mdadm-git-fixes.patch b/mdadm-git-fixes.patch new file mode 100644 index 0000000..345b443 --- /dev/null +++ b/mdadm-git-fixes.patch @@ -0,0 +1,79 @@ +Commit: bf40ab857fa3e4f8e98750f750f520a2e3ecc49f +Author: Neil Brown Wed, 11 Jul 2007 09:08:49 +1000 + + Typo in man page: Multipath has an L ... + +diff --git a/md.4 b/md.4 +index 7937b79..0076558 100644 +--- a/md.4 ++++ b/md.4 +@@ -256,7 +256,7 @@ copies, then there will be a total of 4 copies of each block, each on + a different drive. This is an artifact of the implementation and is + unlikely to be of real value. + +-.SS MUTIPATH ++.SS MULTIPATH + + MULTIPATH is not really a RAID at all as there is only one real device + in a MULTIPATH md array. However there are multiple access points + +Commit: 01d9299c1a1632b1be47dd6c9191b0e905928b2b +Author: Neil Brown Mon, 09 Jul 2007 09:59:42 +1000 + + Fix spare migration and other problems with --monitor. + + 2.6 broke --monitor in various ways, including spare migration + stopped working. This fixes it. + +diff --git a/Monitor.c b/Monitor.c +index ece6abb..9293637 100644 +--- a/Monitor.c ++++ b/Monitor.c +@@ -328,6 +328,7 @@ int Monitor(mddev_dev_t devlist, + for (i=0; i= 0) { + info[i].state = disc.state; + info[i].major = disc.major; +diff --git a/mdadm.8 b/mdadm.8 +index ce88d04..25a6758 100644 +--- a/mdadm.8 ++++ b/mdadm.8 +@@ -972,6 +972,8 @@ the right thing, then the array can be successfully assembled using + .TP + .BR \-X ", " \-\-examine\-bitmap + Report information about a bitmap file. ++The argument is either an external bitmap file or an array component ++in case of an internal bitmap. + + .TP + .BR \-R ", " \-\-run + +Commit: a328c097ff8016342ae336af92cabbc32bc8d1fd +Author: Neil Brown Tue, 22 May 2007 09:46:29 +1000 + + Fix compile error in Detail.c + + 'avail' is undefined if '--export', so make sure we don't try to use + it. + +diff --git a/Detail.c b/Detail.c +index 0ed81d1..7e14163 100644 +--- a/Detail.c ++++ b/Detail.c +@@ -377,12 +377,12 @@ This is pretty boring + + if (brief > 1 && devices) printf("\n devices=%s", devices); + if (brief) printf("\n"); +-out: + if (test && + !enough(array.level, array.raid_disks, array.layout, + 1, avail, avail_disks)) + rv = 2; + ++out: + close(fd); + return rv; + } diff --git a/mdadm.changes b/mdadm.changes index 2ee20e0..a0b2b0c 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,21 @@ +------------------------------------------------------------------- +Fri Jul 13 15:02:21 CEST 2007 - mmarek@suse.cz + +- updated to 2.6.2 + * --fail detached and --remove faulty can be used to fail and + remove devices that are no longer physically present. + * --export option for --detail or present information in a format + that can be processed by udev. + * fix internal bitmap allocation problems with v1.1, v1.2 + metadata. + * --help now goes to stdout so you can direct it to a pager. + * Various manpage updates. + * Make "--grow --add" for linear arrays really work. + * --auto-detect to trigger in-kernel autodetect. + * Make return code for "--detail --test" more reliable. Missing + devices as well as failed devices cause an error. +- added some fixes from Neil's git repo (mdadm-git-fixes.patch) + ------------------------------------------------------------------- Thu Jun 21 15:58:37 CEST 2007 - adrian@suse.de diff --git a/mdadm.spec b/mdadm.spec index f10bf3c..21a2fc9 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -1,5 +1,5 @@ # -# spec file for package mdadm (Version 2.6.1) +# spec file for package mdadm (Version 2.6.2) # # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -11,14 +11,14 @@ # norootforbuild Name: mdadm -Version: 2.6.1 -Release: 16 +Version: 2.6.2 +Release: 1 BuildRequires: opensp sgmltool PreReq: %fillup_prereq %insserv_prereq Obsoletes: raidtools Autoreqprov: on Group: System/Base -License: GNU General Public License (GPL) +License: GPL v2 or later URL: http://www.cse.unsw.edu.au/~neilb/source/mdadm/ Summary: Utility for Configuring MD Setup BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -29,6 +29,7 @@ Source3: mdadmd Source4: boot.md Source5: mdrun Source6: raidautorun.c +Patch1: mdadm-git-fixes.patch %description Mdadm is a program that can be used to control Linux md devices. It is @@ -43,6 +44,7 @@ Authors: %prep %setup -q -a1 +%patch1 -p1 %build %{suse_update_config -f} @@ -119,6 +121,21 @@ rm -rf $RPM_BUILD_ROOT %{_var}/adm/fillup-templates/sysconfig.mdadm %changelog +* Fri Jul 13 2007 - mmarek@suse.cz +- updated to 2.6.2 + * --fail detached and --remove faulty can be used to fail and + remove devices that are no longer physically present. + * --export option for --detail or present information in a format + that can be processed by udev. + * fix internal bitmap allocation problems with v1.1, v1.2 + metadata. + * --help now goes to stdout so you can direct it to a pager. + * Various manpage updates. + * Make "--grow --add" for linear arrays really work. + * --auto-detect to trigger in-kernel autodetect. + * Make return code for "--detail --test" more reliable. Missing + devices as well as failed devices cause an error. +- added some fixes from Neil's git repo (mdadm-git-fixes.patch) * Thu Jun 21 2007 - adrian@suse.de - fix changelog entry order * Mon Apr 02 2007 - mmarek@suse.cz From 0147113bc763cf706380706d02681ad0d92a0a2eb30a38ff9f94465ca35465cd Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Fri, 27 Jul 2007 13:12:30 +0000 Subject: [PATCH 05/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=5 --- boot.md | 44 +++++++++++++++++++++++++++++--------------- mdadm.changes | 8 ++++++++ mdadm.spec | 7 ++++++- 3 files changed, 43 insertions(+), 16 deletions(-) diff --git a/boot.md b/boot.md index be9b8bb..d5df95f 100644 --- a/boot.md +++ b/boot.md @@ -75,8 +75,6 @@ rc_reset # considered a success. mdadm_BIN=/sbin/mdadm -mdrun_BIN=/sbin/mdrun -raidautorun_BIN=/sbin/raidautorun mdadm_CONFIG="/etc/mdadm.conf" mdadm_SYSCONFIG="/etc/sysconfig/mdadm" @@ -108,7 +106,6 @@ case "$1" in # Check for missing binaries (stale symlinks should not happen) [ -x $mdadm_BIN ] || _rc_exit 5 "... $mdadm_BIN not installed " - [ -x $mdrun_BIN ] || _rc_exit 5 "... $mdrun_BIN not installed " # Try to load md_mod [ ! -f /proc/mdstat -a -x /sbin/modprobe ] && /sbin/modprobe -k md_mod 2>&1 | : @@ -119,20 +116,35 @@ case "$1" in /sbin/udevsettle --timeout="$MDADM_DEVICE_TIMEOUT" fi - # Fallback to raidautorun / mdrun when $mdadm_CONFIG missing - # or mdadm exits with an error - [ "$BOOT_MD_USE_MDADM_CONFIG" = "yes" -a -s "$mdadm_CONFIG" ] - [ $? = 0 ] && { $mdadm_BIN -A -s -c $mdadm_CONFIG || rc_failed 1; } - if [ $? != 0 ]; then - if test -b /dev/md0; then - $raidautorun_BIN - else - $mdrun_BIN + if test "$BOOT_MD_USE_MDADM_CONFIG" = "yes" -a -s "$mdadm_CONFIG"; then + if ! grep -q '[^[:blank:]]' $mdadm_CONFIG; then + # empty /etc/mdadm.conf, "unused" + rc_status -u + fi + if ! $mdadm_BIN -A -s -c $mdadm_CONFIG; then + rc_failed 1 + rc_status -v + fi + else + # do auto-assemly only if /etc/mdadm.conf is missing + rm -f /tmp/mdadm.conf + if ! mdadm --examine --scan --config=partitions >/tmp/mdadm.conf + then + rc_failed 1 + rc_status -v + fi + if test -s /tmp/mdadm.conf; then + if ! mdadm --assemble --scan --config=/tmp/mdadm.conf + then + rc_failed 1 + rc_status -v + fi + else + # partitions found, "unused" + rc_status -u fi - fi - # Remember status and be verbose - rc_status -v + fi ;; stop) echo -n "Shutting down MD Raid " @@ -150,3 +162,5 @@ case "$1" in ;; esac rc_exit + +# vim:ft=sh diff --git a/mdadm.changes b/mdadm.changes index a0b2b0c..4b899b0 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Jul 27 13:01:01 CEST 2007 - mmarek@suse.cz + +- changes to the init script [#288454] + * don't try to autoassemble if /etc/mdadm.conf exists (even an + empty one) + * ony autoassemble partitions found in /proc/partitions + ------------------------------------------------------------------- Fri Jul 13 15:02:21 CEST 2007 - mmarek@suse.cz diff --git a/mdadm.spec b/mdadm.spec index 21a2fc9..9e50a91 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -12,7 +12,7 @@ Name: mdadm Version: 2.6.2 -Release: 1 +Release: 4 BuildRequires: opensp sgmltool PreReq: %fillup_prereq %insserv_prereq Obsoletes: raidtools @@ -121,6 +121,11 @@ rm -rf $RPM_BUILD_ROOT %{_var}/adm/fillup-templates/sysconfig.mdadm %changelog +* Fri Jul 27 2007 - mmarek@suse.cz +- changes to the init script [#288454] + * don't try to autoassemble if /etc/mdadm.conf exists (even an + empty one) + * ony autoassemble partitions found in /proc/partitions * Fri Jul 13 2007 - mmarek@suse.cz - updated to 2.6.2 * --fail detached and --remove faulty can be used to fail and From 88a121f058fb57056e42b71357c5f5a03e2a32b7e909a218ae7b83eecfff055c Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Thu, 25 Oct 2007 00:35:29 +0000 Subject: [PATCH 06/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=6 --- mdadm-2.6.2.tar.bz2 | 3 -- mdadm-2.6.4.tar.bz2 | 3 ++ mdadm-git-fixes.patch | 79 ------------------------------------------- mdadm.changes | 30 ++++++++++++++++ mdadm.spec | 42 ++++++++++++++++++----- 5 files changed, 66 insertions(+), 91 deletions(-) delete mode 100644 mdadm-2.6.2.tar.bz2 create mode 100644 mdadm-2.6.4.tar.bz2 delete mode 100644 mdadm-git-fixes.patch diff --git a/mdadm-2.6.2.tar.bz2 b/mdadm-2.6.2.tar.bz2 deleted file mode 100644 index 3f9cc18..0000000 --- a/mdadm-2.6.2.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:b026731babd23013277d7a0e087d2233ff044deb616c51851dc3adffaae32a55 -size 151082 diff --git a/mdadm-2.6.4.tar.bz2 b/mdadm-2.6.4.tar.bz2 new file mode 100644 index 0000000..e0c9ab7 --- /dev/null +++ b/mdadm-2.6.4.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1d39f110eda550b9e7dbe9d1e56098ef77197029cb8c5f5d638d2c255feaf23d +size 152401 diff --git a/mdadm-git-fixes.patch b/mdadm-git-fixes.patch deleted file mode 100644 index 345b443..0000000 --- a/mdadm-git-fixes.patch +++ /dev/null @@ -1,79 +0,0 @@ -Commit: bf40ab857fa3e4f8e98750f750f520a2e3ecc49f -Author: Neil Brown Wed, 11 Jul 2007 09:08:49 +1000 - - Typo in man page: Multipath has an L ... - -diff --git a/md.4 b/md.4 -index 7937b79..0076558 100644 ---- a/md.4 -+++ b/md.4 -@@ -256,7 +256,7 @@ copies, then there will be a total of 4 copies of each block, each on - a different drive. This is an artifact of the implementation and is - unlikely to be of real value. - --.SS MUTIPATH -+.SS MULTIPATH - - MULTIPATH is not really a RAID at all as there is only one real device - in a MULTIPATH md array. However there are multiple access points - -Commit: 01d9299c1a1632b1be47dd6c9191b0e905928b2b -Author: Neil Brown Mon, 09 Jul 2007 09:59:42 +1000 - - Fix spare migration and other problems with --monitor. - - 2.6 broke --monitor in various ways, including spare migration - stopped working. This fixes it. - -diff --git a/Monitor.c b/Monitor.c -index ece6abb..9293637 100644 ---- a/Monitor.c -+++ b/Monitor.c -@@ -328,6 +328,7 @@ int Monitor(mddev_dev_t devlist, - for (i=0; i= 0) { - info[i].state = disc.state; - info[i].major = disc.major; -diff --git a/mdadm.8 b/mdadm.8 -index ce88d04..25a6758 100644 ---- a/mdadm.8 -+++ b/mdadm.8 -@@ -972,6 +972,8 @@ the right thing, then the array can be successfully assembled using - .TP - .BR \-X ", " \-\-examine\-bitmap - Report information about a bitmap file. -+The argument is either an external bitmap file or an array component -+in case of an internal bitmap. - - .TP - .BR \-R ", " \-\-run - -Commit: a328c097ff8016342ae336af92cabbc32bc8d1fd -Author: Neil Brown Tue, 22 May 2007 09:46:29 +1000 - - Fix compile error in Detail.c - - 'avail' is undefined if '--export', so make sure we don't try to use - it. - -diff --git a/Detail.c b/Detail.c -index 0ed81d1..7e14163 100644 ---- a/Detail.c -+++ b/Detail.c -@@ -377,12 +377,12 @@ This is pretty boring - - if (brief > 1 && devices) printf("\n devices=%s", devices); - if (brief) printf("\n"); --out: - if (test && - !enough(array.level, array.raid_disks, array.layout, - 1, avail, avail_disks)) - rv = 2; - -+out: - close(fd); - return rv; - } diff --git a/mdadm.changes b/mdadm.changes index 4b899b0..2fbe9f6 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,33 @@ +------------------------------------------------------------------- +Wed Oct 24 17:08:11 CEST 2007 - mmarek@suse.cz + +- updated to 2.6.4 + * Make "--create --auto=mdp" work for non-standard device names. + * Fix restarting of a 'reshape' if it was stopped in the middle. + * Fix a segfault when using v1 superblock. + * Make --write-mostly effective when re-adding a device to an + array. + * Various minor fixes +- changes in 2.6.3: + * allow --write-behind to be set for --grow. + * When adding new disk to an array, don't reserve so much bitmap + space that the disk cannot store the required data. (Needed + when 1.x array was created with older mdadm). + * When adding a drive that was a little too small, we did not get + the correct error message. + * Make sure that if --assemble find an array in the critical + region of a reshape, and cannot find the critical data to + restart the reshape, it gives an error message. + * Fix segfault with '--detail --export' and non-persistent + superblocks. + * Various manpage updates. + * Improved 'raid4' support (--assemble, --monitor) + * Option parsing fixes w.r.t -a + * Interpret "--assemble --metadata=1" to allow any version 1.x + metadata, and be more specific in the "metadata=" message + printed with --examine --brief + * Fix spare migration in --monitor. + ------------------------------------------------------------------- Fri Jul 27 13:01:01 CEST 2007 - mmarek@suse.cz diff --git a/mdadm.spec b/mdadm.spec index 9e50a91..98c5840 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -1,5 +1,5 @@ # -# spec file for package mdadm (Version 2.6.2) +# spec file for package mdadm (Version 2.6.4) # # Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -11,15 +11,15 @@ # norootforbuild Name: mdadm -Version: 2.6.2 -Release: 4 -BuildRequires: opensp sgmltool +Version: 2.6.4 +Release: 1 +BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq Obsoletes: raidtools -Autoreqprov: on +AutoReqProv: on Group: System/Base License: GPL v2 or later -URL: http://www.cse.unsw.edu.au/~neilb/source/mdadm/ +Url: http://www.cse.unsw.edu.au/~neilb/source/mdadm/ Summary: Utility for Configuring MD Setup BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: %{name}-%{version}.tar.bz2 @@ -29,7 +29,6 @@ Source3: mdadmd Source4: boot.md Source5: mdrun Source6: raidautorun.c -Patch1: mdadm-git-fixes.patch %description Mdadm is a program that can be used to control Linux md devices. It is @@ -44,7 +43,6 @@ Authors: %prep %setup -q -a1 -%patch1 -p1 %build %{suse_update_config -f} @@ -119,8 +117,34 @@ rm -rf $RPM_BUILD_ROOT /lib/udev %{_sbindir}/* %{_var}/adm/fillup-templates/sysconfig.mdadm - %changelog +* Wed Oct 24 2007 - mmarek@suse.cz +- updated to 2.6.4 + * Make "--create --auto=mdp" work for non-standard device names. + * Fix restarting of a 'reshape' if it was stopped in the middle. + * Fix a segfault when using v1 superblock. + * Make --write-mostly effective when re-adding a device to an + array. + * Various minor fixes +- changes in 2.6.3: + * allow --write-behind to be set for --grow. + * When adding new disk to an array, don't reserve so much bitmap + space that the disk cannot store the required data. (Needed + when 1.x array was created with older mdadm). + * When adding a drive that was a little too small, we did not get + the correct error message. + * Make sure that if --assemble find an array in the critical + region of a reshape, and cannot find the critical data to + restart the reshape, it gives an error message. + * Fix segfault with '--detail --export' and non-persistent + superblocks. + * Various manpage updates. + * Improved 'raid4' support (--assemble, --monitor) + * Option parsing fixes w.r.t -a + * Interpret "--assemble --metadata=1" to allow any version 1.x + metadata, and be more specific in the "metadata=" message + printed with --examine --brief + * Fix spare migration in --monitor. * Fri Jul 27 2007 - mmarek@suse.cz - changes to the init script [#288454] * don't try to autoassemble if /etc/mdadm.conf exists (even an From ca1dc7c3bb1bdcd7d30395c31399ac4377a3e3a4aee7946c089808847f33bf11 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Thu, 24 Jan 2008 17:30:41 +0000 Subject: [PATCH 07/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=7 --- boot.md | 10 ++-- mdadm.changes | 9 ++++ mdadm.spec | 129 ++++++++++++++++++++++---------------------- mdrun | 147 -------------------------------------------------- raidautorun.c | 16 ------ 5 files changed, 81 insertions(+), 230 deletions(-) delete mode 100644 mdrun delete mode 100644 raidautorun.c diff --git a/boot.md b/boot.md index d5df95f..3a8dd19 100644 --- a/boot.md +++ b/boot.md @@ -116,8 +116,8 @@ case "$1" in /sbin/udevsettle --timeout="$MDADM_DEVICE_TIMEOUT" fi - if test "$BOOT_MD_USE_MDADM_CONFIG" = "yes" -a -s "$mdadm_CONFIG"; then - if ! grep -q '[^[:blank:]]' $mdadm_CONFIG; then + if test "$BOOT_MD_USE_MDADM_CONFIG" = "yes" -a -e "$mdadm_CONFIG"; then + if ! grep -q '^[^#]*[^[:blank:]#]' $mdadm_CONFIG; then # empty /etc/mdadm.conf, "unused" rc_status -u fi @@ -127,12 +127,14 @@ case "$1" in fi else # do auto-assemly only if /etc/mdadm.conf is missing - rm -f /tmp/mdadm.conf + # run at boot-time, so a fixed tmp name is safe + rm -rf /tmp/mdadm.conf if ! mdadm --examine --scan --config=partitions >/tmp/mdadm.conf then rc_failed 1 rc_status -v fi + chmod 0600 /tmp/mdadm.conf if test -s /tmp/mdadm.conf; then if ! mdadm --assemble --scan --config=/tmp/mdadm.conf then @@ -140,7 +142,7 @@ case "$1" in rc_status -v fi else - # partitions found, "unused" + # no partitions found, "unused" rc_status -u fi diff --git a/mdadm.changes b/mdadm.changes index 2fbe9f6..c822a05 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Wed Jan 23 15:55:24 CET 2008 - mmarek@suse.cz + +- fixed auto-assembly part of boot.md + * if /etc/mdadm.conf is empy or only contains whitespace or + comments, no autoassembly is done + * remove /tmp/mdadm.conf even if a directory [#329678] +- dropped mdrun and raidautorun (no longer needed) + ------------------------------------------------------------------- Wed Oct 24 17:08:11 CEST 2007 - mmarek@suse.cz diff --git a/mdadm.spec b/mdadm.spec index 98c5840..fd5892c 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -1,7 +1,7 @@ # # spec file for package mdadm (Version 2.6.4) # -# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine # package are under the same license as the package itself. # @@ -12,7 +12,7 @@ Name: mdadm Version: 2.6.4 -Release: 1 +Release: 17 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq Obsoletes: raidtools @@ -27,8 +27,6 @@ Source1: Software-RAID.HOWTO.tar.bz2 Source2: sysconfig.mdadm Source3: mdadmd Source4: boot.md -Source5: mdrun -Source6: raidautorun.c %description Mdadm is a program that can be used to control Linux md devices. It is @@ -47,7 +45,6 @@ Authors: %build %{suse_update_config -f} make CXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -Wno-error" -gcc $RPM_OPT_FLAGS %{S:6} -o raidautorun cd Software-RAID.HOWTO sgml2html Software-RAID.HOWTO.sgml sgml2txt Software-RAID.HOWTO.sgml @@ -57,7 +54,6 @@ make install DESTDIR=$RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT%{_var}/adm/fillup-templates install -d $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}/init.d} install -d $RPM_BUILD_ROOT/lib/udev/devices -install -m 755 %{S:5} raidautorun $RPM_BUILD_ROOT/sbin/ install -m 755 %{S:4} %{S:3} $RPM_BUILD_ROOT%{_sysconfdir}/init.d/ install -m 644 %{S:2} $RPM_BUILD_ROOT%{_var}/adm/fillup-templates/ ln -sf ../../etc/init.d/mdadmd $RPM_BUILD_ROOT/%{_sbindir}/rcmdadmd @@ -117,8 +113,15 @@ rm -rf $RPM_BUILD_ROOT /lib/udev %{_sbindir}/* %{_var}/adm/fillup-templates/sysconfig.mdadm + %changelog -* Wed Oct 24 2007 - mmarek@suse.cz +* Wed Jan 23 2008 mmarek@suse.cz +- fixed auto-assembly part of boot.md + * if /etc/mdadm.conf is empy or only contains whitespace or + comments, no autoassembly is done + * remove /tmp/mdadm.conf even if a directory [#329678] +- dropped mdrun and raidautorun (no longer needed) +* Wed Oct 24 2007 mmarek@suse.cz - updated to 2.6.4 * Make "--create --auto=mdp" work for non-standard device names. * Fix restarting of a 'reshape' if it was stopped in the middle. @@ -145,12 +148,12 @@ rm -rf $RPM_BUILD_ROOT metadata, and be more specific in the "metadata=" message printed with --examine --brief * Fix spare migration in --monitor. -* Fri Jul 27 2007 - mmarek@suse.cz +* Fri Jul 27 2007 mmarek@suse.cz - changes to the init script [#288454] * don't try to autoassemble if /etc/mdadm.conf exists (even an empty one) * ony autoassemble partitions found in /proc/partitions -* Fri Jul 13 2007 - mmarek@suse.cz +* Fri Jul 13 2007 mmarek@suse.cz - updated to 2.6.2 * --fail detached and --remove faulty can be used to fail and remove devices that are no longer physically present. @@ -165,9 +168,9 @@ rm -rf $RPM_BUILD_ROOT * Make return code for "--detail --test" more reliable. Missing devices as well as failed devices cause an error. - added some fixes from Neil's git repo (mdadm-git-fixes.patch) -* Thu Jun 21 2007 - adrian@suse.de +* Thu Jun 21 2007 adrian@suse.de - fix changelog entry order -* Mon Apr 02 2007 - mmarek@suse.cz +* Mon Apr 02 2007 mmarek@suse.cz - updated to 2.6.1 * --monitor was producing some meaningless warnings due to a bug. * Fix some compiler warnings. @@ -284,95 +287,95 @@ rm -rf $RPM_BUILD_ROOT intended for use with udev. * lots of bugfixes * manpage updates -* Wed Jan 10 2007 - mmarek@suse.cz +* Wed Jan 10 2007 mmarek@suse.cz - use raidautorun instead of mdrun to autodetect the raid arrays in boot.md [#230733] -* Wed Nov 08 2006 - prusnak@suse.cz +* Wed Nov 08 2006 prusnak@suse.cz - fixed subscript out of range [#212697] -* Wed Sep 20 2006 - mjancar@suse.cz +* Wed Sep 20 2006 mjancar@suse.cz - update to 2.5.3 * lots bugfixes * drop all patches (integrated upstream) -* Fri Jul 28 2006 - olh@suse.de +* Fri Jul 28 2006 olh@suse.de - remove dropped boot.ibmsis from boot.md - boot.rootfsck should start before boot.md (#181972) -* Fri Jul 21 2006 - olh@suse.de +* Fri Jul 21 2006 olh@suse.de - remove boot.proc from Required-Start: in boot.md (#178753) -* Wed May 03 2006 - mjancar@suse.cz +* Wed May 03 2006 mjancar@suse.cz - fix false SparesMissing error (#171326) -* Wed Apr 26 2006 - hare@suse.de +* Wed Apr 26 2006 hare@suse.de - Fix init script dependencies - Implement MDADM_DEVICE_TIMEOUT to set a timeout for udevsettle (#149979) -* Tue Apr 25 2006 - mjancar@suse.cz +* Tue Apr 25 2006 mjancar@suse.cz - add static device nodes for udev (#168824) -* Wed Apr 19 2006 - mjancar@suse.cz +* Wed Apr 19 2006 mjancar@suse.cz - set $BOOT_MD_USE_MDADM_CONFIG to "yes" by default (#155120) -* Fri Apr 07 2006 - mjancar@suse.cz +* Fri Apr 07 2006 mjancar@suse.cz - detach mdadmd from tty in rcmdadmd (#160881) -* Mon Apr 03 2006 - mjancar@suse.cz +* Mon Apr 03 2006 mjancar@suse.cz - fix garbled output with --detail (#160827) - fix fix write-mostly with --add and --re-add (#162968) -* Fri Mar 24 2006 - mjancar@suse.cz +* Fri Mar 24 2006 mjancar@suse.cz - add /sbin/raidautorun (#159460) -* Wed Mar 08 2006 - mjancar@suse.cz +* Wed Mar 08 2006 mjancar@suse.cz - add $BOOT_MD_USE_MDADM_CONFIG sysconfig variable (#155120) -* Thu Feb 09 2006 - mjancar@suse.cz +* Thu Feb 09 2006 mjancar@suse.cz - round free size to chunk size multiply on --create (#148562) -* Tue Feb 07 2006 - mjancar@suse.cz +* Tue Feb 07 2006 mjancar@suse.cz - move boot.multipath to Should-Start instead of Required-Start -* Mon Feb 06 2006 - mjancar@suse.cz +* Mon Feb 06 2006 mjancar@suse.cz - add "Obsoletes: raidtools" - start boot.md after boot.multipath - call mdadm without -a from mdrun, an argument is required in 2.2 -* Mon Feb 06 2006 - mjancar@suse.de +* Mon Feb 06 2006 mjancar@suse.de - don't start mdadmd by default -* Sun Feb 05 2006 - mjancar@suse.cz +* Sun Feb 05 2006 mjancar@suse.cz - include option for email to be sent on start (#142105) - fix missing md autostart due to raidtools dropped (#148234) * include mdrun script from Debian * create boot.md initscipt -* Sun Feb 05 2006 - schwab@suse.de +* Sun Feb 05 2006 schwab@suse.de - Fix memset parameters. -* Thu Feb 02 2006 - mjancar@suse.cz +* Thu Feb 02 2006 mjancar@suse.cz - fix segfault on --assemble (#146514) -* Fri Jan 27 2006 - mls@suse.de +* Fri Jan 27 2006 mls@suse.de - converted neededforbuild to BuildRequires -* Wed Jan 25 2006 - olh@suse.de +* Wed Jan 25 2006 olh@suse.de - fix uninitialized variable, memset call and memcmp/memcpy bug mdadm.bug144647-array.init.patch mdadm.bug144647-update_super1-memcpy.patch mdadm.bug144647-add_internal_bitmap0-memcpy.patch -* Wed Jan 11 2006 - mjancar@suse.cz +* Wed Jan 11 2006 mjancar@suse.cz - update ro 2.2 -* Tue Dec 20 2005 - ro@suse.de +* Tue Dec 20 2005 ro@suse.de - at least output errors if they occur (instead of ignoring) -* Wed Nov 30 2005 - schwab@suse.de +* Wed Nov 30 2005 schwab@suse.de - Fix broken formats. -* Tue Oct 25 2005 - aj@suse.de +* Tue Oct 25 2005 aj@suse.de - Build with -fno-strict-aliasing. -* Wed Oct 12 2005 - mjancar@suse.cz +* Wed Oct 12 2005 mjancar@suse.cz - update to 2.1 -* Thu Jul 28 2005 - anicka@suse.cz +* Thu Jul 28 2005 anicka@suse.cz - update to 1.12.0 -* Wed Jun 15 2005 - meissner@suse.de +* Wed Jun 15 2005 meissner@suse.de - use RPM_OPT_FLAGS correctly. -* Tue Apr 19 2005 - postadal@suse.de +* Tue Apr 19 2005 postadal@suse.de - updated to version 1.11.0 - fixed for gcc 4.0 - removed obsoleted patch config-fix -* Wed Mar 30 2005 - postadal@suse.cz +* Wed Mar 30 2005 postadal@suse.cz - fixed parsing command line option '--config=partions' [#74603] -* Fri Feb 04 2005 - postadal@suse.cz +* Fri Feb 04 2005 postadal@suse.cz - updated to version 1.9.0 -* Thu Jan 13 2005 - postadal@suse.cz +* Thu Jan 13 2005 postadal@suse.cz - updated to version 1.8.1 - extended comment in sysconfig.mdadm [#48567] -* Fri Aug 06 2004 - postadal@suse.cz +* Fri Aug 06 2004 postadal@suse.cz - updated to version 1.6.0 * added --auto= and --assume-clean options * added "degraded" and "recovering" options to the "Status:" entry -* Tue Feb 10 2004 - postadal@suse.cz +* Tue Feb 10 2004 postadal@suse.cz - updated to version 1.5.0 * new commands "mdassemble" * support for raid6 as found in 2.6.2 @@ -380,39 +383,39 @@ rm -rf $RPM_BUILD_ROOT naming scheme * added "SparesMissing" event when --monitor first sees an array and it doesn't have the enough spare devices. -* Sun Jan 11 2004 - adrian@suse.de +* Sun Jan 11 2004 adrian@suse.de - add %%defattr -* Mon Dec 01 2003 - fehr@suse.de +* Mon Dec 01 2003 fehr@suse.de - fix quoting problem in start script (#33392) -* Fri Aug 29 2003 - fehr@suse.de +* Fri Aug 29 2003 fehr@suse.de - add PreReq for fillup -* Tue Aug 26 2003 - fehr@suse.de +* Tue Aug 26 2003 fehr@suse.de - add %%stop_on_removal and %%restart_on_update -* Thu Aug 14 2003 - fehr@suse.de +* Thu Aug 14 2003 fehr@suse.de - add missing activation metadata in sysconfig (#28901) -* Tue Jul 29 2003 - fehr@suse.de +* Tue Jul 29 2003 fehr@suse.de - update to new version 1.3.0 of package -* Mon Apr 14 2003 - postadal@suse.cz +* Mon Apr 14 2003 postadal@suse.cz - fixed init script (added return value for unimplemented reload function) -* Mon Mar 31 2003 - postadal@suse.cz +* Mon Mar 31 2003 postadal@suse.cz - added buildroot, init script, sysconfig - bzip2 sources and cleaned specfile -* Thu Mar 20 2003 - fehr@suse.de +* Thu Mar 20 2003 fehr@suse.de - update to version 1.2.0 of package -* Mon Mar 03 2003 - fehr@suse.de +* Mon Mar 03 2003 fehr@suse.de - update to version 1.1.0 of package -* Mon Dec 02 2002 - fehr@suse.de +* Mon Dec 02 2002 fehr@suse.de - Fix for new glibc/gcc -* Tue Sep 17 2002 - ro@suse.de +* Tue Sep 17 2002 ro@suse.de - removed bogus self-provides -* Fri Sep 13 2002 - lmb@suse.de +* Fri Sep 13 2002 lmb@suse.de - Fix for 64bit arch; ioctl returns long instead of int (#20339) -* Fri Aug 23 2002 - lmb@suse.de +* Fri Aug 23 2002 lmb@suse.de - Multipath arrays can now be build manually even without a superblock. - One debugging chunk removed from patch. -* Tue Aug 13 2002 - lmb@suse.de +* Tue Aug 13 2002 lmb@suse.de - Fix for the assembly of multipath arrays. -* Mon Aug 12 2002 - lmb@suse.de +* Mon Aug 12 2002 lmb@suse.de - Added patch to support the enhanced multipath features. -* Mon Aug 05 2002 - fehr@suse.de +* Mon Aug 05 2002 fehr@suse.de - make SuSE package from version 1.0.1 of mdadm diff --git a/mdrun b/mdrun deleted file mode 100644 index f83fe3b..0000000 --- a/mdrun +++ /dev/null @@ -1,147 +0,0 @@ -#!/bin/sh - -# mdrun, (c) Eduard Bloch 2003 - -# Usage: -# Without arguments: autodetect all RAID partitions and activate MDs -# Arguments: [ DEVDIR ] NUMBER UUID [ ... ] -# a number of number/uuid pairs, where NUMBER is the one from /dev/md/* -# Argument: LIST -# lists all raids in the syntax needed for the pairs (see above) - -# IMPORTANT: create /dev/fs directory if you have devfs support in the kernel -# but do not want to mount it over /dev. Usage of /dev/fs directory will keep -# mdrun away from /dev. - -# If the first argument is a directory, it will be used as a writeable -# temporary directory for device nodes. mdrun needs mknod to create them -# on-the-fly - -# Environment: -# MORERAIDVOLUMES (list of strings) : additional raid disks to scan, -# eg. loop devices - -if ! test -e /proc/partitions ; then - echo "/proc not mounted!" - exit 1 -fi - -DEVDIR=/dev - -if [ -d "$1" ] ; then - AUTOCREATE=true - DEVDIR="$1" - shift -fi - -# For people that compile the kernel with devfs (means: different -# proc/partitions content), but without auto-mounting it -if ! uname -r | grep "^2.6" 1>/dev/null && [ -z "$AUTOCREATE" ] && grep " devfs" /proc/filesystems >/dev/null 2>&1 && ! grep "^devfs" /proc/mounts >/dev/null 2>&1 ; then - - mkdir /dev/fs 2>/dev/null - # if we can do it - good, we will use it. Otherwise, use /dev even if it is ugly - - # mount devfs for now to make the device names match, umount later - if [ -d /dev/fs ] ; then - DEVDIR=/dev/fs - fi - mount none $DEVDIR -tdevfs - UMNTDEVFS="umount $DEVDIR" -fi - -# arr(array, index): return contents in array[index]; as with Bourne shell -# in general, there is no easy way to distinguish between index not -# existing and empty string assigned. -arr() { sa_i=`arr_index $2`; eval "echo \"\$$1_${sa_i}\""; unset sa_i; } - -# seterr(array, index, value): assign the given value to array[index]. -setarr() { sa_i=`arr_index $2`; eval "$1_${sa_i}=\"$3\""; unset sa_i; } - -# arr_index(index): make sure the given index is valid for use. -arr_index() { echo $1 | sed -e 's/:/_/g' | sed 's;/;_;g'; } - - -BASE=$DEVDIR/md -export BASE -#devfs -test -d $BASE && BASE=$BASE/ - -next_free_md() { - for raidnr in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24; do - if ! mdadm -D $BASE$raidnr >/dev/null 2>&1 ; then - echo $BASE$raidnr - return 0 - fi - done - return 1 -} - -listpairs() { - for NUMBER in `cat /proc/mdstat | grep "^md. : active" | sed -e 's/^md\(.\) :.*/\1/'`; do - echo $NUMBER - mdadm -D ${BASE}$NUMBER 2>/dev/null |grep UUID | sed 's/.*: \(.*\)/\1/' - done -} - -if [ "$1" = LIST ] ; then - echo `listpairs` - $UMNTDEVFS - exit 0 -fi - -DEVDIRESC=$(echo $DEVDIR | sed -e 's!/!\\/!g') -if [ "$AUTOCREATE" ] ; then - CREATECMD=$(sed -e "s/.*major.*//; s/.*\ \([:0-9:]\+\)\ \+\ \([:0-9:]\+\)\ \+\ [:0-9:]\+\ \+\([:a-z0-9\/:]\+\).*/mknod \3 b \1 \2 ; / ; s/\//_/g" < /proc/partitions) - export CREATECMD - export DEVDIR - # and we need array nodes, of course - ( - cd $DEVDIR ; - eval $CREATECMD ; - for x in 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 ; do - mknod ${BASE}$x b 9 $x - done - ) - PARTLIST=$(sed -e "s/.*major.*//; s/.*\ \([:0-9:]\+\)\ \+\ \([:0-9:]\+\)\ \+\ [:0-9:]\+\ \+\([:a-z0-9\/:]\+\).*/DEVDIR\3 /; s/\//_/g ; s/DEVDIR/$DEVDIRESC\//;" < /proc/partitions) -else - PARTLIST=$(sed -e "s/.*major.*//; s/^[:0-9 :]* \([:a-z:].[:a-z0-9\/:]*\).*/\1/; s/^\([:a-z:].*\)/$DEVDIRESC\/\1/g" < /proc/partitions) -fi - -for SRC in $PARTLIST $MORERAIDVOLUMES ; do - SUM=$(mdadm -E $SRC 2>/dev/null | grep UUID | sed 's/.*: \(.*\)/\1/') - for x in $SUM; do - UUIDS="$UUIDS $SUM" - setarr MDS $SUM "`arr MDS $SUM` $SRC" - done -done - -if [ "$#" -gt 1 ] ; then - NUMBER=${BASE}$1 - MD=$2 - shift ; shift - if [ "`arr MDS $MD`" != "started" ] ; then - mdadm -A $NUMBER -f `arr MDS $MD` && setarr MDS $MD "started" - # just to be sure - ln /dev/md/$NUMBER /dev/md$NUMBER 2>/dev/null - fi -fi - -# and process the rest, if it exists -# do not touch active arrays -#dropactive() { - for NUMBER in `cat /proc/mdstat | grep "^md. : active" | sed -e 's/^md\(.\) :.*/\1/'`; do - setarr MDS `mdadm -D ${BASE}$NUMBER 2>/dev/null |grep UUID | sed 's/.*: \(.*\)/\1/'` "started" - done -#} - - -for MD in $UUIDS; do - if [ "`arr MDS $MD`" != "started" ] ; then - NUMBER=`next_free_md` - mdadm -A $NUMBER -f `arr MDS $MD` && setarr MDS $MD "started" - # just to be sure - ln /dev/md/$NUMBER /dev/md$NUMBER 2>/dev/null - fi -done - -$UMNTDEVFS diff --git a/raidautorun.c b/raidautorun.c deleted file mode 100644 index a82ef8a..0000000 --- a/raidautorun.c +++ /dev/null @@ -1,16 +0,0 @@ -#include -#include -#include -#include -#include - -int main(int argc, char *argv[]) -{ - int fd = open("/dev/md0", O_RDWR); - - if (fd >= 0) { - ioctl(fd, RAID_AUTORUN, 0); - close(fd); - } - return (0); -} From 65feb0c36167bad8b96aafa6063e93c4ea749ce45e3c9f82005251ab28ccb12f Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Mon, 4 Feb 2008 20:59:25 +0000 Subject: [PATCH 08/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=8 --- boot.md | 14 ++++++-------- mdadm.changes | 5 +++++ mdadm.spec | 4 +++- 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/boot.md b/boot.md index 3a8dd19..4ba85d0 100644 --- a/boot.md +++ b/boot.md @@ -120,9 +120,8 @@ case "$1" in if ! grep -q '^[^#]*[^[:blank:]#]' $mdadm_CONFIG; then # empty /etc/mdadm.conf, "unused" rc_status -u - fi - if ! $mdadm_BIN -A -s -c $mdadm_CONFIG; then - rc_failed 1 + else + $mdadm_BIN -A -s -c $mdadm_CONFIG rc_status -v fi else @@ -133,14 +132,13 @@ case "$1" in then rc_failed 1 rc_status -v + chmod 0600 /tmp/mdadm.conf + rc_exit fi chmod 0600 /tmp/mdadm.conf if test -s /tmp/mdadm.conf; then - if ! mdadm --assemble --scan --config=/tmp/mdadm.conf - then - rc_failed 1 - rc_status -v - fi + mdadm --assemble --scan --config=/tmp/mdadm.conf + rc_status -v else # no partitions found, "unused" rc_status -u diff --git a/mdadm.changes b/mdadm.changes index c822a05..c72f71d 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Feb 4 19:24:54 CET 2008 - mmarek@suse.cz + +- correctly display rc_status in boot.md + ------------------------------------------------------------------- Wed Jan 23 15:55:24 CET 2008 - mmarek@suse.cz diff --git a/mdadm.spec b/mdadm.spec index fd5892c..f4ad773 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -12,7 +12,7 @@ Name: mdadm Version: 2.6.4 -Release: 17 +Release: 23 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq Obsoletes: raidtools @@ -115,6 +115,8 @@ rm -rf $RPM_BUILD_ROOT %{_var}/adm/fillup-templates/sysconfig.mdadm %changelog +* Mon Feb 04 2008 mmarek@suse.cz +- correctly display rc_status in boot.md * Wed Jan 23 2008 mmarek@suse.cz - fixed auto-assembly part of boot.md * if /etc/mdadm.conf is empy or only contains whitespace or From 1de2eeb5201820418fed3e65820ca30b061d9b6f3607cd402a6ba5d19b198a52 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Thu, 1 May 2008 12:47:26 +0000 Subject: [PATCH 09/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=9 --- mdadm-2.6.4-519561f7.patch | 36 ++++++++++++++++++ mdadm-2.6.4-6fb79233.patch | 70 +++++++++++++++++++++++++++++++++++ mdadm-2.6.4-7a3be72f.patch | 76 ++++++++++++++++++++++++++++++++++++++ mdadm.changes | 6 +++ mdadm.spec | 12 +++++- 5 files changed, 199 insertions(+), 1 deletion(-) create mode 100644 mdadm-2.6.4-519561f7.patch create mode 100644 mdadm-2.6.4-6fb79233.patch create mode 100644 mdadm-2.6.4-7a3be72f.patch diff --git a/mdadm-2.6.4-519561f7.patch b/mdadm-2.6.4-519561f7.patch new file mode 100644 index 0000000..40abc2d --- /dev/null +++ b/mdadm-2.6.4-519561f7.patch @@ -0,0 +1,36 @@ +based on + + commit 519561f73f7ba987affde8b174d2691bb098439d + Author: Neil Brown + Date: Tue Apr 29 17:13:53 2008 +1000 + + Fix possible bug with bitmap space allocation with v1.0 metadata + + When adding a device to an array, make sure we don't reserve + so much space for the bitmap that there isn't room for the data. + +(minus the roff comments change) +--- + super1.c | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- super1.c.orig ++++ super1.c +@@ -903,7 +903,7 @@ static int write_init_super1(struct supe + * for a bitmap. + */ + array_size = __le64_to_cpu(sb->size); +- /* work out how much space we left of a bitmap */ ++ /* work out how much space we left for a bitmap */ + bm_space = choose_bm_space(array_size); + + switch(st->minor_version) { +@@ -913,6 +913,8 @@ static int write_init_super1(struct supe + sb_offset &= ~(4*2-1); + sb->super_offset = __cpu_to_le64(sb_offset); + sb->data_offset = __cpu_to_le64(0); ++ if (sb_offset - bm_space < array_size) ++ bm_space = sb_offset - array_size; + sb->data_size = __cpu_to_le64(sb_offset - bm_space); + break; + case 1: diff --git a/mdadm-2.6.4-6fb79233.patch b/mdadm-2.6.4-6fb79233.patch new file mode 100644 index 0000000..4ad2a98 --- /dev/null +++ b/mdadm-2.6.4-6fb79233.patch @@ -0,0 +1,70 @@ +based on + commit 6fb79233b050b4a3575f0e466ab04b5d301ac1de + Author: Neil Brown + Date: Mon Apr 28 16:30:09 2008 +1000 + + Allow creation of a RAID6 with a single missing device. + + This did not work before as we couldn't mark it clean as there would + be some parity blocks out of sync, and raid6 will not assemble a + dirty degraded array. + So make such arrays doubly degraded (the last device becomes a spare) + and clean. + +--- + Create.c | 20 ++++++++++++++++++-- + 1 file changed, 18 insertions(+), 2 deletions(-) + +--- Create.c.orig ++++ Create.c +@@ -63,6 +63,7 @@ int Create(struct supertype *st, char *m + int fail=0, warn=0; + struct stat stb; + int first_missing = subdevs * 2; ++ int second_missing = subdevs * 2; + int missing_disks = 0; + int insert_point = subdevs * 2; /* where to insert a missing drive */ + void *super; +@@ -203,6 +204,8 @@ int Create(struct supertype *st, char *m + if (strcasecmp(dname, "missing")==0) { + if (first_missing > dnum) + first_missing = dnum; ++ if (second_missing > dnum && dnum > first_missing) ++ second_missing = dnum; + missing_disks ++; + continue; + } +@@ -341,6 +344,18 @@ int Create(struct supertype *st, char *m + break; + } + } ++ /* For raid6, if creating with 1 missing drive, make a good drive ++ * into a spare, else the create will fail ++ */ ++ if (assume_clean == 0 && force == 0 && first_missing < raiddisks && ++ second_missing >= raiddisks && level == 6) { ++ insert_point = raiddisks - 1; ++ if (insert_point == first_missing) ++ insert_point--; ++ sparedisks ++; ++ array.active_disks--; ++ missing_disks++; ++ } + + if (level <= 0 && first_missing != subdevs * 2) { + fprintf(stderr, +@@ -360,11 +375,12 @@ int Create(struct supertype *st, char *m + if (fstat(mdfd, &stb)==0) + array.md_minor = minor(stb.st_rdev); + array.not_persistent = 0; +- /*** FIX: Need to do something about RAID-6 here ***/ ++ + if ( ( (level == 4 || level == 5) && + (insert_point < raiddisks || first_missing < raiddisks) ) + || +- ( level == 6 && missing_disks == 2) ++ ( level == 6 && (insert_point < raiddisks ++ || second_missing < raiddisks)) + || + assume_clean + ) diff --git a/mdadm-2.6.4-7a3be72f.patch b/mdadm-2.6.4-7a3be72f.patch new file mode 100644 index 0000000..e4d21b1 --- /dev/null +++ b/mdadm-2.6.4-7a3be72f.patch @@ -0,0 +1,76 @@ +Based on + commit 7a3be72fc621b4a7589e923cf0652c51493f831a + Author: Neil Brown + Date: Mon Apr 28 16:29:37 2008 +1000 + + Fix problems with array.size overflowing on large arrays. + + 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. + +--- + Detail.c | 2 +- + Manage.c | 14 ++++++++++++-- + 2 files changed, 13 insertions(+), 3 deletions(-) + +--- Detail.c.orig ++++ Detail.c +@@ -174,7 +174,7 @@ int Detail(char *dev, int brief, int exp + if (dsize > 0) + printf(" Used Dev Size : %llu%s\n", + dsize, +- human_size((long long)array.size<<10)); ++ human_size((long long)dsize<<10)); + else + printf(" Used Dev Size : unknown\n"); + } else +--- Manage.c.orig ++++ Manage.c +@@ -188,6 +188,7 @@ int Manage_subdevs(char *devname, int fd + */ + mdu_array_info_t array; + mdu_disk_info_t disc; ++ unsigned long long array_size; + mddev_dev_t dv, next = NULL; + struct stat stb; + int j, jnext = 0; +@@ -203,6 +204,15 @@ int Manage_subdevs(char *devname, int fd + devname); + return 1; + } ++ ++ /* array.size is only 32 bit and may be truncated. ++ * So read from sysfs if possible, and record number of sectors ++ */ ++ ++ array_size = get_component_size(fd); ++ if (array_size <= 0) ++ array_size = array.size * 2; ++ + for (dv = devlist, j=0 ; dv; dv = next, j = jnext) { + unsigned long long ldsize; + char dvname[20]; +@@ -335,7 +345,7 @@ int Manage_subdevs(char *devname, int fd + + /* Make sure device is large enough */ + if (st->ss->avail_size(st, ldsize/512) < +- array.size) { ++ array_size) { + fprintf(stderr, Name ": %s not large enough to join array\n", + dv->devname); + return 1; +@@ -409,7 +419,7 @@ int Manage_subdevs(char *devname, int fd + /* non-persistent. Must ensure that new drive + * is at least array.size big. + */ +- if (ldsize/512 < array.size) { ++ if (ldsize/512 < array_size) { + fprintf(stderr, Name ": %s not large enough to join array\n", + dv->devname); + return 1; diff --git a/mdadm.changes b/mdadm.changes index c72f71d..3c4c3ed 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Apr 30 15:57:14 CEST 2008 - mmarek@suse.cz + +- added some fixes from Neil's git repo, fixing bnc#368704 among + others + ------------------------------------------------------------------- Mon Feb 4 19:24:54 CET 2008 - mmarek@suse.cz diff --git a/mdadm.spec b/mdadm.spec index f4ad773..23c9795 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -10,9 +10,10 @@ # norootforbuild + Name: mdadm Version: 2.6.4 -Release: 23 +Release: 37 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq Obsoletes: raidtools @@ -27,6 +28,9 @@ Source1: Software-RAID.HOWTO.tar.bz2 Source2: sysconfig.mdadm Source3: mdadmd Source4: boot.md +Patch1: mdadm-2.6.4-7a3be72f.patch +Patch2: mdadm-2.6.4-6fb79233.patch +Patch3: mdadm-2.6.4-519561f7.patch %description Mdadm is a program that can be used to control Linux md devices. It is @@ -41,6 +45,9 @@ Authors: %prep %setup -q -a1 +%patch1 +%patch2 +%patch3 %build %{suse_update_config -f} @@ -115,6 +122,9 @@ rm -rf $RPM_BUILD_ROOT %{_var}/adm/fillup-templates/sysconfig.mdadm %changelog +* Wed Apr 30 2008 mmarek@suse.cz +- added some fixes from Neil's git repo, fixing bnc#368704 among + others * Mon Feb 04 2008 mmarek@suse.cz - correctly display rc_status in boot.md * Wed Jan 23 2008 mmarek@suse.cz From bc4cbaecaa0259b62f8afac0bc34bcf30eaa0623c22b188e701bb8e5badfe24e Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Mon, 23 Jun 2008 02:11:39 +0000 Subject: [PATCH 10/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=10 --- boot.md | 5 ++- mdadm-2.6.4-519561f7.patch | 36 ------------------ mdadm-2.6.4-6fb79233.patch | 70 ----------------------------------- mdadm-2.6.4-7a3be72f.patch | 76 -------------------------------------- mdadm-2.6.4.tar.bz2 | 3 -- mdadm-2.6.7-56f8add2.patch | 31 ++++++++++++++++ mdadm-2.6.7-60b435db.patch | 24 ++++++++++++ mdadm-2.6.7.tar.bz2 | 3 ++ mdadm.changes | 21 +++++++++++ mdadm.spec | 34 ++++++++++++----- 10 files changed, 108 insertions(+), 195 deletions(-) delete mode 100644 mdadm-2.6.4-519561f7.patch delete mode 100644 mdadm-2.6.4-6fb79233.patch delete mode 100644 mdadm-2.6.4-7a3be72f.patch delete mode 100644 mdadm-2.6.4.tar.bz2 create mode 100644 mdadm-2.6.7-56f8add2.patch create mode 100644 mdadm-2.6.7-60b435db.patch create mode 100644 mdadm-2.6.7.tar.bz2 diff --git a/boot.md b/boot.md index 4ba85d0..b354d43 100644 --- a/boot.md +++ b/boot.md @@ -130,9 +130,11 @@ case "$1" in rm -rf /tmp/mdadm.conf if ! mdadm --examine --scan --config=partitions >/tmp/mdadm.conf then + echo "mdadm --examine --scan failed:" + cat /tmp/mdadm.conf + rm -f /tmp/mdadm.conf rc_failed 1 rc_status -v - chmod 0600 /tmp/mdadm.conf rc_exit fi chmod 0600 /tmp/mdadm.conf @@ -143,6 +145,7 @@ case "$1" in # no partitions found, "unused" rc_status -u fi + rm -f /tmp/mdadm.conf fi ;; diff --git a/mdadm-2.6.4-519561f7.patch b/mdadm-2.6.4-519561f7.patch deleted file mode 100644 index 40abc2d..0000000 --- a/mdadm-2.6.4-519561f7.patch +++ /dev/null @@ -1,36 +0,0 @@ -based on - - commit 519561f73f7ba987affde8b174d2691bb098439d - Author: Neil Brown - Date: Tue Apr 29 17:13:53 2008 +1000 - - Fix possible bug with bitmap space allocation with v1.0 metadata - - When adding a device to an array, make sure we don't reserve - so much space for the bitmap that there isn't room for the data. - -(minus the roff comments change) ---- - super1.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - ---- super1.c.orig -+++ super1.c -@@ -903,7 +903,7 @@ static int write_init_super1(struct supe - * for a bitmap. - */ - array_size = __le64_to_cpu(sb->size); -- /* work out how much space we left of a bitmap */ -+ /* work out how much space we left for a bitmap */ - bm_space = choose_bm_space(array_size); - - switch(st->minor_version) { -@@ -913,6 +913,8 @@ static int write_init_super1(struct supe - sb_offset &= ~(4*2-1); - sb->super_offset = __cpu_to_le64(sb_offset); - sb->data_offset = __cpu_to_le64(0); -+ if (sb_offset - bm_space < array_size) -+ bm_space = sb_offset - array_size; - sb->data_size = __cpu_to_le64(sb_offset - bm_space); - break; - case 1: diff --git a/mdadm-2.6.4-6fb79233.patch b/mdadm-2.6.4-6fb79233.patch deleted file mode 100644 index 4ad2a98..0000000 --- a/mdadm-2.6.4-6fb79233.patch +++ /dev/null @@ -1,70 +0,0 @@ -based on - commit 6fb79233b050b4a3575f0e466ab04b5d301ac1de - Author: Neil Brown - Date: Mon Apr 28 16:30:09 2008 +1000 - - Allow creation of a RAID6 with a single missing device. - - This did not work before as we couldn't mark it clean as there would - be some parity blocks out of sync, and raid6 will not assemble a - dirty degraded array. - So make such arrays doubly degraded (the last device becomes a spare) - and clean. - ---- - Create.c | 20 ++++++++++++++++++-- - 1 file changed, 18 insertions(+), 2 deletions(-) - ---- Create.c.orig -+++ Create.c -@@ -63,6 +63,7 @@ int Create(struct supertype *st, char *m - int fail=0, warn=0; - struct stat stb; - int first_missing = subdevs * 2; -+ int second_missing = subdevs * 2; - int missing_disks = 0; - int insert_point = subdevs * 2; /* where to insert a missing drive */ - void *super; -@@ -203,6 +204,8 @@ int Create(struct supertype *st, char *m - if (strcasecmp(dname, "missing")==0) { - if (first_missing > dnum) - first_missing = dnum; -+ if (second_missing > dnum && dnum > first_missing) -+ second_missing = dnum; - missing_disks ++; - continue; - } -@@ -341,6 +344,18 @@ int Create(struct supertype *st, char *m - break; - } - } -+ /* For raid6, if creating with 1 missing drive, make a good drive -+ * into a spare, else the create will fail -+ */ -+ if (assume_clean == 0 && force == 0 && first_missing < raiddisks && -+ second_missing >= raiddisks && level == 6) { -+ insert_point = raiddisks - 1; -+ if (insert_point == first_missing) -+ insert_point--; -+ sparedisks ++; -+ array.active_disks--; -+ missing_disks++; -+ } - - if (level <= 0 && first_missing != subdevs * 2) { - fprintf(stderr, -@@ -360,11 +375,12 @@ int Create(struct supertype *st, char *m - if (fstat(mdfd, &stb)==0) - array.md_minor = minor(stb.st_rdev); - array.not_persistent = 0; -- /*** FIX: Need to do something about RAID-6 here ***/ -+ - if ( ( (level == 4 || level == 5) && - (insert_point < raiddisks || first_missing < raiddisks) ) - || -- ( level == 6 && missing_disks == 2) -+ ( level == 6 && (insert_point < raiddisks -+ || second_missing < raiddisks)) - || - assume_clean - ) diff --git a/mdadm-2.6.4-7a3be72f.patch b/mdadm-2.6.4-7a3be72f.patch deleted file mode 100644 index e4d21b1..0000000 --- a/mdadm-2.6.4-7a3be72f.patch +++ /dev/null @@ -1,76 +0,0 @@ -Based on - commit 7a3be72fc621b4a7589e923cf0652c51493f831a - Author: Neil Brown - Date: Mon Apr 28 16:29:37 2008 +1000 - - Fix problems with array.size overflowing on large arrays. - - 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. - ---- - Detail.c | 2 +- - Manage.c | 14 ++++++++++++-- - 2 files changed, 13 insertions(+), 3 deletions(-) - ---- Detail.c.orig -+++ Detail.c -@@ -174,7 +174,7 @@ int Detail(char *dev, int brief, int exp - if (dsize > 0) - printf(" Used Dev Size : %llu%s\n", - dsize, -- human_size((long long)array.size<<10)); -+ human_size((long long)dsize<<10)); - else - printf(" Used Dev Size : unknown\n"); - } else ---- Manage.c.orig -+++ Manage.c -@@ -188,6 +188,7 @@ int Manage_subdevs(char *devname, int fd - */ - mdu_array_info_t array; - mdu_disk_info_t disc; -+ unsigned long long array_size; - mddev_dev_t dv, next = NULL; - struct stat stb; - int j, jnext = 0; -@@ -203,6 +204,15 @@ int Manage_subdevs(char *devname, int fd - devname); - return 1; - } -+ -+ /* array.size is only 32 bit and may be truncated. -+ * So read from sysfs if possible, and record number of sectors -+ */ -+ -+ array_size = get_component_size(fd); -+ if (array_size <= 0) -+ array_size = array.size * 2; -+ - for (dv = devlist, j=0 ; dv; dv = next, j = jnext) { - unsigned long long ldsize; - char dvname[20]; -@@ -335,7 +345,7 @@ int Manage_subdevs(char *devname, int fd - - /* Make sure device is large enough */ - if (st->ss->avail_size(st, ldsize/512) < -- array.size) { -+ array_size) { - fprintf(stderr, Name ": %s not large enough to join array\n", - dv->devname); - return 1; -@@ -409,7 +419,7 @@ int Manage_subdevs(char *devname, int fd - /* non-persistent. Must ensure that new drive - * is at least array.size big. - */ -- if (ldsize/512 < array.size) { -+ if (ldsize/512 < array_size) { - fprintf(stderr, Name ": %s not large enough to join array\n", - dv->devname); - return 1; diff --git a/mdadm-2.6.4.tar.bz2 b/mdadm-2.6.4.tar.bz2 deleted file mode 100644 index e0c9ab7..0000000 --- a/mdadm-2.6.4.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:1d39f110eda550b9e7dbe9d1e56098ef77197029cb8c5f5d638d2c255feaf23d -size 152401 diff --git a/mdadm-2.6.7-56f8add2.patch b/mdadm-2.6.7-56f8add2.patch new file mode 100644 index 0000000..107eae9 --- /dev/null +++ b/mdadm-2.6.7-56f8add2.patch @@ -0,0 +1,31 @@ +commit 56f8add211a840faaed325bd16483b55da544e93 +Author: Neil Brown +Date: Thu Jun 19 16:30:36 2008 +1000 + + Fix an error when assembling arrays that are in the middle of a reshape. + + It is important that dup_super always returns an 'st' with the same + ->ss and ->minor_version as the st that was passed. + This wasn't happening for 0.91 metadata (i.e. in the middle of a reshape). + +diff --git a/super0.c b/super0.c +index 7e81482..8e4c568 100644 +--- a/super0.c ++++ b/super0.c +@@ -849,12 +849,15 @@ static struct supertype *match_metadata_desc0(char *arg) + st->sb = NULL; + if (strcmp(arg, "0") == 0 || + strcmp(arg, "0.90") == 0 || +- strcmp(arg, "0.91") == 0 || + strcmp(arg, "default") == 0 || + strcmp(arg, "") == 0 /* no metadata */ + ) + return st; + ++ st->minor_version = 91; /* reshape in progress */ ++ if (strcmp(arg, "0.91") == 0) /* For dup_super support */ ++ return st; ++ + st->minor_version = 9; /* flag for 'byte-swapped' */ + if (strcmp(arg, "0.swap")==0 || + strcmp(arg, "0.9") == 0) /* For dup_super support */ diff --git a/mdadm-2.6.7-60b435db.patch b/mdadm-2.6.7-60b435db.patch new file mode 100644 index 0000000..a1f896c --- /dev/null +++ b/mdadm-2.6.7-60b435db.patch @@ -0,0 +1,24 @@ +commit 60b435db5a7b085ad1204168879037bf14ebd6d1 +Author: Chris Webb +Date: Thu Jun 19 16:30:39 2008 +1000 + + Fix bug in forced assemble. + + From: Chris Webb + + We are loading into the already-loaded 'st' instead of the + newly create 'tst', which is clearly wrong. + +diff --git a/Assemble.c b/Assemble.c +index 36b2304..79f0912 100644 +--- a/Assemble.c ++++ b/Assemble.c +@@ -656,7 +656,7 @@ int Assemble(struct supertype *st, char *mddev, int mdfd, + continue; + } + tst = dup_super(st); +- if (tst->ss->load_super(st,fd, NULL)) { ++ if (tst->ss->load_super(tst,fd, NULL)) { + close(fd); + fprintf(stderr, Name ": RAID superblock disappeared from %s - not updating.\n", + devices[chosen_drive].devname); diff --git a/mdadm-2.6.7.tar.bz2 b/mdadm-2.6.7.tar.bz2 new file mode 100644 index 0000000..8dd2cd3 --- /dev/null +++ b/mdadm-2.6.7.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:f2ec116bb1fc0102861796bc56777e751ea65202b460b0d43ae6ad277def807e +size 153982 diff --git a/mdadm.changes b/mdadm.changes index 3c4c3ed..dab5c84 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,24 @@ +------------------------------------------------------------------- +Fri Jun 20 14:28:20 CEST 2008 - mmarek@suse.cz + +- updated to 2.6.7 + fixes from git + * Avoid segfault when parsing /proc/mdstat with auto-read-only + arrays. + * For v0.90 superblocks, print the 'Events' count as a real + count, not 2 numbers separated by a dot. + * Allow creation of a RAID6 with exactly one missing device. + * Use LOG_PID for syslog, so you get the pid of mdadm in the + log files. + * --export now works with --examine too (not just --detail) + * Improve auto-creation of device special file when using + --incremental + * Simple locking for --incremental so mdadm doesn't get + confused when run concurrently with itself. + * Make --incremental cope better with arrays that are being + reshaped. + * Fix autoassemble for stack arrays. +- remove /tmp/mdadm.conf in boot.md (bnc#401138) + ------------------------------------------------------------------- Wed Apr 30 15:57:14 CEST 2008 - mmarek@suse.cz diff --git a/mdadm.spec b/mdadm.spec index 23c9795..9823c19 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -1,5 +1,5 @@ # -# spec file for package mdadm (Version 2.6.4) +# spec file for package mdadm (Version 2.6.7) # # Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. # This file and all modifications and additions to the pristine @@ -12,8 +12,8 @@ Name: mdadm -Version: 2.6.4 -Release: 37 +Version: 2.6.7 +Release: 1 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq Obsoletes: raidtools @@ -28,9 +28,8 @@ Source1: Software-RAID.HOWTO.tar.bz2 Source2: sysconfig.mdadm Source3: mdadmd Source4: boot.md -Patch1: mdadm-2.6.4-7a3be72f.patch -Patch2: mdadm-2.6.4-6fb79233.patch -Patch3: mdadm-2.6.4-519561f7.patch +Patch1: mdadm-2.6.7-56f8add2.patch +Patch2: mdadm-2.6.7-60b435db.patch %description Mdadm is a program that can be used to control Linux md devices. It is @@ -45,9 +44,8 @@ Authors: %prep %setup -q -a1 -%patch1 -%patch2 -%patch3 +%patch1 -p1 +%patch2 -p1 %build %{suse_update_config -f} @@ -122,6 +120,24 @@ rm -rf $RPM_BUILD_ROOT %{_var}/adm/fillup-templates/sysconfig.mdadm %changelog +* Fri Jun 20 2008 mmarek@suse.cz +- updated to 2.6.7 + fixes from git + * Avoid segfault when parsing /proc/mdstat with auto-read-only + arrays. + * For v0.90 superblocks, print the 'Events' count as a real + count, not 2 numbers separated by a dot. + * Allow creation of a RAID6 with exactly one missing device. + * Use LOG_PID for syslog, so you get the pid of mdadm in the + log files. + * --export now works with --examine too (not just --detail) + * Improve auto-creation of device special file when using + --incremental + * Simple locking for --incremental so mdadm doesn't get + confused when run concurrently with itself. + * Make --incremental cope better with arrays that are being + reshaped. + * Fix autoassemble for stack arrays. +- remove /tmp/mdadm.conf in boot.md (bnc#401138) * Wed Apr 30 2008 mmarek@suse.cz - added some fixes from Neil's git repo, fixing bnc#368704 among others From 7b76b7f88b310f8b7674e15096da44490f10de3dd7081a74bfd60f5fdd62079c Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Fri, 25 Jul 2008 00:32:37 +0000 Subject: [PATCH 11/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=11 --- mdadm.changes | 5 ++++ mdadm.spec | 13 ++++++++- mkinitrd-boot.sh | 67 +++++++++++++++++++++++++++++++++++++++++++++++ mkinitrd-setup.sh | 34 ++++++++++++++++++++++++ 4 files changed, 118 insertions(+), 1 deletion(-) create mode 100644 mkinitrd-boot.sh create mode 100644 mkinitrd-setup.sh diff --git a/mdadm.changes b/mdadm.changes index dab5c84..1d2db67 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Jul 23 15:21:59 CEST 2008 - hare@suse.de + +- Include mkinitrd scriptlets. + ------------------------------------------------------------------- Fri Jun 20 14:28:20 CEST 2008 - mmarek@suse.cz diff --git a/mdadm.spec b/mdadm.spec index 9823c19..cfbbcc9 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -13,7 +13,7 @@ Name: mdadm Version: 2.6.7 -Release: 1 +Release: 6 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq Obsoletes: raidtools @@ -28,6 +28,8 @@ Source1: Software-RAID.HOWTO.tar.bz2 Source2: sysconfig.mdadm Source3: mdadmd Source4: boot.md +Source5: mkinitrd-setup.sh +Source6: mkinitrd-boot.sh Patch1: mdadm-2.6.7-56f8add2.patch Patch2: mdadm-2.6.7-60b435db.patch @@ -60,6 +62,9 @@ install -d $RPM_BUILD_ROOT%{_var}/adm/fillup-templates install -d $RPM_BUILD_ROOT{%{_sbindir},%{_sysconfdir}/init.d} install -d $RPM_BUILD_ROOT/lib/udev/devices install -m 755 %{S:4} %{S:3} $RPM_BUILD_ROOT%{_sysconfdir}/init.d/ +install -d $RPM_BUILD_ROOT/lib/mkinitrd/scripts +install -m 755 %{S:5} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/setup-md.sh +install -m 755 %{S:6} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/boot-md.sh install -m 644 %{S:2} $RPM_BUILD_ROOT%{_var}/adm/fillup-templates/ ln -sf ../../etc/init.d/mdadmd $RPM_BUILD_ROOT/%{_sbindir}/rcmdadmd @@ -118,8 +123,14 @@ rm -rf $RPM_BUILD_ROOT /lib/udev %{_sbindir}/* %{_var}/adm/fillup-templates/sysconfig.mdadm +%dir /lib/mkinitrd +%dir /lib/mkinitrd/scripts +/lib/mkinitrd/scripts/setup-md.sh +/lib/mkinitrd/scripts/boot-md.sh %changelog +* Wed Jul 23 2008 hare@suse.de +- Include mkinitrd scriptlets. * Fri Jun 20 2008 mmarek@suse.cz - updated to 2.6.7 + fixes from git * Avoid segfault when parsing /proc/mdstat with auto-read-only diff --git a/mkinitrd-boot.sh b/mkinitrd-boot.sh new file mode 100644 index 0000000..e20e05c --- /dev/null +++ b/mkinitrd-boot.sh @@ -0,0 +1,67 @@ +#!/bin/bash +#%stage: softraid +#%programs: /sbin/mdadm +#%modules: raid0 raid1 raid456 +#%if: -n "$need_mdadm" +# +##### MD (Software-)Raid +## +## This activates and waits for an MD software raid. +## +## Command line parameters +## ----------------------- +## +## need_mdadm=1 use MD raid +## md_uuid the uuid of the raid to activate +## + +# load the necessary module before we initialize the raid system +load_modules + +[ "$mduuid" ] && md_uuid="$mduuid" + +md_major=$(sed -ne 's/\s*\([0-9]\+\)\s*md$/\1/p' /proc/devices) +if [ -n "$md_major" -a "$md_major" = "$maj" ]; then + md_minor="$min" + md_dev="/dev/md$md_minor" +fi + +# Always start md devices read/only. They will get set to rw as soon +# as the first write occurs. This way we can guarantee that no +# restore occurs before resume. +if [ -f /sys/module/md_mod/parameters/start_ro ]; then + echo 1 > /sys/module/md_mod/parameters/start_ro +fi + +if [ -n "$need_mdadm" ]; then + + if [ -f /etc/mdadm.conf ] ; then + mdconf="-Ac /etc/mdadm.conf" + [ -z "$md_dev" ] && md_dev="--scan" + fi + + if [ -n "$md_uuid" ] ; then + mdarg="--uuid=$md_uuid" + elif [ -n "$md_uuid" ] ; then + mdarg="$mdarg --uuid=$md_uuid" + fi + if [ -n "$md_minor" ] ; then + mdarg="$mdarg --super-minor=$md_minor" + md_dev="/dev/md$md_minor" + elif [ -z "$md_minor" -a -n "$md_minor" ] ; then + mdarg="$mdarg --super-minor=$md_minor" + fi + + case $resumedev in + /dev/md*) + echo 1 > /sys/module/md_mod/parameters/start_ro + resume_minor="${resumedev#/dev/md}" + mdadm -Ac partitions -m $resume_minor --auto=md $resumedev + ;; + esac + + if [ "$md_dev" ] ; then + /sbin/mdadm $mdconf --auto=md $md_dev || /sbin/mdadm -Ac partitions $mdarg --auto=md $md_dev + fi +fi + diff --git a/mkinitrd-setup.sh b/mkinitrd-setup.sh new file mode 100644 index 0000000..0729999 --- /dev/null +++ b/mkinitrd-setup.sh @@ -0,0 +1,34 @@ +#!/bin/bash +# +#%stage: softraid +# +mdblockdev= + +for bd in $blockdev ; do + # get information about the current blockdev + update_blockdev $bd + mdconf=$(mdadm -Db $bd 2> /dev/null | sed -n "s@/dev/md[0-9]*@/dev/md$blockminor@p") + if [ -n "$mdconf" ] ; then + md_tmpblockdev=$(mdadm -Dbv $bd 2> /dev/null | sed -n "1D;s/,/ /g;s/^ *devices=\(.*\)/\1/p") + md_dev=${bd##/dev/} + mdblockdev="$mdblockdev $md_tmpblockdev" + eval md_conf_${md_dev}=\"$mdconf\" + md_devs="$md_devs $md_dev" + root_md=1 + else + mdblockdev="$mdblockdev $bd" + fi +done + +blockdev="$mdblockdev" + +if [ -n "$root_md" ] ; then + need_mdadm=1 + echo "DEVICE partitions" > $tmp_mnt/etc/mdadm.conf + for md in $md_devs; do + eval echo \$md_conf_$md >> $tmp_mnt/etc/mdadm.conf + done +fi + +save_var need_mdadm +save_var root_md From aaee2ad9fd401022f0b52b01c7c15e834f889a37207952c318e914f8d55be549 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Sun, 17 Aug 2008 22:16:04 +0000 Subject: [PATCH 12/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=12 --- boot.md | 4 +++- mdadm.changes | 5 +++++ mdadm.spec | 15 ++++++++++++--- mdadmd | 4 ++-- 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/boot.md b/boot.md index b354d43..31381f1 100644 --- a/boot.md +++ b/boot.md @@ -22,7 +22,9 @@ ### BEGIN INIT INFO # Provides: boot.md # Required-Start: boot.udev boot.rootfsck -# X-SUSE-Should-Start: boot.scsidev boot.multipath +# Required-Stop: $null +# Should-Start: boot.scsidev boot.multipath +# Should-Stop: boot.scsidev boot.multipath # Default-Start: B # Default-Stop: # Short-Description: Multiple Device RAID diff --git a/mdadm.changes b/mdadm.changes index 1d2db67..8c13bf4 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Aug 17 08:04:26 CEST 2008 - aj@suse.de + +- Fix init scripts. + ------------------------------------------------------------------- Wed Jul 23 15:21:59 CEST 2008 - hare@suse.de diff --git a/mdadm.spec b/mdadm.spec index cfbbcc9..871b129 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -2,9 +2,16 @@ # spec file for package mdadm (Version 2.6.7) # # Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. -# This file and all modifications and additions to the pristine -# package are under the same license as the package itself. # +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + # Please submit bugfixes or comments via http://bugs.opensuse.org/ # @@ -13,7 +20,7 @@ Name: mdadm Version: 2.6.7 -Release: 6 +Release: 16 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq Obsoletes: raidtools @@ -129,6 +136,8 @@ rm -rf $RPM_BUILD_ROOT /lib/mkinitrd/scripts/boot-md.sh %changelog +* Sun Aug 17 2008 aj@suse.de +- Fix init scripts. * Wed Jul 23 2008 hare@suse.de - Include mkinitrd scriptlets. * Fri Jun 20 2008 mmarek@suse.cz diff --git a/mdadmd b/mdadmd index 0c6e7d7..9975b1a 100644 --- a/mdadmd +++ b/mdadmd @@ -13,9 +13,9 @@ ### BEGIN INIT INFO # Provides: mdadmd # Required-Start: $local_fs -# X-UnitedLinux-Should-Start: $time sendmail +# Should-Start: $time sendmail # Required-Stop: $local_fs -# X-UnitedLinux-Should-Stop: $time sendmail +# Should-Stop: $time sendmail # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Short-Description: mdadmd daemon monitoring MD devices From 31dbcfdae130af1d2b51c23ab2752cbbac5023660f98706ee8760c163165882d Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Fri, 5 Sep 2008 19:15:10 +0000 Subject: [PATCH 13/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=13 --- mdadm.changes | 5 +++++ mdadm.spec | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/mdadm.changes b/mdadm.changes index 8c13bf4..02aa800 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Sep 3 11:09:34 CEST 2008 - hare@suse.de + +- Call mkinitrd_setup during %post and %postun (bnc#413709) + ------------------------------------------------------------------- Sun Aug 17 08:04:26 CEST 2008 - aj@suse.de diff --git a/mdadm.spec b/mdadm.spec index 871b129..9fe29aa 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -20,7 +20,7 @@ Name: mdadm Version: 2.6.7 -Release: 16 +Release: 22 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq Obsoletes: raidtools @@ -76,10 +76,12 @@ install -m 644 %{S:2} $RPM_BUILD_ROOT%{_var}/adm/fillup-templates/ ln -sf ../../etc/init.d/mdadmd $RPM_BUILD_ROOT/%{_sbindir}/rcmdadmd %post +[ -x /sbin/mkinitrd_setup ] && mkinitrd_setup %{fillup_and_insserv -Y boot.md} %postun %restart_on_update mdadmd +[ -x /sbin/mkinitrd_setup ] && mkinitrd_setup %{insserv_cleanup} %preun @@ -136,6 +138,8 @@ rm -rf $RPM_BUILD_ROOT /lib/mkinitrd/scripts/boot-md.sh %changelog +* Wed Sep 03 2008 hare@suse.de +- Call mkinitrd_setup during %%post and %%postun (bnc#413709) * Sun Aug 17 2008 aj@suse.de - Fix init scripts. * Wed Jul 23 2008 hare@suse.de From 77d023930b7df4b9a7ae2d8e219448211cb24f47923c23450849d9dfff9bc04c Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Wed, 24 Sep 2008 15:12:07 +0000 Subject: [PATCH 14/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=14 --- mdadm-2.6.7-56f8add2.patch | 31 ------------------------------- mdadm-2.6.7-60b435db.patch | 24 ------------------------ mdadm-2.6.7.tar.bz2 | 3 --- mdadm-3.0-devel1.tar.bz2 | 3 +++ mdadm.changes | 23 +++++++++++++++++++++++ mdadm.spec | 37 +++++++++++++++++++++++++------------ 6 files changed, 51 insertions(+), 70 deletions(-) delete mode 100644 mdadm-2.6.7-56f8add2.patch delete mode 100644 mdadm-2.6.7-60b435db.patch delete mode 100644 mdadm-2.6.7.tar.bz2 create mode 100644 mdadm-3.0-devel1.tar.bz2 diff --git a/mdadm-2.6.7-56f8add2.patch b/mdadm-2.6.7-56f8add2.patch deleted file mode 100644 index 107eae9..0000000 --- a/mdadm-2.6.7-56f8add2.patch +++ /dev/null @@ -1,31 +0,0 @@ -commit 56f8add211a840faaed325bd16483b55da544e93 -Author: Neil Brown -Date: Thu Jun 19 16:30:36 2008 +1000 - - Fix an error when assembling arrays that are in the middle of a reshape. - - It is important that dup_super always returns an 'st' with the same - ->ss and ->minor_version as the st that was passed. - This wasn't happening for 0.91 metadata (i.e. in the middle of a reshape). - -diff --git a/super0.c b/super0.c -index 7e81482..8e4c568 100644 ---- a/super0.c -+++ b/super0.c -@@ -849,12 +849,15 @@ static struct supertype *match_metadata_desc0(char *arg) - st->sb = NULL; - if (strcmp(arg, "0") == 0 || - strcmp(arg, "0.90") == 0 || -- strcmp(arg, "0.91") == 0 || - strcmp(arg, "default") == 0 || - strcmp(arg, "") == 0 /* no metadata */ - ) - return st; - -+ st->minor_version = 91; /* reshape in progress */ -+ if (strcmp(arg, "0.91") == 0) /* For dup_super support */ -+ return st; -+ - st->minor_version = 9; /* flag for 'byte-swapped' */ - if (strcmp(arg, "0.swap")==0 || - strcmp(arg, "0.9") == 0) /* For dup_super support */ diff --git a/mdadm-2.6.7-60b435db.patch b/mdadm-2.6.7-60b435db.patch deleted file mode 100644 index a1f896c..0000000 --- a/mdadm-2.6.7-60b435db.patch +++ /dev/null @@ -1,24 +0,0 @@ -commit 60b435db5a7b085ad1204168879037bf14ebd6d1 -Author: Chris Webb -Date: Thu Jun 19 16:30:39 2008 +1000 - - Fix bug in forced assemble. - - From: Chris Webb - - We are loading into the already-loaded 'st' instead of the - newly create 'tst', which is clearly wrong. - -diff --git a/Assemble.c b/Assemble.c -index 36b2304..79f0912 100644 ---- a/Assemble.c -+++ b/Assemble.c -@@ -656,7 +656,7 @@ int Assemble(struct supertype *st, char *mddev, int mdfd, - continue; - } - tst = dup_super(st); -- if (tst->ss->load_super(st,fd, NULL)) { -+ if (tst->ss->load_super(tst,fd, NULL)) { - close(fd); - fprintf(stderr, Name ": RAID superblock disappeared from %s - not updating.\n", - devices[chosen_drive].devname); diff --git a/mdadm-2.6.7.tar.bz2 b/mdadm-2.6.7.tar.bz2 deleted file mode 100644 index 8dd2cd3..0000000 --- a/mdadm-2.6.7.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f2ec116bb1fc0102861796bc56777e751ea65202b460b0d43ae6ad277def807e -size 153982 diff --git a/mdadm-3.0-devel1.tar.bz2 b/mdadm-3.0-devel1.tar.bz2 new file mode 100644 index 0000000..895f459 --- /dev/null +++ b/mdadm-3.0-devel1.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d996c9f69429fcb746a1bc7665ee8c413906996a75c2baeff7e9573487be7521 +size 236945 diff --git a/mdadm.changes b/mdadm.changes index 02aa800..105f34f 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,26 @@ +------------------------------------------------------------------- +Fri Sep 19 11:14:05 CEST 2008 - mmarek@suse.cz + +- added /var/run/mdadm for mdmon +- fixed build + +------------------------------------------------------------------- +Thu Sep 18 09:33:19 CEST 2008 - nfbrown@suse.de + +- update to mdadm-3.0-devel1 + package version number is set to 3.0 to avodi future confusion. + This is a substantial update that provides support for handling + the metadata entirely in userspace and thus making easier to + handle a variety of metadata formats. Support is included for + DDF and for the Intel Matrix metadata used by recent ICH chipsets. + + An extra program 'mdmon' is needed and included. It is run to + monitor any array using 'external' (to the kernel) metadata + and will update the metadata in response to device failures etc. + + This is required for FATE 304219 + + ------------------------------------------------------------------- Wed Sep 3 11:09:34 CEST 2008 - hare@suse.de diff --git a/mdadm.spec b/mdadm.spec index 9fe29aa..97ec4ce 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -1,5 +1,5 @@ # -# spec file for package mdadm (Version 2.6.7) +# spec file for package mdadm (Version 3.0) # # Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -19,26 +19,25 @@ Name: mdadm -Version: 2.6.7 -Release: 22 +Version: 3.0 +Release: 1 +%define ver 3.0-devel1 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq Obsoletes: raidtools AutoReqProv: on Group: System/Base License: GPL v2 or later -Url: http://www.cse.unsw.edu.au/~neilb/source/mdadm/ +Url: http://www.kernel.org/pub/linux/utils/mdadm/ Summary: Utility for Configuring MD Setup BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source: %{name}-%{version}.tar.bz2 +Source: %{name}-%{ver}.tar.bz2 Source1: Software-RAID.HOWTO.tar.bz2 Source2: sysconfig.mdadm Source3: mdadmd Source4: boot.md Source5: mkinitrd-setup.sh Source6: mkinitrd-boot.sh -Patch1: mdadm-2.6.7-56f8add2.patch -Patch2: mdadm-2.6.7-60b435db.patch %description Mdadm is a program that can be used to control Linux md devices. It is @@ -49,12 +48,10 @@ programs but with a very different interface. Authors: -------- - Neil Brown + Neil Brown %prep -%setup -q -a1 -%patch1 -p1 -%patch2 -p1 +%setup -q -a1 -n %{name}-%{ver} %build %{suse_update_config -f} @@ -74,6 +71,7 @@ install -m 755 %{S:5} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/setup-md.sh install -m 755 %{S:6} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/boot-md.sh install -m 644 %{S:2} $RPM_BUILD_ROOT%{_var}/adm/fillup-templates/ ln -sf ../../etc/init.d/mdadmd $RPM_BUILD_ROOT/%{_sbindir}/rcmdadmd +install -d $RPM_BUILD_ROOT/var/run/mdadm %post [ -x /sbin/mkinitrd_setup ] && mkinitrd_setup @@ -125,19 +123,34 @@ rm -rf $RPM_BUILD_ROOT %attr(640,root,disk) %dev(b,9,29) /lib/udev/devices/md29 %attr(640,root,disk) %dev(b,9,30) /lib/udev/devices/md30 %attr(640,root,disk) %dev(b,9,31) /lib/udev/devices/md31 -%doc ANNOUNCE-2.0 ANNOUNCE-2.1 ANNOUNCE-2.2 COPYING ChangeLog README.initramfs TODO mdadm.conf-example mkinitramfs +%doc COPYING ChangeLog README.initramfs TODO mdadm.conf-example mkinitramfs %doc Software-RAID.HOWTO/Software-RAID.HOWTO*{.txt,.html} %doc %{_mandir}/man?/* /sbin/* /lib/udev %{_sbindir}/* %{_var}/adm/fillup-templates/sysconfig.mdadm +%dir /var/run/mdadm %dir /lib/mkinitrd %dir /lib/mkinitrd/scripts /lib/mkinitrd/scripts/setup-md.sh /lib/mkinitrd/scripts/boot-md.sh %changelog +* Fri Sep 19 2008 mmarek@suse.cz +- added /var/run/mdadm for mdmon +- fixed build +* Thu Sep 18 2008 nfbrown@suse.de +- update to mdadm-3.0-devel1 + package version number is set to 3.0 to avodi future confusion. + This is a substantial update that provides support for handling + the metadata entirely in userspace and thus making easier to + handle a variety of metadata formats. Support is included for + DDF and for the Intel Matrix metadata used by recent ICH chipsets. + An extra program 'mdmon' is needed and included. It is run to + monitor any array using 'external' (to the kernel) metadata + and will update the metadata in response to device failures etc. + This is required for FATE 304219 * Wed Sep 03 2008 hare@suse.de - Call mkinitrd_setup during %%post and %%postun (bnc#413709) * Sun Aug 17 2008 aj@suse.de From 1359ce6d4611df75006702cc7dd04634c16149ec9a24a9c7832f2dd7c00e459b Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Wed, 24 Sep 2008 23:04:15 +0000 Subject: [PATCH 15/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=15 --- boot.md | 4 ++-- mdadm.changes | 5 +++++ mdadm.spec | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/boot.md b/boot.md index 31381f1..668352b 100644 --- a/boot.md +++ b/boot.md @@ -81,7 +81,7 @@ mdadm_CONFIG="/etc/mdadm.conf" mdadm_SYSCONFIG="/etc/sysconfig/mdadm" # udev integration -if [ -x /sbin/udevsettle ] ; then +if [ -x /sbin/udevadm ] ; then [ -z "$MDADM_DEVICE_TIMEOUT" ] && MDADM_DEVICE_TIMEOUT=60 else MDADM_DEVICE_TIMEOUT=0 @@ -115,7 +115,7 @@ case "$1" in # Wait for udev to settle if [ "$MDADM_DEVICE_TIMEOUT" -gt 0 ] ; then - /sbin/udevsettle --timeout="$MDADM_DEVICE_TIMEOUT" + /sbin/udevadm settle --timeout="$MDADM_DEVICE_TIMEOUT" fi if test "$BOOT_MD_USE_MDADM_CONFIG" = "yes" -a -e "$mdadm_CONFIG"; then diff --git a/mdadm.changes b/mdadm.changes index 105f34f..a69b4e7 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Wed Sep 24 18:24:25 CEST 2008 - ro@suse.de + +- change "udevsettle" to "udevadm settle" + ------------------------------------------------------------------- Fri Sep 19 11:14:05 CEST 2008 - mmarek@suse.cz diff --git a/mdadm.spec b/mdadm.spec index 97ec4ce..09e5d24 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -20,7 +20,7 @@ Name: mdadm Version: 3.0 -Release: 1 +Release: 2 %define ver 3.0-devel1 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq @@ -137,6 +137,8 @@ rm -rf $RPM_BUILD_ROOT /lib/mkinitrd/scripts/boot-md.sh %changelog +* Wed Sep 24 2008 ro@suse.de +- change "udevsettle" to "udevadm settle" * Fri Sep 19 2008 mmarek@suse.cz - added /var/run/mdadm for mdmon - fixed build From 4769cdb5dfe336b0cf99391a7a7f4ff72bde24926cf538798160d0a808624c97 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Mon, 6 Oct 2008 15:46:23 +0000 Subject: [PATCH 16/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=16 --- mdadm.changes | 10 ++++++++ mdadm.spec | 12 ++++++++-- mdmon-ia64-clone.patch | 33 +++++++++++++++++++++++++++ super-intel-undefined-operation.patch | 24 +++++++++++++++++++ 4 files changed, 77 insertions(+), 2 deletions(-) create mode 100644 mdmon-ia64-clone.patch create mode 100644 super-intel-undefined-operation.patch diff --git a/mdadm.changes b/mdadm.changes index a69b4e7..ff84ada 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Fri Oct 3 15:28:49 CEST 2008 - mmarek@suse.cz + +- fixed mdmon's clone_monitor on ia64 + +------------------------------------------------------------------- +Fri Oct 3 14:28:55 CEST 2008 - mmarek@suse.cz + +- fixed byte swapping in super-intel.c on big endian. + ------------------------------------------------------------------- Wed Sep 24 18:24:25 CEST 2008 - ro@suse.de diff --git a/mdadm.spec b/mdadm.spec index 09e5d24..33cfa29 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -20,7 +20,7 @@ Name: mdadm Version: 3.0 -Release: 2 +Release: 3 %define ver 3.0-devel1 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq @@ -28,10 +28,12 @@ Obsoletes: raidtools AutoReqProv: on Group: System/Base License: GPL v2 or later -Url: http://www.kernel.org/pub/linux/utils/mdadm/ +Url: http://www.kernel.org/pub/linux/utils/raid/mdadm/ Summary: Utility for Configuring MD Setup BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: %{name}-%{ver}.tar.bz2 +Patch1: super-intel-undefined-operation.patch +Patch2: mdmon-ia64-clone.patch Source1: Software-RAID.HOWTO.tar.bz2 Source2: sysconfig.mdadm Source3: mdadmd @@ -52,6 +54,8 @@ Authors: %prep %setup -q -a1 -n %{name}-%{ver} +%patch1 +%patch2 %build %{suse_update_config -f} @@ -137,6 +141,10 @@ rm -rf $RPM_BUILD_ROOT /lib/mkinitrd/scripts/boot-md.sh %changelog +* Fri Oct 03 2008 mmarek@suse.cz +- fixed mdmon's clone_monitor on ia64 +* Fri Oct 03 2008 mmarek@suse.cz +- fixed byte swapping in super-intel.c on big endian. * Wed Sep 24 2008 ro@suse.de - change "udevsettle" to "udevadm settle" * Fri Sep 19 2008 mmarek@suse.cz diff --git a/mdmon-ia64-clone.patch b/mdmon-ia64-clone.patch new file mode 100644 index 0000000..8a417a3 --- /dev/null +++ b/mdmon-ia64-clone.patch @@ -0,0 +1,33 @@ +ia64 has __clone2 instead of clone() +--- + mdmon.c | 12 ++++++++++++ + 1 file changed, 12 insertions(+) + +--- mdmon.c.orig ++++ mdmon.c +@@ -57,13 +57,25 @@ int run_child(void *v) + return 0; + } + ++#ifdef __ia64__ ++int __clone2(int (*fn)(void *), ++ void *child_stack_base, size_t stack_size, ++ int flags, void *arg, ... ++ /* pid_t *pid, struct user_desc *tls, pid_t *ctid */ ); ++#endif + int clone_monitor(struct supertype *container) + { + static char stack[4096]; + ++#ifdef __ia64__ ++ mon_tid = __clone2(run_child, stack, sizeof(stack), ++ CLONE_FS|CLONE_FILES|CLONE_VM|CLONE_SIGHAND|CLONE_THREAD, ++ container); ++#else + mon_tid = clone(run_child, stack+4096-64, + CLONE_FS|CLONE_FILES|CLONE_VM|CLONE_SIGHAND|CLONE_THREAD, + container); ++#endif + + mgr_tid = syscall(SYS_gettid); + diff --git a/super-intel-undefined-operation.patch b/super-intel-undefined-operation.patch new file mode 100644 index 0000000..c9a26c8 --- /dev/null +++ b/super-intel-undefined-operation.patch @@ -0,0 +1,24 @@ +super-intel.c:284: warning: operation on 'p' may be undefined +super-intel.c:284: warning: operation on 'p' may be undefined +super-intel.c:284: warning: operation on 'p' may be undefined + +The swap macros can evaluate their argument multiple times. +--- + super-intel.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- super-intel.c.orig ++++ super-intel.c +@@ -280,8 +280,10 @@ static __u32 __gen_imsm_checksum(struct + __u32 *p = (__u32 *) mpb; + __u32 sum = 0; + +- while (end--) +- sum += __le32_to_cpu(*p++); ++ while (end--) { ++ sum += __le32_to_cpu(*p); ++ p++; ++ } + + return sum - __le32_to_cpu(mpb->check_sum); + } From 8a0f82ca20bf0fb5ea0991e4011b3ca96c66e024c1f2b61148e64d4e6cc57d0d Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Thu, 6 Nov 2008 21:19:12 +0000 Subject: [PATCH 17/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=17 --- boot.md | 6 +++++- mdadm-3.0-devel1.tar.bz2 | 3 --- mdadm-3.0-devel2.tar.bz2 | 3 +++ mdadm.changes | 13 +++++++++++++ mdadm.spec | 14 ++++++++++++-- sysconfig.mdadm | 5 ++++- 6 files changed, 37 insertions(+), 7 deletions(-) delete mode 100644 mdadm-3.0-devel1.tar.bz2 create mode 100644 mdadm-3.0-devel2.tar.bz2 diff --git a/boot.md b/boot.md index 668352b..838aef0 100644 --- a/boot.md +++ b/boot.md @@ -130,7 +130,11 @@ case "$1" in # do auto-assemly only if /etc/mdadm.conf is missing # run at boot-time, so a fixed tmp name is safe rm -rf /tmp/mdadm.conf - if ! mdadm --examine --scan --config=partitions >/tmp/mdadm.conf + + if test "$BOOT_MD_USE_MDADM_CONFIG" = "part"; then + echo CREATE auto=part > /tmp/mdadm.conf + fi + if ! mdadm --examine --scan --config=partitions >>/tmp/mdadm.conf then echo "mdadm --examine --scan failed:" cat /tmp/mdadm.conf diff --git a/mdadm-3.0-devel1.tar.bz2 b/mdadm-3.0-devel1.tar.bz2 deleted file mode 100644 index 895f459..0000000 --- a/mdadm-3.0-devel1.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d996c9f69429fcb746a1bc7665ee8c413906996a75c2baeff7e9573487be7521 -size 236945 diff --git a/mdadm-3.0-devel2.tar.bz2 b/mdadm-3.0-devel2.tar.bz2 new file mode 100644 index 0000000..ac323c9 --- /dev/null +++ b/mdadm-3.0-devel2.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:40c18353b488cd1731349d4b585c3e14f3003e0d04f487c680f47b4500e1fcfc +size 246779 diff --git a/mdadm.changes b/mdadm.changes index ff84ada..09d3034 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Thu Nov 6 03:22:50 CET 2008 - nfbrown@suse.de + +- Update from mdadm-3.0-devel1 to mdadm-3.0-devel2. + This includes various bug fixes and enhancements to the + extent that DDF and IMSM work reasonably well and can be + auto-assembled much like other arrays. +- Allow BOOT_MD_USE_MDADM_CONFIG to have the value 'part' + that, like 'no', arrays are auto-assembled. However they + get assembled as 'mdp' partitionable arrays where possible. + This currently only affect arrays with v1.x metadata. + This supports FATE#303894 + ------------------------------------------------------------------- Fri Oct 3 15:28:49 CEST 2008 - mmarek@suse.cz diff --git a/mdadm.spec b/mdadm.spec index 33cfa29..9c076a6 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -20,8 +20,8 @@ Name: mdadm Version: 3.0 -Release: 3 -%define ver 3.0-devel1 +Release: 4 +%define ver 3.0-devel2 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq Obsoletes: raidtools @@ -141,6 +141,16 @@ rm -rf $RPM_BUILD_ROOT /lib/mkinitrd/scripts/boot-md.sh %changelog +* Thu Nov 06 2008 nfbrown@suse.de +- Update from mdadm-3.0-devel1 to mdadm-3.0-devel2. + This includes various bug fixes and enhancements to the + extent that DDF and IMSM work reasonably well and can be + auto-assembled much like other arrays. +- Allow BOOT_MD_USE_MDADM_CONFIG to have the value 'part' + that, like 'no', arrays are auto-assembled. However they + get assembled as 'mdp' partitionable arrays where possible. + This currently only affect arrays with v1.x metadata. + This supports FATE#303894 * Fri Oct 03 2008 mmarek@suse.cz - fixed mdmon's clone_monitor on ia64 * Fri Oct 03 2008 mmarek@suse.cz diff --git a/sysconfig.mdadm b/sysconfig.mdadm index 36324f9..9682950 100644 --- a/sysconfig.mdadm +++ b/sysconfig.mdadm @@ -51,10 +51,13 @@ MDADM_CONFIG="/etc/mdadm.conf" # MDADM_SEND_MAIL_ON_START=no -## Type: yesno +## Type: list(yes,no,part) ## Default: no # # "yes" for mdadm.conf to be used for array assembly on boot +# "no" for arrays to be automatically detected and assembled +# "part" is like "no" except that arrays with 1.x metadate +# will be assembled as partitionable arrays. # BOOT_MD_USE_MDADM_CONFIG=yes From 31b9d497b4a7f9a59fc07a381ce7bf7972ce3a10b6228b461a583195ffff10c1 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Fri, 7 Nov 2008 02:14:41 +0000 Subject: [PATCH 18/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=18 --- mdadm-destdir.patch | 11 +++++++++++ mdadm-overflow.patch | 11 +++++++++++ mdadm.changes | 7 +++++++ mdadm.spec | 10 +++++++++- 4 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 mdadm-destdir.patch create mode 100644 mdadm-overflow.patch diff --git a/mdadm-destdir.patch b/mdadm-destdir.patch new file mode 100644 index 0000000..0d816fa --- /dev/null +++ b/mdadm-destdir.patch @@ -0,0 +1,11 @@ +--- Makefile ++++ Makefile +@@ -199,7 +199,7 @@ + $(INSTALL) -D -m 644 mdadm.conf.5 $(DESTDIR)$(MAN5DIR)/mdadm.conf.5 + + install-udev: udev-md-raid.rules +- $(INSTALL) -D -m 644 udev-md-raid.rules /lib/udev/rules.d/64-md-raid.rules ++ $(INSTALL) -D -m 644 udev-md-raid.rules $(DESTDIR)/lib/udev/rules.d/64-md-raid.rules + + uninstall: + rm -f $(DESTDIR)$(MAN8DIR)/mdadm.8 md.4 $(DESTDIR)$(MAN4DIR)/md.4 $(DESTDIR)$(MAN5DIR)/mdadm.conf.5 $(DESTDIR)$(BINDIR)/mdadm diff --git a/mdadm-overflow.patch b/mdadm-overflow.patch new file mode 100644 index 0000000..d92cd1f --- /dev/null +++ b/mdadm-overflow.patch @@ -0,0 +1,11 @@ +--- mdopen.c ++++ mdopen.c +@@ -88,7 +88,7 @@ + if (chmod(name, stb2.st_mode & 07777)) + perror("chmod"); + } else { +- snprintf(sym, 10000, "%s%s%d", orig, odig?"p":"", i); ++ snprintf(sym, 1024, "%s%s%d", orig, odig?"p":"", i); + symlink(sym, name); + } + stat(name, &stb2); diff --git a/mdadm.changes b/mdadm.changes index 09d3034..1e94a52 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Nov 7 02:58:40 CET 2008 - ro@suse.de + +- buildfix: add missing DESTDIR to Makefile for udev rule +- fix len in snprintf to silence compiler warning about potential + overflow + ------------------------------------------------------------------- Thu Nov 6 03:22:50 CET 2008 - nfbrown@suse.de diff --git a/mdadm.spec b/mdadm.spec index 9c076a6..58ffecb 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -20,7 +20,7 @@ Name: mdadm Version: 3.0 -Release: 4 +Release: 5 %define ver 3.0-devel2 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq @@ -34,6 +34,8 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: %{name}-%{ver}.tar.bz2 Patch1: super-intel-undefined-operation.patch Patch2: mdmon-ia64-clone.patch +Patch3: mdadm-destdir.patch +Patch4: mdadm-overflow.patch Source1: Software-RAID.HOWTO.tar.bz2 Source2: sysconfig.mdadm Source3: mdadmd @@ -56,6 +58,8 @@ Authors: %setup -q -a1 -n %{name}-%{ver} %patch1 %patch2 +%patch3 +%patch4 %build %{suse_update_config -f} @@ -141,6 +145,10 @@ rm -rf $RPM_BUILD_ROOT /lib/mkinitrd/scripts/boot-md.sh %changelog +* Fri Nov 07 2008 ro@suse.de +- buildfix: add missing DESTDIR to Makefile for udev rule +- fix len in snprintf to silence compiler warning about potential + overflow * Thu Nov 06 2008 nfbrown@suse.de - Update from mdadm-3.0-devel1 to mdadm-3.0-devel2. This includes various bug fixes and enhancements to the From 89404fe74f7a8ed07dfa223b15f35efd59eb11c69fd544acaae78759b9ce7aba Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Fri, 7 Nov 2008 09:41:08 +0000 Subject: [PATCH 19/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=19 --- mdadm.changes | 5 +++++ mdadm.spec | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/mdadm.changes b/mdadm.changes index 1e94a52..c634021 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Nov 7 10:32:35 CET 2008 - ro@suse.de + +- remove udev rule (conflicting with file in udev package) + ------------------------------------------------------------------- Fri Nov 7 02:58:40 CET 2008 - ro@suse.de diff --git a/mdadm.spec b/mdadm.spec index 58ffecb..343567e 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -20,7 +20,7 @@ Name: mdadm Version: 3.0 -Release: 5 +Release: 6 %define ver 3.0-devel2 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq @@ -80,6 +80,8 @@ install -m 755 %{S:6} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/boot-md.sh install -m 644 %{S:2} $RPM_BUILD_ROOT%{_var}/adm/fillup-templates/ ln -sf ../../etc/init.d/mdadmd $RPM_BUILD_ROOT/%{_sbindir}/rcmdadmd install -d $RPM_BUILD_ROOT/var/run/mdadm +# remove here, using the one in the udev package +rm -f $RPM_BUILD_ROOT/lib/udev/rules.d/64-md-raid.rules %post [ -x /sbin/mkinitrd_setup ] && mkinitrd_setup @@ -135,7 +137,8 @@ rm -rf $RPM_BUILD_ROOT %doc Software-RAID.HOWTO/Software-RAID.HOWTO*{.txt,.html} %doc %{_mandir}/man?/* /sbin/* -/lib/udev +%dir /lib/udev +%dir /lib/udev/devices %{_sbindir}/* %{_var}/adm/fillup-templates/sysconfig.mdadm %dir /var/run/mdadm @@ -146,6 +149,8 @@ rm -rf $RPM_BUILD_ROOT %changelog * Fri Nov 07 2008 ro@suse.de +- remove udev rule (conflicting with file in udev package) +* Fri Nov 07 2008 ro@suse.de - buildfix: add missing DESTDIR to Makefile for udev rule - fix len in snprintf to silence compiler warning about potential overflow From b2dce9999ac01ff86763d22034a5eb115e6412e05bdd406f5e0263d49eb4880f Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Fri, 7 Nov 2008 14:24:02 +0000 Subject: [PATCH 20/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=20 --- Start-kpartx-for-imsm-devices.patch | 131 ++++++++++++++++++++++++++++ mdadm-auto-assemble.patch | 110 +++++++++++++++++++++++ mdadm.changes | 12 +++ mdadm.spec | 15 +++- 4 files changed, 267 insertions(+), 1 deletion(-) create mode 100644 Start-kpartx-for-imsm-devices.patch create mode 100644 mdadm-auto-assemble.patch diff --git a/Start-kpartx-for-imsm-devices.patch b/Start-kpartx-for-imsm-devices.patch new file mode 100644 index 0000000..9ff2216 --- /dev/null +++ b/Start-kpartx-for-imsm-devices.patch @@ -0,0 +1,131 @@ +From 057fb70bf4e4b284cc06299853122273815b1d6e Mon Sep 17 00:00:00 2001 +From: NeilBrown +Date: Fri, 7 Nov 2008 22:22:41 +1100 +Subject: [PATCH] Start kpartx for imsm devices. + +This probably wont get into mainline, but is need on SLES +to create partitions that the YaST partitioner has a chance +of recognising. + +Signed-off-by: NeilBrown +--- + Assemble.c | 4 +++- + Create.c | 3 +++ + Manage.c | 4 ++++ + mdadm.h | 1 + + super-intel.c | 2 +- + util.c | 25 +++++++++++++++++++++++++ + 6 files changed, 37 insertions(+), 2 deletions(-) + +diff --git a/Assemble.c b/Assemble.c +index 20c4be7..c597526 100644 +--- a/Assemble.c ++++ b/Assemble.c +@@ -1251,8 +1251,10 @@ int assemble_container_content(struct supertype *st, int mdfd, + fprintf(stderr, " (%d new)", working); + fprintf(stderr, "\n"); + } +- wait_for(chosen_name); + close(mdfd); ++ wait_for(chosen_name); ++ if (st->ss->match_metadata_desc("imsm")) ++ run_kpartx('a', chosen_name); + return 0; + /* FIXME should have an O_EXCL and wait for read-auto */ + } else { +diff --git a/Create.c b/Create.c +index 783ab09..4368107 100644 +--- a/Create.c ++++ b/Create.c +@@ -780,7 +780,10 @@ int Create(struct supertype *st, char *mddev, + ping_monitor(devnum2devname(st->container_dev)); + close(container_fd); + } ++ close(mdfd); + wait_for(chosen_name); ++ if (st->ss->match_metadata_desc("imsm")) ++ run_kpartx('a', chosen_name); + } else { + fprintf(stderr, Name ": not starting array - not enough devices.\n"); + } +diff --git a/Manage.c b/Manage.c +index 9424650..06f9e05 100644 +--- a/Manage.c ++++ b/Manage.c +@@ -219,8 +219,12 @@ int Manage_runstop(char *devname, int fd, int runstop, int quiet) + if (mdi && + mdi->array.level > 0 && + is_subarray(mdi->text_version)) { ++ struct map_ent *me = map_by_devnum(&map, devnum); + /* This is mdmon managed. */ + close(fd); ++ ++ /* Delete any kpartx partitions */ ++ run_kpartx('d', me->path); + if (sysfs_set_str(mdi, NULL, + "array_state", "inactive") < 0) { + if (quiet == 0) +diff --git a/mdadm.h b/mdadm.h +index 2b34acf..9d819f9 100644 +--- a/mdadm.h ++++ b/mdadm.h +@@ -833,6 +833,7 @@ extern char *devnum2devname(int num); + extern int devname2devnum(char *name); + extern int stat2devnum(struct stat *st); + extern int fd2devnum(int fd); ++extern void run_kpartx(char mode, char *dev); + + static inline int dev2major(int d) + { +diff --git a/super-intel.c b/super-intel.c +index a2b9bd2..5f06f30 100644 +--- a/super-intel.c ++++ b/super-intel.c +@@ -636,7 +636,7 @@ static void brief_examine_super_imsm(struct supertype *st) + getinfo_super_imsm(st, &info); + fname_from_uuid(st, &info, nbuf1,'-'); + printf("ARRAY /dev/md/%.16s container=%s\n" +- " member=%d auto=mdp UUID=%s\n", ++ " member=%d auto=md UUID=%s\n", + dev->volume, nbuf + 5, i, nbuf1 + 5); + } + } +diff --git a/util.c b/util.c +index 8845a0f..f21d2bb 100644 +--- a/util.c ++++ b/util.c +@@ -1327,6 +1327,31 @@ void append_metadata_update(struct supertype *st, void *buf, int len) + } + #endif /* MDASSEMBLE */ + ++void run_kpartx(char mode, char *dev) ++{ ++ char buf[1024]; ++ char *cp; ++ ++ sprintf(buf, "/sbin/kpartx > /dev/null 2>&1 -%c '", mode); ++ ++ cp = buf + strlen(buf); ++ while (cp < buf+sizeof(buf)-10 && ++ *dev) { ++ if (*dev == '\'') { ++ *cp++ = '\''; ++ *cp++ = '\\'; ++ *cp++ = '\''; ++ /* *cp++ = '\''; */ ++ } ++ *cp ++ = *dev++; ++ } ++ *cp++ = '\''; ++ *cp++ = 0; ++ system(buf); ++} ++ ++ ++ + #ifdef __TINYC__ + /* tinyc doesn't optimize this check in ioctl.h out ... */ + unsigned int __invalid_size_argument_for_IOC = 0; +-- +1.5.6.5 + diff --git a/mdadm-auto-assemble.patch b/mdadm-auto-assemble.patch new file mode 100644 index 0000000..716d60c --- /dev/null +++ b/mdadm-auto-assemble.patch @@ -0,0 +1,110 @@ +diff --git a/Assemble.c b/Assemble.c +index c86a165..20c4be7 100644 +--- a/Assemble.c ++++ b/Assemble.c +@@ -320,7 +320,7 @@ int Assemble(struct supertype *st, char *mddev, + + tmpdev->content = content->next; + if (tmpdev->content == NULL) +- tmpdev->used = 1; ++ tmpdev->used = 2; + + } else if (ident->container || ident->member) { + /* No chance of this matching if we don't have +@@ -396,12 +396,15 @@ int Assemble(struct supertype *st, char *mddev, + * looking. If the chosen member is active, skip. + */ + if (is_member_busy(content->text_version)) { ++ if (report_missmatch) ++ fprintf(stderr, Name ": member %s in %s is already assembled\n", ++ content->text_version, ++ devname); ++ tst->ss->free_super(tst); ++ tst = NULL; ++ content = NULL; + if (auto_assem) + goto loop; +- fprintf(stderr, Name ": member %s in %s is already assembled\n", +- content->text_version, +- devname); +- tst->ss->free_super(tst); + return 1; + } + st = tst; tst = NULL; +@@ -1202,8 +1205,10 @@ int assemble_container_content(struct supertype *st, int mdfd, + + sra = sysfs_read(mdfd, 0, GET_VERSION); + if (sra == NULL || strcmp(sra->text_version, content->text_version) != 0) +- if (sysfs_set_array(content, md_get_version(mdfd)) != 0) ++ if (sysfs_set_array(content, md_get_version(mdfd)) != 0) { ++ close(mdfd); + return 1; ++ } + if (sra) + sysfs_free(sra); + +@@ -1212,9 +1217,10 @@ int assemble_container_content(struct supertype *st, int mdfd, + working++; + else if (errno == EEXIST) + preexist++; +- if (working == 0) +- /* Nothing new, don't try to start */ ; +- else if (runstop > 0 || ++ if (working == 0) { ++ close(mdfd); ++ return 1;/* Nothing new, don't try to start */ ++ } else if (runstop > 0 || + (working + preexist) >= content->array.working_disks) { + + map_update(&map, fd2devnum(mdfd), +@@ -1246,15 +1252,18 @@ int assemble_container_content(struct supertype *st, int mdfd, + fprintf(stderr, "\n"); + } + wait_for(chosen_name); ++ close(mdfd); ++ return 0; + /* FIXME should have an O_EXCL and wait for read-auto */ +- } else ++ } else { + if (verbose >= 0) + fprintf(stderr, Name + ": %s assembled with %d devices but " + "not started\n", + chosen_name, working); +- +- return 0; ++ close(mdfd); ++ return 1; ++ } + } + #endif + +diff --git a/Create.c b/Create.c +index da05eed..783ab09 100644 +--- a/Create.c ++++ b/Create.c +@@ -780,11 +780,11 @@ int Create(struct supertype *st, char *mddev, + ping_monitor(devnum2devname(st->container_dev)); + close(container_fd); + } ++ wait_for(chosen_name); + } else { + fprintf(stderr, Name ": not starting array - not enough devices.\n"); + } + close(mdfd); +- wait_for(chosen_name); + return 0; + + abort: +diff --git a/Incremental.c b/Incremental.c +index ff8aa9a..474f78d 100644 +--- a/Incremental.c ++++ b/Incremental.c +@@ -829,7 +829,6 @@ int Incremental_container(struct supertype *st, char *devname, int verbose, + + err = assemble_container_content(st, mdfd, ra, runstop, + chosen_name, verbose); +- close(mdfd); + if (err) + return err; + } diff --git a/mdadm.changes b/mdadm.changes index c634021..b91a6b5 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Fri Nov 7 12:34:30 CET 2008 - nfbrown@suse.de + +- mdadm-auto-assemble.patch - fix various bugs in + auto-assemble +- start-kpartx-for-imsm-devices.patch - IMSM devices + need to be partitioned, and may programs including + YaST don't understand partitioned md devices, + so run kpartx to create 'dm' based partitions which + have a better chance for being understood + This relates to FATE#304220 + ------------------------------------------------------------------- Fri Nov 7 10:32:35 CET 2008 - ro@suse.de diff --git a/mdadm.spec b/mdadm.spec index 343567e..c7422e5 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -20,7 +20,7 @@ Name: mdadm Version: 3.0 -Release: 6 +Release: 7 %define ver 3.0-devel2 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq @@ -36,6 +36,8 @@ Patch1: super-intel-undefined-operation.patch Patch2: mdmon-ia64-clone.patch Patch3: mdadm-destdir.patch Patch4: mdadm-overflow.patch +Patch5: mdadm-auto-assemble.patch +Patch6: Start-kpartx-for-imsm-devices.patch Source1: Software-RAID.HOWTO.tar.bz2 Source2: sysconfig.mdadm Source3: mdadmd @@ -60,6 +62,8 @@ Authors: %patch2 %patch3 %patch4 +%patch5 +%patch6 %build %{suse_update_config -f} @@ -148,6 +152,15 @@ rm -rf $RPM_BUILD_ROOT /lib/mkinitrd/scripts/boot-md.sh %changelog +* Fri Nov 07 2008 nfbrown@suse.de +- mdadm-auto-assemble.patch - fix various bugs in + auto-assemble +- start-kpartx-for-imsm-devices.patch - IMSM devices + need to be partitioned, and may programs including + YaST don't understand partitioned md devices, + so run kpartx to create 'dm' based partitions which + have a better chance for being understood + This relates to FATE#304220 * Fri Nov 07 2008 ro@suse.de - remove udev rule (conflicting with file in udev package) * Fri Nov 07 2008 ro@suse.de From a081c7b76afb9911a46836a90da9451f7b17a4f5741480f6a3e96d1aef1647b4 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Sun, 9 Nov 2008 23:30:20 +0000 Subject: [PATCH 21/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=21 --- mdadm.changes | 5 +++++ mdadm.spec | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/mdadm.changes b/mdadm.changes index b91a6b5..38bd538 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Sun Nov 9 23:38:39 CET 2008 - ro@suse.de + +- fix patch apply depth + ------------------------------------------------------------------- Fri Nov 7 12:34:30 CET 2008 - nfbrown@suse.de diff --git a/mdadm.spec b/mdadm.spec index c7422e5..707f49e 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -20,7 +20,7 @@ Name: mdadm Version: 3.0 -Release: 7 +Release: 8 %define ver 3.0-devel2 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq @@ -62,8 +62,8 @@ Authors: %patch2 %patch3 %patch4 -%patch5 -%patch6 +%patch5 -p1 +%patch6 -p1 %build %{suse_update_config -f} @@ -152,6 +152,8 @@ rm -rf $RPM_BUILD_ROOT /lib/mkinitrd/scripts/boot-md.sh %changelog +* Sun Nov 09 2008 ro@suse.de +- fix patch apply depth * Fri Nov 07 2008 nfbrown@suse.de - mdadm-auto-assemble.patch - fix various bugs in auto-assemble From 983c220251151cf6b909ae7b2bd94e91d338d51d1bf237672b05458985fb4ee5 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Mon, 17 Nov 2008 16:22:54 +0000 Subject: [PATCH 22/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=22 --- intel.fixes.patch | 623 ++++++++++++++++++++++++++ mdadm.changes | 8 + mdadm.spec | 11 +- mdmon-ia64-clone.patch | 4 +- name.fixes.patch | 62 +++ super-intel-undefined-operation.patch | 4 +- 6 files changed, 709 insertions(+), 3 deletions(-) create mode 100644 intel.fixes.patch create mode 100644 name.fixes.patch diff --git a/intel.fixes.patch b/intel.fixes.patch new file mode 100644 index 0000000..c033649 --- /dev/null +++ b/intel.fixes.patch @@ -0,0 +1,623 @@ +Multiple patches combined, fixing various issues with Intel metadata. + +commit 92bd8f8d3f2c9c7733f92a062a0752d9b9997673 +Author: Dan Williams +Date: Sat Nov 8 16:03:07 2008 -0700 + + imsm: fix uuid_from_super given 'signature' is not constant + + The version portion of the signature changes depending on the contents + of the container. + + Signed-off-by: Dan Williams + +commit 4d1313e9017e2608bfd2d01f854c19e23f7daf62 +Author: Dan Williams +Date: Sat Nov 8 16:03:07 2008 -0700 + + imsm: compatibility fixes for creating imsm arrays + + When creating an imsm array use the lowest possible feature set to + maximize compatibility. + + Signed-off-by: Dan Williams + +commit f2f27e63c44baac976b0022c6830393954d59fd4 +Author: Dan Williams +Date: Sat Nov 8 16:02:56 2008 -0700 + + imsm: fixup disk status definition endianess + + Change the multibyte disk status field definitions to imsm byte-order + (little-endian) to match other multibyte field definitions. + + Signed-off-by: Dan Williams + +commit fe7ed8cb4f43e8324ca526e4a56fb23095f0023b +Author: Dan Williams +Date: Sat Nov 8 15:47:39 2008 -0700 + + imsm: add definitions for recent imsm versions + + Signed-off-by: Dan Williams + +commit e3bba0e010e5ce61a804139ee77ef8e25a244dd1 +Author: Dan Williams +Date: Fri Nov 7 15:57:31 2008 -0700 + + imsm: cleanup migration definitions and usage + + imsm_set_array_state need not look at the map_state when failed==0 + + Signed-off-by: Dan Williams + +commit 5115ca67fd28a0d2f4f156fbbbdf8f648c83fc20 +Author: Dan Williams +Date: Fri Nov 7 15:08:09 2008 -0700 + + imsm: cleanup ->match_home and comment on return value + + Signed-off-by: Dan Williams +diff --git a/super-intel.c b/super-intel.c +index 5f06f30..d160b6a 100644 +--- a/super-intel.c ++++ b/super-intel.c +@@ -30,9 +30,25 @@ + #define MPB_SIG_LEN (strlen(MPB_SIGNATURE)) + #define MPB_VERSION_RAID0 "1.0.00" + #define MPB_VERSION_RAID1 "1.1.00" ++#define MPB_VERSION_MANY_VOLUMES_PER_ARRAY "1.2.00" ++#define MPB_VERSION_3OR4_DISK_ARRAY "1.2.01" + #define MPB_VERSION_RAID5 "1.2.02" ++#define MPB_VERSION_5OR6_DISK_ARRAY "1.2.04" ++#define MPB_VERSION_CNG "1.2.06" ++#define MPB_VERSION_ATTRIBS "1.3.00" + #define MAX_SIGNATURE_LENGTH 32 + #define MAX_RAID_SERIAL_LEN 16 ++ ++#define MPB_ATTRIB_CHECKSUM_VERIFY __cpu_to_le32(0x80000000) ++#define MPB_ATTRIB_PM __cpu_to_le32(0x40000000) ++#define MPB_ATTRIB_2TB __cpu_to_le32(0x20000000) ++#define MPB_ATTRIB_RAID0 __cpu_to_le32(0x00000001) ++#define MPB_ATTRIB_RAID1 __cpu_to_le32(0x00000002) ++#define MPB_ATTRIB_RAID10 __cpu_to_le32(0x00000004) ++#define MPB_ATTRIB_RAID1E __cpu_to_le32(0x00000008) ++#define MPB_ATTRIB_RAID5 __cpu_to_le32(0x00000010) ++#define MPB_ATTRIB_RAIDCNG __cpu_to_le32(0x00000020) ++ + #define MPB_SECTOR_CNT 418 + #define IMSM_RESERVED_SECTORS 4096 + +@@ -42,13 +58,13 @@ struct imsm_disk { + __u8 serial[MAX_RAID_SERIAL_LEN];/* 0xD8 - 0xE7 ascii serial number */ + __u32 total_blocks; /* 0xE8 - 0xEB total blocks */ + __u32 scsi_id; /* 0xEC - 0xEF scsi ID */ ++#define SPARE_DISK __cpu_to_le32(0x01) /* Spare */ ++#define CONFIGURED_DISK __cpu_to_le32(0x02) /* Member of some RaidDev */ ++#define FAILED_DISK __cpu_to_le32(0x04) /* Permanent failure */ ++#define USABLE_DISK __cpu_to_le32(0x08) /* Fully usable unless FAILED_DISK is set */ + __u32 status; /* 0xF0 - 0xF3 */ +-#define SPARE_DISK 0x01 /* Spare */ +-#define CONFIGURED_DISK 0x02 /* Member of some RaidDev */ +-#define FAILED_DISK 0x04 /* Permanent failure */ +-#define USABLE_DISK 0x08 /* Fully usable unless FAILED_DISK is set */ +- +-#define IMSM_DISK_FILLERS 5 ++ __u32 owner_cfg_num; /* which config 0,1,2... owns this disk */ ++#define IMSM_DISK_FILLERS 4 + __u32 filler[IMSM_DISK_FILLERS]; /* 0xF4 - 0x107 MPB_DISK_FILLERS for future expansion */ + }; + +@@ -61,14 +77,16 @@ struct imsm_map { + __u8 map_state; /* Normal, Uninitialized, Degraded, Failed */ + #define IMSM_T_STATE_NORMAL 0 + #define IMSM_T_STATE_UNINITIALIZED 1 +-#define IMSM_T_STATE_DEGRADED 2 /* FIXME: is this correct? */ +-#define IMSM_T_STATE_FAILED 3 /* FIXME: is this correct? */ ++#define IMSM_T_STATE_DEGRADED 2 ++#define IMSM_T_STATE_FAILED 3 + __u8 raid_level; + #define IMSM_T_RAID0 0 + #define IMSM_T_RAID1 1 + #define IMSM_T_RAID5 5 /* since metadata version 1.2.02 ? */ + __u8 num_members; /* number of member disks */ +- __u8 reserved[3]; ++ __u8 num_domains; /* number of parity domains */ ++ __u8 failed_disk_num; /* valid only when state is degraded */ ++ __u8 reserved[1]; + __u32 filler[7]; /* expansion area */ + #define IMSM_ORD_REBUILD (1 << 24) + __u32 disk_ord_tbl[1]; /* disk_ord_tbl[num_members], +@@ -78,23 +96,50 @@ struct imsm_map { + + struct imsm_vol { + __u32 curr_migr_unit; +- __u32 reserved; ++ __u32 checkpoint_id; /* id to access curr_migr_unit */ + __u8 migr_state; /* Normal or Migrating */ ++#define MIGR_INIT 0 ++#define MIGR_REBUILD 1 ++#define MIGR_VERIFY 2 /* analagous to echo check > sync_action */ ++#define MIGR_GEN_MIGR 3 ++#define MIGR_STATE_CHANGE 4 + __u8 migr_type; /* Initializing, Rebuilding, ... */ + __u8 dirty; +- __u8 fill[1]; +- __u32 filler[5]; ++ __u8 fs_state; /* fast-sync state for CnG (0xff == disabled) */ ++ __u16 verify_errors; /* number of mismatches */ ++ __u16 bad_blocks; /* number of bad blocks during verify */ ++ __u32 filler[4]; + struct imsm_map map[1]; + /* here comes another one if migr_state */ + } __attribute__ ((packed)); + + struct imsm_dev { +- __u8 volume[MAX_RAID_SERIAL_LEN]; ++ __u8 volume[MAX_RAID_SERIAL_LEN]; + __u32 size_low; + __u32 size_high; ++#define DEV_BOOTABLE __cpu_to_le32(0x01) ++#define DEV_BOOT_DEVICE __cpu_to_le32(0x02) ++#define DEV_READ_COALESCING __cpu_to_le32(0x04) ++#define DEV_WRITE_COALESCING __cpu_to_le32(0x08) ++#define DEV_LAST_SHUTDOWN_DIRTY __cpu_to_le32(0x10) ++#define DEV_HIDDEN_AT_BOOT __cpu_to_le32(0x20) ++#define DEV_CURRENTLY_HIDDEN __cpu_to_le32(0x40) ++#define DEV_VERIFY_AND_FIX __cpu_to_le32(0x80) ++#define DEV_MAP_STATE_UNINIT __cpu_to_le32(0x100) ++#define DEV_NO_AUTO_RECOVERY __cpu_to_le32(0x200) ++#define DEV_CLONE_N_GO __cpu_to_le32(0x400) ++#define DEV_CLONE_MAN_SYNC __cpu_to_le32(0x800) ++#define DEV_CNG_MASTER_DISK_NUM __cpu_to_le32(0x1000) + __u32 status; /* Persistent RaidDev status */ + __u32 reserved_blocks; /* Reserved blocks at beginning of volume */ +-#define IMSM_DEV_FILLERS 12 ++ __u8 migr_priority; ++ __u8 num_sub_vols; ++ __u8 tid; ++ __u8 cng_master_disk; ++ __u16 cache_policy; ++ __u8 cng_state; ++ __u8 cng_sub_state; ++#define IMSM_DEV_FILLERS 10 + __u32 filler[IMSM_DEV_FILLERS]; + struct imsm_vol vol; + } __attribute__ ((packed)); +@@ -546,7 +591,7 @@ static void print_imsm_disk(struct imsm_super *mpb, int index, __u32 reserved) + printf("\n"); + snprintf(str, MAX_RAID_SERIAL_LEN + 1, "%s", disk->serial); + printf(" Disk%02d Serial : %s\n", index, str); +- s = __le32_to_cpu(disk->status); ++ s = disk->status; + printf(" State :%s%s%s%s\n", s&SPARE_DISK ? " spare" : "", + s&CONFIGURED_DISK ? " active" : "", + s&FAILED_DISK ? " failed" : "", +@@ -663,7 +708,14 @@ static void brief_detail_super_imsm(struct supertype *st) + + static int match_home_imsm(struct supertype *st, char *homehost) + { +- printf("%s\n", __FUNCTION__); ++ /* the imsm metadata format does not specify any host ++ * identification information. We return -1 since we can never ++ * confirm nor deny whether a given array is "meant" for this ++ * host. We rely on compare_super and the 'family_num' field to ++ * exclude member disks that do not belong, and we rely on ++ * mdadm.conf to specify the arrays that should be assembled. ++ * Auto-assembly may still pick up "foreign" arrays. ++ */ + + return -1; + } +@@ -699,7 +751,7 @@ static void uuid_from_super_imsm(struct supertype *st, int uuid[4]) + struct imsm_dev *dev = NULL; + + sha1_init_ctx(&ctx); +- sha1_process_bytes(super->anchor->sig, MAX_SIGNATURE_LENGTH, &ctx); ++ sha1_process_bytes(super->anchor->sig, MPB_SIG_LEN, &ctx); + sha1_process_bytes(&super->anchor->family_num, sizeof(__u32), &ctx); + if (super->current_vol >= 0) + dev = get_imsm_dev(super, super->current_vol); +@@ -838,7 +890,7 @@ static void getinfo_super_imsm(struct supertype *st, struct mdinfo *info) + disk = &super->disks->disk; + info->data_offset = __le32_to_cpu(disk->total_blocks) - reserved; + info->component_size = reserved; +- s = __le32_to_cpu(disk->status); ++ s = disk->status; + info->disk.state = s & CONFIGURED_DISK ? (1 << MD_DISK_ACTIVE) : 0; + info->disk.state |= s & FAILED_DISK ? (1 << MD_DISK_FAULTY) : 0; + info->disk.state |= s & SPARE_DISK ? 0 : (1 << MD_DISK_SYNC); +@@ -1127,16 +1179,13 @@ load_imsm_disk(int fd, struct intel_super *super, char *devname, int keep_fd) + disk_iter = __get_imsm_disk(super->anchor, i); + + if (serialcmp(disk_iter->serial, dl->serial) == 0) { +- __u32 status; +- + dl->disk = *disk_iter; +- status = __le32_to_cpu(dl->disk.status); + /* only set index on disks that are a member of a + * populated contianer, i.e. one with raid_devs + */ +- if (status & FAILED_DISK) ++ if (dl->disk.status & FAILED_DISK) + dl->index = -2; +- else if (status & SPARE_DISK) ++ else if (dl->disk.status & SPARE_DISK) + dl->index = -1; + else + dl->index = i; +@@ -1148,7 +1197,7 @@ load_imsm_disk(int fd, struct intel_super *super, char *devname, int keep_fd) + /* no match, maybe a stale failed drive */ + if (i == super->anchor->num_disks && dl->index >= 0) { + dl->disk = *__get_imsm_disk(super->anchor, dl->index); +- if (__le32_to_cpu(dl->disk.status) & FAILED_DISK) ++ if (dl->disk.status & FAILED_DISK) + dl->index = -2; + } + +@@ -1171,11 +1220,11 @@ static void imsm_copy_dev(struct imsm_dev *dest, struct imsm_dev *src) + * + * Migration is indicated by one of the following states + * 1/ Idle (migr_state=0 map0state=normal||unitialized||degraded||failed) +- * 2/ Initialize (migr_state=1 migr_type=0 map0state=normal ++ * 2/ Initialize (migr_state=1 migr_type=MIGR_INIT map0state=normal + * map1state=unitialized) +- * 3/ Verify (Resync) (migr_state=1 migr_type=1 map0state=normal ++ * 3/ Verify (Resync) (migr_state=1 migr_type=MIGR_REBUILD map0state=normal + * map1state=normal) +- * 4/ Rebuild (migr_state=1 migr_type=1 map0state=normal ++ * 4/ Rebuild (migr_state=1 migr_type=MIGR_REBUILD map0state=normal + * map1state=degraded) + */ + static void migrate(struct imsm_dev *dev, __u8 to_state, int rebuild_resync) +@@ -1451,7 +1500,6 @@ static int find_missing(struct intel_super *super) + struct imsm_super *mpb = super->anchor; + struct dl *dl; + struct imsm_disk *disk; +- __u32 status; + + for (i = 0; i < mpb->num_disks; i++) { + disk = __get_imsm_disk(mpb, i); +@@ -1463,8 +1511,7 @@ static int find_missing(struct intel_super *super) + /* ok we have a 'disk' without a live entry in + * super->disks + */ +- status = __le32_to_cpu(disk->status); +- if (status & FAILED_DISK || !(status & USABLE_DISK)) ++ if (disk->status & FAILED_DISK || !(disk->status & USABLE_DISK)) + continue; /* never mind, already marked */ + + dl = malloc(sizeof(*dl)); +@@ -1659,6 +1706,53 @@ static __u32 info_to_blocks_per_member(mdu_array_info_t *info) + return (info->size * 2) & ~(info_to_blocks_per_strip(info) - 1); + } + ++static void imsm_update_version_info(struct intel_super *super) ++{ ++ /* update the version and attributes */ ++ struct imsm_super *mpb = super->anchor; ++ char *version; ++ struct imsm_dev *dev; ++ struct imsm_map *map; ++ int i; ++ ++ for (i = 0; i < mpb->num_raid_devs; i++) { ++ dev = get_imsm_dev(super, i); ++ map = get_imsm_map(dev, 0); ++ if (__le32_to_cpu(dev->size_high) > 0) ++ mpb->attributes |= MPB_ATTRIB_2TB; ++ ++ /* FIXME detect when an array spans a port multiplier */ ++ #if 0 ++ mpb->attributes |= MPB_ATTRIB_PM; ++ #endif ++ ++ if (mpb->num_raid_devs > 1 || ++ mpb->attributes != MPB_ATTRIB_CHECKSUM_VERIFY) { ++ version = MPB_VERSION_ATTRIBS; ++ switch (get_imsm_raid_level(map)) { ++ case 0: mpb->attributes |= MPB_ATTRIB_RAID0; break; ++ case 1: mpb->attributes |= MPB_ATTRIB_RAID1; break; ++ case 10: mpb->attributes |= MPB_ATTRIB_RAID10; break; ++ case 5: mpb->attributes |= MPB_ATTRIB_RAID5; break; ++ } ++ } else { ++ if (map->num_members >= 5) ++ version = MPB_VERSION_5OR6_DISK_ARRAY; ++ else if (dev->status == DEV_CLONE_N_GO) ++ version = MPB_VERSION_CNG; ++ else if (get_imsm_raid_level(map) == 5) ++ version = MPB_VERSION_RAID5; ++ else if (map->num_members >= 3) ++ version = MPB_VERSION_3OR4_DISK_ARRAY; ++ else if (get_imsm_raid_level(map) == 1) ++ version = MPB_VERSION_RAID1; ++ else ++ version = MPB_VERSION_RAID0; ++ } ++ strcpy(((char *) mpb->sig) + strlen(MPB_SIGNATURE), version); ++ } ++} ++ + static int init_super_imsm_volume(struct supertype *st, mdu_array_info_t *info, + unsigned long long size, char *name, + char *homehost, int *uuid) +@@ -1724,7 +1818,7 @@ static int init_super_imsm_volume(struct supertype *st, mdu_array_info_t *info, + dev->reserved_blocks = __cpu_to_le32(0); + vol = &dev->vol; + vol->migr_state = 0; +- vol->migr_type = 0; ++ vol->migr_type = MIGR_INIT; + vol->dirty = 0; + vol->curr_migr_unit = 0; + for (i = 0; i < idx; i++) { +@@ -1747,10 +1841,13 @@ static int init_super_imsm_volume(struct supertype *st, mdu_array_info_t *info, + "in a raid1 volume\n"); + return 0; + } +- if (info->level == 10) ++ if (info->level == 10) { + map->raid_level = 1; +- else ++ map->num_domains = info->raid_disks / 2; ++ } else { + map->raid_level = info->level; ++ map->num_domains = !!map->raid_level; ++ } + + map->num_members = info->raid_disks; + for (i = 0; i < map->num_members; i++) { +@@ -1760,6 +1857,8 @@ static int init_super_imsm_volume(struct supertype *st, mdu_array_info_t *info, + mpb->num_raid_devs++; + super->dev_tbl[super->current_vol] = dev; + ++ imsm_update_version_info(super); ++ + return 1; + } + +@@ -1778,6 +1877,7 @@ static int init_super_imsm(struct supertype *st, mdu_array_info_t *info, + struct intel_super *super; + struct imsm_super *mpb; + size_t mpb_size; ++ char *version; + + if (!info) { + st->sb = NULL; +@@ -1798,9 +1898,12 @@ static int init_super_imsm(struct supertype *st, mdu_array_info_t *info, + mpb = super->buf; + memset(mpb, 0, mpb_size); + +- memcpy(mpb->sig, MPB_SIGNATURE, strlen(MPB_SIGNATURE)); +- memcpy(mpb->sig + strlen(MPB_SIGNATURE), MPB_VERSION_RAID5, +- strlen(MPB_VERSION_RAID5)); ++ mpb->attributes = MPB_ATTRIB_CHECKSUM_VERIFY; ++ ++ version = (char *) mpb->sig; ++ strcpy(version, MPB_SIGNATURE); ++ version += strlen(MPB_SIGNATURE); ++ strcpy(version, MPB_VERSION_RAID0); + mpb->mpb_size = mpb_size; + + st->sb = super; +@@ -1816,7 +1919,6 @@ static void add_to_super_imsm_volume(struct supertype *st, mdu_disk_info_t *dk, + struct dl *dl; + struct imsm_dev *dev; + struct imsm_map *map; +- __u32 status; + + dev = get_imsm_dev(super, super->current_vol); + map = get_imsm_map(dev, 0); +@@ -1835,8 +1937,7 @@ static void add_to_super_imsm_volume(struct supertype *st, mdu_disk_info_t *dk, + super->anchor->num_disks++; + } + set_imsm_ord_tbl_ent(map, dk->number, dl->index); +- status = CONFIGURED_DISK | USABLE_DISK; +- dl->disk.status = __cpu_to_le32(status); ++ dl->disk.status = CONFIGURED_DISK | USABLE_DISK; + + /* if we are creating the first raid device update the family number */ + if (super->current_vol == 0) { +@@ -1857,7 +1958,7 @@ static void add_to_super_imsm(struct supertype *st, mdu_disk_info_t *dk, + struct intel_super *super = st->sb; + struct dl *dd; + unsigned long long size; +- __u32 status, id; ++ __u32 id; + int rv; + struct stat stb; + +@@ -1889,10 +1990,9 @@ static void add_to_super_imsm(struct supertype *st, mdu_disk_info_t *dk, + + get_dev_size(fd, NULL, &size); + size /= 512; +- status = USABLE_DISK | SPARE_DISK; + serialcpy(dd->disk.serial, dd->serial); + dd->disk.total_blocks = __cpu_to_le32(size); +- dd->disk.status = __cpu_to_le32(status); ++ dd->disk.status = USABLE_DISK | SPARE_DISK; + if (sysfs_disk_to_scsi_id(fd, &id) == 0) + dd->disk.scsi_id = __cpu_to_le32(id); + else +@@ -2392,7 +2492,7 @@ static struct mdinfo *container_content_imsm(struct supertype *st) + if (d == NULL) + skip = 1; + +- s = d ? __le32_to_cpu(d->disk.status) : 0; ++ s = d ? d->disk.status : 0; + if (s & FAILED_DISK) + skip = 1; + if (!(s & USABLE_DISK)) +@@ -2502,8 +2602,7 @@ static __u8 imsm_check_degraded(struct intel_super *super, struct imsm_dev *dev, + insync = 2; + + disk = get_imsm_disk(super, idx); +- if (!disk || +- __le32_to_cpu(disk->status) & FAILED_DISK || ++ if (!disk || disk->status & FAILED_DISK || + ord & IMSM_ORD_REBUILD) + insync--; + +@@ -2541,8 +2640,7 @@ static int imsm_count_failed(struct intel_super *super, struct imsm_dev *dev) + int idx = ord_to_idx(ord); + + disk = get_imsm_disk(super, idx); +- if (!disk || +- __le32_to_cpu(disk->status) & FAILED_DISK || ++ if (!disk || disk->status & FAILED_DISK || + ord & IMSM_ORD_REBUILD) + failed++; + } +@@ -2557,7 +2655,7 @@ static int is_resyncing(struct imsm_dev *dev) + if (!dev->vol.migr_state) + return 0; + +- if (dev->vol.migr_type == 0) ++ if (dev->vol.migr_type == MIGR_INIT) + return 1; + + migr_map = get_imsm_map(dev, 1); +@@ -2575,7 +2673,7 @@ static int is_rebuilding(struct imsm_dev *dev) + if (!dev->vol.migr_state) + return 0; + +- if (dev->vol.migr_type == 0) ++ if (dev->vol.migr_type != MIGR_REBUILD) + return 0; + + migr_map = get_imsm_map(dev, 1); +@@ -2588,12 +2686,9 @@ static int is_rebuilding(struct imsm_dev *dev) + + static void mark_failure(struct imsm_disk *disk) + { +- __u32 status = __le32_to_cpu(disk->status); +- +- if (status & FAILED_DISK) ++ if (disk->status & FAILED_DISK) + return; +- status |= FAILED_DISK; +- disk->status = __cpu_to_le32(status); ++ disk->status |= FAILED_DISK; + disk->scsi_id = __cpu_to_le32(~(__u32)0); + memmove(&disk->serial[0], &disk->serial[1], MAX_RAID_SERIAL_LEN - 1); + } +@@ -2641,9 +2736,10 @@ static int imsm_set_array_state(struct active_array *a, int consistent) + } else if (!is_resyncing(dev) && !failed) { + /* mark the start of the init process if nothing is failed */ + dprintf("imsm: mark resync start (%llu)\n", a->resync_start); +- map->map_state = map_state; +- migrate(dev, IMSM_T_STATE_NORMAL, +- map->map_state == IMSM_T_STATE_NORMAL); ++ if (map->map_state == IMSM_T_STATE_NORMAL) ++ migrate(dev, IMSM_T_STATE_NORMAL, MIGR_REBUILD); ++ else ++ migrate(dev, IMSM_T_STATE_NORMAL, MIGR_INIT); + super->updates_pending++; + } + +@@ -2676,7 +2772,6 @@ static void imsm_set_disk(struct active_array *a, int n, int state) + struct imsm_map *map = get_imsm_map(dev, 0); + struct imsm_disk *disk; + int failed; +- __u32 status; + __u32 ord; + __u8 map_state; + +@@ -2693,8 +2788,7 @@ static void imsm_set_disk(struct active_array *a, int n, int state) + disk = get_imsm_disk(super, ord_to_idx(ord)); + + /* check for new failures */ +- status = __le32_to_cpu(disk->status); +- if ((state & DS_FAULTY) && !(status & FAILED_DISK)) { ++ if ((state & DS_FAULTY) && !(disk->status & FAILED_DISK)) { + mark_failure(disk); + super->updates_pending++; + } +@@ -2781,7 +2875,7 @@ static struct dl *imsm_readd(struct intel_super *super, int idx, struct active_a + if (dl->index == i) + break; + +- if (dl && __le32_to_cpu(dl->disk.status) & FAILED_DISK) ++ if (dl && dl->disk.status & FAILED_DISK) + dl = NULL; + + if (dl) +@@ -2802,7 +2896,6 @@ static struct dl *imsm_add_spare(struct intel_super *super, int slot, struct act + int j; + int found; + __u32 array_start; +- __u32 status; + struct dl *dl; + + for (dl = super->disks; dl; dl = dl->next) { +@@ -2818,11 +2911,10 @@ static struct dl *imsm_add_spare(struct intel_super *super, int slot, struct act + continue; + + /* skip in use or failed drives */ +- status = __le32_to_cpu(dl->disk.status); +- if (status & FAILED_DISK || idx == dl->index) { ++ if (dl->disk.status & FAILED_DISK || idx == dl->index) { + dprintf("%x:%x status ( %s%s)\n", + dl->major, dl->minor, +- status & FAILED_DISK ? "failed " : "", ++ dl->disk.status & FAILED_DISK ? "failed " : "", + idx == dl->index ? "in use " : ""); + continue; + } +@@ -3072,7 +3164,6 @@ static void imsm_process_update(struct supertype *st, + struct imsm_map *migr_map; + struct active_array *a; + struct imsm_disk *disk; +- __u32 status; + __u8 to_state; + struct dl *dl; + unsigned int found; +@@ -3101,8 +3192,7 @@ static void imsm_process_update(struct supertype *st, + if (i == u->slot) + continue; + disk = get_imsm_disk(super, get_imsm_disk_idx(dev, i)); +- if (!disk || +- __le32_to_cpu(disk->status) & FAILED_DISK) ++ if (!disk || disk->status & FAILED_DISK) + failed++; + } + +@@ -3112,15 +3202,13 @@ static void imsm_process_update(struct supertype *st, + super->anchor->num_disks++; + } + disk = &dl->disk; +- status = __le32_to_cpu(disk->status); +- status |= CONFIGURED_DISK; +- status &= ~SPARE_DISK; +- disk->status = __cpu_to_le32(status); ++ disk->status |= CONFIGURED_DISK; ++ disk->status &= ~SPARE_DISK; + + /* mark rebuild */ + to_state = imsm_check_degraded(super, dev, failed); + map->map_state = IMSM_T_STATE_DEGRADED; +- migrate(dev, to_state, 1); ++ migrate(dev, to_state, MIGR_REBUILD); + migr_map = get_imsm_map(dev, 1); + set_imsm_ord_tbl_ent(map, u->slot, dl->index); + set_imsm_ord_tbl_ent(migr_map, u->slot, dl->index | IMSM_ORD_REBUILD); +@@ -3233,14 +3321,14 @@ static void imsm_process_update(struct supertype *st, + /* fix up flags */ + for (i = 0; i < map->num_members; i++) { + struct imsm_disk *disk; +- __u32 status; + + disk = get_imsm_disk(super, get_imsm_disk_idx(dev, i)); +- status = __le32_to_cpu(disk->status); +- status |= CONFIGURED_DISK; +- status &= ~SPARE_DISK; +- disk->status = __cpu_to_le32(status); ++ disk->status |= CONFIGURED_DISK; ++ disk->status &= ~SPARE_DISK; + } ++ ++ imsm_update_version_info(super); ++ + break; + } + case update_add_disk: diff --git a/mdadm.changes b/mdadm.changes index 38bd538..332a6f4 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Fri Nov 14 05:33:41 CET 2008 - nfbrown@suse.de + +- intel.fixes.patch : various fixes from intel for + proper handling of their metadata +- name.fixes.patch : various fixes for new handling + of device names - one could cause a crash. + ------------------------------------------------------------------- Sun Nov 9 23:38:39 CET 2008 - ro@suse.de diff --git a/mdadm.spec b/mdadm.spec index 707f49e..6853d99 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -20,7 +20,7 @@ Name: mdadm Version: 3.0 -Release: 8 +Release: 9 %define ver 3.0-devel2 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq @@ -38,6 +38,8 @@ Patch3: mdadm-destdir.patch Patch4: mdadm-overflow.patch Patch5: mdadm-auto-assemble.patch Patch6: Start-kpartx-for-imsm-devices.patch +Patch7: intel.fixes.patch +Patch8: name.fixes.patch Source1: Software-RAID.HOWTO.tar.bz2 Source2: sysconfig.mdadm Source3: mdadmd @@ -64,6 +66,8 @@ Authors: %patch4 %patch5 -p1 %patch6 -p1 +%patch7 -p1 +%patch8 -p1 %build %{suse_update_config -f} @@ -152,6 +156,11 @@ rm -rf $RPM_BUILD_ROOT /lib/mkinitrd/scripts/boot-md.sh %changelog +* Fri Nov 14 2008 nfbrown@suse.de +- intel.fixes.patch : various fixes from intel for + proper handling of their metadata +- name.fixes.patch : various fixes for new handling + of device names - one could cause a crash. * Sun Nov 09 2008 ro@suse.de - fix patch apply depth * Fri Nov 07 2008 nfbrown@suse.de diff --git a/mdmon-ia64-clone.patch b/mdmon-ia64-clone.patch index 8a417a3..9656032 100644 --- a/mdmon-ia64-clone.patch +++ b/mdmon-ia64-clone.patch @@ -3,9 +3,11 @@ ia64 has __clone2 instead of clone() mdmon.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) +Index: mdmon.c +=================================================================== --- mdmon.c.orig +++ mdmon.c -@@ -57,13 +57,25 @@ int run_child(void *v) +@@ -79,13 +79,25 @@ int run_child(void *v) return 0; } diff --git a/name.fixes.patch b/name.fixes.patch new file mode 100644 index 0000000..181d50a --- /dev/null +++ b/name.fixes.patch @@ -0,0 +1,62 @@ +Two patches fixing issues with device naming. + +commit bf68e9d9ab185121b6004fc81b531bce8348726d +Author: Dan Williams +Date: Mon Nov 10 09:30:07 2008 -0700 + + fix add_dev() handling of broken links + + Resolves issues like: + mdadm -Ss + mdadm: unable to open /dev/md/r1: No such file or directory + + ...where /dev/md/r1 points to a removed device. + + Signed-off-by: Dan Williams + +commit ef70b9f4ef7a3a9f70b3a09b3a55b1cc675c0a37 +Author: Dan Williams +Date: Sat Nov 8 16:03:07 2008 -0700 + + fix remove_devices() + + Don't write to 'pe' if 'path' was not specified + + Signed-off-by: Dan Williams +diff --git a/Manage.c b/Manage.c +index 06f9e05..85bb2c8 100644 +--- a/Manage.c ++++ b/Manage.c +@@ -150,10 +150,12 @@ static void remove_devices(int devnum, char *path) + for (part = 0; part < 16; part++) { + if (part) { + sprintf(be, "p%d", part); +- if (isdigit(pe[-1])) +- sprintf(pe, "p%d", part); +- else +- sprintf(pe, "%d", part); ++ if (path) { ++ if (isdigit(pe[-1])) ++ sprintf(pe, "p%d", part); ++ else ++ sprintf(pe, "%d", part); ++ } + } + /* FIXME test if really is md device ?? */ + unlink(base); +diff --git a/util.c b/util.c +index f21d2bb..2b4f902 100644 +--- a/util.c ++++ b/util.c +@@ -467,8 +467,10 @@ int devlist_ready = 0; + int add_dev(const char *name, const struct stat *stb, int flag, struct FTW *s) + { + struct stat st; ++ + if (S_ISLNK(stb->st_mode)) { +- stat(name, &st); ++ if (stat(name, &st) != 0) ++ return 0; + stb = &st; + } + diff --git a/super-intel-undefined-operation.patch b/super-intel-undefined-operation.patch index c9a26c8..bef7b9c 100644 --- a/super-intel-undefined-operation.patch +++ b/super-intel-undefined-operation.patch @@ -7,9 +7,11 @@ The swap macros can evaluate their argument multiple times. super-intel.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) +Index: super-intel.c +=================================================================== --- super-intel.c.orig +++ super-intel.c -@@ -280,8 +280,10 @@ static __u32 __gen_imsm_checksum(struct +@@ -271,8 +271,10 @@ static __u32 __gen_imsm_checksum(struct __u32 *p = (__u32 *) mpb; __u32 sum = 0; From 783b8551f29839471035702345bec5cfe21e86b2958721d61ce4bb955299589f Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Thu, 20 Nov 2008 14:53:21 +0000 Subject: [PATCH 23/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=23 --- ...auto-assemble-if-any-arrays-are-list.patch | 40 +++++ mdadm.changes | 14 ++ mdadm.spec | 14 +- ...olic-name-to-mdmon-instead-of-device.patch | 138 ++++++++++++++++++ 4 files changed, 205 insertions(+), 1 deletion(-) create mode 100644 don-t-auto-assemble-if-any-arrays-are-list.patch create mode 100644 mdmon-pass-symbolic-name-to-mdmon-instead-of-device.patch diff --git a/don-t-auto-assemble-if-any-arrays-are-list.patch b/don-t-auto-assemble-if-any-arrays-are-list.patch new file mode 100644 index 0000000..23a0604 --- /dev/null +++ b/don-t-auto-assemble-if-any-arrays-are-list.patch @@ -0,0 +1,40 @@ +From 0d172d634f153165a730181572abe90c3a2b646f Mon Sep 17 00:00:00 2001 +From: NeilBrown +Date: Thu, 20 Nov 2008 17:02:55 +1100 +Subject: [PATCH] Assemble: don't auto-assemble if any arrays are listed in mdadm.conf + +Auto-assembly and planned assembly don't really work well together, +it can be confusing. +In particular in mkinitrd or similar creates an mdadm.conf to +assemble a particular array, we shouldn't go assembling any +other arrays as well. + +If you want auto assembly, you need to give mdadm a config +file with no ARRAY lines. + mdadm -Ascpartitions +can do this. + +Signed-off-by: NeilBrown +--- + mdadm.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/mdadm.c b/mdadm.c +index 2bd963a..e0f51b7 100644 +--- a/mdadm.c ++++ b/mdadm.c +@@ -1092,9 +1092,9 @@ int main(int argc, char *argv[]) + array_list, + NULL, NULL, + readonly, runstop, NULL, homehost, verbose-quiet, force); +- if (rv == 0) cnt++; ++ cnt++; + } +- if (homehost) { ++ if (homehost && cnt == 0) { + /* Maybe we can auto-assemble something. + * Repeatedly call Assemble in auto-assemble mode + * until it fails +-- +1.5.6.5 + diff --git a/mdadm.changes b/mdadm.changes index 332a6f4..54afc68 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,17 @@ +------------------------------------------------------------------- +Thu Nov 20 07:07:06 CET 2008 - nfbrown@suse.de + +- don-t-auto-assemble-if-any-arrays-are-list.patch + Avoid assembling extra arrays during initrd + processing. bnc#445438 + +------------------------------------------------------------------- +Thu Nov 20 04:57:30 CET 2008 - nfbrown@suse.de + +- mdmon-pass-symbolic-name-to-mdmon-instead-of-device.patch + avoid problems if mdmon is run before + udev creates any devices. + ------------------------------------------------------------------- Fri Nov 14 05:33:41 CET 2008 - nfbrown@suse.de diff --git a/mdadm.spec b/mdadm.spec index 6853d99..4969800 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -20,7 +20,7 @@ Name: mdadm Version: 3.0 -Release: 9 +Release: 10 %define ver 3.0-devel2 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq @@ -40,6 +40,8 @@ Patch5: mdadm-auto-assemble.patch Patch6: Start-kpartx-for-imsm-devices.patch Patch7: intel.fixes.patch Patch8: name.fixes.patch +Patch9: mdmon-pass-symbolic-name-to-mdmon-instead-of-device.patch +Patch10: don-t-auto-assemble-if-any-arrays-are-list.patch Source1: Software-RAID.HOWTO.tar.bz2 Source2: sysconfig.mdadm Source3: mdadmd @@ -68,6 +70,8 @@ Authors: %patch6 -p1 %patch7 -p1 %patch8 -p1 +%patch9 -p1 +%patch10 -p1 %build %{suse_update_config -f} @@ -156,6 +160,14 @@ rm -rf $RPM_BUILD_ROOT /lib/mkinitrd/scripts/boot-md.sh %changelog +* Thu Nov 20 2008 nfbrown@suse.de +- don-t-auto-assemble-if-any-arrays-are-list.patch + Avoid assembling extra arrays during initrd + processing. bnc#445438 +* Thu Nov 20 2008 nfbrown@suse.de +- mdmon-pass-symbolic-name-to-mdmon-instead-of-device.patch + avoid problems if mdmon is run before + udev creates any devices. * Fri Nov 14 2008 nfbrown@suse.de - intel.fixes.patch : various fixes from intel for proper handling of their metadata diff --git a/mdmon-pass-symbolic-name-to-mdmon-instead-of-device.patch b/mdmon-pass-symbolic-name-to-mdmon-instead-of-device.patch new file mode 100644 index 0000000..1337527 --- /dev/null +++ b/mdmon-pass-symbolic-name-to-mdmon-instead-of-device.patch @@ -0,0 +1,138 @@ +From b6e15d73b19d963de7412560cc651e3b6d6a5428 Mon Sep 17 00:00:00 2001 +From: NeilBrown +Date: Thu, 20 Nov 2008 14:51:42 +1100 +Subject: [PATCH] mdmon: pass symbolic name to mdmon instead of device name. + +Now that names in /dev are usually created (eventually) by udev, +it isn't really safe to rely in finding a name in /dev to pass to +mdmon to identify which array to monitor. +And it isn't really necessary to have a name in /dev. +So just pass the symbolic name, e.g. md127 or md123. + +Change util.c to pass that name, and change mdmon to process the +name sensibly. + +Signed-off-by: NeilBrown +--- + mdadm.h | 2 +- + mdmon.c | 17 +++++++++++++---- + monitor.c | 2 +- + util.c | 13 ++++++++++--- + 4 files changed, 25 insertions(+), 9 deletions(-) + +diff --git a/mdadm.h b/mdadm.h +index 9d819f9..2772650 100644 +--- a/mdadm.h ++++ b/mdadm.h +@@ -634,7 +634,6 @@ struct supertype { + * external:/md0/12 + */ + int devcnt; +- char *device_name; /* e.g. /dev/md/whatever */ + + struct mdinfo *devs; + +@@ -761,6 +760,7 @@ extern int check_raid(int fd, char *name); + + extern int get_mdp_major(void); + extern int dev_open(char *dev, int flags); ++extern int open_dev(int devnum); + extern int open_dev_excl(int devnum); + extern int is_standard(char *dev, int *nump); + extern int same_dev(char *one, char *two); +diff --git a/mdmon.c b/mdmon.c +index 5ee8346..73c244a 100644 +--- a/mdmon.c ++++ b/mdmon.c +@@ -287,6 +287,8 @@ int main(int argc, char *argv[]) + int ignore; + char *container_name = NULL; + char *switchroot = NULL; ++ int devnum; ++ char *devname; + + switch (argc) { + case 2: +@@ -304,7 +306,14 @@ int main(int argc, char *argv[]) + usage(); + } + +- mdfd = open(container_name, O_RDWR); ++ devnum = devname2devnum(container_name); ++ devname = devnum2devname(devnum); ++ if (strcmp(container_name, devname) != 0) { ++ fprintf(stderr, "mdmon: %s is not a valid md device name\n", ++ container_name); ++ exit(1); ++ } ++ mdfd = open_dev(devnum); + if (mdfd < 0) { + fprintf(stderr, "mdmon: %s: %s\n", container_name, + strerror(errno)); +@@ -342,9 +351,8 @@ int main(int argc, char *argv[]) + pfd[0] = pfd[1] = -1; + + container = malloc(sizeof(*container)); +- container->devnum = fd2devnum(mdfd); +- container->devname = devnum2devname(container->devnum); +- container->device_name = container_name; ++ container->devnum = devnum; ++ container->devname = devname; + container->arrays = NULL; + + if (!container->devname) { +@@ -462,6 +470,7 @@ int main(int argc, char *argv[]) + container_name); + exit(3); + } ++ close(mdfd); + + /* Ok, this is close enough. We can say goodbye to our parent now. + */ +diff --git a/monitor.c b/monitor.c +index 15791f4..5c17910 100644 +--- a/monitor.c ++++ b/monitor.c +@@ -469,7 +469,7 @@ static int wait_and_act(struct supertype *container, int nowait) + * problem as there are no active arrays, there is + * nothing that we need to be ready to do. + */ +- int fd = open(container->device_name, O_RDONLY|O_EXCL); ++ int fd = open_dev_excl(container->devnum); + if (fd >= 0 || errno != EBUSY) { + /* OK, we are safe to leave */ + if (sigterm && !dirty_arrays) +diff --git a/util.c b/util.c +index 2b4f902..d7597fa 100644 +--- a/util.c ++++ b/util.c +@@ -813,6 +813,14 @@ int dev_open(char *dev, int flags) + return fd; + } + ++int open_dev(int devnum) ++{ ++ char buf[20]; ++ ++ sprintf(buf, "%d:%d", dev2major(devnum), dev2minor(devnum)); ++ return dev_open(buf, O_RDWR); ++} ++ + int open_dev_excl(int devnum) + { + char buf[20]; +@@ -1261,9 +1269,8 @@ int start_mdmon(int devnum) + for (i=0; paths[i]; i++) + if (paths[i][0]) + execl(paths[i], "mdmon", +- map_dev(dev2major(devnum), +- dev2minor(devnum), +- 1), NULL); ++ devnum2devname(devnum), ++ NULL); + exit(1); + case -1: fprintf(stderr, Name ": cannot run mdmon. " + "Array remains readonly\n"); +-- +1.5.6.5 + From b367a6f6e2c26c0a0e22eb2f43bdaa35124ae2020b04e24283ad30fdbb5d7ba7 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Fri, 5 Dec 2008 14:45:45 +0000 Subject: [PATCH 24/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=24 --- boot.md | 4 ++++ mdadm.changes | 9 +++++++++ mdadm.spec | 8 +++++++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/boot.md b/boot.md index 838aef0..a19106b 100644 --- a/boot.md +++ b/boot.md @@ -124,6 +124,8 @@ case "$1" in rc_status -u else $mdadm_BIN -A -s -c $mdadm_CONFIG + # a status of 2 is not an error + test $? -eq 0 -o $? -eq 2 rc_status -v fi else @@ -146,6 +148,8 @@ case "$1" in chmod 0600 /tmp/mdadm.conf if test -s /tmp/mdadm.conf; then mdadm --assemble --scan --config=/tmp/mdadm.conf + # a status of 2 is not an error + test $? -eq 0 -o $? -eq 2 rc_status -v else # no partitions found, "unused" diff --git a/mdadm.changes b/mdadm.changes index 54afc68..d1ec05b 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Fri Dec 5 06:18:44 CET 2008 - nfbrown@suse.de + +- boot.md : an exit status of '2' from "mdadm --assemble" + should not be seen as failure by boot.md. + It happens if one or more arrays is already + assembled. + (bnc#456028) + ------------------------------------------------------------------- Thu Nov 20 07:07:06 CET 2008 - nfbrown@suse.de diff --git a/mdadm.spec b/mdadm.spec index 4969800..c9f6908 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -20,7 +20,7 @@ Name: mdadm Version: 3.0 -Release: 10 +Release: 11 %define ver 3.0-devel2 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq @@ -160,6 +160,12 @@ rm -rf $RPM_BUILD_ROOT /lib/mkinitrd/scripts/boot-md.sh %changelog +* Fri Dec 05 2008 nfbrown@suse.de +- boot.md : an exit status of '2' from "mdadm --assemble" + should not be seen as failure by boot.md. + It happens if one or more arrays is already + assembled. + (bnc#456028) * Thu Nov 20 2008 nfbrown@suse.de - don-t-auto-assemble-if-any-arrays-are-list.patch Avoid assembling extra arrays during initrd From 7f5a0a38d0554a5b7d9d64a6413d26379feb8c6edf061eddec93f5852f0c0d39 Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Fri, 5 Dec 2008 15:04:23 +0000 Subject: [PATCH 25/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=25 --- mdadm.changes | 5 +++++ mdadm.spec | 4 +++- mkinitrd-boot.sh | 1 + 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/mdadm.changes b/mdadm.changes index d1ec05b..2467d42 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Dec 5 10:21:10 CET 2008 - hare@suse.de + +- Wait for udev to settle before continuing (bnc#435778) + ------------------------------------------------------------------- Fri Dec 5 06:18:44 CET 2008 - nfbrown@suse.de diff --git a/mdadm.spec b/mdadm.spec index c9f6908..016731d 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -20,7 +20,7 @@ Name: mdadm Version: 3.0 -Release: 11 +Release: 12 %define ver 3.0-devel2 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq @@ -160,6 +160,8 @@ rm -rf $RPM_BUILD_ROOT /lib/mkinitrd/scripts/boot-md.sh %changelog +* Fri Dec 05 2008 hare@suse.de +- Wait for udev to settle before continuing (bnc#435778) * Fri Dec 05 2008 nfbrown@suse.de - boot.md : an exit status of '2' from "mdadm --assemble" should not be seen as failure by boot.md. diff --git a/mkinitrd-boot.sh b/mkinitrd-boot.sh index e20e05c..ca68fdc 100644 --- a/mkinitrd-boot.sh +++ b/mkinitrd-boot.sh @@ -63,5 +63,6 @@ if [ -n "$need_mdadm" ]; then if [ "$md_dev" ] ; then /sbin/mdadm $mdconf --auto=md $md_dev || /sbin/mdadm -Ac partitions $mdarg --auto=md $md_dev fi + wait_for_events fi From bd206bd90305edae2c4a6a7d4d032b31e8bc6a98540495e81e8120447510757a Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Tue, 27 Jan 2009 01:19:51 +0000 Subject: [PATCH 26/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=26 --- mdadm.changes | 6 ++++++ mdadm.spec | 9 ++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/mdadm.changes b/mdadm.changes index 2467d42..0c18972 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Jan 26 11:47:59 CET 2009 - ro@suse.de + +- change fillup call from "-Y" to "-y" the boot script has + been present in this package for long enough (SLES10-GA) + ------------------------------------------------------------------- Fri Dec 5 10:21:10 CET 2008 - hare@suse.de diff --git a/mdadm.spec b/mdadm.spec index 016731d..8c50be4 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -1,7 +1,7 @@ # # spec file for package mdadm (Version 3.0) # -# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,7 +20,7 @@ Name: mdadm Version: 3.0 -Release: 12 +Release: 13 %define ver 3.0-devel2 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq @@ -97,7 +97,7 @@ rm -f $RPM_BUILD_ROOT/lib/udev/rules.d/64-md-raid.rules %post [ -x /sbin/mkinitrd_setup ] && mkinitrd_setup -%{fillup_and_insserv -Y boot.md} +%{fillup_and_insserv -y boot.md} %postun %restart_on_update mdadmd @@ -160,6 +160,9 @@ rm -rf $RPM_BUILD_ROOT /lib/mkinitrd/scripts/boot-md.sh %changelog +* Mon Jan 26 2009 ro@suse.de +- change fillup call from "-Y" to "-y" the boot script has + been present in this package for long enough (SLES10-GA) * Fri Dec 05 2008 hare@suse.de - Wait for udev to settle before continuing (bnc#435778) * Fri Dec 05 2008 nfbrown@suse.de From 3afdc4f0aa2f0b96401d5df1ba959ace1b78e43ccc66ead11a554ab6f65ee47c Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Mon, 16 Feb 2009 15:15:28 +0000 Subject: [PATCH 27/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=27 --- manage-rebuild-map-for-kpartx | 43 +++++++++++++++++++++++++++++++++++ mdadm.changes | 6 +++++ mdadm.spec | 7 +++++- 3 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 manage-rebuild-map-for-kpartx diff --git a/manage-rebuild-map-for-kpartx b/manage-rebuild-map-for-kpartx new file mode 100644 index 0000000..eeae570 --- /dev/null +++ b/manage-rebuild-map-for-kpartx @@ -0,0 +1,43 @@ +Manage: rebuild map for 'kpartx -d' at stop + +From: Dan Williams + +mdadm needs the 'map' file to run 'kpartx -d' at array shutdown. +Rebuild it if it does not exist. + +Signed-off-by: Dan Williams +--- + + Manage.c | 14 +++++++++++++- + 1 files changed, 13 insertions(+), 1 deletions(-) + + +diff --git a/Manage.c b/Manage.c +index 85bb2c8..603e838 100644 +--- a/Manage.c ++++ b/Manage.c +@@ -222,11 +222,23 @@ int Manage_runstop(char *devname, int fd, int runstop, int quiet) + mdi->array.level > 0 && + is_subarray(mdi->text_version)) { + struct map_ent *me = map_by_devnum(&map, devnum); ++ ++ if (!me) { ++ RebuildMap(); ++ me = map_by_devnum(&map, devnum); ++ } ++ ++ if (!me) { ++ fprintf(stderr, Name ": failed to map device %d\n", ++ devnum); ++ return 1; ++ } else ++ run_kpartx('d', me->path); ++ + /* This is mdmon managed. */ + close(fd); + + /* Delete any kpartx partitions */ +- run_kpartx('d', me->path); + if (sysfs_set_str(mdi, NULL, + "array_state", "inactive") < 0) { + if (quiet == 0) diff --git a/mdadm.changes b/mdadm.changes index 0c18972..c7031fa 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Feb 16 16:00:11 CET 2009 - mmarek@suse.cz + +- fix segfault when stopping imsm arrays + (bnc#473947, patch by Dan Williams) + ------------------------------------------------------------------- Mon Jan 26 11:47:59 CET 2009 - ro@suse.de diff --git a/mdadm.spec b/mdadm.spec index 8c50be4..57e3e33 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -20,7 +20,7 @@ Name: mdadm Version: 3.0 -Release: 13 +Release: 14 %define ver 3.0-devel2 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq @@ -42,6 +42,7 @@ Patch7: intel.fixes.patch Patch8: name.fixes.patch Patch9: mdmon-pass-symbolic-name-to-mdmon-instead-of-device.patch Patch10: don-t-auto-assemble-if-any-arrays-are-list.patch +Patch11: manage-rebuild-map-for-kpartx Source1: Software-RAID.HOWTO.tar.bz2 Source2: sysconfig.mdadm Source3: mdadmd @@ -72,6 +73,7 @@ Authors: %patch8 -p1 %patch9 -p1 %patch10 -p1 +%patch11 -p1 %build %{suse_update_config -f} @@ -160,6 +162,9 @@ rm -rf $RPM_BUILD_ROOT /lib/mkinitrd/scripts/boot-md.sh %changelog +* Mon Feb 16 2009 mmarek@suse.cz +- fix segfault when stopping imsm arrays + (bnc#473947, patch by Dan Williams) * Mon Jan 26 2009 ro@suse.de - change fillup call from "-Y" to "-y" the boot script has been present in this package for long enough (SLES10-GA) From 497526e378258764575e4952cf11bdd6afae9afd6c88611aa6b361ca835195ec Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Tue, 17 Feb 2009 22:07:01 +0000 Subject: [PATCH 28/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=28 --- boot.md | 45 +++++++-------------------------------------- mdadm.changes | 10 ++++++++++ mdadm.spec | 8 +++++++- sysconfig.mdadm | 10 ---------- 4 files changed, 24 insertions(+), 49 deletions(-) diff --git a/boot.md b/boot.md index a19106b..946b67d 100644 --- a/boot.md +++ b/boot.md @@ -118,45 +118,14 @@ case "$1" in /sbin/udevadm settle --timeout="$MDADM_DEVICE_TIMEOUT" fi - if test "$BOOT_MD_USE_MDADM_CONFIG" = "yes" -a -e "$mdadm_CONFIG"; then - if ! grep -q '^[^#]*[^[:blank:]#]' $mdadm_CONFIG; then - # empty /etc/mdadm.conf, "unused" - rc_status -u - else - $mdadm_BIN -A -s -c $mdadm_CONFIG - # a status of 2 is not an error - test $? -eq 0 -o $? -eq 2 - rc_status -v - fi + if ! grep -qs '^[^#]*[^[:blank:]#]' $mdadm_CONFIG; then + # empty or missing /etc/mdadm.conf, "unused" + rc_status -u else - # do auto-assemly only if /etc/mdadm.conf is missing - # run at boot-time, so a fixed tmp name is safe - rm -rf /tmp/mdadm.conf - - if test "$BOOT_MD_USE_MDADM_CONFIG" = "part"; then - echo CREATE auto=part > /tmp/mdadm.conf - fi - if ! mdadm --examine --scan --config=partitions >>/tmp/mdadm.conf - then - echo "mdadm --examine --scan failed:" - cat /tmp/mdadm.conf - rm -f /tmp/mdadm.conf - rc_failed 1 - rc_status -v - rc_exit - fi - chmod 0600 /tmp/mdadm.conf - if test -s /tmp/mdadm.conf; then - mdadm --assemble --scan --config=/tmp/mdadm.conf - # a status of 2 is not an error - test $? -eq 0 -o $? -eq 2 - rc_status -v - else - # no partitions found, "unused" - rc_status -u - fi - rm -f /tmp/mdadm.conf - + $mdadm_BIN -A -s -c $mdadm_CONFIG + # a status of 2 is not an error + test $? -eq 0 -o $? -eq 2 + rc_status -v fi ;; stop) diff --git a/mdadm.changes b/mdadm.changes index c7031fa..d80cd0f 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Tue Feb 17 17:01:23 CET 2009 - mmarek@suse.cz + +- disable auto-assemly in boot.md completely as it can collide with + dmraid (bnc#474652). If someone wants to auto-assemble md arrays + in the rescue system, they can run + 'mdadm -Es -c partitions >mdadm.conf && mdadm -As -c mdadm.conf' + manually. + + ------------------------------------------------------------------- Mon Feb 16 16:00:11 CET 2009 - mmarek@suse.cz diff --git a/mdadm.spec b/mdadm.spec index 57e3e33..f448718 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -20,7 +20,7 @@ Name: mdadm Version: 3.0 -Release: 14 +Release: 17 %define ver 3.0-devel2 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq @@ -162,6 +162,12 @@ rm -rf $RPM_BUILD_ROOT /lib/mkinitrd/scripts/boot-md.sh %changelog +* Tue Feb 17 2009 mmarek@suse.cz +- disable auto-assemly in boot.md completely as it can collide with + dmraid (bnc#474652). If someone wants to auto-assemble md arrays + in the rescue system, they can run + 'mdadm -Es -c partitions >mdadm.conf && mdadm -As -c mdadm.conf' + manually. * Mon Feb 16 2009 mmarek@suse.cz - fix segfault when stopping imsm arrays (bnc#473947, patch by Dan Williams) diff --git a/sysconfig.mdadm b/sysconfig.mdadm index 9682950..7cdd682 100644 --- a/sysconfig.mdadm +++ b/sysconfig.mdadm @@ -51,16 +51,6 @@ MDADM_CONFIG="/etc/mdadm.conf" # MDADM_SEND_MAIL_ON_START=no -## Type: list(yes,no,part) -## Default: no -# -# "yes" for mdadm.conf to be used for array assembly on boot -# "no" for arrays to be automatically detected and assembled -# "part" is like "no" except that arrays with 1.x metadate -# will be assembled as partitionable arrays. -# -BOOT_MD_USE_MDADM_CONFIG=yes - ## Type: integer ## Default: 60 # From de7be309e9805ddf2338609e5378b963d7deeb378aa646a6756fc578e746f45d Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Mon, 23 Feb 2009 11:57:34 +0000 Subject: [PATCH 29/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=29 --- mdadm.changes | 6 ++++++ mdadm.spec | 5 ++++- mkinitrd-setup.sh | 19 +++++++++++++++---- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/mdadm.changes b/mdadm.changes index d80cd0f..4af4caf 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Sat Feb 21 15:37:55 CET 2009 - mmarek@suse.cz + +- mkinitrd-setup.sh: filter out duplicate devices (bnc#461673, + patch by Xin Wei Hu) + ------------------------------------------------------------------- Tue Feb 17 17:01:23 CET 2009 - mmarek@suse.cz diff --git a/mdadm.spec b/mdadm.spec index f448718..03db28b 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -20,7 +20,7 @@ Name: mdadm Version: 3.0 -Release: 17 +Release: 19 %define ver 3.0-devel2 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq @@ -162,6 +162,9 @@ rm -rf $RPM_BUILD_ROOT /lib/mkinitrd/scripts/boot-md.sh %changelog +* Sat Feb 21 2009 mmarek@suse.cz +- mkinitrd-setup.sh: filter out duplicate devices (bnc#461673, + patch by Xin Wei Hu) * Tue Feb 17 2009 mmarek@suse.cz - disable auto-assemly in boot.md completely as it can collide with dmraid (bnc#474652). If someone wants to auto-assemble md arrays diff --git a/mkinitrd-setup.sh b/mkinitrd-setup.sh index 0729999..29e177b 100644 --- a/mkinitrd-setup.sh +++ b/mkinitrd-setup.sh @@ -11,10 +11,21 @@ for bd in $blockdev ; do if [ -n "$mdconf" ] ; then md_tmpblockdev=$(mdadm -Dbv $bd 2> /dev/null | sed -n "1D;s/,/ /g;s/^ *devices=\(.*\)/\1/p") md_dev=${bd##/dev/} - mdblockdev="$mdblockdev $md_tmpblockdev" - eval md_conf_${md_dev}=\"$mdconf\" - md_devs="$md_devs $md_dev" - root_md=1 + dup_found=0 + for dup in $md_devs; do + if [ x"$dup" = x"$md_dev" ]; then + dup_found=1 + break + fi + done + if [ $dup_found -eq 0 ]; then + mdblockdev="$mdblockdev $md_tmpblockdev" + eval md_conf_${md_dev}=\"$mdconf\" + md_devs="$md_devs $md_dev" + root_md=1 + else + echo "setup-md.sh: $md_dev found multiple times" >&2 + fi else mdblockdev="$mdblockdev $bd" fi From e31bf10e2e76bf7a4843bb16f772541b669db6d1edba97879ffc452d3c755d4e Mon Sep 17 00:00:00 2001 From: OBS User unknown Date: Tue, 17 Mar 2009 19:08:56 +0000 Subject: [PATCH 30/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=30 --- mdadm.changes | 8 + mdadm.spec | 10 +- ...-metadata-IO-with-4096byte-alignment.patch | 86 +++++++++++ ...-do-metadata-IO-in-sector_size-units.patch | 137 ++++++++++++++++++ 4 files changed, 240 insertions(+), 1 deletion(-) create mode 100644 super0-Do-all-metadata-IO-with-4096byte-alignment.patch create mode 100644 super1-do-metadata-IO-in-sector_size-units.patch diff --git a/mdadm.changes b/mdadm.changes index 4af4caf..e7f70a7 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Tue Mar 3 10:36:11 CET 2009 - mmarek@suse.cz + +- super0: Do all metadata IO with 4096byte alignment +- super1 - do metadata IO in sector_size units. + (bnc#466172) + + ------------------------------------------------------------------- Sat Feb 21 15:37:55 CET 2009 - mmarek@suse.cz diff --git a/mdadm.spec b/mdadm.spec index 03db28b..0b1cd00 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -20,7 +20,7 @@ Name: mdadm Version: 3.0 -Release: 19 +Release: 20 %define ver 3.0-devel2 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq @@ -43,6 +43,8 @@ Patch8: name.fixes.patch Patch9: mdmon-pass-symbolic-name-to-mdmon-instead-of-device.patch Patch10: don-t-auto-assemble-if-any-arrays-are-list.patch Patch11: manage-rebuild-map-for-kpartx +Patch12: super0-Do-all-metadata-IO-with-4096byte-alignment.patch +Patch13: super1-do-metadata-IO-in-sector_size-units.patch Source1: Software-RAID.HOWTO.tar.bz2 Source2: sysconfig.mdadm Source3: mdadmd @@ -74,6 +76,8 @@ Authors: %patch9 -p1 %patch10 -p1 %patch11 -p1 +%patch12 -p1 +%patch13 -p1 %build %{suse_update_config -f} @@ -162,6 +166,10 @@ rm -rf $RPM_BUILD_ROOT /lib/mkinitrd/scripts/boot-md.sh %changelog +* Tue Mar 03 2009 mmarek@suse.cz +- super0: Do all metadata IO with 4096byte alignment +- super1 - do metadata IO in sector_size units. + (bnc#466172) * Sat Feb 21 2009 mmarek@suse.cz - mkinitrd-setup.sh: filter out duplicate devices (bnc#461673, patch by Xin Wei Hu) diff --git a/super0-Do-all-metadata-IO-with-4096byte-alignment.patch b/super0-Do-all-metadata-IO-with-4096byte-alignment.patch new file mode 100644 index 0000000..bebc318 --- /dev/null +++ b/super0-Do-all-metadata-IO-with-4096byte-alignment.patch @@ -0,0 +1,86 @@ +From 24303a80dfff51654595b3605fa8b1b9b1c4b578 Mon Sep 17 00:00:00 2001 +From: NeilBrown +Date: Tue, 3 Mar 2009 14:25:59 +1100 +Subject: [PATCH 1/2] super0: Do all metadata IO with 4096byte alignment + +.. because some devices (dasd) has 4096 byte sector size. + +As the superblock is 4096 bytes and the bitmap is in a +60K region, this is safe from any possible corruption. + +Signed-off-by: NeilBrown +--- + super0.c | 25 ++++++++++++++----------- + 1 files changed, 14 insertions(+), 11 deletions(-) + +Index: mdadm-3.0-devel2/super0.c +=================================================================== +--- mdadm-3.0-devel2.orig/super0.c ++++ mdadm-3.0-devel2/super0.c +@@ -545,7 +545,8 @@ static int init_super0(struct supertype + mdp_super_t *sb; + int spares; + +- if (posix_memalign((void**)&sb, 512, MD_SB_BYTES + sizeof(bitmap_super_t)) != 0) { ++ if (posix_memalign((void**)&sb, 4096, ++ MD_SB_BYTES + ROUND_UP(sizeof(bitmap_super_t), 4096)) != 0) { + fprintf(stderr, Name ": %s could not allocate superblock\n", __func__); + return 0; + } +@@ -680,8 +681,8 @@ static int store_super0(struct supertype + if (super->state & (1<magic) == BITMAP_MAGIC) +- if (write(fd, bm, ROUND_UP(sizeof(*bm),512)) != +- ROUND_UP(sizeof(*bm),512)) ++ if (write(fd, bm, ROUND_UP(sizeof(*bm),4096)) != ++ ROUND_UP(sizeof(*bm),4096)) + return 5; + } + +@@ -741,8 +742,9 @@ static int compare_super0(struct superty + if (second->md_magic != MD_SB_MAGIC) + return 1; + if (!first) { +- if (posix_memalign((void**)&first, 512, +- MD_SB_BYTES + sizeof(struct bitmap_super_s)) != 0) { ++ if (posix_memalign((void**)&first, 4096, ++ MD_SB_BYTES + ++ ROUND_UP(sizeof(struct bitmap_super_s), 4096)) != 0) { + fprintf(stderr, Name + ": %s could not allocate superblock\n", __func__); + return 1; +@@ -815,8 +817,9 @@ static int load_super0(struct supertype + return 1; + } + +- if (posix_memalign((void**)&super, 512, +- MD_SB_BYTES + sizeof(bitmap_super_t)+512) != 0) { ++ if (posix_memalign((void**)&super, 4096, ++ MD_SB_BYTES + ++ ROUND_UP(sizeof(bitmap_super_t), 4096)) != 0) { + fprintf(stderr, Name + ": %s could not allocate superblock\n", __func__); + return 1; +@@ -864,8 +867,8 @@ static int load_super0(struct supertype + * valid. If it doesn't clear the bit. An --assemble --force + * should get that written out. + */ +- if (read(fd, super+1, ROUND_UP(sizeof(struct bitmap_super_s),512)) +- != ROUND_UP(sizeof(struct bitmap_super_s),512)) ++ if (read(fd, super+1, ROUND_UP(sizeof(struct bitmap_super_s),4096)) ++ != ROUND_UP(sizeof(struct bitmap_super_s),4096)) + goto no_bitmap; + + uuid_from_super0(st, uuid); +@@ -996,8 +999,8 @@ static int write_bitmap0(struct supertyp + int rv = 0; + + int towrite, n; +- char abuf[4096+512]; +- char *buf = (char*)(((long)(abuf+512))&~511UL); ++ char abuf[4096+4096]; ++ char *buf = (char*)(((long)(abuf+4096))&~4095L); + + if (!get_dev_size(fd, NULL, &dsize)) + return 1; diff --git a/super1-do-metadata-IO-in-sector_size-units.patch b/super1-do-metadata-IO-in-sector_size-units.patch new file mode 100644 index 0000000..c7d7163 --- /dev/null +++ b/super1-do-metadata-IO-in-sector_size-units.patch @@ -0,0 +1,137 @@ +From ae8b146d524dd162f159f27938ed14df037e3ff8 Mon Sep 17 00:00:00 2001 +From: NeilBrown +Date: Tue, 3 Mar 2009 15:44:26 +1100 +Subject: [PATCH 2/2] super1 - do metadata IO in sector_size units. + +If the sector size is > 512, we need to be more careful about +alignment. +The largest known sector size is 4096 and (fortunately) both the +superblock and (in many cases) the bitmap are 4096-byte aligned. +So there should be no data-overlap problems. + +The exception is when the bitmap is squeezed into the 3K after the +superblock. This arrangement cannot currently be supported on +4K sector-size devices. + +Signed-off-by: NeilBrown +--- + super1.c | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++------ + 1 files changed, 64 insertions(+), 7 deletions(-) + +Index: mdadm-3.0-devel2/super1.c +=================================================================== +--- mdadm-3.0-devel2.orig/super1.c ++++ mdadm-3.0-devel2/super1.c +@@ -141,6 +141,64 @@ static unsigned int calc_sb_1_csum(struc + return __cpu_to_le32(csum); + } + ++static char abuf[4096+4096]; ++static int aread(int fd, void *buf, int len) ++{ ++ /* aligned read. ++ * On devices with a 4K sector size, we need to read ++ * the full sector and copy relevant bits into ++ * the buffer ++ */ ++ int bsize; ++ char *b; ++ int n; ++ if (ioctl(fd, BLKSSZGET, &bsize) != 0 || ++ bsize <= len) ++ return read(fd, buf, len); ++ if (bsize > 4096) ++ return -1; ++ b = (char*)(((long)(abuf+4096))&~4095UL); ++ ++ n = read(fd, b, bsize); ++ if (n <= 0) ++ return n; ++ lseek(fd, len - n, 1); ++ if (n > len) ++ n = len; ++ memcpy(buf, b, n); ++ return n; ++} ++ ++static int awrite(int fd, void *buf, int len) ++{ ++ /* aligned write. ++ * On devices with a 4K sector size, we need to write ++ * the full sector. We pre-read if the sector is larger ++ * than the write. ++ * The address must be sector-aligned. ++ */ ++ int bsize; ++ char *b; ++ int n; ++ if (ioctl(fd, BLKSSZGET, &bsize) != 0 || ++ bsize <= len) ++ return write(fd, buf, len); ++ if (bsize > 4096) ++ return -1; ++ b = (char*)(((long)(abuf+4096))&~4095UL); ++ ++ n = read(fd, b, bsize); ++ if (n <= 0) ++ return n; ++ lseek(fd, -n, 1); ++ memcpy(b, buf, len); ++ n = write(fd, b, bsize); ++ if (n <= 0) ++ return n; ++ lseek(fd, len - n, 1); ++ return len; ++} ++ + #ifndef MDASSEMBLE + static void examine_super1(struct supertype *st, char *homehost) + { +@@ -881,7 +939,7 @@ static int store_super1(struct supertype + sbsize = sizeof(*sb) + 2 * __le32_to_cpu(sb->max_dev); + sbsize = (sbsize+511)&(~511UL); + +- if (write(fd, sb, sbsize) != sbsize) ++ if (awrite(fd, sb, sbsize) != sbsize) + return 4; + + if (sb->feature_map & __cpu_to_le32(MD_FEATURE_BITMAP_OFFSET)) { +@@ -889,8 +947,8 @@ static int store_super1(struct supertype + (((char*)sb)+1024); + if (__le32_to_cpu(bm->magic) == BITMAP_MAGIC) { + locate_bitmap1(st, fd); +- if (write(fd, bm, ROUND_UP(sizeof(*bm),512)) != +- ROUND_UP(sizeof(*bm),512)) ++ if (awrite(fd, bm, sizeof(*bm)) != ++ sizeof(*bm)) + return 5; + } + } +@@ -1187,7 +1245,7 @@ static int load_super1(struct supertype + return 1; + } + +- if (read(fd, super, 1024) != 1024) { ++ if (aread(fd, super, 1024) != 1024) { + if (devname) + fprintf(stderr, Name ": Cannot read superblock on %s\n", + devname); +@@ -1232,7 +1290,7 @@ static int load_super1(struct supertype + * should get that written out. + */ + locate_bitmap1(st, fd); +- if (read(fd, ((char*)super)+1024, 512) ++ if (aread(fd, ((char*)super)+1024, 512) + != 512) + goto no_bitmap; + +@@ -1470,8 +1528,7 @@ static int write_bitmap1(struct supertyp + int rv = 0; + + int towrite, n; +- char abuf[4096+512]; +- char *buf = (char*)(((long)(abuf+512))&~511UL); ++ char *buf = (char*)(((long)(abuf+4096))&~4095UL); + + locate_bitmap1(st, fd); + From 2fc8835c695ecf350efcff06d093bd4bcb63fb236fe2bb304606d08eb050cb96 Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Tue, 11 Aug 2009 15:09:53 +0000 Subject: [PATCH 31/39] Accepting request 17443 from Base:System Copy from Base:System/mdadm based on submit request 17443 from user michal-m OBS-URL: https://build.opensuse.org/request/show/17443 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=31 --- ...auto-assemble-if-any-arrays-are-list.patch | 40 -- intel.fixes.patch | 623 ------------------ mdadm-3.0-devel2.tar.bz2 | 3 - mdadm-3.0.tar.bz2 | 3 + mdadm-auto-assemble.patch | 110 ---- mdadm-destdir.patch | 11 - mdadm-overflow.patch | 11 - mdadm.changes | 12 + mdadm.spec | 483 +------------- mdmon-ia64-clone.patch | 35 - ...olic-name-to-mdmon-instead-of-device.patch | 138 ---- name.fixes.patch | 62 -- super-intel-undefined-operation.patch | 26 - ...-metadata-IO-with-4096byte-alignment.patch | 86 --- ...-do-metadata-IO-in-sector_size-units.patch | 137 ---- 15 files changed, 20 insertions(+), 1760 deletions(-) delete mode 100644 don-t-auto-assemble-if-any-arrays-are-list.patch delete mode 100644 intel.fixes.patch delete mode 100644 mdadm-3.0-devel2.tar.bz2 create mode 100644 mdadm-3.0.tar.bz2 delete mode 100644 mdadm-auto-assemble.patch delete mode 100644 mdadm-destdir.patch delete mode 100644 mdadm-overflow.patch delete mode 100644 mdmon-ia64-clone.patch delete mode 100644 mdmon-pass-symbolic-name-to-mdmon-instead-of-device.patch delete mode 100644 name.fixes.patch delete mode 100644 super-intel-undefined-operation.patch delete mode 100644 super0-Do-all-metadata-IO-with-4096byte-alignment.patch delete mode 100644 super1-do-metadata-IO-in-sector_size-units.patch diff --git a/don-t-auto-assemble-if-any-arrays-are-list.patch b/don-t-auto-assemble-if-any-arrays-are-list.patch deleted file mode 100644 index 23a0604..0000000 --- a/don-t-auto-assemble-if-any-arrays-are-list.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 0d172d634f153165a730181572abe90c3a2b646f Mon Sep 17 00:00:00 2001 -From: NeilBrown -Date: Thu, 20 Nov 2008 17:02:55 +1100 -Subject: [PATCH] Assemble: don't auto-assemble if any arrays are listed in mdadm.conf - -Auto-assembly and planned assembly don't really work well together, -it can be confusing. -In particular in mkinitrd or similar creates an mdadm.conf to -assemble a particular array, we shouldn't go assembling any -other arrays as well. - -If you want auto assembly, you need to give mdadm a config -file with no ARRAY lines. - mdadm -Ascpartitions -can do this. - -Signed-off-by: NeilBrown ---- - mdadm.c | 4 ++-- - 1 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/mdadm.c b/mdadm.c -index 2bd963a..e0f51b7 100644 ---- a/mdadm.c -+++ b/mdadm.c -@@ -1092,9 +1092,9 @@ int main(int argc, char *argv[]) - array_list, - NULL, NULL, - readonly, runstop, NULL, homehost, verbose-quiet, force); -- if (rv == 0) cnt++; -+ cnt++; - } -- if (homehost) { -+ if (homehost && cnt == 0) { - /* Maybe we can auto-assemble something. - * Repeatedly call Assemble in auto-assemble mode - * until it fails --- -1.5.6.5 - diff --git a/intel.fixes.patch b/intel.fixes.patch deleted file mode 100644 index c033649..0000000 --- a/intel.fixes.patch +++ /dev/null @@ -1,623 +0,0 @@ -Multiple patches combined, fixing various issues with Intel metadata. - -commit 92bd8f8d3f2c9c7733f92a062a0752d9b9997673 -Author: Dan Williams -Date: Sat Nov 8 16:03:07 2008 -0700 - - imsm: fix uuid_from_super given 'signature' is not constant - - The version portion of the signature changes depending on the contents - of the container. - - Signed-off-by: Dan Williams - -commit 4d1313e9017e2608bfd2d01f854c19e23f7daf62 -Author: Dan Williams -Date: Sat Nov 8 16:03:07 2008 -0700 - - imsm: compatibility fixes for creating imsm arrays - - When creating an imsm array use the lowest possible feature set to - maximize compatibility. - - Signed-off-by: Dan Williams - -commit f2f27e63c44baac976b0022c6830393954d59fd4 -Author: Dan Williams -Date: Sat Nov 8 16:02:56 2008 -0700 - - imsm: fixup disk status definition endianess - - Change the multibyte disk status field definitions to imsm byte-order - (little-endian) to match other multibyte field definitions. - - Signed-off-by: Dan Williams - -commit fe7ed8cb4f43e8324ca526e4a56fb23095f0023b -Author: Dan Williams -Date: Sat Nov 8 15:47:39 2008 -0700 - - imsm: add definitions for recent imsm versions - - Signed-off-by: Dan Williams - -commit e3bba0e010e5ce61a804139ee77ef8e25a244dd1 -Author: Dan Williams -Date: Fri Nov 7 15:57:31 2008 -0700 - - imsm: cleanup migration definitions and usage - - imsm_set_array_state need not look at the map_state when failed==0 - - Signed-off-by: Dan Williams - -commit 5115ca67fd28a0d2f4f156fbbbdf8f648c83fc20 -Author: Dan Williams -Date: Fri Nov 7 15:08:09 2008 -0700 - - imsm: cleanup ->match_home and comment on return value - - Signed-off-by: Dan Williams -diff --git a/super-intel.c b/super-intel.c -index 5f06f30..d160b6a 100644 ---- a/super-intel.c -+++ b/super-intel.c -@@ -30,9 +30,25 @@ - #define MPB_SIG_LEN (strlen(MPB_SIGNATURE)) - #define MPB_VERSION_RAID0 "1.0.00" - #define MPB_VERSION_RAID1 "1.1.00" -+#define MPB_VERSION_MANY_VOLUMES_PER_ARRAY "1.2.00" -+#define MPB_VERSION_3OR4_DISK_ARRAY "1.2.01" - #define MPB_VERSION_RAID5 "1.2.02" -+#define MPB_VERSION_5OR6_DISK_ARRAY "1.2.04" -+#define MPB_VERSION_CNG "1.2.06" -+#define MPB_VERSION_ATTRIBS "1.3.00" - #define MAX_SIGNATURE_LENGTH 32 - #define MAX_RAID_SERIAL_LEN 16 -+ -+#define MPB_ATTRIB_CHECKSUM_VERIFY __cpu_to_le32(0x80000000) -+#define MPB_ATTRIB_PM __cpu_to_le32(0x40000000) -+#define MPB_ATTRIB_2TB __cpu_to_le32(0x20000000) -+#define MPB_ATTRIB_RAID0 __cpu_to_le32(0x00000001) -+#define MPB_ATTRIB_RAID1 __cpu_to_le32(0x00000002) -+#define MPB_ATTRIB_RAID10 __cpu_to_le32(0x00000004) -+#define MPB_ATTRIB_RAID1E __cpu_to_le32(0x00000008) -+#define MPB_ATTRIB_RAID5 __cpu_to_le32(0x00000010) -+#define MPB_ATTRIB_RAIDCNG __cpu_to_le32(0x00000020) -+ - #define MPB_SECTOR_CNT 418 - #define IMSM_RESERVED_SECTORS 4096 - -@@ -42,13 +58,13 @@ struct imsm_disk { - __u8 serial[MAX_RAID_SERIAL_LEN];/* 0xD8 - 0xE7 ascii serial number */ - __u32 total_blocks; /* 0xE8 - 0xEB total blocks */ - __u32 scsi_id; /* 0xEC - 0xEF scsi ID */ -+#define SPARE_DISK __cpu_to_le32(0x01) /* Spare */ -+#define CONFIGURED_DISK __cpu_to_le32(0x02) /* Member of some RaidDev */ -+#define FAILED_DISK __cpu_to_le32(0x04) /* Permanent failure */ -+#define USABLE_DISK __cpu_to_le32(0x08) /* Fully usable unless FAILED_DISK is set */ - __u32 status; /* 0xF0 - 0xF3 */ --#define SPARE_DISK 0x01 /* Spare */ --#define CONFIGURED_DISK 0x02 /* Member of some RaidDev */ --#define FAILED_DISK 0x04 /* Permanent failure */ --#define USABLE_DISK 0x08 /* Fully usable unless FAILED_DISK is set */ -- --#define IMSM_DISK_FILLERS 5 -+ __u32 owner_cfg_num; /* which config 0,1,2... owns this disk */ -+#define IMSM_DISK_FILLERS 4 - __u32 filler[IMSM_DISK_FILLERS]; /* 0xF4 - 0x107 MPB_DISK_FILLERS for future expansion */ - }; - -@@ -61,14 +77,16 @@ struct imsm_map { - __u8 map_state; /* Normal, Uninitialized, Degraded, Failed */ - #define IMSM_T_STATE_NORMAL 0 - #define IMSM_T_STATE_UNINITIALIZED 1 --#define IMSM_T_STATE_DEGRADED 2 /* FIXME: is this correct? */ --#define IMSM_T_STATE_FAILED 3 /* FIXME: is this correct? */ -+#define IMSM_T_STATE_DEGRADED 2 -+#define IMSM_T_STATE_FAILED 3 - __u8 raid_level; - #define IMSM_T_RAID0 0 - #define IMSM_T_RAID1 1 - #define IMSM_T_RAID5 5 /* since metadata version 1.2.02 ? */ - __u8 num_members; /* number of member disks */ -- __u8 reserved[3]; -+ __u8 num_domains; /* number of parity domains */ -+ __u8 failed_disk_num; /* valid only when state is degraded */ -+ __u8 reserved[1]; - __u32 filler[7]; /* expansion area */ - #define IMSM_ORD_REBUILD (1 << 24) - __u32 disk_ord_tbl[1]; /* disk_ord_tbl[num_members], -@@ -78,23 +96,50 @@ struct imsm_map { - - struct imsm_vol { - __u32 curr_migr_unit; -- __u32 reserved; -+ __u32 checkpoint_id; /* id to access curr_migr_unit */ - __u8 migr_state; /* Normal or Migrating */ -+#define MIGR_INIT 0 -+#define MIGR_REBUILD 1 -+#define MIGR_VERIFY 2 /* analagous to echo check > sync_action */ -+#define MIGR_GEN_MIGR 3 -+#define MIGR_STATE_CHANGE 4 - __u8 migr_type; /* Initializing, Rebuilding, ... */ - __u8 dirty; -- __u8 fill[1]; -- __u32 filler[5]; -+ __u8 fs_state; /* fast-sync state for CnG (0xff == disabled) */ -+ __u16 verify_errors; /* number of mismatches */ -+ __u16 bad_blocks; /* number of bad blocks during verify */ -+ __u32 filler[4]; - struct imsm_map map[1]; - /* here comes another one if migr_state */ - } __attribute__ ((packed)); - - struct imsm_dev { -- __u8 volume[MAX_RAID_SERIAL_LEN]; -+ __u8 volume[MAX_RAID_SERIAL_LEN]; - __u32 size_low; - __u32 size_high; -+#define DEV_BOOTABLE __cpu_to_le32(0x01) -+#define DEV_BOOT_DEVICE __cpu_to_le32(0x02) -+#define DEV_READ_COALESCING __cpu_to_le32(0x04) -+#define DEV_WRITE_COALESCING __cpu_to_le32(0x08) -+#define DEV_LAST_SHUTDOWN_DIRTY __cpu_to_le32(0x10) -+#define DEV_HIDDEN_AT_BOOT __cpu_to_le32(0x20) -+#define DEV_CURRENTLY_HIDDEN __cpu_to_le32(0x40) -+#define DEV_VERIFY_AND_FIX __cpu_to_le32(0x80) -+#define DEV_MAP_STATE_UNINIT __cpu_to_le32(0x100) -+#define DEV_NO_AUTO_RECOVERY __cpu_to_le32(0x200) -+#define DEV_CLONE_N_GO __cpu_to_le32(0x400) -+#define DEV_CLONE_MAN_SYNC __cpu_to_le32(0x800) -+#define DEV_CNG_MASTER_DISK_NUM __cpu_to_le32(0x1000) - __u32 status; /* Persistent RaidDev status */ - __u32 reserved_blocks; /* Reserved blocks at beginning of volume */ --#define IMSM_DEV_FILLERS 12 -+ __u8 migr_priority; -+ __u8 num_sub_vols; -+ __u8 tid; -+ __u8 cng_master_disk; -+ __u16 cache_policy; -+ __u8 cng_state; -+ __u8 cng_sub_state; -+#define IMSM_DEV_FILLERS 10 - __u32 filler[IMSM_DEV_FILLERS]; - struct imsm_vol vol; - } __attribute__ ((packed)); -@@ -546,7 +591,7 @@ static void print_imsm_disk(struct imsm_super *mpb, int index, __u32 reserved) - printf("\n"); - snprintf(str, MAX_RAID_SERIAL_LEN + 1, "%s", disk->serial); - printf(" Disk%02d Serial : %s\n", index, str); -- s = __le32_to_cpu(disk->status); -+ s = disk->status; - printf(" State :%s%s%s%s\n", s&SPARE_DISK ? " spare" : "", - s&CONFIGURED_DISK ? " active" : "", - s&FAILED_DISK ? " failed" : "", -@@ -663,7 +708,14 @@ static void brief_detail_super_imsm(struct supertype *st) - - static int match_home_imsm(struct supertype *st, char *homehost) - { -- printf("%s\n", __FUNCTION__); -+ /* the imsm metadata format does not specify any host -+ * identification information. We return -1 since we can never -+ * confirm nor deny whether a given array is "meant" for this -+ * host. We rely on compare_super and the 'family_num' field to -+ * exclude member disks that do not belong, and we rely on -+ * mdadm.conf to specify the arrays that should be assembled. -+ * Auto-assembly may still pick up "foreign" arrays. -+ */ - - return -1; - } -@@ -699,7 +751,7 @@ static void uuid_from_super_imsm(struct supertype *st, int uuid[4]) - struct imsm_dev *dev = NULL; - - sha1_init_ctx(&ctx); -- sha1_process_bytes(super->anchor->sig, MAX_SIGNATURE_LENGTH, &ctx); -+ sha1_process_bytes(super->anchor->sig, MPB_SIG_LEN, &ctx); - sha1_process_bytes(&super->anchor->family_num, sizeof(__u32), &ctx); - if (super->current_vol >= 0) - dev = get_imsm_dev(super, super->current_vol); -@@ -838,7 +890,7 @@ static void getinfo_super_imsm(struct supertype *st, struct mdinfo *info) - disk = &super->disks->disk; - info->data_offset = __le32_to_cpu(disk->total_blocks) - reserved; - info->component_size = reserved; -- s = __le32_to_cpu(disk->status); -+ s = disk->status; - info->disk.state = s & CONFIGURED_DISK ? (1 << MD_DISK_ACTIVE) : 0; - info->disk.state |= s & FAILED_DISK ? (1 << MD_DISK_FAULTY) : 0; - info->disk.state |= s & SPARE_DISK ? 0 : (1 << MD_DISK_SYNC); -@@ -1127,16 +1179,13 @@ load_imsm_disk(int fd, struct intel_super *super, char *devname, int keep_fd) - disk_iter = __get_imsm_disk(super->anchor, i); - - if (serialcmp(disk_iter->serial, dl->serial) == 0) { -- __u32 status; -- - dl->disk = *disk_iter; -- status = __le32_to_cpu(dl->disk.status); - /* only set index on disks that are a member of a - * populated contianer, i.e. one with raid_devs - */ -- if (status & FAILED_DISK) -+ if (dl->disk.status & FAILED_DISK) - dl->index = -2; -- else if (status & SPARE_DISK) -+ else if (dl->disk.status & SPARE_DISK) - dl->index = -1; - else - dl->index = i; -@@ -1148,7 +1197,7 @@ load_imsm_disk(int fd, struct intel_super *super, char *devname, int keep_fd) - /* no match, maybe a stale failed drive */ - if (i == super->anchor->num_disks && dl->index >= 0) { - dl->disk = *__get_imsm_disk(super->anchor, dl->index); -- if (__le32_to_cpu(dl->disk.status) & FAILED_DISK) -+ if (dl->disk.status & FAILED_DISK) - dl->index = -2; - } - -@@ -1171,11 +1220,11 @@ static void imsm_copy_dev(struct imsm_dev *dest, struct imsm_dev *src) - * - * Migration is indicated by one of the following states - * 1/ Idle (migr_state=0 map0state=normal||unitialized||degraded||failed) -- * 2/ Initialize (migr_state=1 migr_type=0 map0state=normal -+ * 2/ Initialize (migr_state=1 migr_type=MIGR_INIT map0state=normal - * map1state=unitialized) -- * 3/ Verify (Resync) (migr_state=1 migr_type=1 map0state=normal -+ * 3/ Verify (Resync) (migr_state=1 migr_type=MIGR_REBUILD map0state=normal - * map1state=normal) -- * 4/ Rebuild (migr_state=1 migr_type=1 map0state=normal -+ * 4/ Rebuild (migr_state=1 migr_type=MIGR_REBUILD map0state=normal - * map1state=degraded) - */ - static void migrate(struct imsm_dev *dev, __u8 to_state, int rebuild_resync) -@@ -1451,7 +1500,6 @@ static int find_missing(struct intel_super *super) - struct imsm_super *mpb = super->anchor; - struct dl *dl; - struct imsm_disk *disk; -- __u32 status; - - for (i = 0; i < mpb->num_disks; i++) { - disk = __get_imsm_disk(mpb, i); -@@ -1463,8 +1511,7 @@ static int find_missing(struct intel_super *super) - /* ok we have a 'disk' without a live entry in - * super->disks - */ -- status = __le32_to_cpu(disk->status); -- if (status & FAILED_DISK || !(status & USABLE_DISK)) -+ if (disk->status & FAILED_DISK || !(disk->status & USABLE_DISK)) - continue; /* never mind, already marked */ - - dl = malloc(sizeof(*dl)); -@@ -1659,6 +1706,53 @@ static __u32 info_to_blocks_per_member(mdu_array_info_t *info) - return (info->size * 2) & ~(info_to_blocks_per_strip(info) - 1); - } - -+static void imsm_update_version_info(struct intel_super *super) -+{ -+ /* update the version and attributes */ -+ struct imsm_super *mpb = super->anchor; -+ char *version; -+ struct imsm_dev *dev; -+ struct imsm_map *map; -+ int i; -+ -+ for (i = 0; i < mpb->num_raid_devs; i++) { -+ dev = get_imsm_dev(super, i); -+ map = get_imsm_map(dev, 0); -+ if (__le32_to_cpu(dev->size_high) > 0) -+ mpb->attributes |= MPB_ATTRIB_2TB; -+ -+ /* FIXME detect when an array spans a port multiplier */ -+ #if 0 -+ mpb->attributes |= MPB_ATTRIB_PM; -+ #endif -+ -+ if (mpb->num_raid_devs > 1 || -+ mpb->attributes != MPB_ATTRIB_CHECKSUM_VERIFY) { -+ version = MPB_VERSION_ATTRIBS; -+ switch (get_imsm_raid_level(map)) { -+ case 0: mpb->attributes |= MPB_ATTRIB_RAID0; break; -+ case 1: mpb->attributes |= MPB_ATTRIB_RAID1; break; -+ case 10: mpb->attributes |= MPB_ATTRIB_RAID10; break; -+ case 5: mpb->attributes |= MPB_ATTRIB_RAID5; break; -+ } -+ } else { -+ if (map->num_members >= 5) -+ version = MPB_VERSION_5OR6_DISK_ARRAY; -+ else if (dev->status == DEV_CLONE_N_GO) -+ version = MPB_VERSION_CNG; -+ else if (get_imsm_raid_level(map) == 5) -+ version = MPB_VERSION_RAID5; -+ else if (map->num_members >= 3) -+ version = MPB_VERSION_3OR4_DISK_ARRAY; -+ else if (get_imsm_raid_level(map) == 1) -+ version = MPB_VERSION_RAID1; -+ else -+ version = MPB_VERSION_RAID0; -+ } -+ strcpy(((char *) mpb->sig) + strlen(MPB_SIGNATURE), version); -+ } -+} -+ - static int init_super_imsm_volume(struct supertype *st, mdu_array_info_t *info, - unsigned long long size, char *name, - char *homehost, int *uuid) -@@ -1724,7 +1818,7 @@ static int init_super_imsm_volume(struct supertype *st, mdu_array_info_t *info, - dev->reserved_blocks = __cpu_to_le32(0); - vol = &dev->vol; - vol->migr_state = 0; -- vol->migr_type = 0; -+ vol->migr_type = MIGR_INIT; - vol->dirty = 0; - vol->curr_migr_unit = 0; - for (i = 0; i < idx; i++) { -@@ -1747,10 +1841,13 @@ static int init_super_imsm_volume(struct supertype *st, mdu_array_info_t *info, - "in a raid1 volume\n"); - return 0; - } -- if (info->level == 10) -+ if (info->level == 10) { - map->raid_level = 1; -- else -+ map->num_domains = info->raid_disks / 2; -+ } else { - map->raid_level = info->level; -+ map->num_domains = !!map->raid_level; -+ } - - map->num_members = info->raid_disks; - for (i = 0; i < map->num_members; i++) { -@@ -1760,6 +1857,8 @@ static int init_super_imsm_volume(struct supertype *st, mdu_array_info_t *info, - mpb->num_raid_devs++; - super->dev_tbl[super->current_vol] = dev; - -+ imsm_update_version_info(super); -+ - return 1; - } - -@@ -1778,6 +1877,7 @@ static int init_super_imsm(struct supertype *st, mdu_array_info_t *info, - struct intel_super *super; - struct imsm_super *mpb; - size_t mpb_size; -+ char *version; - - if (!info) { - st->sb = NULL; -@@ -1798,9 +1898,12 @@ static int init_super_imsm(struct supertype *st, mdu_array_info_t *info, - mpb = super->buf; - memset(mpb, 0, mpb_size); - -- memcpy(mpb->sig, MPB_SIGNATURE, strlen(MPB_SIGNATURE)); -- memcpy(mpb->sig + strlen(MPB_SIGNATURE), MPB_VERSION_RAID5, -- strlen(MPB_VERSION_RAID5)); -+ mpb->attributes = MPB_ATTRIB_CHECKSUM_VERIFY; -+ -+ version = (char *) mpb->sig; -+ strcpy(version, MPB_SIGNATURE); -+ version += strlen(MPB_SIGNATURE); -+ strcpy(version, MPB_VERSION_RAID0); - mpb->mpb_size = mpb_size; - - st->sb = super; -@@ -1816,7 +1919,6 @@ static void add_to_super_imsm_volume(struct supertype *st, mdu_disk_info_t *dk, - struct dl *dl; - struct imsm_dev *dev; - struct imsm_map *map; -- __u32 status; - - dev = get_imsm_dev(super, super->current_vol); - map = get_imsm_map(dev, 0); -@@ -1835,8 +1937,7 @@ static void add_to_super_imsm_volume(struct supertype *st, mdu_disk_info_t *dk, - super->anchor->num_disks++; - } - set_imsm_ord_tbl_ent(map, dk->number, dl->index); -- status = CONFIGURED_DISK | USABLE_DISK; -- dl->disk.status = __cpu_to_le32(status); -+ dl->disk.status = CONFIGURED_DISK | USABLE_DISK; - - /* if we are creating the first raid device update the family number */ - if (super->current_vol == 0) { -@@ -1857,7 +1958,7 @@ static void add_to_super_imsm(struct supertype *st, mdu_disk_info_t *dk, - struct intel_super *super = st->sb; - struct dl *dd; - unsigned long long size; -- __u32 status, id; -+ __u32 id; - int rv; - struct stat stb; - -@@ -1889,10 +1990,9 @@ static void add_to_super_imsm(struct supertype *st, mdu_disk_info_t *dk, - - get_dev_size(fd, NULL, &size); - size /= 512; -- status = USABLE_DISK | SPARE_DISK; - serialcpy(dd->disk.serial, dd->serial); - dd->disk.total_blocks = __cpu_to_le32(size); -- dd->disk.status = __cpu_to_le32(status); -+ dd->disk.status = USABLE_DISK | SPARE_DISK; - if (sysfs_disk_to_scsi_id(fd, &id) == 0) - dd->disk.scsi_id = __cpu_to_le32(id); - else -@@ -2392,7 +2492,7 @@ static struct mdinfo *container_content_imsm(struct supertype *st) - if (d == NULL) - skip = 1; - -- s = d ? __le32_to_cpu(d->disk.status) : 0; -+ s = d ? d->disk.status : 0; - if (s & FAILED_DISK) - skip = 1; - if (!(s & USABLE_DISK)) -@@ -2502,8 +2602,7 @@ static __u8 imsm_check_degraded(struct intel_super *super, struct imsm_dev *dev, - insync = 2; - - disk = get_imsm_disk(super, idx); -- if (!disk || -- __le32_to_cpu(disk->status) & FAILED_DISK || -+ if (!disk || disk->status & FAILED_DISK || - ord & IMSM_ORD_REBUILD) - insync--; - -@@ -2541,8 +2640,7 @@ static int imsm_count_failed(struct intel_super *super, struct imsm_dev *dev) - int idx = ord_to_idx(ord); - - disk = get_imsm_disk(super, idx); -- if (!disk || -- __le32_to_cpu(disk->status) & FAILED_DISK || -+ if (!disk || disk->status & FAILED_DISK || - ord & IMSM_ORD_REBUILD) - failed++; - } -@@ -2557,7 +2655,7 @@ static int is_resyncing(struct imsm_dev *dev) - if (!dev->vol.migr_state) - return 0; - -- if (dev->vol.migr_type == 0) -+ if (dev->vol.migr_type == MIGR_INIT) - return 1; - - migr_map = get_imsm_map(dev, 1); -@@ -2575,7 +2673,7 @@ static int is_rebuilding(struct imsm_dev *dev) - if (!dev->vol.migr_state) - return 0; - -- if (dev->vol.migr_type == 0) -+ if (dev->vol.migr_type != MIGR_REBUILD) - return 0; - - migr_map = get_imsm_map(dev, 1); -@@ -2588,12 +2686,9 @@ static int is_rebuilding(struct imsm_dev *dev) - - static void mark_failure(struct imsm_disk *disk) - { -- __u32 status = __le32_to_cpu(disk->status); -- -- if (status & FAILED_DISK) -+ if (disk->status & FAILED_DISK) - return; -- status |= FAILED_DISK; -- disk->status = __cpu_to_le32(status); -+ disk->status |= FAILED_DISK; - disk->scsi_id = __cpu_to_le32(~(__u32)0); - memmove(&disk->serial[0], &disk->serial[1], MAX_RAID_SERIAL_LEN - 1); - } -@@ -2641,9 +2736,10 @@ static int imsm_set_array_state(struct active_array *a, int consistent) - } else if (!is_resyncing(dev) && !failed) { - /* mark the start of the init process if nothing is failed */ - dprintf("imsm: mark resync start (%llu)\n", a->resync_start); -- map->map_state = map_state; -- migrate(dev, IMSM_T_STATE_NORMAL, -- map->map_state == IMSM_T_STATE_NORMAL); -+ if (map->map_state == IMSM_T_STATE_NORMAL) -+ migrate(dev, IMSM_T_STATE_NORMAL, MIGR_REBUILD); -+ else -+ migrate(dev, IMSM_T_STATE_NORMAL, MIGR_INIT); - super->updates_pending++; - } - -@@ -2676,7 +2772,6 @@ static void imsm_set_disk(struct active_array *a, int n, int state) - struct imsm_map *map = get_imsm_map(dev, 0); - struct imsm_disk *disk; - int failed; -- __u32 status; - __u32 ord; - __u8 map_state; - -@@ -2693,8 +2788,7 @@ static void imsm_set_disk(struct active_array *a, int n, int state) - disk = get_imsm_disk(super, ord_to_idx(ord)); - - /* check for new failures */ -- status = __le32_to_cpu(disk->status); -- if ((state & DS_FAULTY) && !(status & FAILED_DISK)) { -+ if ((state & DS_FAULTY) && !(disk->status & FAILED_DISK)) { - mark_failure(disk); - super->updates_pending++; - } -@@ -2781,7 +2875,7 @@ static struct dl *imsm_readd(struct intel_super *super, int idx, struct active_a - if (dl->index == i) - break; - -- if (dl && __le32_to_cpu(dl->disk.status) & FAILED_DISK) -+ if (dl && dl->disk.status & FAILED_DISK) - dl = NULL; - - if (dl) -@@ -2802,7 +2896,6 @@ static struct dl *imsm_add_spare(struct intel_super *super, int slot, struct act - int j; - int found; - __u32 array_start; -- __u32 status; - struct dl *dl; - - for (dl = super->disks; dl; dl = dl->next) { -@@ -2818,11 +2911,10 @@ static struct dl *imsm_add_spare(struct intel_super *super, int slot, struct act - continue; - - /* skip in use or failed drives */ -- status = __le32_to_cpu(dl->disk.status); -- if (status & FAILED_DISK || idx == dl->index) { -+ if (dl->disk.status & FAILED_DISK || idx == dl->index) { - dprintf("%x:%x status ( %s%s)\n", - dl->major, dl->minor, -- status & FAILED_DISK ? "failed " : "", -+ dl->disk.status & FAILED_DISK ? "failed " : "", - idx == dl->index ? "in use " : ""); - continue; - } -@@ -3072,7 +3164,6 @@ static void imsm_process_update(struct supertype *st, - struct imsm_map *migr_map; - struct active_array *a; - struct imsm_disk *disk; -- __u32 status; - __u8 to_state; - struct dl *dl; - unsigned int found; -@@ -3101,8 +3192,7 @@ static void imsm_process_update(struct supertype *st, - if (i == u->slot) - continue; - disk = get_imsm_disk(super, get_imsm_disk_idx(dev, i)); -- if (!disk || -- __le32_to_cpu(disk->status) & FAILED_DISK) -+ if (!disk || disk->status & FAILED_DISK) - failed++; - } - -@@ -3112,15 +3202,13 @@ static void imsm_process_update(struct supertype *st, - super->anchor->num_disks++; - } - disk = &dl->disk; -- status = __le32_to_cpu(disk->status); -- status |= CONFIGURED_DISK; -- status &= ~SPARE_DISK; -- disk->status = __cpu_to_le32(status); -+ disk->status |= CONFIGURED_DISK; -+ disk->status &= ~SPARE_DISK; - - /* mark rebuild */ - to_state = imsm_check_degraded(super, dev, failed); - map->map_state = IMSM_T_STATE_DEGRADED; -- migrate(dev, to_state, 1); -+ migrate(dev, to_state, MIGR_REBUILD); - migr_map = get_imsm_map(dev, 1); - set_imsm_ord_tbl_ent(map, u->slot, dl->index); - set_imsm_ord_tbl_ent(migr_map, u->slot, dl->index | IMSM_ORD_REBUILD); -@@ -3233,14 +3321,14 @@ static void imsm_process_update(struct supertype *st, - /* fix up flags */ - for (i = 0; i < map->num_members; i++) { - struct imsm_disk *disk; -- __u32 status; - - disk = get_imsm_disk(super, get_imsm_disk_idx(dev, i)); -- status = __le32_to_cpu(disk->status); -- status |= CONFIGURED_DISK; -- status &= ~SPARE_DISK; -- disk->status = __cpu_to_le32(status); -+ disk->status |= CONFIGURED_DISK; -+ disk->status &= ~SPARE_DISK; - } -+ -+ imsm_update_version_info(super); -+ - break; - } - case update_add_disk: diff --git a/mdadm-3.0-devel2.tar.bz2 b/mdadm-3.0-devel2.tar.bz2 deleted file mode 100644 index ac323c9..0000000 --- a/mdadm-3.0-devel2.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:40c18353b488cd1731349d4b585c3e14f3003e0d04f487c680f47b4500e1fcfc -size 246779 diff --git a/mdadm-3.0.tar.bz2 b/mdadm-3.0.tar.bz2 new file mode 100644 index 0000000..e20f227 --- /dev/null +++ b/mdadm-3.0.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:6fd6ab77c4d996879192edd8ad90cd512165a857795c25c98fc35206df6c2e64 +size 250775 diff --git a/mdadm-auto-assemble.patch b/mdadm-auto-assemble.patch deleted file mode 100644 index 716d60c..0000000 --- a/mdadm-auto-assemble.patch +++ /dev/null @@ -1,110 +0,0 @@ -diff --git a/Assemble.c b/Assemble.c -index c86a165..20c4be7 100644 ---- a/Assemble.c -+++ b/Assemble.c -@@ -320,7 +320,7 @@ int Assemble(struct supertype *st, char *mddev, - - tmpdev->content = content->next; - if (tmpdev->content == NULL) -- tmpdev->used = 1; -+ tmpdev->used = 2; - - } else if (ident->container || ident->member) { - /* No chance of this matching if we don't have -@@ -396,12 +396,15 @@ int Assemble(struct supertype *st, char *mddev, - * looking. If the chosen member is active, skip. - */ - if (is_member_busy(content->text_version)) { -+ if (report_missmatch) -+ fprintf(stderr, Name ": member %s in %s is already assembled\n", -+ content->text_version, -+ devname); -+ tst->ss->free_super(tst); -+ tst = NULL; -+ content = NULL; - if (auto_assem) - goto loop; -- fprintf(stderr, Name ": member %s in %s is already assembled\n", -- content->text_version, -- devname); -- tst->ss->free_super(tst); - return 1; - } - st = tst; tst = NULL; -@@ -1202,8 +1205,10 @@ int assemble_container_content(struct supertype *st, int mdfd, - - sra = sysfs_read(mdfd, 0, GET_VERSION); - if (sra == NULL || strcmp(sra->text_version, content->text_version) != 0) -- if (sysfs_set_array(content, md_get_version(mdfd)) != 0) -+ if (sysfs_set_array(content, md_get_version(mdfd)) != 0) { -+ close(mdfd); - return 1; -+ } - if (sra) - sysfs_free(sra); - -@@ -1212,9 +1217,10 @@ int assemble_container_content(struct supertype *st, int mdfd, - working++; - else if (errno == EEXIST) - preexist++; -- if (working == 0) -- /* Nothing new, don't try to start */ ; -- else if (runstop > 0 || -+ if (working == 0) { -+ close(mdfd); -+ return 1;/* Nothing new, don't try to start */ -+ } else if (runstop > 0 || - (working + preexist) >= content->array.working_disks) { - - map_update(&map, fd2devnum(mdfd), -@@ -1246,15 +1252,18 @@ int assemble_container_content(struct supertype *st, int mdfd, - fprintf(stderr, "\n"); - } - wait_for(chosen_name); -+ close(mdfd); -+ return 0; - /* FIXME should have an O_EXCL and wait for read-auto */ -- } else -+ } else { - if (verbose >= 0) - fprintf(stderr, Name - ": %s assembled with %d devices but " - "not started\n", - chosen_name, working); -- -- return 0; -+ close(mdfd); -+ return 1; -+ } - } - #endif - -diff --git a/Create.c b/Create.c -index da05eed..783ab09 100644 ---- a/Create.c -+++ b/Create.c -@@ -780,11 +780,11 @@ int Create(struct supertype *st, char *mddev, - ping_monitor(devnum2devname(st->container_dev)); - close(container_fd); - } -+ wait_for(chosen_name); - } else { - fprintf(stderr, Name ": not starting array - not enough devices.\n"); - } - close(mdfd); -- wait_for(chosen_name); - return 0; - - abort: -diff --git a/Incremental.c b/Incremental.c -index ff8aa9a..474f78d 100644 ---- a/Incremental.c -+++ b/Incremental.c -@@ -829,7 +829,6 @@ int Incremental_container(struct supertype *st, char *devname, int verbose, - - err = assemble_container_content(st, mdfd, ra, runstop, - chosen_name, verbose); -- close(mdfd); - if (err) - return err; - } diff --git a/mdadm-destdir.patch b/mdadm-destdir.patch deleted file mode 100644 index 0d816fa..0000000 --- a/mdadm-destdir.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- Makefile -+++ Makefile -@@ -199,7 +199,7 @@ - $(INSTALL) -D -m 644 mdadm.conf.5 $(DESTDIR)$(MAN5DIR)/mdadm.conf.5 - - install-udev: udev-md-raid.rules -- $(INSTALL) -D -m 644 udev-md-raid.rules /lib/udev/rules.d/64-md-raid.rules -+ $(INSTALL) -D -m 644 udev-md-raid.rules $(DESTDIR)/lib/udev/rules.d/64-md-raid.rules - - uninstall: - rm -f $(DESTDIR)$(MAN8DIR)/mdadm.8 md.4 $(DESTDIR)$(MAN4DIR)/md.4 $(DESTDIR)$(MAN5DIR)/mdadm.conf.5 $(DESTDIR)$(BINDIR)/mdadm diff --git a/mdadm-overflow.patch b/mdadm-overflow.patch deleted file mode 100644 index d92cd1f..0000000 --- a/mdadm-overflow.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- mdopen.c -+++ mdopen.c -@@ -88,7 +88,7 @@ - if (chmod(name, stb2.st_mode & 07777)) - perror("chmod"); - } else { -- snprintf(sym, 10000, "%s%s%d", orig, odig?"p":"", i); -+ snprintf(sym, 1024, "%s%s%d", orig, odig?"p":"", i); - symlink(sym, name); - } - stat(name, &stb2); diff --git a/mdadm.changes b/mdadm.changes index e7f70a7..1c5a09b 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Fri Jun 12 09:43:43 CEST 2009 - mmarek@suse.cz + +- remove static md* device nodes, they should not be needed + anymore. + +------------------------------------------------------------------- +Thu Jun 11 11:32:55 CEST 2009 - mmarek@suse.cz + +- updated to 3.0 final +- dropped all patches + ------------------------------------------------------------------- Tue Mar 3 10:36:11 CET 2009 - mmarek@suse.cz diff --git a/mdadm.spec b/mdadm.spec index 0b1cd00..faf1932 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -20,8 +20,8 @@ Name: mdadm Version: 3.0 -Release: 20 -%define ver 3.0-devel2 +Release: 21 +%define ver 3.0 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq Obsoletes: raidtools @@ -32,19 +32,9 @@ Url: http://www.kernel.org/pub/linux/utils/raid/mdadm/ Summary: Utility for Configuring MD Setup BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: %{name}-%{ver}.tar.bz2 -Patch1: super-intel-undefined-operation.patch -Patch2: mdmon-ia64-clone.patch -Patch3: mdadm-destdir.patch -Patch4: mdadm-overflow.patch -Patch5: mdadm-auto-assemble.patch +# XXX - still needed? Patch6: Start-kpartx-for-imsm-devices.patch -Patch7: intel.fixes.patch -Patch8: name.fixes.patch -Patch9: mdmon-pass-symbolic-name-to-mdmon-instead-of-device.patch -Patch10: don-t-auto-assemble-if-any-arrays-are-list.patch Patch11: manage-rebuild-map-for-kpartx -Patch12: super0-Do-all-metadata-IO-with-4096byte-alignment.patch -Patch13: super1-do-metadata-IO-in-sector_size-units.patch Source1: Software-RAID.HOWTO.tar.bz2 Source2: sysconfig.mdadm Source3: mdadmd @@ -65,19 +55,8 @@ Authors: %prep %setup -q -a1 -n %{name}-%{ver} -%patch1 -%patch2 -%patch3 -%patch4 -%patch5 -p1 -%patch6 -p1 -%patch7 -p1 -%patch8 -p1 -%patch9 -p1 -%patch10 -p1 -%patch11 -p1 -%patch12 -p1 -%patch13 -p1 +#patch6 -p1 +#patch11 -p1 %build %{suse_update_config -f} @@ -119,38 +98,6 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %attr(0755,root,root) %config %{_sysconfdir}/init.d/* -%attr(640,root,disk) %dev(b,9,0) /lib/udev/devices/md0 -%attr(640,root,disk) %dev(b,9,1) /lib/udev/devices/md1 -%attr(640,root,disk) %dev(b,9,2) /lib/udev/devices/md2 -%attr(640,root,disk) %dev(b,9,3) /lib/udev/devices/md3 -%attr(640,root,disk) %dev(b,9,4) /lib/udev/devices/md4 -%attr(640,root,disk) %dev(b,9,5) /lib/udev/devices/md5 -%attr(640,root,disk) %dev(b,9,6) /lib/udev/devices/md6 -%attr(640,root,disk) %dev(b,9,7) /lib/udev/devices/md7 -%attr(640,root,disk) %dev(b,9,8) /lib/udev/devices/md8 -%attr(640,root,disk) %dev(b,9,9) /lib/udev/devices/md9 -%attr(640,root,disk) %dev(b,9,10) /lib/udev/devices/md10 -%attr(640,root,disk) %dev(b,9,11) /lib/udev/devices/md11 -%attr(640,root,disk) %dev(b,9,12) /lib/udev/devices/md12 -%attr(640,root,disk) %dev(b,9,13) /lib/udev/devices/md13 -%attr(640,root,disk) %dev(b,9,14) /lib/udev/devices/md14 -%attr(640,root,disk) %dev(b,9,15) /lib/udev/devices/md15 -%attr(640,root,disk) %dev(b,9,16) /lib/udev/devices/md16 -%attr(640,root,disk) %dev(b,9,17) /lib/udev/devices/md17 -%attr(640,root,disk) %dev(b,9,18) /lib/udev/devices/md18 -%attr(640,root,disk) %dev(b,9,19) /lib/udev/devices/md19 -%attr(640,root,disk) %dev(b,9,20) /lib/udev/devices/md20 -%attr(640,root,disk) %dev(b,9,21) /lib/udev/devices/md21 -%attr(640,root,disk) %dev(b,9,22) /lib/udev/devices/md22 -%attr(640,root,disk) %dev(b,9,23) /lib/udev/devices/md23 -%attr(640,root,disk) %dev(b,9,24) /lib/udev/devices/md24 -%attr(640,root,disk) %dev(b,9,25) /lib/udev/devices/md25 -%attr(640,root,disk) %dev(b,9,26) /lib/udev/devices/md26 -%attr(640,root,disk) %dev(b,9,27) /lib/udev/devices/md27 -%attr(640,root,disk) %dev(b,9,28) /lib/udev/devices/md28 -%attr(640,root,disk) %dev(b,9,29) /lib/udev/devices/md29 -%attr(640,root,disk) %dev(b,9,30) /lib/udev/devices/md30 -%attr(640,root,disk) %dev(b,9,31) /lib/udev/devices/md31 %doc COPYING ChangeLog README.initramfs TODO mdadm.conf-example mkinitramfs %doc Software-RAID.HOWTO/Software-RAID.HOWTO*{.txt,.html} %doc %{_mandir}/man?/* @@ -166,423 +113,3 @@ rm -rf $RPM_BUILD_ROOT /lib/mkinitrd/scripts/boot-md.sh %changelog -* Tue Mar 03 2009 mmarek@suse.cz -- super0: Do all metadata IO with 4096byte alignment -- super1 - do metadata IO in sector_size units. - (bnc#466172) -* Sat Feb 21 2009 mmarek@suse.cz -- mkinitrd-setup.sh: filter out duplicate devices (bnc#461673, - patch by Xin Wei Hu) -* Tue Feb 17 2009 mmarek@suse.cz -- disable auto-assemly in boot.md completely as it can collide with - dmraid (bnc#474652). If someone wants to auto-assemble md arrays - in the rescue system, they can run - 'mdadm -Es -c partitions >mdadm.conf && mdadm -As -c mdadm.conf' - manually. -* Mon Feb 16 2009 mmarek@suse.cz -- fix segfault when stopping imsm arrays - (bnc#473947, patch by Dan Williams) -* Mon Jan 26 2009 ro@suse.de -- change fillup call from "-Y" to "-y" the boot script has - been present in this package for long enough (SLES10-GA) -* Fri Dec 05 2008 hare@suse.de -- Wait for udev to settle before continuing (bnc#435778) -* Fri Dec 05 2008 nfbrown@suse.de -- boot.md : an exit status of '2' from "mdadm --assemble" - should not be seen as failure by boot.md. - It happens if one or more arrays is already - assembled. - (bnc#456028) -* Thu Nov 20 2008 nfbrown@suse.de -- don-t-auto-assemble-if-any-arrays-are-list.patch - Avoid assembling extra arrays during initrd - processing. bnc#445438 -* Thu Nov 20 2008 nfbrown@suse.de -- mdmon-pass-symbolic-name-to-mdmon-instead-of-device.patch - avoid problems if mdmon is run before - udev creates any devices. -* Fri Nov 14 2008 nfbrown@suse.de -- intel.fixes.patch : various fixes from intel for - proper handling of their metadata -- name.fixes.patch : various fixes for new handling - of device names - one could cause a crash. -* Sun Nov 09 2008 ro@suse.de -- fix patch apply depth -* Fri Nov 07 2008 nfbrown@suse.de -- mdadm-auto-assemble.patch - fix various bugs in - auto-assemble -- start-kpartx-for-imsm-devices.patch - IMSM devices - need to be partitioned, and may programs including - YaST don't understand partitioned md devices, - so run kpartx to create 'dm' based partitions which - have a better chance for being understood - This relates to FATE#304220 -* Fri Nov 07 2008 ro@suse.de -- remove udev rule (conflicting with file in udev package) -* Fri Nov 07 2008 ro@suse.de -- buildfix: add missing DESTDIR to Makefile for udev rule -- fix len in snprintf to silence compiler warning about potential - overflow -* Thu Nov 06 2008 nfbrown@suse.de -- Update from mdadm-3.0-devel1 to mdadm-3.0-devel2. - This includes various bug fixes and enhancements to the - extent that DDF and IMSM work reasonably well and can be - auto-assembled much like other arrays. -- Allow BOOT_MD_USE_MDADM_CONFIG to have the value 'part' - that, like 'no', arrays are auto-assembled. However they - get assembled as 'mdp' partitionable arrays where possible. - This currently only affect arrays with v1.x metadata. - This supports FATE#303894 -* Fri Oct 03 2008 mmarek@suse.cz -- fixed mdmon's clone_monitor on ia64 -* Fri Oct 03 2008 mmarek@suse.cz -- fixed byte swapping in super-intel.c on big endian. -* Wed Sep 24 2008 ro@suse.de -- change "udevsettle" to "udevadm settle" -* Fri Sep 19 2008 mmarek@suse.cz -- added /var/run/mdadm for mdmon -- fixed build -* Thu Sep 18 2008 nfbrown@suse.de -- update to mdadm-3.0-devel1 - package version number is set to 3.0 to avodi future confusion. - This is a substantial update that provides support for handling - the metadata entirely in userspace and thus making easier to - handle a variety of metadata formats. Support is included for - DDF and for the Intel Matrix metadata used by recent ICH chipsets. - An extra program 'mdmon' is needed and included. It is run to - monitor any array using 'external' (to the kernel) metadata - and will update the metadata in response to device failures etc. - This is required for FATE 304219 -* Wed Sep 03 2008 hare@suse.de -- Call mkinitrd_setup during %%post and %%postun (bnc#413709) -* Sun Aug 17 2008 aj@suse.de -- Fix init scripts. -* Wed Jul 23 2008 hare@suse.de -- Include mkinitrd scriptlets. -* Fri Jun 20 2008 mmarek@suse.cz -- updated to 2.6.7 + fixes from git - * Avoid segfault when parsing /proc/mdstat with auto-read-only - arrays. - * For v0.90 superblocks, print the 'Events' count as a real - count, not 2 numbers separated by a dot. - * Allow creation of a RAID6 with exactly one missing device. - * Use LOG_PID for syslog, so you get the pid of mdadm in the - log files. - * --export now works with --examine too (not just --detail) - * Improve auto-creation of device special file when using - --incremental - * Simple locking for --incremental so mdadm doesn't get - confused when run concurrently with itself. - * Make --incremental cope better with arrays that are being - reshaped. - * Fix autoassemble for stack arrays. -- remove /tmp/mdadm.conf in boot.md (bnc#401138) -* Wed Apr 30 2008 mmarek@suse.cz -- added some fixes from Neil's git repo, fixing bnc#368704 among - others -* Mon Feb 04 2008 mmarek@suse.cz -- correctly display rc_status in boot.md -* Wed Jan 23 2008 mmarek@suse.cz -- fixed auto-assembly part of boot.md - * if /etc/mdadm.conf is empy or only contains whitespace or - comments, no autoassembly is done - * remove /tmp/mdadm.conf even if a directory [#329678] -- dropped mdrun and raidautorun (no longer needed) -* Wed Oct 24 2007 mmarek@suse.cz -- updated to 2.6.4 - * Make "--create --auto=mdp" work for non-standard device names. - * Fix restarting of a 'reshape' if it was stopped in the middle. - * Fix a segfault when using v1 superblock. - * Make --write-mostly effective when re-adding a device to an - array. - * Various minor fixes -- changes in 2.6.3: - * allow --write-behind to be set for --grow. - * When adding new disk to an array, don't reserve so much bitmap - space that the disk cannot store the required data. (Needed - when 1.x array was created with older mdadm). - * When adding a drive that was a little too small, we did not get - the correct error message. - * Make sure that if --assemble find an array in the critical - region of a reshape, and cannot find the critical data to - restart the reshape, it gives an error message. - * Fix segfault with '--detail --export' and non-persistent - superblocks. - * Various manpage updates. - * Improved 'raid4' support (--assemble, --monitor) - * Option parsing fixes w.r.t -a - * Interpret "--assemble --metadata=1" to allow any version 1.x - metadata, and be more specific in the "metadata=" message - printed with --examine --brief - * Fix spare migration in --monitor. -* Fri Jul 27 2007 mmarek@suse.cz -- changes to the init script [#288454] - * don't try to autoassemble if /etc/mdadm.conf exists (even an - empty one) - * ony autoassemble partitions found in /proc/partitions -* Fri Jul 13 2007 mmarek@suse.cz -- updated to 2.6.2 - * --fail detached and --remove faulty can be used to fail and - remove devices that are no longer physically present. - * --export option for --detail or present information in a format - that can be processed by udev. - * fix internal bitmap allocation problems with v1.1, v1.2 - metadata. - * --help now goes to stdout so you can direct it to a pager. - * Various manpage updates. - * Make "--grow --add" for linear arrays really work. - * --auto-detect to trigger in-kernel autodetect. - * Make return code for "--detail --test" more reliable. Missing - devices as well as failed devices cause an error. -- added some fixes from Neil's git repo (mdadm-git-fixes.patch) -* Thu Jun 21 2007 adrian@suse.de -- fix changelog entry order -* Mon Apr 02 2007 mmarek@suse.cz -- updated to 2.6.1 - * --monitor was producing some meaningless warnings due to a bug. - * Fix some compiler warnings. - * Fully support --grow for raid6. If a reshape crashed during - the critical period, mdadm wouldn't restore the Q information - properly. - * Update documentation for --grow. - * Report bitmap status in --detail and --examine - * Default to v1 superblocks instead of v0.90 if the array - is too big for 0.90 to handle. - * Sort the output of "mdadm --detail --scan" so that it is - in a suitable order for assembling arrays. i.e. components come - before an array that they are part of. - * Require bitmap files to have a '/' in their name. - * Rewrite 'reshape' support including performing a backup - of the critical region for a raid5 growth, and restoring that - backup after a crash. - * Put a 'canary' at each end of the backup so a corruption - can be more easily detected. - * Support --backup-file for backing-up critical section during - growth. - * Erase old superblocks (of different versions) when creating new - array. - * Allow --monitor to work with arrays with >28 devices - * Report reshape information in --detail - * Handle symlinks in /dev better - * Fix mess in --detail output which a device is missing. - * Support 'bitmap=' in mdadm.conf for auto-assembling arrays with - write-intent bitmaps in separate files. - * Fix alignment problem in version-1 superblocks. - NOTE: This is an incompatable change affecting raid5 reshape. - If you want to reshape a raid5 using version-1 superblocks, - use 2.6.17-rc2 or later, and mdadm-2.4.1 or later. - * Support 'mailfrom' line in mdadm.conf so the From: line in alert - emails can be explicitly set. - * Arrange that SparesMissing (which is similar in import to - DegradedArray) generates an Email. - * Assume "DEVICE partitions" if no DEVICE line is given. - * Support new 'offset' layout for raid10. - * When creating a bitmap file, choose a chunksize to limit number - of bitmap chunks to 2 million. More than this can cause kmalloc - failure. - * New 'CREATE' line in mdadm.conf for defaults such as owner, group, - mode and auto-flag - * --detail checks if array has been started or not and includes that - in report. - * When using --update=uuid on an array with a bitmap, update the - bitmap's uuid too. - * Add a copy of /proc/mdstat to the mail message sent by mdadm - --monitor. - * New flag --no-degraded to avoid starting arrays if there are - fewer devices available than last time the array was started. - This is only needed with --scan, as with --scan, that behaviour - is the default. - * Support for 'homehost' concept. This is a fairly major update. - It includes a configfile option and a command line option for - specifying a homehost, records that host in the superblock, - and reports the homehost where possible. - * Support for Auto Assembly. "mdadm -As" will, if provided with - the name of a homehost, try to assemble all arrays it can find - that were created for that homehost. See man pages for more details. - * Don't try to create devices with --manage or --grow - * allow default metadata (superblock) type to be specified - in mdadm.conf - * Avoid some misdetection of overlapping partitions - * Add 'Array Slot' line to --examine for version-1 superblocks - to make it a bit easier to see what is happening. - * Work around bug in --add handling for version-1 superblocks - in 2.6.17 (and prior). - * Make -assemble a bit more resilient to finding strange - information in superblocks. - * When creating devices in /dev/md/ create matching symlinks - from /dev. e.g. /dev/md0 -> /dev/md/0. - Allow this to be disabled in mdadm.conf or on command line. - * Allow a number (of partitions) after the 'yes' option to --auto= - This is particularly useful in the 'create' line in mdadm.conf. - * Remove partitions from any whole device that is made part of - an md array. This is a work-around for annoying messages - when the first block on some drive accidentally looks like a - partition table. - * Close stray fd in mdassemble so that it can assemble stacked - devices - * If mdassemble finds an array already assembled, it marks it - read-write. - * Remove error in md_open if array is already active. This isn't - needed and gets in the ways if an array was created e.g. in - initramfs, but device doesn't yet exist in /dev. - * When --assemble --scan is run, if all arrays that could be found - have already been started, don't report an error. - * Allow --assemble --force to mark a raid6 clean when it has two - missing devices (which is needed else if won't assemble. - Without this fix it would only assemble if one or zero - missing devices. - * Support --update=devicesize for cases where the underlying device - can change size. - * Default to --auto=yes so the array devices with 'standard' names - get created automatically, as this is almost always what is wanted. - * Give useful message if raid4/5/6 cannot be started because it is - not clean and is also degraded. - * Increase raid456 stripe cache size if needed to --grow the array. - The setting used unfortunately requires intimate knowledge of the - kernel, and it not reset when the reshape finishes. - * Change 'Device Size' to 'Used Dev Size' because it only shows how - much of each device is actually used, not how big they are. - * --wait or -W will wait for resync activity to finish on the given - devices. - * If two drives in a raid5 disappear at the same time, then "-Af" - will add them both in rather than just one and forcing the array - to 'clean'. This is slightly safer in some cases. - * Don't hold md device open for so long in --monitor mode - map_dev - can be slow and interferes with trying to stop the array. - * Support --uuid= with --create to choose your own UUID. - * New major more "--incremental" for incremental assemble of arrays, - intended for use with udev. - * lots of bugfixes - * manpage updates -* Wed Jan 10 2007 mmarek@suse.cz -- use raidautorun instead of mdrun to autodetect the raid arrays in - boot.md [#230733] -* Wed Nov 08 2006 prusnak@suse.cz -- fixed subscript out of range [#212697] -* Wed Sep 20 2006 mjancar@suse.cz -- update to 2.5.3 - * lots bugfixes - * drop all patches (integrated upstream) -* Fri Jul 28 2006 olh@suse.de -- remove dropped boot.ibmsis from boot.md -- boot.rootfsck should start before boot.md (#181972) -* Fri Jul 21 2006 olh@suse.de -- remove boot.proc from Required-Start: in boot.md (#178753) -* Wed May 03 2006 mjancar@suse.cz -- fix false SparesMissing error (#171326) -* Wed Apr 26 2006 hare@suse.de -- Fix init script dependencies -- Implement MDADM_DEVICE_TIMEOUT to set a timeout for - udevsettle (#149979) -* Tue Apr 25 2006 mjancar@suse.cz -- add static device nodes for udev (#168824) -* Wed Apr 19 2006 mjancar@suse.cz -- set $BOOT_MD_USE_MDADM_CONFIG to "yes" by default (#155120) -* Fri Apr 07 2006 mjancar@suse.cz -- detach mdadmd from tty in rcmdadmd (#160881) -* Mon Apr 03 2006 mjancar@suse.cz -- fix garbled output with --detail (#160827) -- fix fix write-mostly with --add and --re-add (#162968) -* Fri Mar 24 2006 mjancar@suse.cz -- add /sbin/raidautorun (#159460) -* Wed Mar 08 2006 mjancar@suse.cz -- add $BOOT_MD_USE_MDADM_CONFIG sysconfig variable (#155120) -* Thu Feb 09 2006 mjancar@suse.cz -- round free size to chunk size multiply on --create (#148562) -* Tue Feb 07 2006 mjancar@suse.cz -- move boot.multipath to Should-Start instead of Required-Start -* Mon Feb 06 2006 mjancar@suse.cz -- add "Obsoletes: raidtools" -- start boot.md after boot.multipath -- call mdadm without -a from mdrun, an argument is required in 2.2 -* Mon Feb 06 2006 mjancar@suse.de -- don't start mdadmd by default -* Sun Feb 05 2006 mjancar@suse.cz -- include option for email to be sent on start (#142105) -- fix missing md autostart due to raidtools dropped (#148234) - * include mdrun script from Debian - * create boot.md initscipt -* Sun Feb 05 2006 schwab@suse.de -- Fix memset parameters. -* Thu Feb 02 2006 mjancar@suse.cz -- fix segfault on --assemble (#146514) -* Fri Jan 27 2006 mls@suse.de -- converted neededforbuild to BuildRequires -* Wed Jan 25 2006 olh@suse.de -- fix uninitialized variable, memset call and memcmp/memcpy bug - mdadm.bug144647-array.init.patch - mdadm.bug144647-update_super1-memcpy.patch - mdadm.bug144647-add_internal_bitmap0-memcpy.patch -* Wed Jan 11 2006 mjancar@suse.cz -- update ro 2.2 -* Tue Dec 20 2005 ro@suse.de -- at least output errors if they occur (instead of ignoring) -* Wed Nov 30 2005 schwab@suse.de -- Fix broken formats. -* Tue Oct 25 2005 aj@suse.de -- Build with -fno-strict-aliasing. -* Wed Oct 12 2005 mjancar@suse.cz -- update to 2.1 -* Thu Jul 28 2005 anicka@suse.cz -- update to 1.12.0 -* Wed Jun 15 2005 meissner@suse.de -- use RPM_OPT_FLAGS correctly. -* Tue Apr 19 2005 postadal@suse.de -- updated to version 1.11.0 -- fixed for gcc 4.0 -- removed obsoleted patch config-fix -* Wed Mar 30 2005 postadal@suse.cz -- fixed parsing command line option '--config=partions' [#74603] -* Fri Feb 04 2005 postadal@suse.cz -- updated to version 1.9.0 -* Thu Jan 13 2005 postadal@suse.cz -- updated to version 1.8.1 -- extended comment in sysconfig.mdadm [#48567] -* Fri Aug 06 2004 postadal@suse.cz -- updated to version 1.6.0 - * added --auto= and --assume-clean options - * added "degraded" and "recovering" options to the "Status:" entry -* Tue Feb 10 2004 postadal@suse.cz -- updated to version 1.5.0 - * new commands "mdassemble" - * support for raid6 as found in 2.6.2 - * support partitioned md arrays with a different major number and - naming scheme - * added "SparesMissing" event when --monitor first sees an array and - it doesn't have the enough spare devices. -* Sun Jan 11 2004 adrian@suse.de -- add %%defattr -* Mon Dec 01 2003 fehr@suse.de -- fix quoting problem in start script (#33392) -* Fri Aug 29 2003 fehr@suse.de -- add PreReq for fillup -* Tue Aug 26 2003 fehr@suse.de -- add %%stop_on_removal and %%restart_on_update -* Thu Aug 14 2003 fehr@suse.de -- add missing activation metadata in sysconfig (#28901) -* Tue Jul 29 2003 fehr@suse.de -- update to new version 1.3.0 of package -* Mon Apr 14 2003 postadal@suse.cz -- fixed init script (added return value for unimplemented reload function) -* Mon Mar 31 2003 postadal@suse.cz -- added buildroot, init script, sysconfig -- bzip2 sources and cleaned specfile -* Thu Mar 20 2003 fehr@suse.de -- update to version 1.2.0 of package -* Mon Mar 03 2003 fehr@suse.de -- update to version 1.1.0 of package -* Mon Dec 02 2002 fehr@suse.de -- Fix for new glibc/gcc -* Tue Sep 17 2002 ro@suse.de -- removed bogus self-provides -* Fri Sep 13 2002 lmb@suse.de -- Fix for 64bit arch; ioctl returns long instead of int (#20339) -* Fri Aug 23 2002 lmb@suse.de -- Multipath arrays can now be build manually even without a superblock. -- One debugging chunk removed from patch. -* Tue Aug 13 2002 lmb@suse.de -- Fix for the assembly of multipath arrays. -* Mon Aug 12 2002 lmb@suse.de -- Added patch to support the enhanced multipath features. -* Mon Aug 05 2002 fehr@suse.de -- make SuSE package from version 1.0.1 of mdadm diff --git a/mdmon-ia64-clone.patch b/mdmon-ia64-clone.patch deleted file mode 100644 index 9656032..0000000 --- a/mdmon-ia64-clone.patch +++ /dev/null @@ -1,35 +0,0 @@ -ia64 has __clone2 instead of clone() ---- - mdmon.c | 12 ++++++++++++ - 1 file changed, 12 insertions(+) - -Index: mdmon.c -=================================================================== ---- mdmon.c.orig -+++ mdmon.c -@@ -79,13 +79,25 @@ int run_child(void *v) - return 0; - } - -+#ifdef __ia64__ -+int __clone2(int (*fn)(void *), -+ void *child_stack_base, size_t stack_size, -+ int flags, void *arg, ... -+ /* pid_t *pid, struct user_desc *tls, pid_t *ctid */ ); -+#endif - int clone_monitor(struct supertype *container) - { - static char stack[4096]; - -+#ifdef __ia64__ -+ mon_tid = __clone2(run_child, stack, sizeof(stack), -+ CLONE_FS|CLONE_FILES|CLONE_VM|CLONE_SIGHAND|CLONE_THREAD, -+ container); -+#else - mon_tid = clone(run_child, stack+4096-64, - CLONE_FS|CLONE_FILES|CLONE_VM|CLONE_SIGHAND|CLONE_THREAD, - container); -+#endif - - mgr_tid = syscall(SYS_gettid); - diff --git a/mdmon-pass-symbolic-name-to-mdmon-instead-of-device.patch b/mdmon-pass-symbolic-name-to-mdmon-instead-of-device.patch deleted file mode 100644 index 1337527..0000000 --- a/mdmon-pass-symbolic-name-to-mdmon-instead-of-device.patch +++ /dev/null @@ -1,138 +0,0 @@ -From b6e15d73b19d963de7412560cc651e3b6d6a5428 Mon Sep 17 00:00:00 2001 -From: NeilBrown -Date: Thu, 20 Nov 2008 14:51:42 +1100 -Subject: [PATCH] mdmon: pass symbolic name to mdmon instead of device name. - -Now that names in /dev are usually created (eventually) by udev, -it isn't really safe to rely in finding a name in /dev to pass to -mdmon to identify which array to monitor. -And it isn't really necessary to have a name in /dev. -So just pass the symbolic name, e.g. md127 or md123. - -Change util.c to pass that name, and change mdmon to process the -name sensibly. - -Signed-off-by: NeilBrown ---- - mdadm.h | 2 +- - mdmon.c | 17 +++++++++++++---- - monitor.c | 2 +- - util.c | 13 ++++++++++--- - 4 files changed, 25 insertions(+), 9 deletions(-) - -diff --git a/mdadm.h b/mdadm.h -index 9d819f9..2772650 100644 ---- a/mdadm.h -+++ b/mdadm.h -@@ -634,7 +634,6 @@ struct supertype { - * external:/md0/12 - */ - int devcnt; -- char *device_name; /* e.g. /dev/md/whatever */ - - struct mdinfo *devs; - -@@ -761,6 +760,7 @@ extern int check_raid(int fd, char *name); - - extern int get_mdp_major(void); - extern int dev_open(char *dev, int flags); -+extern int open_dev(int devnum); - extern int open_dev_excl(int devnum); - extern int is_standard(char *dev, int *nump); - extern int same_dev(char *one, char *two); -diff --git a/mdmon.c b/mdmon.c -index 5ee8346..73c244a 100644 ---- a/mdmon.c -+++ b/mdmon.c -@@ -287,6 +287,8 @@ int main(int argc, char *argv[]) - int ignore; - char *container_name = NULL; - char *switchroot = NULL; -+ int devnum; -+ char *devname; - - switch (argc) { - case 2: -@@ -304,7 +306,14 @@ int main(int argc, char *argv[]) - usage(); - } - -- mdfd = open(container_name, O_RDWR); -+ devnum = devname2devnum(container_name); -+ devname = devnum2devname(devnum); -+ if (strcmp(container_name, devname) != 0) { -+ fprintf(stderr, "mdmon: %s is not a valid md device name\n", -+ container_name); -+ exit(1); -+ } -+ mdfd = open_dev(devnum); - if (mdfd < 0) { - fprintf(stderr, "mdmon: %s: %s\n", container_name, - strerror(errno)); -@@ -342,9 +351,8 @@ int main(int argc, char *argv[]) - pfd[0] = pfd[1] = -1; - - container = malloc(sizeof(*container)); -- container->devnum = fd2devnum(mdfd); -- container->devname = devnum2devname(container->devnum); -- container->device_name = container_name; -+ container->devnum = devnum; -+ container->devname = devname; - container->arrays = NULL; - - if (!container->devname) { -@@ -462,6 +470,7 @@ int main(int argc, char *argv[]) - container_name); - exit(3); - } -+ close(mdfd); - - /* Ok, this is close enough. We can say goodbye to our parent now. - */ -diff --git a/monitor.c b/monitor.c -index 15791f4..5c17910 100644 ---- a/monitor.c -+++ b/monitor.c -@@ -469,7 +469,7 @@ static int wait_and_act(struct supertype *container, int nowait) - * problem as there are no active arrays, there is - * nothing that we need to be ready to do. - */ -- int fd = open(container->device_name, O_RDONLY|O_EXCL); -+ int fd = open_dev_excl(container->devnum); - if (fd >= 0 || errno != EBUSY) { - /* OK, we are safe to leave */ - if (sigterm && !dirty_arrays) -diff --git a/util.c b/util.c -index 2b4f902..d7597fa 100644 ---- a/util.c -+++ b/util.c -@@ -813,6 +813,14 @@ int dev_open(char *dev, int flags) - return fd; - } - -+int open_dev(int devnum) -+{ -+ char buf[20]; -+ -+ sprintf(buf, "%d:%d", dev2major(devnum), dev2minor(devnum)); -+ return dev_open(buf, O_RDWR); -+} -+ - int open_dev_excl(int devnum) - { - char buf[20]; -@@ -1261,9 +1269,8 @@ int start_mdmon(int devnum) - for (i=0; paths[i]; i++) - if (paths[i][0]) - execl(paths[i], "mdmon", -- map_dev(dev2major(devnum), -- dev2minor(devnum), -- 1), NULL); -+ devnum2devname(devnum), -+ NULL); - exit(1); - case -1: fprintf(stderr, Name ": cannot run mdmon. " - "Array remains readonly\n"); --- -1.5.6.5 - diff --git a/name.fixes.patch b/name.fixes.patch deleted file mode 100644 index 181d50a..0000000 --- a/name.fixes.patch +++ /dev/null @@ -1,62 +0,0 @@ -Two patches fixing issues with device naming. - -commit bf68e9d9ab185121b6004fc81b531bce8348726d -Author: Dan Williams -Date: Mon Nov 10 09:30:07 2008 -0700 - - fix add_dev() handling of broken links - - Resolves issues like: - mdadm -Ss - mdadm: unable to open /dev/md/r1: No such file or directory - - ...where /dev/md/r1 points to a removed device. - - Signed-off-by: Dan Williams - -commit ef70b9f4ef7a3a9f70b3a09b3a55b1cc675c0a37 -Author: Dan Williams -Date: Sat Nov 8 16:03:07 2008 -0700 - - fix remove_devices() - - Don't write to 'pe' if 'path' was not specified - - Signed-off-by: Dan Williams -diff --git a/Manage.c b/Manage.c -index 06f9e05..85bb2c8 100644 ---- a/Manage.c -+++ b/Manage.c -@@ -150,10 +150,12 @@ static void remove_devices(int devnum, char *path) - for (part = 0; part < 16; part++) { - if (part) { - sprintf(be, "p%d", part); -- if (isdigit(pe[-1])) -- sprintf(pe, "p%d", part); -- else -- sprintf(pe, "%d", part); -+ if (path) { -+ if (isdigit(pe[-1])) -+ sprintf(pe, "p%d", part); -+ else -+ sprintf(pe, "%d", part); -+ } - } - /* FIXME test if really is md device ?? */ - unlink(base); -diff --git a/util.c b/util.c -index f21d2bb..2b4f902 100644 ---- a/util.c -+++ b/util.c -@@ -467,8 +467,10 @@ int devlist_ready = 0; - int add_dev(const char *name, const struct stat *stb, int flag, struct FTW *s) - { - struct stat st; -+ - if (S_ISLNK(stb->st_mode)) { -- stat(name, &st); -+ if (stat(name, &st) != 0) -+ return 0; - stb = &st; - } - diff --git a/super-intel-undefined-operation.patch b/super-intel-undefined-operation.patch deleted file mode 100644 index bef7b9c..0000000 --- a/super-intel-undefined-operation.patch +++ /dev/null @@ -1,26 +0,0 @@ -super-intel.c:284: warning: operation on 'p' may be undefined -super-intel.c:284: warning: operation on 'p' may be undefined -super-intel.c:284: warning: operation on 'p' may be undefined - -The swap macros can evaluate their argument multiple times. ---- - super-intel.c | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -Index: super-intel.c -=================================================================== ---- super-intel.c.orig -+++ super-intel.c -@@ -271,8 +271,10 @@ static __u32 __gen_imsm_checksum(struct - __u32 *p = (__u32 *) mpb; - __u32 sum = 0; - -- while (end--) -- sum += __le32_to_cpu(*p++); -+ while (end--) { -+ sum += __le32_to_cpu(*p); -+ p++; -+ } - - return sum - __le32_to_cpu(mpb->check_sum); - } diff --git a/super0-Do-all-metadata-IO-with-4096byte-alignment.patch b/super0-Do-all-metadata-IO-with-4096byte-alignment.patch deleted file mode 100644 index bebc318..0000000 --- a/super0-Do-all-metadata-IO-with-4096byte-alignment.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 24303a80dfff51654595b3605fa8b1b9b1c4b578 Mon Sep 17 00:00:00 2001 -From: NeilBrown -Date: Tue, 3 Mar 2009 14:25:59 +1100 -Subject: [PATCH 1/2] super0: Do all metadata IO with 4096byte alignment - -.. because some devices (dasd) has 4096 byte sector size. - -As the superblock is 4096 bytes and the bitmap is in a -60K region, this is safe from any possible corruption. - -Signed-off-by: NeilBrown ---- - super0.c | 25 ++++++++++++++----------- - 1 files changed, 14 insertions(+), 11 deletions(-) - -Index: mdadm-3.0-devel2/super0.c -=================================================================== ---- mdadm-3.0-devel2.orig/super0.c -+++ mdadm-3.0-devel2/super0.c -@@ -545,7 +545,8 @@ static int init_super0(struct supertype - mdp_super_t *sb; - int spares; - -- if (posix_memalign((void**)&sb, 512, MD_SB_BYTES + sizeof(bitmap_super_t)) != 0) { -+ if (posix_memalign((void**)&sb, 4096, -+ MD_SB_BYTES + ROUND_UP(sizeof(bitmap_super_t), 4096)) != 0) { - fprintf(stderr, Name ": %s could not allocate superblock\n", __func__); - return 0; - } -@@ -680,8 +681,8 @@ static int store_super0(struct supertype - if (super->state & (1<magic) == BITMAP_MAGIC) -- if (write(fd, bm, ROUND_UP(sizeof(*bm),512)) != -- ROUND_UP(sizeof(*bm),512)) -+ if (write(fd, bm, ROUND_UP(sizeof(*bm),4096)) != -+ ROUND_UP(sizeof(*bm),4096)) - return 5; - } - -@@ -741,8 +742,9 @@ static int compare_super0(struct superty - if (second->md_magic != MD_SB_MAGIC) - return 1; - if (!first) { -- if (posix_memalign((void**)&first, 512, -- MD_SB_BYTES + sizeof(struct bitmap_super_s)) != 0) { -+ if (posix_memalign((void**)&first, 4096, -+ MD_SB_BYTES + -+ ROUND_UP(sizeof(struct bitmap_super_s), 4096)) != 0) { - fprintf(stderr, Name - ": %s could not allocate superblock\n", __func__); - return 1; -@@ -815,8 +817,9 @@ static int load_super0(struct supertype - return 1; - } - -- if (posix_memalign((void**)&super, 512, -- MD_SB_BYTES + sizeof(bitmap_super_t)+512) != 0) { -+ if (posix_memalign((void**)&super, 4096, -+ MD_SB_BYTES + -+ ROUND_UP(sizeof(bitmap_super_t), 4096)) != 0) { - fprintf(stderr, Name - ": %s could not allocate superblock\n", __func__); - return 1; -@@ -864,8 +867,8 @@ static int load_super0(struct supertype - * valid. If it doesn't clear the bit. An --assemble --force - * should get that written out. - */ -- if (read(fd, super+1, ROUND_UP(sizeof(struct bitmap_super_s),512)) -- != ROUND_UP(sizeof(struct bitmap_super_s),512)) -+ if (read(fd, super+1, ROUND_UP(sizeof(struct bitmap_super_s),4096)) -+ != ROUND_UP(sizeof(struct bitmap_super_s),4096)) - goto no_bitmap; - - uuid_from_super0(st, uuid); -@@ -996,8 +999,8 @@ static int write_bitmap0(struct supertyp - int rv = 0; - - int towrite, n; -- char abuf[4096+512]; -- char *buf = (char*)(((long)(abuf+512))&~511UL); -+ char abuf[4096+4096]; -+ char *buf = (char*)(((long)(abuf+4096))&~4095L); - - if (!get_dev_size(fd, NULL, &dsize)) - return 1; diff --git a/super1-do-metadata-IO-in-sector_size-units.patch b/super1-do-metadata-IO-in-sector_size-units.patch deleted file mode 100644 index c7d7163..0000000 --- a/super1-do-metadata-IO-in-sector_size-units.patch +++ /dev/null @@ -1,137 +0,0 @@ -From ae8b146d524dd162f159f27938ed14df037e3ff8 Mon Sep 17 00:00:00 2001 -From: NeilBrown -Date: Tue, 3 Mar 2009 15:44:26 +1100 -Subject: [PATCH 2/2] super1 - do metadata IO in sector_size units. - -If the sector size is > 512, we need to be more careful about -alignment. -The largest known sector size is 4096 and (fortunately) both the -superblock and (in many cases) the bitmap are 4096-byte aligned. -So there should be no data-overlap problems. - -The exception is when the bitmap is squeezed into the 3K after the -superblock. This arrangement cannot currently be supported on -4K sector-size devices. - -Signed-off-by: NeilBrown ---- - super1.c | 71 +++++++++++++++++++++++++++++++++++++++++++++++++++++++------ - 1 files changed, 64 insertions(+), 7 deletions(-) - -Index: mdadm-3.0-devel2/super1.c -=================================================================== ---- mdadm-3.0-devel2.orig/super1.c -+++ mdadm-3.0-devel2/super1.c -@@ -141,6 +141,64 @@ static unsigned int calc_sb_1_csum(struc - return __cpu_to_le32(csum); - } - -+static char abuf[4096+4096]; -+static int aread(int fd, void *buf, int len) -+{ -+ /* aligned read. -+ * On devices with a 4K sector size, we need to read -+ * the full sector and copy relevant bits into -+ * the buffer -+ */ -+ int bsize; -+ char *b; -+ int n; -+ if (ioctl(fd, BLKSSZGET, &bsize) != 0 || -+ bsize <= len) -+ return read(fd, buf, len); -+ if (bsize > 4096) -+ return -1; -+ b = (char*)(((long)(abuf+4096))&~4095UL); -+ -+ n = read(fd, b, bsize); -+ if (n <= 0) -+ return n; -+ lseek(fd, len - n, 1); -+ if (n > len) -+ n = len; -+ memcpy(buf, b, n); -+ return n; -+} -+ -+static int awrite(int fd, void *buf, int len) -+{ -+ /* aligned write. -+ * On devices with a 4K sector size, we need to write -+ * the full sector. We pre-read if the sector is larger -+ * than the write. -+ * The address must be sector-aligned. -+ */ -+ int bsize; -+ char *b; -+ int n; -+ if (ioctl(fd, BLKSSZGET, &bsize) != 0 || -+ bsize <= len) -+ return write(fd, buf, len); -+ if (bsize > 4096) -+ return -1; -+ b = (char*)(((long)(abuf+4096))&~4095UL); -+ -+ n = read(fd, b, bsize); -+ if (n <= 0) -+ return n; -+ lseek(fd, -n, 1); -+ memcpy(b, buf, len); -+ n = write(fd, b, bsize); -+ if (n <= 0) -+ return n; -+ lseek(fd, len - n, 1); -+ return len; -+} -+ - #ifndef MDASSEMBLE - static void examine_super1(struct supertype *st, char *homehost) - { -@@ -881,7 +939,7 @@ static int store_super1(struct supertype - sbsize = sizeof(*sb) + 2 * __le32_to_cpu(sb->max_dev); - sbsize = (sbsize+511)&(~511UL); - -- if (write(fd, sb, sbsize) != sbsize) -+ if (awrite(fd, sb, sbsize) != sbsize) - return 4; - - if (sb->feature_map & __cpu_to_le32(MD_FEATURE_BITMAP_OFFSET)) { -@@ -889,8 +947,8 @@ static int store_super1(struct supertype - (((char*)sb)+1024); - if (__le32_to_cpu(bm->magic) == BITMAP_MAGIC) { - locate_bitmap1(st, fd); -- if (write(fd, bm, ROUND_UP(sizeof(*bm),512)) != -- ROUND_UP(sizeof(*bm),512)) -+ if (awrite(fd, bm, sizeof(*bm)) != -+ sizeof(*bm)) - return 5; - } - } -@@ -1187,7 +1245,7 @@ static int load_super1(struct supertype - return 1; - } - -- if (read(fd, super, 1024) != 1024) { -+ if (aread(fd, super, 1024) != 1024) { - if (devname) - fprintf(stderr, Name ": Cannot read superblock on %s\n", - devname); -@@ -1232,7 +1290,7 @@ static int load_super1(struct supertype - * should get that written out. - */ - locate_bitmap1(st, fd); -- if (read(fd, ((char*)super)+1024, 512) -+ if (aread(fd, ((char*)super)+1024, 512) - != 512) - goto no_bitmap; - -@@ -1470,8 +1528,7 @@ static int write_bitmap1(struct supertyp - int rv = 0; - - int towrite, n; -- char abuf[4096+512]; -- char *buf = (char*)(((long)(abuf+512))&~511UL); -+ char *buf = (char*)(((long)(abuf+4096))&~4095UL); - - locate_bitmap1(st, fd); - From 9dedcbd2c3a2f22c481e34f20f305f4f18e6f44bf23d1eb495092def05432405 Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Fri, 2 Oct 2009 22:44:49 +0000 Subject: [PATCH 32/39] Accepting request 21463 from Base:System Copy from Base:System/mdadm based on submit request 21463 from user michal-m OBS-URL: https://build.opensuse.org/request/show/21463 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=32 --- ...missing-space-in-detail-brief-output.patch | 32 +++++ ...-null-dereference-in-set_member_info.patch | 48 +++++++ Start-kpartx-for-imsm-devices.patch | 131 ------------------ manage-rebuild-map-for-kpartx | 43 ------ mdadm-3.0.2.tar.bz2 | 3 + mdadm-3.0.tar.bz2 | 3 - mdadm.changes | 6 + mdadm.spec | 20 ++- 8 files changed, 98 insertions(+), 188 deletions(-) create mode 100644 0001-Add-missing-space-in-detail-brief-output.patch create mode 100644 0002-Fix-null-dereference-in-set_member_info.patch delete mode 100644 Start-kpartx-for-imsm-devices.patch delete mode 100644 manage-rebuild-map-for-kpartx create mode 100644 mdadm-3.0.2.tar.bz2 delete mode 100644 mdadm-3.0.tar.bz2 diff --git a/0001-Add-missing-space-in-detail-brief-output.patch b/0001-Add-missing-space-in-detail-brief-output.patch new file mode 100644 index 0000000..34e888c --- /dev/null +++ b/0001-Add-missing-space-in-detail-brief-output.patch @@ -0,0 +1,32 @@ +From 0e90271e53c0f6efb33e904cf407498350e2a14d Mon Sep 17 00:00:00 2001 +From: NeilBrown +Date: Thu, 1 Oct 2009 12:38:31 +1000 +Subject: [PATCH 1/2] Add missing space in "--detail --brief" output. + +We need a space between the device name and the word "level".. + +Signed-off-by: NeilBrown +--- + Detail.c | 4 ++-- + 1 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/Detail.c b/Detail.c +index 001012a..a70db34 100644 +--- a/Detail.c ++++ b/Detail.c +@@ -207,11 +207,11 @@ int Detail(char *dev, int brief, int export, int test, char *homehost) + printf("ARRAY %s", dev); + if (brief > 1) { + if (array.raid_disks) +- printf("level=%s num-devices=%d", ++ printf(" level=%s num-devices=%d", + c?c:"-unknown-", + array.raid_disks ); + else +- printf("level=container num-devices=%d", ++ printf(" level=container num-devices=%d", + array.nr_disks); + } + if (container) { +-- +1.6.3.3 diff --git a/0002-Fix-null-dereference-in-set_member_info.patch b/0002-Fix-null-dereference-in-set_member_info.patch new file mode 100644 index 0000000..dfbb818 --- /dev/null +++ b/0002-Fix-null-dereference-in-set_member_info.patch @@ -0,0 +1,48 @@ +From 2b9aa337af7291d3f141322da96c9f667c99d53c Mon Sep 17 00:00:00 2001 +From: NeilBrown +Date: Thu, 1 Oct 2009 12:51:04 +1000 +Subject: [PATCH 2/2] Fix null-dereference in set_member_info + +set_member_info would try to dereference ->metadata_version, without +checking that it isn't NULL. + +Signed-off-by: NeilBrown +--- + mapfile.c | 15 +++++++++------ + 1 files changed, 9 insertions(+), 6 deletions(-) + +diff --git a/mapfile.c b/mapfile.c +index a3038be..ed59db5 100644 +--- a/mapfile.c ++++ b/mapfile.c +@@ -303,19 +303,22 @@ struct map_ent *map_by_name(struct map_ent **map, char *name) + */ + static void set_member_info(struct supertype *st, struct mdstat_ent *ent) + { +- char version[strlen(ent->metadata_version)+1]; + + st->subarray[0] = '\0'; + +- if (strncmp(ent->metadata_version, "external:", 9) != 0) ++ if (ent->metadata_version == NULL || ++ strncmp(ent->metadata_version, "external:", 9) != 0) + return; + +- strcpy(version, ent->metadata_version); +- +- if (is_subarray(&version[9])) { +- char *subarray = strrchr(version, '/'); ++ if (is_subarray(&ent->metadata_version[9])) { ++ char version[strlen(ent->metadata_version)+1]; ++ char *subarray; + char *name = &version[10]; + ++ strcpy(version, ent->metadata_version); ++ subarray = strrchr(version, '/'); ++ name = &version[10]; ++ + if (!subarray) + return; + *subarray++ = '\0'; +-- +1.6.3.3 diff --git a/Start-kpartx-for-imsm-devices.patch b/Start-kpartx-for-imsm-devices.patch deleted file mode 100644 index 9ff2216..0000000 --- a/Start-kpartx-for-imsm-devices.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 057fb70bf4e4b284cc06299853122273815b1d6e Mon Sep 17 00:00:00 2001 -From: NeilBrown -Date: Fri, 7 Nov 2008 22:22:41 +1100 -Subject: [PATCH] Start kpartx for imsm devices. - -This probably wont get into mainline, but is need on SLES -to create partitions that the YaST partitioner has a chance -of recognising. - -Signed-off-by: NeilBrown ---- - Assemble.c | 4 +++- - Create.c | 3 +++ - Manage.c | 4 ++++ - mdadm.h | 1 + - super-intel.c | 2 +- - util.c | 25 +++++++++++++++++++++++++ - 6 files changed, 37 insertions(+), 2 deletions(-) - -diff --git a/Assemble.c b/Assemble.c -index 20c4be7..c597526 100644 ---- a/Assemble.c -+++ b/Assemble.c -@@ -1251,8 +1251,10 @@ int assemble_container_content(struct supertype *st, int mdfd, - fprintf(stderr, " (%d new)", working); - fprintf(stderr, "\n"); - } -- wait_for(chosen_name); - close(mdfd); -+ wait_for(chosen_name); -+ if (st->ss->match_metadata_desc("imsm")) -+ run_kpartx('a', chosen_name); - return 0; - /* FIXME should have an O_EXCL and wait for read-auto */ - } else { -diff --git a/Create.c b/Create.c -index 783ab09..4368107 100644 ---- a/Create.c -+++ b/Create.c -@@ -780,7 +780,10 @@ int Create(struct supertype *st, char *mddev, - ping_monitor(devnum2devname(st->container_dev)); - close(container_fd); - } -+ close(mdfd); - wait_for(chosen_name); -+ if (st->ss->match_metadata_desc("imsm")) -+ run_kpartx('a', chosen_name); - } else { - fprintf(stderr, Name ": not starting array - not enough devices.\n"); - } -diff --git a/Manage.c b/Manage.c -index 9424650..06f9e05 100644 ---- a/Manage.c -+++ b/Manage.c -@@ -219,8 +219,12 @@ int Manage_runstop(char *devname, int fd, int runstop, int quiet) - if (mdi && - mdi->array.level > 0 && - is_subarray(mdi->text_version)) { -+ struct map_ent *me = map_by_devnum(&map, devnum); - /* This is mdmon managed. */ - close(fd); -+ -+ /* Delete any kpartx partitions */ -+ run_kpartx('d', me->path); - if (sysfs_set_str(mdi, NULL, - "array_state", "inactive") < 0) { - if (quiet == 0) -diff --git a/mdadm.h b/mdadm.h -index 2b34acf..9d819f9 100644 ---- a/mdadm.h -+++ b/mdadm.h -@@ -833,6 +833,7 @@ extern char *devnum2devname(int num); - extern int devname2devnum(char *name); - extern int stat2devnum(struct stat *st); - extern int fd2devnum(int fd); -+extern void run_kpartx(char mode, char *dev); - - static inline int dev2major(int d) - { -diff --git a/super-intel.c b/super-intel.c -index a2b9bd2..5f06f30 100644 ---- a/super-intel.c -+++ b/super-intel.c -@@ -636,7 +636,7 @@ static void brief_examine_super_imsm(struct supertype *st) - getinfo_super_imsm(st, &info); - fname_from_uuid(st, &info, nbuf1,'-'); - printf("ARRAY /dev/md/%.16s container=%s\n" -- " member=%d auto=mdp UUID=%s\n", -+ " member=%d auto=md UUID=%s\n", - dev->volume, nbuf + 5, i, nbuf1 + 5); - } - } -diff --git a/util.c b/util.c -index 8845a0f..f21d2bb 100644 ---- a/util.c -+++ b/util.c -@@ -1327,6 +1327,31 @@ void append_metadata_update(struct supertype *st, void *buf, int len) - } - #endif /* MDASSEMBLE */ - -+void run_kpartx(char mode, char *dev) -+{ -+ char buf[1024]; -+ char *cp; -+ -+ sprintf(buf, "/sbin/kpartx > /dev/null 2>&1 -%c '", mode); -+ -+ cp = buf + strlen(buf); -+ while (cp < buf+sizeof(buf)-10 && -+ *dev) { -+ if (*dev == '\'') { -+ *cp++ = '\''; -+ *cp++ = '\\'; -+ *cp++ = '\''; -+ /* *cp++ = '\''; */ -+ } -+ *cp ++ = *dev++; -+ } -+ *cp++ = '\''; -+ *cp++ = 0; -+ system(buf); -+} -+ -+ -+ - #ifdef __TINYC__ - /* tinyc doesn't optimize this check in ioctl.h out ... */ - unsigned int __invalid_size_argument_for_IOC = 0; --- -1.5.6.5 - diff --git a/manage-rebuild-map-for-kpartx b/manage-rebuild-map-for-kpartx deleted file mode 100644 index eeae570..0000000 --- a/manage-rebuild-map-for-kpartx +++ /dev/null @@ -1,43 +0,0 @@ -Manage: rebuild map for 'kpartx -d' at stop - -From: Dan Williams - -mdadm needs the 'map' file to run 'kpartx -d' at array shutdown. -Rebuild it if it does not exist. - -Signed-off-by: Dan Williams ---- - - Manage.c | 14 +++++++++++++- - 1 files changed, 13 insertions(+), 1 deletions(-) - - -diff --git a/Manage.c b/Manage.c -index 85bb2c8..603e838 100644 ---- a/Manage.c -+++ b/Manage.c -@@ -222,11 +222,23 @@ int Manage_runstop(char *devname, int fd, int runstop, int quiet) - mdi->array.level > 0 && - is_subarray(mdi->text_version)) { - struct map_ent *me = map_by_devnum(&map, devnum); -+ -+ if (!me) { -+ RebuildMap(); -+ me = map_by_devnum(&map, devnum); -+ } -+ -+ if (!me) { -+ fprintf(stderr, Name ": failed to map device %d\n", -+ devnum); -+ return 1; -+ } else -+ run_kpartx('d', me->path); -+ - /* This is mdmon managed. */ - close(fd); - - /* Delete any kpartx partitions */ -- run_kpartx('d', me->path); - if (sysfs_set_str(mdi, NULL, - "array_state", "inactive") < 0) { - if (quiet == 0) diff --git a/mdadm-3.0.2.tar.bz2 b/mdadm-3.0.2.tar.bz2 new file mode 100644 index 0000000..2db571a --- /dev/null +++ b/mdadm-3.0.2.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:821c2a073daed4916973226a6c623de5d697cceb077de935e2b1c316b11f3da7 +size 252754 diff --git a/mdadm-3.0.tar.bz2 b/mdadm-3.0.tar.bz2 deleted file mode 100644 index e20f227..0000000 --- a/mdadm-3.0.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:6fd6ab77c4d996879192edd8ad90cd512165a857795c25c98fc35206df6c2e64 -size 250775 diff --git a/mdadm.changes b/mdadm.changes index 1c5a09b..6de6c6a 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Thu Oct 1 10:51:38 CEST 2009 - mmarek@suse.cz + +- updated to 3.0.2 + 2 patches + * bugfixes only + ------------------------------------------------------------------- Fri Jun 12 09:43:43 CEST 2009 - mmarek@suse.cz diff --git a/mdadm.spec b/mdadm.spec index faf1932..66d01fa 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -1,5 +1,5 @@ # -# spec file for package mdadm (Version 3.0) +# spec file for package mdadm (Version 3.0.2) # # Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. # @@ -19,9 +19,8 @@ Name: mdadm -Version: 3.0 -Release: 21 -%define ver 3.0 +Version: 3.0.2 +Release: 1 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq Obsoletes: raidtools @@ -31,10 +30,9 @@ License: GPL v2 or later Url: http://www.kernel.org/pub/linux/utils/raid/mdadm/ Summary: Utility for Configuring MD Setup BuildRoot: %{_tmppath}/%{name}-%{version}-build -Source: %{name}-%{ver}.tar.bz2 -# XXX - still needed? -Patch6: Start-kpartx-for-imsm-devices.patch -Patch11: manage-rebuild-map-for-kpartx +Source: %{name}-%{version}.tar.bz2 +Patch1: 0001-Add-missing-space-in-detail-brief-output.patch +Patch2: 0002-Fix-null-dereference-in-set_member_info.patch Source1: Software-RAID.HOWTO.tar.bz2 Source2: sysconfig.mdadm Source3: mdadmd @@ -54,9 +52,9 @@ Authors: Neil Brown %prep -%setup -q -a1 -n %{name}-%{ver} -#patch6 -p1 -#patch11 -p1 +%setup -q -a1 +%patch1 -p1 +%patch2 -p1 %build %{suse_update_config -f} From bbe112a8b97dc3e038fc21ab1e263f7c1deeeb50bed004750cd7cd29eab8f2e6 Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Mon, 2 Nov 2009 17:10:11 +0000 Subject: [PATCH 33/39] Accepting request 23607 from Base:System Copy from Base:System/mdadm based on submit request 23607 from user michal-m OBS-URL: https://build.opensuse.org/request/show/23607 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=34 --- mdadm.changes | 5 +++++ mdadm.spec | 2 +- mkinitrd-boot.sh | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/mdadm.changes b/mdadm.changes index 6de6c6a..d8cf938 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Oct 30 16:49:40 CET 2009 - mmarek@suse.cz + +- mkinitrd-boot.sh: add /sbin/mdmon to the initrd (fate#306823). + ------------------------------------------------------------------- Thu Oct 1 10:51:38 CEST 2009 - mmarek@suse.cz diff --git a/mdadm.spec b/mdadm.spec index 66d01fa..d9cf54d 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -20,7 +20,7 @@ Name: mdadm Version: 3.0.2 -Release: 1 +Release: 2 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq Obsoletes: raidtools diff --git a/mkinitrd-boot.sh b/mkinitrd-boot.sh index ca68fdc..0e216d4 100644 --- a/mkinitrd-boot.sh +++ b/mkinitrd-boot.sh @@ -1,6 +1,6 @@ #!/bin/bash #%stage: softraid -#%programs: /sbin/mdadm +#%programs: /sbin/mdadm /sbin/mdmon #%modules: raid0 raid1 raid456 #%if: -n "$need_mdadm" # From e499e72cb5ab42261e9af7a4159829df2ba43c35eeeb73058f4ba070a32f2e4a Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Wed, 16 Dec 2009 15:59:32 +0000 Subject: [PATCH 34/39] Accepting request 26748 from Base:System Copy from Base:System/mdadm based on submit request 26748 from user michal-m OBS-URL: https://build.opensuse.org/request/show/26748 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=35 --- mdadm.changes | 5 +++++ mdadm.spec | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/mdadm.changes b/mdadm.changes index d8cf938..950cbb8 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Tue Dec 15 20:26:46 CET 2009 - jengelh@medozas.de + +- enable parallel building + ------------------------------------------------------------------- Fri Oct 30 16:49:40 CET 2009 - mmarek@suse.cz diff --git a/mdadm.spec b/mdadm.spec index d9cf54d..dd7a4d9 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -20,13 +20,13 @@ Name: mdadm Version: 3.0.2 -Release: 2 +Release: 3 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq Obsoletes: raidtools AutoReqProv: on Group: System/Base -License: GPL v2 or later +License: GPLv2+ Url: http://www.kernel.org/pub/linux/utils/raid/mdadm/ Summary: Utility for Configuring MD Setup BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -58,7 +58,7 @@ Authors: %build %{suse_update_config -f} -make CXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -Wno-error" +make %{?jobs:-j%jobs} CXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing -Wno-error" cd Software-RAID.HOWTO sgml2html Software-RAID.HOWTO.sgml sgml2txt Software-RAID.HOWTO.sgml From 3dbb86c70a2a81df91b9a1a32aca52091b07bdc686a36c9e38476600a311b8c7 Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Mon, 11 Jan 2010 14:50:57 +0000 Subject: [PATCH 35/39] Accepting request 29138 from Base:System Copy from Base:System/mdadm based on submit request 29138 from user michal-m OBS-URL: https://build.opensuse.org/request/show/29138 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=36 --- ...missing-space-in-detail-brief-output.patch | 32 ------ ...-null-dereference-in-set_member_info.patch | 48 -------- mdadm-3.0.2.tar.bz2 | 3 - mdadm-3.0.3.tar.bz2 | 3 + mdadm.changes | 19 ++++ mdadm.spec | 12 +- mkinitrd-boot.sh | 49 +++++---- mkinitrd-setup.sh | 103 ++++++++++++++---- 8 files changed, 132 insertions(+), 137 deletions(-) delete mode 100644 0001-Add-missing-space-in-detail-brief-output.patch delete mode 100644 0002-Fix-null-dereference-in-set_member_info.patch delete mode 100644 mdadm-3.0.2.tar.bz2 create mode 100644 mdadm-3.0.3.tar.bz2 diff --git a/0001-Add-missing-space-in-detail-brief-output.patch b/0001-Add-missing-space-in-detail-brief-output.patch deleted file mode 100644 index 34e888c..0000000 --- a/0001-Add-missing-space-in-detail-brief-output.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 0e90271e53c0f6efb33e904cf407498350e2a14d Mon Sep 17 00:00:00 2001 -From: NeilBrown -Date: Thu, 1 Oct 2009 12:38:31 +1000 -Subject: [PATCH 1/2] Add missing space in "--detail --brief" output. - -We need a space between the device name and the word "level".. - -Signed-off-by: NeilBrown ---- - Detail.c | 4 ++-- - 1 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/Detail.c b/Detail.c -index 001012a..a70db34 100644 ---- a/Detail.c -+++ b/Detail.c -@@ -207,11 +207,11 @@ int Detail(char *dev, int brief, int export, int test, char *homehost) - printf("ARRAY %s", dev); - if (brief > 1) { - if (array.raid_disks) -- printf("level=%s num-devices=%d", -+ printf(" level=%s num-devices=%d", - c?c:"-unknown-", - array.raid_disks ); - else -- printf("level=container num-devices=%d", -+ printf(" level=container num-devices=%d", - array.nr_disks); - } - if (container) { --- -1.6.3.3 diff --git a/0002-Fix-null-dereference-in-set_member_info.patch b/0002-Fix-null-dereference-in-set_member_info.patch deleted file mode 100644 index dfbb818..0000000 --- a/0002-Fix-null-dereference-in-set_member_info.patch +++ /dev/null @@ -1,48 +0,0 @@ -From 2b9aa337af7291d3f141322da96c9f667c99d53c Mon Sep 17 00:00:00 2001 -From: NeilBrown -Date: Thu, 1 Oct 2009 12:51:04 +1000 -Subject: [PATCH 2/2] Fix null-dereference in set_member_info - -set_member_info would try to dereference ->metadata_version, without -checking that it isn't NULL. - -Signed-off-by: NeilBrown ---- - mapfile.c | 15 +++++++++------ - 1 files changed, 9 insertions(+), 6 deletions(-) - -diff --git a/mapfile.c b/mapfile.c -index a3038be..ed59db5 100644 ---- a/mapfile.c -+++ b/mapfile.c -@@ -303,19 +303,22 @@ struct map_ent *map_by_name(struct map_ent **map, char *name) - */ - static void set_member_info(struct supertype *st, struct mdstat_ent *ent) - { -- char version[strlen(ent->metadata_version)+1]; - - st->subarray[0] = '\0'; - -- if (strncmp(ent->metadata_version, "external:", 9) != 0) -+ if (ent->metadata_version == NULL || -+ strncmp(ent->metadata_version, "external:", 9) != 0) - return; - -- strcpy(version, ent->metadata_version); -- -- if (is_subarray(&version[9])) { -- char *subarray = strrchr(version, '/'); -+ if (is_subarray(&ent->metadata_version[9])) { -+ char version[strlen(ent->metadata_version)+1]; -+ char *subarray; - char *name = &version[10]; - -+ strcpy(version, ent->metadata_version); -+ subarray = strrchr(version, '/'); -+ name = &version[10]; -+ - if (!subarray) - return; - *subarray++ = '\0'; --- -1.6.3.3 diff --git a/mdadm-3.0.2.tar.bz2 b/mdadm-3.0.2.tar.bz2 deleted file mode 100644 index 2db571a..0000000 --- a/mdadm-3.0.2.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:821c2a073daed4916973226a6c623de5d697cceb077de935e2b1c316b11f3da7 -size 252754 diff --git a/mdadm-3.0.3.tar.bz2 b/mdadm-3.0.3.tar.bz2 new file mode 100644 index 0000000..00e1e12 --- /dev/null +++ b/mdadm-3.0.3.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b51a52aebfb83b09ae7faee9eebb4d49a7ad27767bcc9569079df62c7d510599 +size 257554 diff --git a/mdadm.changes b/mdadm.changes index 950cbb8..8cf1029 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,8 +1,27 @@ +------------------------------------------------------------------- +Wed Jan 6 15:47:03 CET 2010 - mmarek@suse.cz + +- mkinitrd-*.sh: fix booting from partitionable md devices and + from container devices (bnc#565219). + ------------------------------------------------------------------- Tue Dec 15 20:26:46 CET 2009 - jengelh@medozas.de - enable parallel building +------------------------------------------------------------------- +Fri Dec 4 18:00:40 CET 2009 - mmarek@suse.cz + +- Support for partitionable md devices in mkinitrd scripts + (fate#305883). + +------------------------------------------------------------------- +Tue Nov 3 11:03:54 CET 2009 - mmarek@suse.cz + +- update to 3.0.3 (fate#307159) + * mdmon improvements (needed for fate#306823) + * other fixes + ------------------------------------------------------------------- Fri Oct 30 16:49:40 CET 2009 - mmarek@suse.cz diff --git a/mdadm.spec b/mdadm.spec index dd7a4d9..1d63461 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -1,7 +1,7 @@ # -# spec file for package mdadm (Version 3.0.2) +# spec file for package mdadm (Version 3.0.3) # -# Copyright (c) 2009 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,8 +19,8 @@ Name: mdadm -Version: 3.0.2 -Release: 3 +Version: 3.0.3 +Release: 1 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq Obsoletes: raidtools @@ -31,8 +31,6 @@ Url: http://www.kernel.org/pub/linux/utils/raid/mdadm/ Summary: Utility for Configuring MD Setup BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: %{name}-%{version}.tar.bz2 -Patch1: 0001-Add-missing-space-in-detail-brief-output.patch -Patch2: 0002-Fix-null-dereference-in-set_member_info.patch Source1: Software-RAID.HOWTO.tar.bz2 Source2: sysconfig.mdadm Source3: mdadmd @@ -53,8 +51,6 @@ Authors: %prep %setup -q -a1 -%patch1 -p1 -%patch2 -p1 %build %{suse_update_config -f} diff --git a/mkinitrd-boot.sh b/mkinitrd-boot.sh index 0e216d4..a7f54cd 100644 --- a/mkinitrd-boot.sh +++ b/mkinitrd-boot.sh @@ -1,7 +1,7 @@ #!/bin/bash #%stage: softraid #%programs: /sbin/mdadm /sbin/mdmon -#%modules: raid0 raid1 raid456 +#%modules: raid0 raid1 raid10 raid456 #%if: -n "$need_mdadm" # ##### MD (Software-)Raid @@ -33,36 +33,41 @@ if [ -f /sys/module/md_mod/parameters/start_ro ]; then echo 1 > /sys/module/md_mod/parameters/start_ro fi -if [ -n "$need_mdadm" ]; then - - if [ -f /etc/mdadm.conf ] ; then - mdconf="-Ac /etc/mdadm.conf" - [ -z "$md_dev" ] && md_dev="--scan" +md_assemble() +{ + local dev=$1 mdconf container + + case "$dev" in + /dev/md[0-9]*p[0-9]*) + dev=${dev%p[0-9]*} + esac + if test -f /etc/mdadm.conf; then + mdconf="-c /etc/mdadm.conf" + container=$( \ + sed -rn "s:^ARRAY +$dev .*container=([^ ]*).*:\\1:p" \ + /etc/mdadm.conf) + else + mdconf="-c partitions" fi + if test -n "$container"; then + mdadm -A $mdconf --uuid="$container" /dev/md/container + fi + mdadm -A $mdconf $mdarg "$dev" +} + +if [ -n "$need_mdadm" ]; then if [ -n "$md_uuid" ] ; then mdarg="--uuid=$md_uuid" - elif [ -n "$md_uuid" ] ; then - mdarg="$mdarg --uuid=$md_uuid" - fi - if [ -n "$md_minor" ] ; then - mdarg="$mdarg --super-minor=$md_minor" - md_dev="/dev/md$md_minor" - elif [ -z "$md_minor" -a -n "$md_minor" ] ; then - mdarg="$mdarg --super-minor=$md_minor" fi case $resumedev in - /dev/md*) - echo 1 > /sys/module/md_mod/parameters/start_ro - resume_minor="${resumedev#/dev/md}" - mdadm -Ac partitions -m $resume_minor --auto=md $resumedev - ;; + /dev/md*) + md_assemble "$resumedev" esac - if [ "$md_dev" ] ; then - /sbin/mdadm $mdconf --auto=md $md_dev || /sbin/mdadm -Ac partitions $mdarg --auto=md $md_dev + if [ -n "$md_dev" ] ; then + md_assemble "$md_dev" fi wait_for_events fi - diff --git a/mkinitrd-setup.sh b/mkinitrd-setup.sh index 29e177b..52c1cb7 100644 --- a/mkinitrd-setup.sh +++ b/mkinitrd-setup.sh @@ -4,40 +4,95 @@ # mdblockdev= +# Full mdadm.conf generated by mdadm. +# Contains all created MD RAIDs +mdadm_conf=$(mdadm --examine --brief --scan) + +cont_list= +md_devs= + +# blockdev contains real devices (/dev/X) for root, resume, journal, dumb +echo "blockdev: $blockdev" for bd in $blockdev ; do - # get information about the current blockdev - update_blockdev $bd - mdconf=$(mdadm -Db $bd 2> /dev/null | sed -n "s@/dev/md[0-9]*@/dev/md$blockminor@p") - if [ -n "$mdconf" ] ; then - md_tmpblockdev=$(mdadm -Dbv $bd 2> /dev/null | sed -n "1D;s/,/ /g;s/^ *devices=\(.*\)/\1/p") - md_dev=${bd##/dev/} - dup_found=0 - for dup in $md_devs; do - if [ x"$dup" = x"$md_dev" ]; then - dup_found=1 - break - fi - done - if [ $dup_found -eq 0 ]; then - mdblockdev="$mdblockdev $md_tmpblockdev" - eval md_conf_${md_dev}=\"$mdconf\" - md_devs="$md_devs $md_dev" - root_md=1 - else - echo "setup-md.sh: $md_dev found multiple times" >&2 + is_part_dev=false + case $bd in + /dev/md[0-9]*p[0-9]*) + # Partitionable MD RAID. This is partition on RAID. Get the RAID + bd=${bd%%p[0-9]*} + is_part_dev=true + ;; + /dev/md[0-9]*) + ;; + *) + mdblockdev="$mdblockdev $bd" + continue + ;; + esac + # Check if this device is already added (possible for partitionable). + md_dev=${bd##/dev/} + dup_found=false + for dup in $md_devs; do + if [ x"$dup" = x"$md_dev" ]; then + dup_found=true + break fi - else - mdblockdev="$mdblockdev $bd" + done + if $dup_found; then + if ! $is_part_dev; then + echo "setup-md.sh: $md_dev found multiple times" >&2 + fi + continue + fi + # Get UUID of block device + tmp_uuid=$(mdadm -D $bd --export 2>/dev/null | grep UUID=) + if [ -n "$tmp_uuid" ]; then + md_tmpblockdev=$(mdadm -Dbv $bd 2> /dev/null | sed -n "1D;s/,/ /g;s/^ *devices=\(.*\)/\1/p") + uuid=${tmp_uuid##MD_} + # Get the corresponding line from config + arr_line=$(echo "$mdadm_conf" | grep "$uuid") + if test -z "$arr_line"; then + continue + fi + # Check for container + cont_line= + cont=$(echo "$arr_line" | sed -n "s/.*container=\([0-9a-z]\{8\}:[0-9a-z]\{8\}:[0-9a-z]\{8\}:[0-9a-z]\{8\}\).*/\1/p") + if [ -n "$cont" ]; then + cnt_dup=0 + for cnt in $cont_list; do + if [ x"$cont"= x"$cnt" ]; then + cnt_dup=1 + fi + done + if [ $cnt_dup -eq 0 ]; then + cont_list="$cont_list $cont" + cont_line=$(echo "$mdadm_conf" | grep "UUID=$cont") + cont_line="$cont_line\n" + fi + fi + # add a line with the "real" md device name so that boot-md.sh finds it + cfg_dev=$(echo "$arr_line" | sed -rn 's/^ARRAY +([^ ]*).*/\1/p; T; q') + real_dev=$(readlink -f "$cfg_dev") + if test -n "$real_dev" -a "$real_dev" != "$cfg_dev"; then + arr_line="$arr_line$(echo -e "\\n$arr_line" | \ + sed -r "s:^(ARRAY +)$cfg_dev:\\1$real_dev:")" + fi + mdblockdev="$mdblockdev $md_tmpblockdev" + # Add ARRAY line (with container line before if needed). + cfg_line=$(echo -e "$cont_line$arr_line") + eval md_conf_${md_dev}=\""$cfg_line"\" + md_devs="$md_devs $md_dev" + root_md=1 fi done +# Any 'md' device is replaced by it's component disks. blockdev="$mdblockdev" if [ -n "$root_md" ] ; then need_mdadm=1 - echo "DEVICE partitions" > $tmp_mnt/etc/mdadm.conf + echo -n "" > $tmp_mnt/etc/mdadm.conf for md in $md_devs; do - eval echo \$md_conf_$md >> $tmp_mnt/etc/mdadm.conf + eval echo -e \"\$md_conf_$md\" >> $tmp_mnt/etc/mdadm.conf done fi From 4061108e2d4d4a57b41b7b6dc809c711e81c4876d8c31c83cbaf49e839a1b39b Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Mon, 18 Jan 2010 13:08:58 +0000 Subject: [PATCH 36/39] Accepting request 29764 from Base:System Copy from Base:System/mdadm based on submit request 29764 from user michal-m OBS-URL: https://build.opensuse.org/request/show/29764 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=37 --- boot.md | 10 ++++++- mdadm.changes | 12 +++++++++ mdadm.spec | 18 ++++++++++--- mkinitrd-boot.sh | 19 +++++++++++-- mkinitrd-setup.sh | 69 ++++++++++++++++++++--------------------------- 5 files changed, 82 insertions(+), 46 deletions(-) diff --git a/boot.md b/boot.md index 946b67d..5e201e5 100644 --- a/boot.md +++ b/boot.md @@ -98,6 +98,14 @@ case "$1" in start) echo -n "Starting MD Raid " + # create the /var/run/mdadm symlink if needed + mkdir -p /dev/.mdadm + if test ! /dev/.mdadm -ef /var/run/mdadm; then + rm -rf /var/run/mdadm + ln -s /dev/.mdadm /var/run/mdadm + fi + # restart mdmon (exits silently if there is nothing to monitor) + /sbin/mdmon /proc/mdstat / # Check for existence of needed config file and read it [ -r $mdadm_SYSCONFIG ] || _rc_exit 6 "... $mdadm_SYSCONFIG not existing " @@ -110,7 +118,7 @@ case "$1" in [ -x $mdadm_BIN ] || _rc_exit 5 "... $mdadm_BIN not installed " # Try to load md_mod - [ ! -f /proc/mdstat -a -x /sbin/modprobe ] && /sbin/modprobe -k md_mod 2>&1 | : + [ ! -f /proc/mdstat -a -x /sbin/modprobe ] && /sbin/modprobe md_mod [ -f /proc/mdstat ] || _rc_exit 5 "... no MD support in kernel " # Wait for udev to settle diff --git a/mdadm.changes b/mdadm.changes index 8cf1029..322d019 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,3 +1,15 @@ +------------------------------------------------------------------- +Fri Jan 15 17:37:26 CET 2010 - mmarek@suse.cz + +- fix modprobe invocation in boot.md (bnc#565293). + +------------------------------------------------------------------- +Fri Jan 15 17:04:06 CET 2010 - mmarek@suse.cz + +- store mdmon runtime files in /dev/.mdadm, to make it easier to + transfer mdmon from the initrd to the real root. +- rework the mkinitrd setup script a bit. + ------------------------------------------------------------------- Wed Jan 6 15:47:03 CET 2010 - mmarek@suse.cz diff --git a/mdadm.spec b/mdadm.spec index 1d63461..4f7ef6f 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -20,7 +20,7 @@ Name: mdadm Version: 3.0.3 -Release: 1 +Release: 2 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq Obsoletes: raidtools @@ -70,13 +70,25 @@ install -m 755 %{S:5} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/setup-md.sh install -m 755 %{S:6} $RPM_BUILD_ROOT/lib/mkinitrd/scripts/boot-md.sh install -m 644 %{S:2} $RPM_BUILD_ROOT%{_var}/adm/fillup-templates/ ln -sf ../../etc/init.d/mdadmd $RPM_BUILD_ROOT/%{_sbindir}/rcmdadmd -install -d $RPM_BUILD_ROOT/var/run/mdadm +rm -rf $RPM_BUILD_ROOT/var/run/mdadm +mkdir -p $RPM_BUILD_ROOT/var/run +ln -s mdadm $RPM_BUILD_ROOT/var/run/mdadm # remove here, using the one in the udev package rm -f $RPM_BUILD_ROOT/lib/udev/rules.d/64-md-raid.rules %post [ -x /sbin/mkinitrd_setup ] && mkinitrd_setup %{fillup_and_insserv -y boot.md} +mkdir -p /dev/.mdadm +# replace the /var/run/mdadm directory (installed by sle11/11.1) with +# a symlink pointing to /dev/.mdadm. Do not do this when /var/run/mdadm is +# not empty, let /etc/init.d/boot.md do it at the next reboot. +if test -e /var/run/mdadm -a ! /var/run/mdadm -ef /dev/.mdadm; then + if ! rmdir /var/run/mdadm 2>/dev/null; then + exit 0 + fi + ln -s /dev/.mdadm /var/run/mdadm +fi %postun %restart_on_update mdadmd @@ -100,7 +112,7 @@ rm -rf $RPM_BUILD_ROOT %dir /lib/udev/devices %{_sbindir}/* %{_var}/adm/fillup-templates/sysconfig.mdadm -%dir /var/run/mdadm +%ghost /var/run/mdadm %dir /lib/mkinitrd %dir /lib/mkinitrd/scripts /lib/mkinitrd/scripts/setup-md.sh diff --git a/mkinitrd-boot.sh b/mkinitrd-boot.sh index a7f54cd..a5c7019 100644 --- a/mkinitrd-boot.sh +++ b/mkinitrd-boot.sh @@ -18,6 +18,11 @@ # load the necessary module before we initialize the raid system load_modules +# put the mdmon socked and pid file to /dev/.mdadm +rm -rf /var/run/mdadm +mkdir -p /var/run +ln -s /dev/.mdadm /var/run/mdadm +mkdir -p /dev/.mdadm [ "$mduuid" ] && md_uuid="$mduuid" md_major=$(sed -ne 's/\s*\([0-9]\+\)\s*md$/\1/p' /proc/devices) @@ -49,9 +54,19 @@ md_assemble() else mdconf="-c partitions" fi - if test -n "$container"; then + case "$container" in + "") + ;; + /dev/*) + mdadm -A $mdconf $container + ;; + [0-9a-f]*[0-9a-f]) mdadm -A $mdconf --uuid="$container" /dev/md/container - fi + ;; + *) + echo "unrecognized container for $dev: $container" + ;; + esac mdadm -A $mdconf $mdarg "$dev" } diff --git a/mkinitrd-setup.sh b/mkinitrd-setup.sh index 52c1cb7..750508c 100644 --- a/mkinitrd-setup.sh +++ b/mkinitrd-setup.sh @@ -12,7 +12,6 @@ cont_list= md_devs= # blockdev contains real devices (/dev/X) for root, resume, journal, dumb -echo "blockdev: $blockdev" for bd in $blockdev ; do is_part_dev=false case $bd in @@ -43,46 +42,36 @@ for bd in $blockdev ; do fi continue fi - # Get UUID of block device - tmp_uuid=$(mdadm -D $bd --export 2>/dev/null | grep UUID=) - if [ -n "$tmp_uuid" ]; then - md_tmpblockdev=$(mdadm -Dbv $bd 2> /dev/null | sed -n "1D;s/,/ /g;s/^ *devices=\(.*\)/\1/p") - uuid=${tmp_uuid##MD_} - # Get the corresponding line from config - arr_line=$(echo "$mdadm_conf" | grep "$uuid") - if test -z "$arr_line"; then - continue - fi - # Check for container - cont_line= - cont=$(echo "$arr_line" | sed -n "s/.*container=\([0-9a-z]\{8\}:[0-9a-z]\{8\}:[0-9a-z]\{8\}:[0-9a-z]\{8\}\).*/\1/p") - if [ -n "$cont" ]; then - cnt_dup=0 - for cnt in $cont_list; do - if [ x"$cont"= x"$cnt" ]; then - cnt_dup=1 - fi - done - if [ $cnt_dup -eq 0 ]; then - cont_list="$cont_list $cont" - cont_line=$(echo "$mdadm_conf" | grep "UUID=$cont") - cont_line="$cont_line\n" - fi - fi - # add a line with the "real" md device name so that boot-md.sh finds it - cfg_dev=$(echo "$arr_line" | sed -rn 's/^ARRAY +([^ ]*).*/\1/p; T; q') - real_dev=$(readlink -f "$cfg_dev") - if test -n "$real_dev" -a "$real_dev" != "$cfg_dev"; then - arr_line="$arr_line$(echo -e "\\n$arr_line" | \ - sed -r "s:^(ARRAY +)$cfg_dev:\\1$real_dev:")" - fi - mdblockdev="$mdblockdev $md_tmpblockdev" - # Add ARRAY line (with container line before if needed). - cfg_line=$(echo -e "$cont_line$arr_line") - eval md_conf_${md_dev}=\""$cfg_line"\" - md_devs="$md_devs $md_dev" - root_md=1 + mdconf=$(mdadm -Db "$bd") + if test -z "$mdconf"; then + mdblockdev="$mdblockdev $bd" + continue fi + md_tmpblockdev=$(mdadm -Dbv $bd | sed -n "1D;s/,/ /g;s/^ *devices=//p") + mdblockdev="$mdblockdev $md_tmpblockdev" + md_devs="$md_devs $md_dev" + container=$(echo "$mdconf" | sed -rn 's/.* container=([^ ]*) .*/\1/p') + for cnt in $cont_list; do + if [ x"$container"= x"$cnt" ]; then + container= + break + fi + done + case "$container" in + "") + ;; + /dev/*) + mdconf="$(mdadm -Db "$container")\\n$mdconf" + ;; + [0-9a-f]*[0-9a-f]) + mdconf="$(mdadm -Ebs | grep "UUID=$container")\\n$mdconf" + ;; + *) + echo "unrecognized container for $md_dev: $container" + ;; + esac + eval md_conf_${md_dev}=\"$mdconf\" + root_md=1 done # Any 'md' device is replaced by it's component disks. From 3d6f1b5d0031a73f2914a3e471236d13437114dabc1d7f3a9257dcb06438fe0c Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Thu, 18 Mar 2010 15:08:42 +0000 Subject: [PATCH 37/39] OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=38 --- ready | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 ready diff --git a/ready b/ready deleted file mode 100644 index 473a0f4..0000000 From 9a4209ca5e33e06c178e1e7f94944fc2cd6161a8216b180986ebd859b7d52653 Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Thu, 18 Mar 2010 23:31:31 +0000 Subject: [PATCH 38/39] Accepting request 35265 from Base:System Copy from Base:System/mdadm based on submit request 35265 from user coolo OBS-URL: https://build.opensuse.org/request/show/35265 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=39 --- 64-md-raid.rules | 35 +++++++++++++++++++++++++++++++++++ mdadm.changes | 21 +++++++++++++++++++++ mdadm.spec | 10 +++++++--- mkinitrd-setup.sh | 7 +++++-- 4 files changed, 68 insertions(+), 5 deletions(-) create mode 100644 64-md-raid.rules diff --git a/64-md-raid.rules b/64-md-raid.rules new file mode 100644 index 0000000..deccce4 --- /dev/null +++ b/64-md-raid.rules @@ -0,0 +1,35 @@ +# do not edit this file, it will be overwritten on update + +SUBSYSTEM!="block", GOTO="md_end" +ACTION!="add|change", GOTO="md_end" + +# import data from a raid member and activate it +ENV{ID_FS_TYPE}=="linux_raid_member", PROGRAM="grep -qs '^AUTO -all' /etc/mdadm.conf", IMPORT{program}="/sbin/mdadm --examine --export $tempnode", RUN+="/sbin/mdadm --incremental $env{DEVNAME}" +# import data from a raid set +KERNEL!="md*", GOTO="md_end" + +# container devices have a metadata version of e.g. 'external:ddf' and +# never leave state 'inactive' +ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" +ATTR{md/array_state}=="|clear|inactive", GOTO="md_end" +LABEL="md_ignore_state" + +IMPORT{program}="/sbin/mdadm --detail --export $tempnode" +ENV{DEVTYPE}=="disk", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}", OPTIONS+="string_escape=replace" +ENV{DEVTYPE}=="disk", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}" +ENV{DEVTYPE}=="disk", ENV{MD_DEVNAME}=="?*", SYMLINK+="md/$env{MD_DEVNAME}" + +ENV{DEVTYPE}!="partition", GOTO="md_vol_id" +IMPORT{program}="/sbin/mdadm --detail --export %r/$parent" +ENV{DEVTYPE}=="partition", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}-part%n", OPTIONS+="string_escape=replace" +ENV{DEVTYPE}=="partition", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}-part%n" +ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[^0-9]", SYMLINK+="md/$env{MD_DEVNAME}%n" +ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[0-9]", SYMLINK+="md/$env{MD_DEVNAME}p%n" + +LABEL="md_vol_id" +IMPORT{program}="/sbin/blkid -o udev -p $tempnode" +OPTIONS+="link_priority=100" +ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" +ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" + +LABEL="md_end" diff --git a/mdadm.changes b/mdadm.changes index 322d019..5b5d3f3 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,4 +1,25 @@ ------------------------------------------------------------------- +Thu Mar 11 10:18:18 CET 2010 - mmarek@suse.cz + +- 64-md-raid.rules: Use blkid instead of vol_id. + +------------------------------------------------------------------- +Thu Mar 11 09:58:21 CET 2010 - mmarek@suse.cz + +- 64-md-raid.rules: Allow --incremental assembly if "AUTO -all" is + given in mdadm.conf (fate#307478). + +------------------------------------------------------------------- +Tue Mar 9 16:15:41 CET 2010 - mmarek@suse.cz + +- Install udev rules in /lib/udev/rules.d (fate#307478). + +------------------------------------------------------------------- +Mon Feb 22 15:14:03 CET 2010 - mmarek@suse.cz + +- mkinitrd-setup.sh: call mdadm --scan only if necessary + (bnc#581769). + Fri Jan 15 17:37:26 CET 2010 - mmarek@suse.cz - fix modprobe invocation in boot.md (bnc#565293). diff --git a/mdadm.spec b/mdadm.spec index 4f7ef6f..2848587 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -20,7 +20,7 @@ Name: mdadm Version: 3.0.3 -Release: 2 +Release: 3 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq Obsoletes: raidtools @@ -37,6 +37,7 @@ Source3: mdadmd Source4: boot.md Source5: mkinitrd-setup.sh Source6: mkinitrd-boot.sh +Source7: 64-md-raid.rules %description Mdadm is a program that can be used to control Linux md devices. It is @@ -73,8 +74,8 @@ ln -sf ../../etc/init.d/mdadmd $RPM_BUILD_ROOT/%{_sbindir}/rcmdadmd rm -rf $RPM_BUILD_ROOT/var/run/mdadm mkdir -p $RPM_BUILD_ROOT/var/run ln -s mdadm $RPM_BUILD_ROOT/var/run/mdadm -# remove here, using the one in the udev package -rm -f $RPM_BUILD_ROOT/lib/udev/rules.d/64-md-raid.rules +install -d $RPM_BUILD_ROOT/lib/udev/rules.d +install -m 644 %_sourcedir/64-md-raid.rules $RPM_BUILD_ROOT/lib/udev/rules.d %post [ -x /sbin/mkinitrd_setup ] && mkinitrd_setup @@ -117,5 +118,8 @@ rm -rf $RPM_BUILD_ROOT %dir /lib/mkinitrd/scripts /lib/mkinitrd/scripts/setup-md.sh /lib/mkinitrd/scripts/boot-md.sh +%dir /lib/udev +%dir /lib/udev/rules.d +/lib/udev/rules.d/64-md-raid.rules %changelog diff --git a/mkinitrd-setup.sh b/mkinitrd-setup.sh index 750508c..5f25c80 100644 --- a/mkinitrd-setup.sh +++ b/mkinitrd-setup.sh @@ -6,7 +6,7 @@ mdblockdev= # Full mdadm.conf generated by mdadm. # Contains all created MD RAIDs -mdadm_conf=$(mdadm --examine --brief --scan) +mdadm_conf= cont_list= md_devs= @@ -64,7 +64,10 @@ for bd in $blockdev ; do mdconf="$(mdadm -Db "$container")\\n$mdconf" ;; [0-9a-f]*[0-9a-f]) - mdconf="$(mdadm -Ebs | grep "UUID=$container")\\n$mdconf" + if test -z "$mdadm_conf"; then + mdadm_conf=$(mdadm --examine --brief --scan) + fi + mdconf="$(echo "$mdadm_conf" | grep "UUID=$container")\\n$mdconf" ;; *) echo "unrecognized container for $md_dev: $container" From c2912a06085959cf3620a65d2d52960fad22868a79e6ada9f98880399315ad9c Mon Sep 17 00:00:00 2001 From: OBS User autobuild Date: Sun, 21 Mar 2010 10:51:29 +0000 Subject: [PATCH 39/39] Accepting request 35415 from openSUSE:Factory Copy from openSUSE:Factory/mdadm based on submit request 35415 from user coolo OBS-URL: https://build.opensuse.org/request/show/35415 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/mdadm?expand=0&rev=40 --- 64-md-raid.rules | 35 ----------------------------------- mdadm.changes | 21 --------------------- mdadm.spec | 10 +++------- mkinitrd-setup.sh | 7 ++----- 4 files changed, 5 insertions(+), 68 deletions(-) delete mode 100644 64-md-raid.rules diff --git a/64-md-raid.rules b/64-md-raid.rules deleted file mode 100644 index deccce4..0000000 --- a/64-md-raid.rules +++ /dev/null @@ -1,35 +0,0 @@ -# do not edit this file, it will be overwritten on update - -SUBSYSTEM!="block", GOTO="md_end" -ACTION!="add|change", GOTO="md_end" - -# import data from a raid member and activate it -ENV{ID_FS_TYPE}=="linux_raid_member", PROGRAM="grep -qs '^AUTO -all' /etc/mdadm.conf", IMPORT{program}="/sbin/mdadm --examine --export $tempnode", RUN+="/sbin/mdadm --incremental $env{DEVNAME}" -# import data from a raid set -KERNEL!="md*", GOTO="md_end" - -# container devices have a metadata version of e.g. 'external:ddf' and -# never leave state 'inactive' -ATTR{md/metadata_version}=="external:[A-Za-z]*", ATTR{md/array_state}=="inactive", GOTO="md_ignore_state" -ATTR{md/array_state}=="|clear|inactive", GOTO="md_end" -LABEL="md_ignore_state" - -IMPORT{program}="/sbin/mdadm --detail --export $tempnode" -ENV{DEVTYPE}=="disk", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}", OPTIONS+="string_escape=replace" -ENV{DEVTYPE}=="disk", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}" -ENV{DEVTYPE}=="disk", ENV{MD_DEVNAME}=="?*", SYMLINK+="md/$env{MD_DEVNAME}" - -ENV{DEVTYPE}!="partition", GOTO="md_vol_id" -IMPORT{program}="/sbin/mdadm --detail --export %r/$parent" -ENV{DEVTYPE}=="partition", ENV{MD_NAME}=="?*", SYMLINK+="disk/by-id/md-name-$env{MD_NAME}-part%n", OPTIONS+="string_escape=replace" -ENV{DEVTYPE}=="partition", ENV{MD_UUID}=="?*", SYMLINK+="disk/by-id/md-uuid-$env{MD_UUID}-part%n" -ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[^0-9]", SYMLINK+="md/$env{MD_DEVNAME}%n" -ENV{DEVTYPE}=="partition", ENV{MD_DEVNAME}=="*[0-9]", SYMLINK+="md/$env{MD_DEVNAME}p%n" - -LABEL="md_vol_id" -IMPORT{program}="/sbin/blkid -o udev -p $tempnode" -OPTIONS+="link_priority=100" -ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" -ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" - -LABEL="md_end" diff --git a/mdadm.changes b/mdadm.changes index 5b5d3f3..322d019 100644 --- a/mdadm.changes +++ b/mdadm.changes @@ -1,25 +1,4 @@ ------------------------------------------------------------------- -Thu Mar 11 10:18:18 CET 2010 - mmarek@suse.cz - -- 64-md-raid.rules: Use blkid instead of vol_id. - -------------------------------------------------------------------- -Thu Mar 11 09:58:21 CET 2010 - mmarek@suse.cz - -- 64-md-raid.rules: Allow --incremental assembly if "AUTO -all" is - given in mdadm.conf (fate#307478). - -------------------------------------------------------------------- -Tue Mar 9 16:15:41 CET 2010 - mmarek@suse.cz - -- Install udev rules in /lib/udev/rules.d (fate#307478). - -------------------------------------------------------------------- -Mon Feb 22 15:14:03 CET 2010 - mmarek@suse.cz - -- mkinitrd-setup.sh: call mdadm --scan only if necessary - (bnc#581769). - Fri Jan 15 17:37:26 CET 2010 - mmarek@suse.cz - fix modprobe invocation in boot.md (bnc#565293). diff --git a/mdadm.spec b/mdadm.spec index 2848587..2b84225 100644 --- a/mdadm.spec +++ b/mdadm.spec @@ -20,7 +20,7 @@ Name: mdadm Version: 3.0.3 -Release: 3 +Release: 4 BuildRequires: sgmltool PreReq: %fillup_prereq %insserv_prereq Obsoletes: raidtools @@ -37,7 +37,6 @@ Source3: mdadmd Source4: boot.md Source5: mkinitrd-setup.sh Source6: mkinitrd-boot.sh -Source7: 64-md-raid.rules %description Mdadm is a program that can be used to control Linux md devices. It is @@ -74,8 +73,8 @@ ln -sf ../../etc/init.d/mdadmd $RPM_BUILD_ROOT/%{_sbindir}/rcmdadmd rm -rf $RPM_BUILD_ROOT/var/run/mdadm mkdir -p $RPM_BUILD_ROOT/var/run ln -s mdadm $RPM_BUILD_ROOT/var/run/mdadm -install -d $RPM_BUILD_ROOT/lib/udev/rules.d -install -m 644 %_sourcedir/64-md-raid.rules $RPM_BUILD_ROOT/lib/udev/rules.d +# remove here, using the one in the udev package +rm -f $RPM_BUILD_ROOT/lib/udev/rules.d/64-md-raid.rules %post [ -x /sbin/mkinitrd_setup ] && mkinitrd_setup @@ -118,8 +117,5 @@ rm -rf $RPM_BUILD_ROOT %dir /lib/mkinitrd/scripts /lib/mkinitrd/scripts/setup-md.sh /lib/mkinitrd/scripts/boot-md.sh -%dir /lib/udev -%dir /lib/udev/rules.d -/lib/udev/rules.d/64-md-raid.rules %changelog diff --git a/mkinitrd-setup.sh b/mkinitrd-setup.sh index 5f25c80..750508c 100644 --- a/mkinitrd-setup.sh +++ b/mkinitrd-setup.sh @@ -6,7 +6,7 @@ mdblockdev= # Full mdadm.conf generated by mdadm. # Contains all created MD RAIDs -mdadm_conf= +mdadm_conf=$(mdadm --examine --brief --scan) cont_list= md_devs= @@ -64,10 +64,7 @@ for bd in $blockdev ; do mdconf="$(mdadm -Db "$container")\\n$mdconf" ;; [0-9a-f]*[0-9a-f]) - if test -z "$mdadm_conf"; then - mdadm_conf=$(mdadm --examine --brief --scan) - fi - mdconf="$(echo "$mdadm_conf" | grep "UUID=$container")\\n$mdconf" + mdconf="$(mdadm -Ebs | grep "UUID=$container")\\n$mdconf" ;; *) echo "unrecognized container for $md_dev: $container"