mdadm-3.3.1-Grow-Do-not-try-to-restart-if-reshape-is-running.patch 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. From 13ffbe89b6103c146c08eb1c9a70833306c8322b Mon Sep 17 00:00:00 2001
  2. From: Pawel Baldysiak <pawel.baldysiak@intel.com>
  3. Date: Wed, 16 Jul 2014 12:20:34 +0200
  4. Subject: [PATCH 14/14] Grow: Do not try to restart if reshape is running
  5. Grow process did not check if reshape is already started
  6. when deciding about restarting.
  7. Sync_action should be checked in this case, and if
  8. reshape is running - restart flag should not be set.
  9. Otherwise, Grow process will fail to write data to
  10. sysfs, and reshape will not be continued.
  11. Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
  12. Signed-off-by: Artur Paszkiewicz <artur.paszkiewicz@intel.com>
  13. Signed-off-by: NeilBrown <neilb@suse.de>
  14. ---
  15. Grow.c | 5 ++++-
  16. 1 file changed, 4 insertions(+), 1 deletion(-)
  17. diff --git a/Grow.c b/Grow.c
  18. index a2f4f14..ea9cc60 100644
  19. --- a/Grow.c
  20. +++ b/Grow.c
  21. @@ -2822,6 +2822,7 @@ static int reshape_array(char *container, int fd, char *devname,
  22. unsigned long long array_size;
  23. int done;
  24. struct mdinfo *sra = NULL;
  25. + char buf[20];
  26. /* when reshaping a RAID0, the component_size might be zero.
  27. * So try to fix that up.
  28. @@ -2869,7 +2870,9 @@ static int reshape_array(char *container, int fd, char *devname,
  29. goto release;
  30. }
  31. - if (st->ss->external && restart && (info->reshape_progress == 0)) {
  32. + if (st->ss->external && restart && (info->reshape_progress == 0) &&
  33. + !((sysfs_get_str(info, NULL, "sync_action", buf, sizeof(buf)) > 0) &&
  34. + (strncmp(buf, "reshape", 7) == 0))) {
  35. /* When reshape is restarted from '0', very begin of array
  36. * it is possible that for external metadata reshape and array
  37. * configuration doesn't happen.
  38. --
  39. 2.0.0