All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Wilck <mwilck@arcor.de>
To: NeilBrown <neilb@suse.de>
Cc: Francis Moreau <francis.moro@gmail.com>, linux-raid@vger.kernel.org
Subject: Re: mdadm 3.3: issue with mdmon --takeover
Date: Wed, 11 Sep 2013 22:51:20 +0200	[thread overview]
Message-ID: <5230D7C8.6080908@arcor.de> (raw)
In-Reply-To: <20130911093518.794bbb21@notabene.brown>

On 09/11/2013 01:35 AM, NeilBrown wrote:
> I think this patch will help.  The last hunk in particular should make the
> difference.
> 
> Please let me know if it fixes the problem.

Thanks for figuring this out. Indeed I forgot the possibility that
secondary LBA may be unused when I wrote that code.

Are you going to fix this directly? Otherwise I might go over it,
double-check, and submit a patch.

Martin

> 
> Thanks,
> NeilBrown
> 
> 
> diff --git a/super-ddf.c b/super-ddf.c
> index 636d7b4..86f9bb0 100644
> --- a/super-ddf.c
> +++ b/super-ddf.c
> @@ -880,7 +880,7 @@ static int load_ddf_headers(int fd, struct ddf_super *super, char *devname)
>  			super->primary.openflag && !super->secondary.openflag)
>  			)
>  			super->active = &super->secondary;
> -	} else if (devname)
> +	} else if (devname && super->anchor.secondary_lba != ~(__u64)0)
>  		pr_err("Failed to load secondary DDF header on %s\n",
>  		       devname);
>  	if (super->active == NULL)
> @@ -2810,7 +2810,8 @@ static int add_to_super_ddf(struct supertype *st,
>  	} while (0)
>  	__calc_lba(dd, ddf->dlist, workspace_lba, 32);
>  	__calc_lba(dd, ddf->dlist, primary_lba, 16);
> -	__calc_lba(dd, ddf->dlist, secondary_lba, 32);
> +	if (ddf->dlist == NULL || ddf->dlist->secondary_lba != ~(__u64)0)
> +		__calc_lba(dd, ddf->dlist, secondary_lba, 32);
>  	pde->config_size = dd->workspace_lba;
>  
>  	sprintf(pde->path, "%17.17s","Information: nil") ;
> @@ -2892,6 +2893,8 @@ static int __write_ddf_structure(struct dl *d, struct ddf_super *ddf, __u8 type)
>  	default:
>  		return 0;
>  	}
> +	if (sector == ~(__u64)0)
> +		return 0;
>  
>  	header->type = type;
>  	header->openflag = 1;


  parent reply	other threads:[~2013-09-11 20:51 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-03 15:54 mdadm 3.3: issue with mdmon --takeover Francis Moreau
2013-09-04  6:08 ` NeilBrown
2013-09-04  7:36   ` Francis Moreau
2013-09-05  2:11     ` NeilBrown
     [not found]       ` <CAC9WiBiHcS126iFv91250d83sMrBYmRbvoqYAEhjJWjb2p5J3A@mail.gmail.com>
2013-09-05  9:03         ` Francis Moreau
2013-09-10 23:35           ` NeilBrown
2013-09-11  7:40             ` Francis Moreau
2013-09-11  8:11               ` Francis Moreau
2013-09-12  5:03                 ` NeilBrown
2013-09-12  7:40                   ` Francis Moreau
2013-09-12  5:00               ` NeilBrown
2013-09-11 20:51             ` Martin Wilck [this message]
2013-09-12  4:59               ` NeilBrown

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=5230D7C8.6080908@arcor.de \
    --to=mwilck@arcor.de \
    --cc=francis.moro@gmail.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.