- Fix up directory in mdmonitor init script so that we restart mdmon like
we are supposed to - Add a rule to run incremental assembly on containers in case there are multiple volumes in a container and we only started some of them in the initramfs - Make -If work with imsm arrays. We had too restrictive of a test in sysfs_unique_holder. - Make incremental assembly of containers act like incremental assembly of regular devices (aka, --run is needed to start a degraded array)
This commit is contained in:
parent
f2098b61d7
commit
f44c832cb2
95
mdadm-3.1.2-container.patch
Normal file
95
mdadm-3.1.2-container.patch
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
commit 3f45610e6b9e2419f09f7f1b415170b6128d91ad
|
||||||
|
Author: Doug Ledford <dledford@redhat.com>
|
||||||
|
Date: Thu Apr 8 12:39:03 2010 -0400
|
||||||
|
|
||||||
|
Make Incremental container assembly behave like native array assembly
|
||||||
|
|
||||||
|
Signed-off-by: Doug Ledford <dledford@redhat.com>:4000
|
||||||
|
|
||||||
|
diff --git a/Assemble.c b/Assemble.c
|
||||||
|
index 1504f1f..d059155 100644
|
||||||
|
--- a/Assemble.c
|
||||||
|
+++ b/Assemble.c
|
||||||
|
@@ -1327,8 +1327,10 @@ int assemble_container_content(struct supertype *st, int mdfd,
|
||||||
|
content->text_version,
|
||||||
|
content->uuid, chosen_name);
|
||||||
|
|
||||||
|
- if (runstop > 0 ||
|
||||||
|
- (working + preexist) >= content->array.working_disks) {
|
||||||
|
+ if ((runstop > 0 &&
|
||||||
|
+ (working + preexist) >= content->array.working_disks) ||
|
||||||
|
+ (runstop == 0 &&
|
||||||
|
+ (working + preexist) == content->array.raid_disks)) {
|
||||||
|
int err;
|
||||||
|
|
||||||
|
switch(content->array.level) {
|
||||||
|
diff --git a/Incremental.c b/Incremental.c
|
||||||
|
index d32a8e5..2a2df82 100644
|
||||||
|
--- a/Incremental.c
|
||||||
|
+++ b/Incremental.c
|
||||||
|
@@ -424,20 +424,21 @@ int Incremental(char *devname, int verbose, int runstop,
|
||||||
|
sysfs_uevent(&info, "change");
|
||||||
|
if (verbose >= 0)
|
||||||
|
fprintf(stderr, Name
|
||||||
|
- ": container %s now has %d devices\n",
|
||||||
|
- chosen_name, info.array.working_disks);
|
||||||
|
+ ": container %s now has %d out of %d devices\n",
|
||||||
|
+ chosen_name, info.array.working_disks,
|
||||||
|
+ info.array.raid_disks);
|
||||||
|
wait_for(chosen_name, mdfd);
|
||||||
|
close(mdfd);
|
||||||
|
- if (runstop < 0)
|
||||||
|
- return 0; /* don't try to assemble */
|
||||||
|
- rv = Incremental(chosen_name, verbose, runstop,
|
||||||
|
- NULL, homehost, require_homehost, autof);
|
||||||
|
- if (rv == 1)
|
||||||
|
- /* Don't fail the whole -I if a subarray didn't
|
||||||
|
- * have enough devices to start yet
|
||||||
|
+ if (runstop == 1 ||
|
||||||
|
+ info.array.working_disks == info.array.raid_disks)
|
||||||
|
+ /* The return value of our container assembly doesn't
|
||||||
|
+ * depend on whether or not subarrays assembled
|
||||||
|
+ * properly, so no need to preserve the return value
|
||||||
|
+ * here.
|
||||||
|
*/
|
||||||
|
- rv = 0;
|
||||||
|
- return rv;
|
||||||
|
+ Incremental(chosen_name, verbose, runstop, NULL,
|
||||||
|
+ homehost, require_homehost, autof);
|
||||||
|
+ return 0;
|
||||||
|
}
|
||||||
|
avail = NULL;
|
||||||
|
active_disks = count_active(st, mdfd, &avail, &info);
|
||||||
|
diff --git a/super-intel.c b/super-intel.c
|
||||||
|
index 999b970..7bcfcdb 100644
|
||||||
|
--- a/super-intel.c
|
||||||
|
+++ b/super-intel.c
|
||||||
|
@@ -1536,12 +1536,27 @@ static void getinfo_super_imsm(struct supertype *st, struct mdinfo *info)
|
||||||
|
if (super->current_vol >= 0) {
|
||||||
|
getinfo_super_imsm_volume(st, info);
|
||||||
|
return;
|
||||||
|
+ } else {
|
||||||
|
+ struct mdinfo vol_info;
|
||||||
|
+
|
||||||
|
+ super->current_vol = 0;
|
||||||
|
+ getinfo_super_imsm_volume(st, &vol_info);
|
||||||
|
+ super->current_vol = -1;
|
||||||
|
+ info->array.raid_disks = vol_info.array.raid_disks;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Set raid_disks to zero so that Assemble will always pull in valid
|
||||||
|
* spares
|
||||||
|
- */
|
||||||
|
+ *
|
||||||
|
+ * Note: my testing with assemble shows that it still works even
|
||||||
|
+ * when we set the raid_disks to a proper setting. However, without
|
||||||
|
+ * this it is impossible to tell when a container has the right
|
||||||
|
+ * number of disks to start cleanly without violating layering
|
||||||
|
+ * boundaries. So, not violating layering boundaries trumps spare
|
||||||
|
+ * disk issues. Doug Ledford
|
||||||
|
+ *
|
||||||
|
info->array.raid_disks = 0;
|
||||||
|
+ */
|
||||||
|
info->array.level = LEVEL_CONTAINER;
|
||||||
|
info->array.layout = 0;
|
||||||
|
info->array.md_minor = -1;
|
@ -15,7 +15,7 @@ ENV{rd_NO_MDIMSM}=="?*", GOTO="md_imsm_inc_end"
|
|||||||
# file, we will need to add this line into the middle of the next rule:
|
# file, we will need to add this line into the middle of the next rule:
|
||||||
# IMPORT{program}="/sbin/mdadm -D --export $tempnode", \
|
# IMPORT{program}="/sbin/mdadm -D --export $tempnode", \
|
||||||
|
|
||||||
SUBSYSTEM=="block", ACTION=="add|change", KERNEL=="md*", \
|
SUBSYSTEM=="block", ACTION=="add", KERNEL=="md*", \
|
||||||
ENV{MD_LEVEL}=="container", RUN+="/sbin/mdadm -I $tempnode"
|
ENV{MD_LEVEL}=="container", RUN+="/sbin/mdadm -I $tempnode"
|
||||||
|
|
||||||
SUBSYSTEM=="block", ACTION=="add", ENV{ID_FS_TYPE}=="isw_raid_member", \
|
SUBSYSTEM=="block", ACTION=="add", ENV{ID_FS_TYPE}=="isw_raid_member", \
|
||||||
|
16
mdadm.spec
16
mdadm.spec
@ -14,9 +14,10 @@ Patch4: mdadm-3.1.2-rebuild.patch
|
|||||||
Patch5: mdadm-3.1.2-directory.patch
|
Patch5: mdadm-3.1.2-directory.patch
|
||||||
Patch6: mdadm-3.1.2-decremental.patch
|
Patch6: mdadm-3.1.2-decremental.patch
|
||||||
Patch7: mdadm-3.1.2-decremental-2.patch
|
Patch7: mdadm-3.1.2-decremental-2.patch
|
||||||
Patch10: mdadm-3.1.2-decremental-3.patch
|
Patch8: mdadm-3.1.2-decremental-3.patch
|
||||||
Patch8: mdadm-3.1.2-powerpc-compile.patch
|
Patch9: mdadm-3.1.2-powerpc-compile.patch
|
||||||
Patch9: mdadm-2.5.2-static.patch
|
Patch10: mdadm-3.1.2-container.patch
|
||||||
|
Patch20: mdadm-2.5.2-static.patch
|
||||||
URL: http://www.kernel.org/pub/linux/utils/raid/mdadm/
|
URL: http://www.kernel.org/pub/linux/utils/raid/mdadm/
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
Group: System Environment/Base
|
Group: System Environment/Base
|
||||||
@ -44,9 +45,10 @@ file can be used to help with some common tasks.
|
|||||||
%patch5 -p1 -b .directory
|
%patch5 -p1 -b .directory
|
||||||
%patch6 -p1 -b .decremental
|
%patch6 -p1 -b .decremental
|
||||||
%patch7 -p1 -b .decremental-2
|
%patch7 -p1 -b .decremental-2
|
||||||
%patch10 -p1 -b .decremental-3
|
%patch8 -p1 -b .decremental-3
|
||||||
%patch8 -p1 -b .powerpc
|
%patch9 -p1 -b .powerpc
|
||||||
%patch9 -p1 -b .static
|
%patch10 -p1 -b .contrainer
|
||||||
|
%patch20 -p1 -b .static
|
||||||
|
|
||||||
%build
|
%build
|
||||||
make %{?_smp_mflags} CXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" SYSCONFDIR="%{_sysconfdir}" mdadm.static mdadm mdmon
|
make %{?_smp_mflags} CXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing" SYSCONFDIR="%{_sysconfdir}" mdadm.static mdadm mdmon
|
||||||
@ -101,6 +103,8 @@ fi
|
|||||||
initramfs
|
initramfs
|
||||||
- Make -If work with imsm arrays. We had too restrictive of a test in
|
- Make -If work with imsm arrays. We had too restrictive of a test in
|
||||||
sysfs_unique_holder.
|
sysfs_unique_holder.
|
||||||
|
- Make incremental assembly of containers act like incremental assembly of
|
||||||
|
regular devices (aka, --run is needed to start a degraded array)
|
||||||
|
|
||||||
* Tue Apr 06 2010 Doug Ledford <dledford@redhat.com> - 3.1.2-6
|
* Tue Apr 06 2010 Doug Ledford <dledford@redhat.com> - 3.1.2-6
|
||||||
- Typo in new rules file
|
- Typo in new rules file
|
||||||
|
Loading…
Reference in New Issue
Block a user