From: NeilBrown <neilb@suse.de>
To: Thomas Jarosch <thomas.jarosch@intra2net.com>
Cc: Tejun Heo <tj@kernel.org>, linux-raid@vger.kernel.org
Subject: Re: raid1 boot regression in 2.6.37 [bisected]
Date: Thu, 28 Apr 2011 11:23:28 +1000 [thread overview]
Message-ID: <20110428112328.07cf4578@notabene.brown> (raw)
In-Reply-To: <201104271700.58894.thomas.jarosch@intra2net.com>
On Wed, 27 Apr 2011 17:00:58 +0200 Thomas Jarosch
<thomas.jarosch@intra2net.com> wrote:
> On Wednesday, 27. April 2011 12:05:13 NeilBrown wrote:
> > > Thanks again for the report.
> >
> > On reflection over dinner, I think I should move the add_disk right to
> > the end just before the mutex_unlock.
> > I'm not sure it makes a big practical difference but it will be easier to
> > justify.
> >
> > So if you could test this one instead please that would be great.
> >
> > The rationale is that as soon as we call add_disk, get_gendisk will
> > return the disk rather than coming through to md_probe and blocking on
> > the mutex. So we want everything set up properly before calling
> > add_disk.
>
> Unfortunately the kernel oopses now. Attached you'll find screenshots
> of the oops. I can bring back the serial console if needed.
>
> I've double verified with "git diff" that I only have your
> latest change in the tree.
>
> Hope that helps,
> Thomas
Yes it helps, thanks.
I do need to add_disk before I kobject_init_and_add the mddev object
otherwise it will try to create something in sysfs in a non-existent
directory.
So the sysfs stuff needs to come last.
Could you try this one please?
Thanks,
NeilBrown
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 818313e..9f9fa54 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -4335,13 +4335,15 @@ static int md_alloc(dev_t dev, char *name)
disk->fops = &md_fops;
disk->private_data = mddev;
disk->queue = mddev->queue;
+ blk_queue_flush(mddev->queue, REQ_FLUSH | REQ_FUA);
/* Allow extended partitions. This makes the
* 'mdp' device redundant, but we can't really
* remove it now.
*/
disk->flags |= GENHD_FL_EXT_DEVT;
- add_disk(disk);
mddev->gendisk = disk;
+ add_disk(disk);
+
error = kobject_init_and_add(&mddev->kobj, &md_ktype,
&disk_to_dev(disk)->kobj, "%s", "md");
if (error) {
@@ -4355,8 +4357,6 @@ static int md_alloc(dev_t dev, char *name)
if (mddev->kobj.sd &&
sysfs_create_group(&mddev->kobj, &md_bitmap_group))
printk(KERN_DEBUG "pointless warning\n");
-
- blk_queue_flush(mddev->queue, REQ_FLUSH | REQ_FUA);
abort:
mutex_unlock(&disks_mutex);
if (!error && mddev->kobj.sd) {
next prev parent reply other threads:[~2011-04-28 1:23 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <201103251725.21180.thomas.jarosch@intra2net.com>
2011-03-28 7:59 ` raid1 boot regression in 2.6.37 [bisected] Tejun Heo
2011-03-28 11:02 ` Thomas Jarosch
2011-03-28 12:53 ` Thomas Jarosch
2011-03-28 15:59 ` Tejun Heo
2011-03-28 19:46 ` Thomas Jarosch
2011-03-28 19:59 ` Roberto Spadim
2011-03-29 12:06 ` Thomas Jarosch
2011-03-29 12:22 ` Roberto Spadim
2011-03-29 8:25 ` Tejun Heo
2011-03-29 9:53 ` Thomas Jarosch
2011-03-29 10:07 ` Tejun Heo
2011-03-29 11:52 ` Thomas Jarosch
2011-04-05 3:46 ` NeilBrown
2011-04-06 10:16 ` Tejun Heo
2011-04-12 14:05 ` Thomas Jarosch
2011-04-12 22:44 ` NeilBrown
[not found] ` <201104261051.09464.thomas.jarosch@intra2net.com>
2011-04-27 8:17 ` NeilBrown
2011-04-27 10:05 ` NeilBrown
[not found] ` <201104271700.58894.thomas.jarosch@intra2net.com>
2011-04-28 1:23 ` NeilBrown [this message]
2011-04-28 13:47 ` Thomas Jarosch
2011-05-02 12:17 ` Thomas Jarosch
2011-03-25 18:55 Thomas Jarosch
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=20110428112328.07cf4578@notabene.brown \
--to=neilb@suse.de \
--cc=linux-raid@vger.kernel.org \
--cc=thomas.jarosch@intra2net.com \
--cc=tj@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 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.