Hello community, here is the log from the commit of package mdadm for openSUSE:Factory checked in at Thu Oct 6 16:43:58 CEST 2011.
-------- --- openSUSE:Factory/mdadm/mdadm.changes 2011-10-04 18:13:31.000000000 +0200 +++ /mounts/work_src_done/STABLE/mdadm/mdadm.changes 2011-10-06 04:24:04.000000000 +0200 @@ -1,0 +2,9 @@ +Thu Oct 6 02:16:35 UTC 2011 - [email protected] + +- mkinitrd-setup.sh -- add "AUTO -all" to initrd mdadm.conf + so that only arrays needed for boot are auto-assembled. +- auto-line.fix -- fix handling of "AUTO" line + in mdadm.conf so it actually works. + (bnc#721905) + +------------------------------------------------------------------- calling whatdependson for head-i586 New: ---- auto-line.fix ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ mdadm.spec ++++++ --- /var/tmp/diff_new_pack.oI9wa3/_old 2011-10-06 16:43:45.000000000 +0200 +++ /var/tmp/diff_new_pack.oI9wa3/_new 2011-10-06 16:43:45.000000000 +0200 @@ -38,6 +38,7 @@ Source5: mkinitrd-setup.sh Source6: mkinitrd-boot.sh Patch0: mdadm-3.2.2_git3b1dab1bdbda0 +Patch1: auto-line.fix %description Mdadm is a program that can be used to control Linux md devices. It is @@ -53,6 +54,7 @@ %prep %setup -q -a1 %patch0 -p1 +%patch1 -p1 %build %{suse_update_config -f} ++++++ auto-line.fix ++++++ >From b451aa4846c5ccca5447a6b6d45e5623b8c8e961 Mon Sep 17 00:00:00 2001 From: NeilBrown <[email protected]> Date: Thu, 6 Oct 2011 13:00:28 +1100 Subject: [PATCH] Fix handling for "auto" line in mdadm.conf Two problems. 1/ pol_merge was ignoring the pol_auto tag so any 'auto' information was lost 2/ If a device had not path (e.g. loop devices) or if there were no path-based policies, we didn't bother looking for policy at all. So path-independant policies were ignored. Reported-by: Christian Boltz <[email protected]> Signed-off-by: NeilBrown <[email protected]> --- policy.c | 35 ++++++++++++++++++++++------------- 1 files changed, 22 insertions(+), 13 deletions(-) diff --git a/policy.c b/policy.c index 4a6ef82..ef48353 100644 --- a/policy.c +++ b/policy.c @@ -195,7 +195,9 @@ static char *disk_path(struct mdinfo *disk) int prefix_len; DIR *by_path; char symlink[PATH_MAX] = "/dev/disk/by-path/"; + char nm[PATH_MAX]; struct dirent *ent; + int rv; by_path = opendir(symlink); if (!by_path) @@ -218,7 +220,17 @@ static char *disk_path(struct mdinfo *disk) return strdup(ent->d_name); } closedir(by_path); - return NULL; + /* A NULL path isn't really acceptable - use the devname.. */ + sprintf(symlink, "/sys/dev/block/%d:%d", disk->disk.major, disk->disk.minor); + rv = readlink(symlink, nm, sizeof(nm)); + if (rv > 0) { + char *dname; + nm[rv] = 0; + dname = strrchr(nm, '/'); + if (dname) + return strdup(dname + 1); + } + return strdup("unknown"); } char type_part[] = "part"; @@ -245,13 +257,13 @@ static int pol_match(struct rule *rule, char *path, char *type) if (rule->name == rule_path) { if (pathok == 0) pathok = -1; - if (fnmatch(rule->value, path, 0) == 0) + if (path && fnmatch(rule->value, path, 0) == 0) pathok = 1; } if (rule->name == rule_type) { if (typeok == 0) typeok = -1; - if (strcmp(rule->value, type) == 0) + if (type && strcmp(rule->value, type) == 0) typeok = 1; } rule = rule->next; @@ -270,7 +282,8 @@ static void pol_merge(struct dev_policy **pol, struct rule *rule) for (r = rule; r ; r = r->next) if (r->name == pol_act || - r->name == pol_domain) + r->name == pol_domain || + r->name == pol_auto) pol_new(pol, r->name, r->value, metadata); } @@ -280,7 +293,10 @@ static int path_has_part(char *path, char **part) * if it does, place a pointer to "-pathNN" * in 'part'. */ - int l = strlen(path); + int l; + if (!path) + return 0; + l = strlen(path); while (l > 1 && isdigit(path[l-1])) l--; if (l < 5 || strncmp(path+l-5, "-part", 5) != 0) @@ -343,9 +359,6 @@ struct dev_policy *path_policy(char *path, char *type) struct dev_policy *pol = NULL; int i; - if (!type) - return NULL; - rules = config_rules; while (rules) { @@ -366,7 +379,7 @@ struct dev_policy *path_policy(char *path, char *type) /* Now add any metadata-specific internal knowledge * about this path */ - for (i=0; superlist[i]; i++) + for (i=0; path && superlist[i]; i++) if (superlist[i]->get_disk_controller_domain) { const char *d = superlist[i]->get_disk_controller_domain(path); @@ -399,12 +412,8 @@ struct dev_policy *disk_policy(struct mdinfo *disk) char *type = disk_type(disk); struct dev_policy *pol = NULL; - if (!type) - return NULL; if (config_rules_has_path) path = disk_path(disk); - if (!path) - return NULL; pol = path_policy(path, type); -- 1.7.6.4 ++++++ mkinitrd-boot.sh ++++++ --- /var/tmp/diff_new_pack.oI9wa3/_old 2011-10-06 16:43:45.000000000 +0200 +++ /var/tmp/diff_new_pack.oI9wa3/_new 2011-10-06 16:43:45.000000000 +0200 @@ -1,5 +1,6 @@ #!/bin/bash #%stage: softraid +# grep needed for udev rules file. #%programs: /sbin/mdadm /sbin/mdmon #%modules: raid0 raid1 raid10 raid456 #%if: -n "$need_mdadm" ++++++ mkinitrd-setup.sh ++++++ --- /var/tmp/diff_new_pack.oI9wa3/_old 2011-10-06 16:43:45.000000000 +0200 +++ /var/tmp/diff_new_pack.oI9wa3/_new 2011-10-06 16:43:45.000000000 +0200 @@ -82,7 +82,7 @@ if [ -n "$root_md" ] ; then need_mdadm=1 - echo -n "" > $tmp_mnt/etc/mdadm.conf + echo "AUTO -all" > $tmp_mnt/etc/mdadm.conf for md in $md_devs; do eval echo -e \"\$md_conf_$md\" >> $tmp_mnt/etc/mdadm.conf done continue with "q"... Remember to have fun... -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
