[PATCH 04/21] imsm: FIX: Detect migration end during migration record saving

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Checkpoint should be saved when migration is in progress only.
End of reshape (based on passes status) should be detected and it should
not cause abort of reshape/check-pointing/ operation.

Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx>
---

 super-intel.c |   10 +++++++---
 1 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/super-intel.c b/super-intel.c
index 269cb0a..3afa913 100644
--- a/super-intel.c
+++ b/super-intel.c
@@ -7760,6 +7760,8 @@ abort:
  * Returns:
  *	0: success
  *	1: failure
+ *	2: failure, means no valid migration record
+ *		   / no general migration in progress /
  ******************************************************************************/
 int save_checkpoint_imsm(struct supertype *st, struct mdinfo *info, int state)
 {
@@ -7771,8 +7773,8 @@ int save_checkpoint_imsm(struct supertype *st, struct mdinfo *info, int state)
 	}
 
 	if (__le32_to_cpu(super->migr_rec->blocks_per_unit) == 0) {
-		dprintf("ERROR: blocks_per_unit = 0!!!\n");
-		return 1;
+		dprintf("imsm: no migration in progress.\n");
+		return 2;
 	}
 
 	super->migr_rec->curr_migr_unit =
@@ -8842,7 +8844,9 @@ static int imsm_manage_reshape(
 
 		sra->reshape_progress = next_step;
 
-		if (save_checkpoint_imsm(st, sra, UNIT_SRC_NORMAL)) {
+		if (save_checkpoint_imsm(st, sra, UNIT_SRC_NORMAL) == 1) {
+			/* ignore error == 2, this can mean end of reshape here
+			 */
 			dprintf("imsm: Cannot write checkpoint to "
 				"migration record (UNIT_SRC_NORMAL)\n");
 			goto abort;

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux