From mboxrd@z Thu Jan 1 00:00:00 1970 From: NeilBrown Subject: Re: [PATCH 1/2] Create: check for UnSet when looking at chunk Date: Tue, 5 Apr 2011 09:32:29 +1000 Message-ID: <20110405093229.193c1585@notabene.brown> References: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-raid-owner@vger.kernel.org To: "Czarnowska, Anna" Cc: "linux-raid@vger.kernel.org" , "Williams, Dan J" , "Ciechanowski, Ed" , "Neubauer, Wojciech" List-Id: linux-raid.ids On Wed, 30 Mar 2011 12:28:11 +0100 "Czarnowska, Anna" wrote: > >From ceb5a3431f27b5030d964567dedb0f983862b347 Mon Sep 17 00:00:00 2001 > From: Anna Czarnowska > 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 , Ciechanowski, Ed > > 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 > Signed-off-by: Anna Czarnowska 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); > }