linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Adam Kwolek <adam.kwolek@intel.com>
Cc: linux-raid@vger.kernel.org, dan.j.williams@intel.com,
	ed.ciechanowski@intel.com, wojciech.neubauer@intel.com
Subject: Re: [PATCH] FIX: Add spare throws exception (v2)
Date: Sun, 20 Mar 2011 15:48:53 +1100	[thread overview]
Message-ID: <20110320154853.73944827@notabene.brown> (raw)
In-Reply-To: <20110318090804.8068.28272.stgit@gklab-128-013.igk.intel.com>

On Fri, 18 Mar 2011 10:08:04 +0100 Adam Kwolek <adam.kwolek@intel.com> wrote:

> sync_metadata() requires st->sb to be loaded, otherwise exception is generated.
> This fails expansion, because spares cannot be added.
> 
> metadata update uses tst instead st pointer, it is better than
> loading anchor for st as I proposed previously.
> 
> Signed-off-by: Adam Kwolek <adam.kwolek@intel.com>
> ---
> 
>  Manage.c |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/Manage.c b/Manage.c
> index 5808557..217c6b6 100644
> --- a/Manage.c
> +++ b/Manage.c
> @@ -914,10 +914,10 @@ int Manage_subdevs(char *devname, int fd,
>  					close(container_fd);
>  					return 1;
>  				}
> -				if (st->update_tail)
> -					flush_metadata_updates(st);
> +				if (tst->update_tail)
> +					flush_metadata_updates(tst);
>  				else
> -					tst->ss->sync_metadata(st);
> +					tst->ss->sync_metadata(tst);
>  
>  				sra = sysfs_read(container_fd, -1, 0);
>  				if (!sra) {

Yes, this is better thanks.

'st' is only used to read the superblock of the new device to see if it is
already a member of the array and so a 're-add' is appropriate.
'tst' should be used whenever working on 'the whole array'.

I really should give these variables better names.

Thanks,
NeilBrown

      reply	other threads:[~2011-03-20  4:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-18  9:08 [PATCH] FIX: Add spare throws exception (v2) Adam Kwolek
2011-03-20  4:48 ` 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=20110320154853.73944827@notabene.brown \
    --to=neilb@suse.de \
    --cc=adam.kwolek@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=ed.ciechanowski@intel.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=wojciech.neubauer@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;
as well as URLs for NNTP newsgroup(s).