From efb5beb4cbd0b12ef1228543df3e729564f86d3d Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Aug 02 2016 13:53:22 +0000 Subject: import mdadm-3.3.2-7.el7_2.1 --- diff --git a/SOURCES/mdadm-3.3.2-Grow-close-file-descriptor-earlier-to-avoid-still-in.patch b/SOURCES/mdadm-3.3.2-Grow-close-file-descriptor-earlier-to-avoid-still-in.patch new file mode 100644 index 0000000..b63705b --- /dev/null +++ b/SOURCES/mdadm-3.3.2-Grow-close-file-descriptor-earlier-to-avoid-still-in.patch @@ -0,0 +1,35 @@ +From 10df72a080f71f01553a14ed8112cee6af7912e8 Mon Sep 17 00:00:00 2001 +From: Artur Paszkiewicz +Date: Wed, 23 Dec 2015 12:57:10 +0100 +Subject: [PATCH] Grow: close file descriptor earlier to avoid "still in use" + when stopping + +Close fd2 as soon as it is no longer needed, before calling +Grow_continue(). Otherwise, we won't be able to stop an array with +external metadata during reshape, because mdadm running in background +will be keeping it open. + +Signed-off-by: Artur Paszkiewicz +Signed-off-by: Pawel Baldysiak +Signed-off-by: NeilBrown +--- + Grow.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/Grow.c b/Grow.c +index 89e4c34..bbdd46c 100755 +--- a/Grow.c ++++ b/Grow.c +@@ -4885,6 +4885,9 @@ int Grow_continue_command(char *devname, int fd, + + sysfs_init(content, fd2, mdstat->devnm); + ++ close(fd2); ++ fd2 = -1; ++ + /* start mdmon in case it is not running + */ + if (!mdmon_running(container)) +-- +2.5.0 + diff --git a/SOURCES/mdadm-3.3.2-imsm-abort-reshape-if-sync_action-is-not-reshape.patch b/SOURCES/mdadm-3.3.2-imsm-abort-reshape-if-sync_action-is-not-reshape.patch new file mode 100644 index 0000000..a5a27b2 --- /dev/null +++ b/SOURCES/mdadm-3.3.2-imsm-abort-reshape-if-sync_action-is-not-reshape.patch @@ -0,0 +1,33 @@ +From d7d3809a1b93f9f7b7ca7d874c17632cb3305c76 Mon Sep 17 00:00:00 2001 +From: Artur Paszkiewicz +Date: Wed, 23 Dec 2015 12:57:11 +0100 +Subject: [PATCH] imsm: abort reshape if sync_action is not "reshape" + +When reshape was interrupted, an incorrect checkpoint would be saved in +the migration record. Change wait_for_reshape_imsm() to return -1 when +sync_action is not "reshape" to abort early in imsm_manage_reshape() +without writing the migration record. + +Signed-off-by: Artur Paszkiewicz +Signed-off-by: NeilBrown +--- + super-intel.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/super-intel.c b/super-intel.c +index e609e0c..c7efa98 100644 +--- a/super-intel.c ++++ b/super-intel.c +@@ -10300,8 +10300,10 @@ int wait_for_reshape_imsm(struct mdinfo *sra, int ndata) + sysfs_wait(fd, NULL); + if (sysfs_get_str(sra, NULL, "sync_action", + action, 20) > 0 && +- strncmp(action, "reshape", 7) != 0) +- break; ++ strncmp(action, "reshape", 7) != 0) { ++ close(fd); ++ return -1; ++ } + if (sysfs_fd_get_ll(fd, &completed) < 0) { + dprintf("imsm: wait_for_reshape_imsm() " + "cannot read reshape_position (in loop)\n"); diff --git a/SOURCES/mdadm-3.3.2-imsm-don-t-call-abort_reshape-in-imsm_manage_reshape.patch b/SOURCES/mdadm-3.3.2-imsm-don-t-call-abort_reshape-in-imsm_manage_reshape.patch new file mode 100644 index 0000000..023c891 --- /dev/null +++ b/SOURCES/mdadm-3.3.2-imsm-don-t-call-abort_reshape-in-imsm_manage_reshape.patch @@ -0,0 +1,36 @@ +From 2139b03c2080e6f4e442ff6b7a0f6ffd30decb8b Mon Sep 17 00:00:00 2001 +From: Artur Paszkiewicz +Date: Mon, 5 Oct 2015 15:18:11 +0200 +Subject: [PATCH] imsm: don't call abort_reshape() in imsm_manage_reshape() + +Calling abort_reshape() in imsm_manage_reshape() is unnecessary in case +of an error because it is handled by reshape_array(). Calling it when +reshape completes successfully is also unnecessary and leads to a race +condition: +- reshape ends +- mdadm calls abort_reshape() -> sets sync_action to idle +- MD_RECOVERY_INTR is set and md_reap_sync_thread() does not finish the + reshape + +Signed-off-by: Artur Paszkiewicz +Signed-off-by: Konrad Dabrowski +Signed-off-by: NeilBrown +--- + super-intel.c | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/super-intel.c b/super-intel.c +index 95a72b6..e609e0c 100644 +--- a/super-intel.c ++++ b/super-intel.c +@@ -10601,7 +10601,6 @@ static int imsm_manage_reshape( + ret_val = 1; + abort: + free(buf); +- abort_reshape(sra); + + return ret_val; + } +-- +2.5.0 + diff --git a/SOURCES/mdadm-3.3.2-imsm-don-t-update-migration-record-when-reshape-is-i.patch b/SOURCES/mdadm-3.3.2-imsm-don-t-update-migration-record-when-reshape-is-i.patch new file mode 100644 index 0000000..7611046 --- /dev/null +++ b/SOURCES/mdadm-3.3.2-imsm-don-t-update-migration-record-when-reshape-is-i.patch @@ -0,0 +1,42 @@ +From c85338c67570ec346bbd7fb0948bb0da4b43bcc3 Mon Sep 17 00:00:00 2001 +From: Artur Paszkiewicz +Date: Tue, 5 Jan 2016 17:16:16 +0100 +Subject: [PATCH] imsm: don't update migration record when reshape is + interrupted + +Abort imsm_manage_reshape() without updating the migration record if any +error occurs when checking progress. If reshape is interrupted and the +migration record is then updated, the checkpoint will be wrong and will +cause reshape to fail when the array is restarted. + +Signed-off-by: Artur Paszkiewicz +Signed-off-by: NeilBrown +--- + super-intel.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/super-intel.c b/super-intel.c +index 3b3d561..90b7b6d 100644 +--- a/super-intel.c ++++ b/super-intel.c +@@ -10373,7 +10373,7 @@ int wait_for_reshape_imsm(struct mdinfo *sra, int ndata) + dprintf("imsm: wait_for_reshape_imsm() " + "cannot read reshape_position (no reshape in progres)\n"); + close(fd); +- return 0; ++ return 1; + } + + if (completed > position_to_set) { +@@ -10662,7 +10662,7 @@ static int imsm_manage_reshape( + sra->reshape_progress = next_step; + + /* wait until reshape finish */ +- if (wait_for_reshape_imsm(sra, ndata) < 0) { ++ if (wait_for_reshape_imsm(sra, ndata)) { + dprintf("wait_for_reshape_imsm returned error!\n"); + goto abort; + } +-- +2.5.0 + diff --git a/SOURCES/mdadm-3.3.2-imsm-use-timeout-when-waiting-for-reshape-progress.patch b/SOURCES/mdadm-3.3.2-imsm-use-timeout-when-waiting-for-reshape-progress.patch new file mode 100644 index 0000000..9e105ce --- /dev/null +++ b/SOURCES/mdadm-3.3.2-imsm-use-timeout-when-waiting-for-reshape-progress.patch @@ -0,0 +1,36 @@ +From 5ff3a780abeb5e4d97727dd213e5923f55cae28b Mon Sep 17 00:00:00 2001 +From: Artur Paszkiewicz +Date: Tue, 5 Jan 2016 17:16:15 +0100 +Subject: [PATCH] imsm: use timeout when waiting for reshape progress + +Waiting for reshape progress is done by using select() on sync_completed +to block until an exception condition is signalled on the +filedescriptor. This happens when the attribute's value is updated by +the kernel, but if the array is stopped when mdadm is blocked on +select() this will never happen, because this attribute is then removed +and apparently the kernel doesn't do sysfs_notify() when removing a +sysfs attribute. So set a 3 second timeout for the sysfs_wait() call. + +Signed-off-by: Artur Paszkiewicz +Signed-off-by: NeilBrown +--- + super-intel.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/super-intel.c b/super-intel.c +index b836816..3b3d561 100644 +--- a/super-intel.c ++++ b/super-intel.c +@@ -10393,7 +10393,8 @@ int wait_for_reshape_imsm(struct mdinfo *sra, int ndata) + + do { + char action[20]; +- sysfs_wait(fd, NULL); ++ int timeout = 3000; ++ sysfs_wait(fd, &timeout); + if (sysfs_get_str(sra, NULL, "sync_action", + action, 20) > 0 && + strncmp(action, "reshape", 7) != 0) { +-- +2.5.0 + diff --git a/SOURCES/mdadm-3.3.2-super-intel-ensure-suspended-region-is-removed-when-.patch b/SOURCES/mdadm-3.3.2-super-intel-ensure-suspended-region-is-removed-when-.patch new file mode 100644 index 0000000..3c52825 --- /dev/null +++ b/SOURCES/mdadm-3.3.2-super-intel-ensure-suspended-region-is-removed-when-.patch @@ -0,0 +1,63 @@ +From 942e1cdb4a6a5be02672bc686169c679e775c2be Mon Sep 17 00:00:00 2001 +From: NeilBrown +Date: Thu, 18 Feb 2016 15:53:32 +1100 +Subject: [PATCH] super-intel: ensure suspended region is removed when reshape + completes. + +A recent commit removed a call to abort_reshape() when IMSM reshape +completed. An unanticipated result of this is that the suspended +region is not cleared as it should be. +So after a reshape, a region of the array will cause all IO to block. + +Re-instate the required updates to suspend_{lo,hi} coped from +abort_reshape(). + +This is caught (sometimes) by the test suite. + +Also fix a couple of typos found while exploring the code. + +Reported-by: Ken Moffat +Cc: Artur Paszkiewicz +Fixes: 2139b03c2080 ("imsm: don't call abort_reshape() in imsm_manage_reshape()") +Signed-off-by: NeilBrown +Signed-off-by: Jes Sorensen +--- + super-intel.c | 8 ++++++-- + 1 file changed, 6 insertions(+), 2 deletions(-) + +diff --git a/super-intel.c b/super-intel.c +index 90b7b6d..ff0506d 100644 +--- a/super-intel.c ++++ b/super-intel.c +@@ -10465,7 +10465,7 @@ int check_degradation_change(struct mdinfo *info, + * Function: imsm_manage_reshape + * Description: Function finds array under reshape and it manages reshape + * process. It creates stripes backups (if required) and sets +- * checheckpoits. ++ * checkpoints. + * Parameters: + * afd : Backup handle (nattive) - not used + * sra : general array info +@@ -10595,7 +10595,7 @@ static int imsm_manage_reshape( + + start = current_position * 512; + +- /* allign reading start to old geometry */ ++ /* align reading start to old geometry */ + start_buf_shift = start % old_data_stripe_length; + start_src = start - start_buf_shift; + +@@ -10700,6 +10700,10 @@ static int imsm_manage_reshape( + ret_val = 1; + abort: + free(buf); ++ /* See Grow.c: abort_reshape() for further explanation */ ++ sysfs_set_num(sra, NULL, "suspend_lo", 0x7FFFFFFFFFFFFFFFULL); ++ sysfs_set_num(sra, NULL, "suspend_hi", 0); ++ sysfs_set_num(sra, NULL, "suspend_lo", 0); + + return ret_val; + } +-- +2.5.0 + diff --git a/SPECS/mdadm.spec b/SPECS/mdadm.spec index 1bbb37d..abdc699 100644 --- a/SPECS/mdadm.spec +++ b/SPECS/mdadm.spec @@ -1,7 +1,7 @@ Summary: The mdadm program controls Linux md devices (software RAID arrays) Name: mdadm Version: 3.3.2 -Release: 7%{?dist} +Release: 7%{?dist}.1 Source: http://www.kernel.org/pub/linux/utils/raid/mdadm/mdadm-%{version}.tar.xz Source1: mdmonitor.init Source2: raid-check @@ -19,6 +19,12 @@ Patch5: mdadm-3.3.2-imsm-add-support-for-NVMe-devices.patch Patch6: mdadm-3.3.2-imsm-detail-platform-improvements.patch Patch7: mdadm-3.3.2-imsm-use-efivarfs-interface-for-reading-UEFI-variabl.patch Patch8: mdadm-3.3.2-fix-problem-with-grow-continue.patch +Patch9: mdadm-3.3.2-imsm-don-t-call-abort_reshape-in-imsm_manage_reshape.patch +Patch10: mdadm-3.3.2-Grow-close-file-descriptor-earlier-to-avoid-still-in.patch +Patch11: mdadm-3.3.2-imsm-abort-reshape-if-sync_action-is-not-reshape.patch +Patch12: mdadm-3.3.2-imsm-use-timeout-when-waiting-for-reshape-progress.patch +Patch13: mdadm-3.3.2-imsm-don-t-update-migration-record-when-reshape-is-i.patch +Patch14: mdadm-3.3.2-super-intel-ensure-suspended-region-is-removed-when-.patch # RHEL customization patches Patch96: mdadm-3.3.2-skip-rules.patch Patch97: mdadm-3.3-udev.patch @@ -54,6 +60,12 @@ file can be used to help with some common tasks. %patch6 -p1 -b .detail %patch7 -p1 -b .efivars %patch8 -p1 -b .grow +%patch9 -p1 -b .noabort +%patch10 -p1 -b .close +%patch11 -p1 -b .abort +%patch12 -p1 -b .timeout +%patch13 -p1 -b .update +%patch14 -p1 -b .ensure # RHEL customization patches %patch96 -p1 -b .rules @@ -120,6 +132,10 @@ rm -rf %{buildroot} /etc/libreport/events.d/* %changelog +* Mon Jun 20 2016 Jes Sorensen - 3.3.2-7.el7_2.1 +- Fix problem not being possible to stop IMSM RAID during reshape +- Resolves bz1322282 + * Thu Sep 17 2015 Jes Sorensen - 3.3.2-7 - Fix race condition when assembling IMSM volumes with mdadm -As - Resolves bz1263205