diff --git a/mdadm-3.2.2-Remove-race-for-starting-container-devices.patch b/mdadm-3.2.2-Remove-race-for-starting-container-devices.patch index 9a767b0..dffffeb 100644 --- a/mdadm-3.2.2-Remove-race-for-starting-container-devices.patch +++ b/mdadm-3.2.2-Remove-race-for-starting-container-devices.patch @@ -1,14 +1,21 @@ -From 50177a4bbed446087dd2529b5518697f2f69de08 Mon Sep 17 00:00:00 2001 -From: Jes Sorensen -Date: Thu, 13 Oct 2011 19:35:07 +0200 -Subject: [PATCH 1/3] Remove race for starting container devices. +commit 5fc8cff3a4177dfbab594947283117620b4b8c9c +Author: Jes Sorensen +Date: Sat Oct 22 11:29:47 2011 +1100 -This moves the lock handling out of Incremental_container() and relies -on the caller holding the lock. This prevents conflict with a -follow-on mdadm comment which may try and launch the device in -parallel. + Remove race for starting container devices. + + This moves the lock handling out of Incremental_container() and relies + on the caller holding the lock. This prevents conflict with a + follow-on mdadm comment which may try and launch the device in + parallel. + + This involves replacing a call to "Incremental" with an + unrolled version with just the case that calls Incremental_container + and so needs a call to ->load_container. + + Signed-off-by: Jes Sorensen + Signed-off-by: NeilBrown -Signed-off-by: Jes Sorensen --- Incremental.c | 22 ++++++++++++---------- 1 files changed, 12 insertions(+), 10 deletions(-) @@ -17,7 +24,7 @@ diff --git a/Incremental.c b/Incremental.c index 14184da..9fa6800 100644 --- a/Incremental.c +++ b/Incremental.c -@@ -138,9 +138,15 @@ int Incremental(char *devname, int verbose, int runstop, +@@ -138,9 +138,15 @@ rv = st->ss->load_container(st, dfd, NULL); close(dfd); @@ -36,7 +43,7 @@ index 14184da..9fa6800 100644 fprintf(stderr, Name ": %s is not part of an md array.\n", devname); -@@ -440,7 +446,6 @@ int Incremental(char *devname, int verbose, int runstop, +@@ -438,7 +444,6 @@ if (info.array.level == LEVEL_CONTAINER) { int devnum = devnum; /* defined and used iff ->external */ /* Try to assemble within the container */ @@ -44,19 +51,24 @@ index 14184da..9fa6800 100644 sysfs_uevent(&info, "change"); if (verbose >= 0) fprintf(stderr, Name -@@ -451,8 +456,9 @@ int Incremental(char *devname, int verbose, int runstop, +@@ -447,10 +452,14 @@ + wait_for(chosen_name, mdfd); + if (st->ss->external) devnum = fd2devnum(mdfd); ++ if (st->ss->load_container) ++ rv = st->ss->load_container(st, mdfd, NULL); close(mdfd); sysfs_free(sra); - rv = Incremental(chosen_name, verbose, runstop, - NULL, homehost, require_homehost, autof); -+ rv = Incremental_container(st, chosen_name, homehost, -+ verbose, runstop, autof); ++ if (!rv) ++ rv = Incremental_container(st, chosen_name, homehost, ++ verbose, runstop, autof); + map_unlock(&map); if (rv == 1) /* Don't fail the whole -I if a subarray didn't * have enough devices to start yet -@@ -1462,9 +1468,6 @@ static int Incremental_container(struct supertype *st, char *devname, +@@ -1460,9 +1469,6 @@ trustworthy = FOREIGN; list = st->ss->container_content(st, NULL); @@ -66,7 +78,7 @@ index 14184da..9fa6800 100644 /* do not assemble arrays that might have bad blocks */ if (list->array.state & (1< - 3.2.2-12 +- Backport upstream version of fix for IMSM RAID assembly problem, + which resolves issues when booting off sysvinit based system. +- Resolves: bz736387 (Fedora 15) bz744217 (Fedora 16) + * Wed Oct 19 2011 Jes Sorensen - 3.2.2-11 - Fix systemd dependency problem - Resolves: bz741115 (F16) bz744226 (rawhide)