Linux RAID subsystem development
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Pawel Baldysiak <pawel.baldysiak@intel.com>
Cc: linux-raid@vger.kernel.org, artur.paszkiewicz@intel.com
Subject: Re: [PATCH] IMSM: Clear migration record on disks more often
Date: Thu, 29 Jan 2015 14:13:14 +1100	[thread overview]
Message-ID: <20150129141314.3ffca025@notabene.brown> (raw)
In-Reply-To: <20150120125225.3110.88243.stgit@gklab-154-222.intel.com>

[-- Attachment #1: Type: text/plain, Size: 2059 bytes --]

On Tue, 20 Jan 2015 13:52:25 +0100 Pawel Baldysiak
<pawel.baldysiak@intel.com> wrote:

> Migration record is not always cleared after successful migration. This can
> block another reshape from being started. Migration will not be continued via
> systemd service due to error in verifying reshape position. This patch added
> clearing migration record when disk is added to container, and after successful
> migration.
> 
> Signed-off-by: Pawel Baldysiak <pawel.baldysiak@intel.com>
> ---
>  super-intel.c |   25 +++++++++++++++++++++++++
>  1 file changed, 25 insertions(+)
> 
> diff --git a/super-intel.c b/super-intel.c
> index 4c53019..2406991 100644
> --- a/super-intel.c
> +++ b/super-intel.c
> @@ -5055,6 +5055,14 @@ static int add_to_super_imsm(struct supertype *st, mdu_disk_info_t *dk,
>  	}
>  
>  	get_dev_size(fd, NULL, &size);
> +	/* clear migr_rec when adding disk to container */
> +	memset(super->migr_rec_buf, 0, MIGR_REC_BUF_SIZE);
> +	if (lseek64(fd, size - 512, SEEK_SET) >= 0) {
> +		if (write(fd, super->migr_rec_buf,
> +			MIGR_REC_BUF_SIZE) != MIGR_REC_BUF_SIZE)
> +			perror("Write migr_rec failed");
> +	}
> +
>  	size /= 512;
>  	serialcpy(dd->disk.serial, dd->serial);
>  	set_total_blocks(&dd->disk, size);
> @@ -10648,6 +10656,23 @@ static int imsm_manage_reshape(
>  
>  	}
>  
> +	/* clear migr_rec on disks after successful migration */
> +	struct dl *d;
> +
> +	memset(super->migr_rec_buf, 0, MIGR_REC_BUF_SIZE);
> +	for (d = super->disks; d; d = d->next) {
> +		if (d->index < 0 || is_failed(&d->disk))
> +			continue;
> +		unsigned long long dsize;
> +
> +		get_dev_size(d->fd, NULL, &dsize);
> +		if (lseek64(d->fd, dsize - 512, SEEK_SET) >= 0) {
> +			if (write(d->fd, super->migr_rec_buf,
> +				MIGR_REC_BUF_SIZE) != MIGR_REC_BUF_SIZE)
> +				perror("Write migr_rec failed");
> +		}
> +	}
> +
>  	/* return '1' if done */
>  	ret_val = 1;
>  abort:


Thanks.
I replaced both "size - 512" with "size - MIGR_REC_POSITION" and applied
the patch.

NeilBrown

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

      reply	other threads:[~2015-01-29  3:13 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-20 12:52 [PATCH] IMSM: Clear migration record on disks more often Pawel Baldysiak
2015-01-29  3:13 ` NeilBrown [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150129141314.3ffca025@notabene.brown \
    --to=neilb@suse.de \
    --cc=artur.paszkiewicz@intel.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=pawel.baldysiak@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox