mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 11:50:43 +09:00
dm raid: fix data corruption on reshape request
am: 2937e22c23
Change-Id: I3a55981aab612685064716fad5c0e70d021c62bb
This commit is contained in:
@@ -3621,6 +3621,8 @@ static int raid_preresume(struct dm_target *ti)
|
||||
return r;
|
||||
}
|
||||
|
||||
#define RESUME_STAY_FROZEN_FLAGS (CTR_FLAG_DELTA_DISKS | CTR_FLAG_DATA_OFFSET)
|
||||
|
||||
static void raid_resume(struct dm_target *ti)
|
||||
{
|
||||
struct raid_set *rs = ti->private;
|
||||
@@ -3638,7 +3640,15 @@ static void raid_resume(struct dm_target *ti)
|
||||
mddev->ro = 0;
|
||||
mddev->in_sync = 0;
|
||||
|
||||
clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery);
|
||||
/*
|
||||
* Keep the RAID set frozen if reshape/rebuild flags are set.
|
||||
* The RAID set is unfrozen once the next table load/resume,
|
||||
* which clears the reshape/rebuild flags, occurs.
|
||||
* This ensures that the constructor for the inactive table
|
||||
* retrieves an up-to-date reshape_position.
|
||||
*/
|
||||
if (!(rs->ctr_flags & RESUME_STAY_FROZEN_FLAGS))
|
||||
clear_bit(MD_RECOVERY_FROZEN, &mddev->recovery);
|
||||
|
||||
if (mddev->suspended)
|
||||
mddev_resume(mddev);
|
||||
|
||||
Reference in New Issue
Block a user