linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: "Czarnowska, Anna" <anna.czarnowska@intel.com>
Cc: "linux-raid@vger.kernel.org" <linux-raid@vger.kernel.org>,
	"Williams, Dan J" <dan.j.williams@intel.com>,
	"Ciechanowski, Ed" <ed.ciechanowski@intel.com>,
	"Neubauer, Wojciech" <Wojciech.Neubauer@intel.com>
Subject: Re: [PATCH 1/2] Create: check for UnSet when looking at chunk
Date: Tue, 5 Apr 2011 09:32:29 +1000	[thread overview]
Message-ID: <20110405093229.193c1585@notabene.brown> (raw)
In-Reply-To: <A9DE54D0CD747C4CB06DCE5B6FA2246F012A8EB878@irsmsx504.ger.corp.intel.com>

On Wed, 30 Mar 2011 12:28:11 +0100 "Czarnowska, Anna"
<anna.czarnowska@intel.com> wrote:

> >From ceb5a3431f27b5030d964567dedb0f983862b347 Mon Sep 17 00:00:00 2001
> From: Anna Czarnowska <anna.czarnowska@intel.com>
> Date: Wed, 30 Mar 2011 13:21:21 +0200
> Subject: [PATCH 1/2] Create: check for UnSet when looking at chunk
> Cc: linux-raid@vger.kernel.org, Williams, Dan J <dan.j.williams@intel.com>, Ciechanowski, Ed <ed.ciechanowski@intel.com>
> 
> A default chunk size of 0 gets modified to UnSet, so any location that
> checks for !chunk really needs to check for !(chunk || chunk == UnSet).
> 
> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
> Signed-off-by: Anna Czarnowska <anna.czarnowska@intel.com>

This and the next one both applied - thanks.

NeilBrown


> ---
>  Create.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Create.c b/Create.c
> index 9f34425..5709baf 100644
> --- a/Create.c
> +++ b/Create.c
> @@ -266,7 +266,7 @@ int Create(struct supertype *st, char *mddev,
>  					      &chunk, size*2, NULL, &newsize, verbose>=0))
>  		return 1;
>  
> -	if (chunk) {
> +	if (chunk && chunk != UnSet) {
>  		newsize &= ~(unsigned long long)(chunk*2 - 1);
>  		size &= ~(unsigned long long)(chunk - 1);
>  	}
> @@ -353,7 +353,7 @@ int Create(struct supertype *st, char *mddev,
>  		}
>  
>  		freesize /= 2; /* convert to K */
> -		if (chunk) {
> +		if (chunk && chunk != UnSet) {
>  			/* round to chunk size */
>  			freesize = freesize & ~(chunk-1);
>  		}


      reply	other threads:[~2011-04-04 23:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-30 11:28 [PATCH 1/2] Create: check for UnSet when looking at chunk Czarnowska, Anna
2011-04-04 23:32 ` 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=20110405093229.193c1585@notabene.brown \
    --to=neilb@suse.de \
    --cc=Wojciech.Neubauer@intel.com \
    --cc=anna.czarnowska@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=ed.ciechanowski@intel.com \
    --cc=linux-raid@vger.kernel.org \
    /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).