mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Alexandre Oliva <aoliva@redhat.com>
Cc: linux-kernel@vger.kernel.org, neilb@suse.de
Subject: Re: let md auto-detect 128+ raid members, fix potential race condition
Date: Sun, 30 Jul 2006 14:21:37 -0700	[thread overview]
Message-ID: <20060730142137.b1789aff.akpm@osdl.org> (raw)
In-Reply-To: <orac6qerr4.fsf@free.oliva.athome.lsd.ic.unicamp.br>

On Sun, 30 Jul 2006 17:56:31 -0300
Alexandre Oliva <aoliva@redhat.com> wrote:

> On Jul 30, 2006, Andrew Morton <akpm@osdl.org> wrote:
> 
> > On Sun, 30 Jul 2006 03:56:21 -0300
> > Alexandre Oliva <aoliva@redhat.com> wrote:
> 
> >> -void md_autodetect_dev(dev_t dev);
> >> +int md_register_autodetect_dev(dev_t dev);
> 
> > Put it in a header file, please.
>  
> AFAICT it really isn't supposed to be used elsewhere.  I suppose I
> could add it to either blkdev.h, fs.h or raid/md.h, since it's more of
> glue code between two modules than something that belongs to one
> specific module.  E.g., if it goes in raid/md.h, where it feels the
> most appropriate, then fs/parititions/check.c has to include it, which
> doesn't sound right.  OTOH, if it goes in blkdev.h or fs.h, then a lot
> of code ends up seeing the declaration that shouldn't be available.
> Thoughts?

If the function is exported by md then md.h would be an appropriate place
for the declaration.

> Maybe we could replace this with some register/unregister notifier
> interface, such that add_partitions() could then notify multiple
> watchers when a new partition is configured.  This would remove the
> backwards dependency here, but I feel it should be done in a separate
> patch.  I don't mind if they're integrated at once, but I don't feel
> that changing two unrelated issues at once is a good approach.

If we went that way then patch #1 would be "add a notifier" and patch #2
would be "use it in md".

Do we anticipate that there would ever be other users of this notifier
callback API?

> >> #ifdef CONFIG_BLK_DEV_MD
> >> -		if (state->parts[p].flags)
> >> -			md_autodetect_dev(bdev->bd_dev+p);
> >> +		if (state->parts[p].flags
> >> +		    && md_register_autodetect_dev(bdev->bd_dev+p))
> >> +			printk(KERN_ERR "md: out of memory registering %s%d\n",
> >> +			       disk->disk_name, p);
> >> #endif
> 
> > What happens if CONFIG_BLK_DEV_MD=m?
> 
> AFAIK then you'd get a link failure.  One more reason to go with the
> notifier approach, I guess.  It wouldn't quite enable md to
> auto-detect from partitions set up before the module was loaded, but
> it would at least remove this presumed link error.
> 
> Another approach would be to split the autodetect stuff out of md.c
> into a separate file that goes in the main kernel image (if
> CONFIG_MD=y, it's never m) even if CONFIG_BLK_DEV_MD=m.  Would this be
> a desirable arrangement?

I guess it sounds logical, but I'm not sure what the end result would look
like.  Which amounts to noncommittal Sunday afternoon waffling ;)

The notifier certainly makes sense if we anticipate other users of it.  If
we think it'll always be an md-special thing then yeah, I guess we can code
it that way.

  reply	other threads:[~2006-07-30 21:21 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-30  6:56 Alexandre Oliva
2006-07-30 19:41 ` Andrew Morton
2006-07-30 20:56   ` Alexandre Oliva
2006-07-30 21:21     ` Andrew Morton [this message]
2006-07-30 23:20     ` Neil Brown
2006-07-31 16:34       ` Helge Hafting
2006-07-31 20:27       ` Alexandre Oliva
2006-07-31 21:48         ` David Greaves
2006-08-01  2:20           ` Alexandre Oliva
2006-08-01  8:28             ` Michael Tokarev
2006-08-01 21:24               ` Alexandre Oliva
2006-08-01  1:19         ` Neil Brown
2006-08-01  2:35           ` Alexandre Oliva
2006-08-01  3:33             ` Alexandre Oliva
2006-08-01 20:46               ` Alexandre Oliva
2006-08-02  6:37                 ` Luca Berra
2006-08-01 17:40       ` Bill Davidsen
2006-08-01 21:32         ` Alexandre Oliva
2006-08-02  6:47           ` Luca Berra
2006-08-02 16:47           ` Bill Davidsen

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=20060730142137.b1789aff.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=aoliva@redhat.com \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome