linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: Dan Williams <dan.j.williams@intel.com>
Cc: "Czarnowska, Anna" <anna.czarnowska@intel.com>,
	"linux-raid@vger.kernel.org" <linux-raid@vger.kernel.org>,
	"Neubauer, Wojciech" <Wojciech.Neubauer@intel.com>,
	"Ciechanowski, Ed" <ed.ciechanowski@intel.com>,
	"Labun, Marcin" <Marcin.Labun@intel.com>,
	"Hawrylewicz Czarnowski,
	Przemyslaw" <przemyslaw.hawrylewicz.czarnowski@intel.com>
Subject: Re: [PATCH 15/17] Monitor: more accurate size check when looking for spares
Date: Mon, 15 Nov 2010 16:32:38 +1100	[thread overview]
Message-ID: <20101115163238.0f3dd61d@notabene.brown> (raw)
In-Reply-To: <AANLkTikWs2Mb5qmY_4tMQhnr4P===W1KJvjgW9xJYVrb@mail.gmail.com>

On Tue, 9 Nov 2010 09:23:49 -0800
Dan Williams <dan.j.williams@intel.com> wrote:

> On Tue, Nov 9, 2010 at 7:43 AM, Czarnowska, Anna
> <anna.czarnowska@intel.com> wrote:
> >>
> >> Neil wondered if we can repurpose validate_geometry for this case?  It
> >> is already charged with checking if a disk is suitable to be added to
> >> an
> >> array.
> >
> > I had a look at validate_geometry and I don't think it makes sense to modify it for Monitor.
> > Validate_geometry is made for Create. When creating container validate_geometry doesn't check much for imsm. When adding to a volume all disks must be already in the same container and have some common free region. We want the check before we move a spare. And the whole spare is free (is not used by any arrays in that container). I think it is better to have smaller functions and use them as building blocks, than make a big function even more complicated for every special case.
> 
> Yes, and no :-). There is a line to be drawn between refactoring and
> adding complexity, and you are right that all things being equal
> validate_geometry() as it stands today is an awkward fit.  However,
> the architecture rework Neil is doing is coming precisely from the
> realization that we are generating lots of these special case routines
> that are doing not much more than representing the same data to
> slightly different contexts.  The conclusion to be drawn is that our
> interface from generic mdadm to the metadata handler is perhaps too
> fine grained.   Hence the refactoring and why in this case it is
> worthwhile to at least ask the question: can a routine tasked with
> validating disks are proper candidates to be added to an array /
> container be trivially re-purposed to handle the case of validating
> that a spare is suitable for an existing container?  I agree with your
> conclusion, but wanted to share why I think Neil asked the question,
> hopefully I am not putting words in his mouth.
> 
> --
> Dan


I had a proper look at the code and I think that when I said
"validate_geometry", I should have said "avail_size".

We can probably just use the one method for both 'avail_size' and
'min_acceptable_spare_size' though I'm not sure currently what it would look
like.

So I'm happy to take that patch with min_acceptable_spare_size, and I will
quite possibly revise it later.

NeilBrown
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

      reply	other threads:[~2010-11-15  5:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-29 14:26 [PATCH 15/17] Monitor: more accurate size check when looking for spares Czarnowska, Anna
2010-11-05  6:01 ` Dan Williams
2010-11-09 15:43   ` Czarnowska, Anna
2010-11-09 17:23     ` Dan Williams
2010-11-15  5:32       ` Neil Brown [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=20101115163238.0f3dd61d@notabene.brown \
    --to=neilb@suse.de \
    --cc=Marcin.Labun@intel.com \
    --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 \
    --cc=przemyslaw.hawrylewicz.czarnowski@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).