linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell King <rmk@arm.linux.org.uk>
To: Alexander Viro <viro@math.psu.edu>
Cc: Mikael Pettersson <mikpe@csd.uu.se>, linux-kernel@vger.kernel.org
Subject: Re: initrd breakage in 2.5.38-2.5.40
Date: Thu, 3 Oct 2002 13:12:41 +0100	[thread overview]
Message-ID: <20021003131240.B2304@flint.arm.linux.org.uk> (raw)
In-Reply-To: <Pine.GSO.4.21.0210030702500.13480-100000@weyl.math.psu.edu>; from viro@math.psu.edu on Thu, Oct 03, 2002 at 07:07:21AM -0400

On Thu, Oct 03, 2002 at 07:07:21AM -0400, Alexander Viro wrote:
> On Thu, 3 Oct 2002, Mikael Pettersson wrote:
> 
> > First I thought the problem was caused by a apparently missing
> > set_capacity() call in 2.5.38's drivers/block/rd.c:
> 
> I _really_ doubt it - check the loop just above the add_disk() one.
> set_capacity() call is done there, repeating it won't change anything.

My mtdblock problems are probably related to this, so I'll followup here.

mtdblock registers its gendisk structure in its open() method.
Unfortunately, do_open wants to obtain this structure before
the open() method (but doesn't use it.)

This patch trivially re-orders stuff to work, and works for me
(with mtdblock.)

--- orig/fs/block_dev.c	Thu Oct  3 12:46:08 2002
+++ linux/fs/block_dev.c	Thu Oct  3 13:08:10 2002
@@ -631,7 +631,7 @@
 	}
 	if (bdev->bd_contains == bdev) {
 		int part;
-		struct gendisk *g = get_gendisk(bdev->bd_dev, &part);
+		struct gendisk *g;
 
 		if (!bdev->bd_queue) {
 			struct blk_dev_struct *p = blk_dev + major(dev);
@@ -645,6 +645,7 @@
 			if (ret)
 				goto out2;
 		}
+		g = get_gendisk(bdev->bd_dev, &part);
 		if (!bdev->bd_openers) {
 			struct backing_dev_info *bdi;
 			sector_t sect = 0;

-- 
Russell King (rmk@arm.linux.org.uk)                The developer of ARM Linux
             http://www.arm.linux.org.uk/personal/aboutme.html


  parent reply	other threads:[~2002-10-03 12:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-03 11:00 initrd breakage in 2.5.38-2.5.40 Mikael Pettersson
2002-10-03 11:07 ` Alexander Viro
2002-10-03 11:52   ` Mikael Pettersson
2002-10-03 14:37     ` Alexander Viro
2002-10-03 12:12   ` Russell King [this message]
2002-10-03 14:40     ` Alexander Viro
2002-10-07 12:52 Mikael Pettersson

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=20021003131240.B2304@flint.arm.linux.org.uk \
    --to=rmk@arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikpe@csd.uu.se \
    --cc=viro@math.psu.edu \
    /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).