diff options
author | Mateusz Kusiak <mateusz.kusiak@intel.com> | 2024-09-02 18:27:56 +0200 |
---|---|---|
committer | Mariusz Tkaczyk <mariusz.tkaczyk@linux.intel.com> | 2024-09-04 09:32:44 +0200 |
commit | dd0d193ad8722140e240c95a4fd1e214077dd719 (patch) | |
tree | 869771417cbdeb92f6f4a419869460e9ebb3ef02 | |
parent | mdadm: Increase number limit in md device name to 1024. (diff) | |
download | mdadm-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.c | 5 |
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 */ |