Re: [PATCH 10/14] Perform restore backup for reshape continuation

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

 



On Fri, 16 Sep 2011 13:55:03 +0200 Adam Kwolek <adam.kwolek@xxxxxxxxx> wrote:

> It can happen that reshape is broken by different reason than reboot.
> this means that on reshape continuation start we cannot be sure
> that critical section has been restored already.

I don't think this is true.

If the array is running, then the critical section must have been restored.
Anything else is simply wrong.

What scenario are you thinking of here?

Thanks,
NeilBrown


> 
> Restore data from checkpoint before reshape continuation to avoid
> data corruption.
> 
> Signed-off-by: Adam Kwolek <adam.kwolek@xxxxxxxxx>
> ---
> 
>  Grow.c |   18 +++++++++++++++++-
>  1 files changed, 17 insertions(+), 1 deletions(-)
> 
> diff --git a/Grow.c b/Grow.c
> index 0b96f7a..da8b72d 100644
> --- a/Grow.c
> +++ b/Grow.c
> @@ -3652,6 +3652,9 @@ int Grow_continue_command(char *devname, int fd,
>  	char container[20];
>  	int cfd = -1;
>  	int fd2 = -1;
> +	int spares;
> +	int working_disks;
> +	struct mdinfo *dev;
>  
>  	dprintf("Grow continue from command line called for %s\n",
>  		devname);
> @@ -3753,7 +3756,20 @@ int Grow_continue_command(char *devname, int fd,
>  
>  	/* continue reshape
>  	 */
> -	ret_val = Grow_continue(fd, st, content, backup_file);
> +	dev = content->devs;
> +	spares = 0;
> +	working_disks = 0;
> +	while (dev) {
> +		if (dev->disk.raid_disk == -1)
> +			spares++;
> +		else
> +			working_disks++;
> +		dev = dev->next;
> +	}
> +	ret_val = restore_backup(st, content, working_disks, spares,
> +				 backup_file, verbose);
> +	if (!ret_val)
> +		ret_val = Grow_continue(fd, st, content, backup_file);
>  
>  Grow_continue_command_exit:
>  	if (fd2 > -1)

Attachment: signature.asc
Description: PGP signature


[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