summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMateusz Kusiak <mateusz.kusiak@intel.com>2024-09-02 18:27:56 +0200
committerMariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com>2024-09-04 09:32:44 +0200
commitdd0d193ad8722140e240c95a4fd1e214077dd719 (patch)
tree869771417cbdeb92f6f4a419869460e9ebb3ef02
parentmdadm: Increase number limit in md device name to 1024. (diff)
downloadmdadm-dd0d193ad8722140e240c95a4fd1e214077dd719.tar.xz
mdadm-dd0d193ad8722140e240c95a4fd1e214077dd719.zip
imsm: save checkpoint prior to exit
If reshape (eg. chunksize migration) is gracefully stopped via SIGTERM the checkpoint is not saved and reshape cannot be resumed due to "data being present in copy area". This is because UNIT_SRC_NORMAL isn't set if SIGTERM occurred. Move SIGTERM handling at the end of the loop to allow saving checkpoint (and state) so reshapes can be properly resumed. Signed-off-by: Mateusz Kusiak <mateusz.kusiak@intel.com>
-rw-r--r--super-intel.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/super-intel.c b/super-intel.c
index 744715d5..30c2939a 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -12631,8 +12631,6 @@ static int imsm_manage_reshape(
dprintf("wait_for_reshape_imsm returned error!\n");
goto abort;
}
- if (sigterm)
- goto abort;
if (save_checkpoint_imsm(st, sra, UNIT_SRC_NORMAL) == 1) {
/* ignore error == 2, this can mean end of reshape here
@@ -12641,6 +12639,9 @@ static int imsm_manage_reshape(
goto abort;
}
+ if (sigterm)
+ goto abort;
+
}
/* clear migr_rec on disks after successful migration */