SHA256
1
0
forked from pool/mdadm
mdadm/Grow-fix-problems-with-prematurely-aborting-of-resha.patch
Neil Brown 702c57405a - mdmonitor
run "mdadm --monitor" from systemd instead of init.d
  sciprt (bnc#849523)
- remove mdadmd due to above.
- udev-rules-try-mdadm-I-on-change-events.patch
  (bnc#851993)
- policy-NULL-path-isn-t-really-acceptable-use-the-dev.patch
- DDF-really-ignore-DDF-metadata-on-partitions.patch
- Assemble-avoid-infinite-loop-when-auto-assembling-pa.patch
- DDF-fix-detection-of-failed-devices-during-assembly.patch
- Grow-fix-problems-with-prematurely-aborting-of-resha.patch
- IMSM-don-t-crash-when-creating-an-array-with-missing.patch
- mdmon-don-t-complain-about-notifying-parent-when-the.patch
- systemd-mdmon-set-IMSM_NO_PLATFORM-1.patch
- mdmon-.service-remove-over-ride-of-Standard-IO.patch
  Various upstream bug fixes.

OBS-URL: https://build.opensuse.org/package/show/Base:System/mdadm?expand=0&rev=101
2014-01-22 04:59:00 +00:00

59 lines
1.9 KiB
Diff

From 5e7be8389446a4afa016351e65d1ead31a978f16 Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.de>
Date: Mon, 20 Jan 2014 15:31:45 +1100
Subject: [PATCH 09/13] Grow: fix problems with prematurely aborting of
reshapes.
1/ when unfreezing, make sure the array is frozen first.
If it isn't we might end up interrupting a reshape.
2/ When the child finishes, don't call abort_reshape() as that
will interrupt the reshape. Just set suspend_* etc
explicitly.
Signed-off-by: NeilBrown <neilb@suse.de>
---
Grow.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
--- mdadm-3.3.orig/Grow.c
+++ mdadm-3.3/Grow.c
@@ -612,9 +612,14 @@ static void unfreeze(struct supertype *s
return unfreeze_container(st);
else {
struct mdinfo *sra = sysfs_read(-1, st->devnm, GET_VERSION);
+ char buf[20];
- if (sra)
+ if (sra &&
+ sysfs_get_str(sra, NULL, "sync_action", buf, 20) > 0
+ && strcmp(buf, "frozen\n") == 0) {
+ printf("unfreeze\n");
sysfs_set_str(sra, NULL, "sync_action", "idle");
+ }
sysfs_free(sra);
}
}
@@ -2666,7 +2671,7 @@ static int impose_level(int fd, int leve
for (d = 0, found = 0;
d < MAX_DISKS && found < array.nr_disks;
d++) {
- mdu_disk_info_t disk;
+ mdu_disk_info_t disk;
disk.number = d;
if (ioctl(fd, GET_DISK_INFO, &disk) < 0)
continue;
@@ -4316,7 +4321,12 @@ int child_monitor(int afd, struct mdinfo
}
/* FIXME maybe call progress_reshape one more time instead */
- abort_reshape(sra); /* remove any remaining suspension */
+ /* remove any remaining suspension */
+ sysfs_set_num(sra, NULL, "suspend_lo", 0x7FFFFFFFFFFFFFFFULL);
+ sysfs_set_num(sra, NULL, "suspend_hi", 0);
+ sysfs_set_num(sra, NULL, "suspend_lo", 0);
+ sysfs_set_num(sra, NULL, "sync_min", 0);
+
if (reshape->before.data_disks == reshape->after.data_disks)
sysfs_set_num(sra, NULL, "sync_speed_min", speed);
free(buf);