public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Randy.Dunlap" <rddunlap@osdl.org>
To: Joe <joecool1029@gmail.com>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org,
	akpm@osdl.org, greg@kroah.com
Subject: Re: Empty partition nodes not created (was device node issues with recent mm's and udev)
Date: Mon, 2 May 2005 22:16:07 -0700	[thread overview]
Message-ID: <20050502221607.0db797d2.rddunlap@osdl.org> (raw)
In-Reply-To: <d4757e600505022118131ec083@mail.gmail.com>

On Tue, 3 May 2005 00:18:05 -0400 Joe wrote:

| On 5/2/05, Randy.Dunlap <rddunlap@osdl.org> wrote:
| > Could this 2.6.11.8 -stable patch fix it?
| > Subject: [04/07] partitions/msdos.c fix
| > 
| > Joe, can you test 2.6.11.8, please?
| > 
| > ---
| > ~Randy
| > 
| 
| Randy, Can't run vanilla at the moment on this setup, any way you can
| get the patch seperate?  I also don't think that will fix it because
| this is an empty, not a msdos partition.

Yeah, I could be way off on this.  Anyway, the patch is below.

---
~Randy



------------------

Erik reports this fixes an oops on boot for him.

From: Andries Brouwer <Andries.Brouwer@cwi.nl>

A well-known kernel bug is that it guesses at the partition type and the
partitions on any disk it encounters.  This is bad because needless I/O is
done, slowing down the boot, sometimes quite a lot, especially when I/O
errors occur.  And it is bad because sometimes we guess wrong.

In other words, we need the user space command `partition', where
"partition -t dos /dev/sda" reads a DOS-type partition table.  (And
"partition /dev/sda" tries all known heuristics to decide what type of
partitioning might be present.) The two variants are: (i) partition tells
the kernel to do the partition table reading, and (ii) partition uses partx
to read the partition table and tells the kernel one-by-one about the
partitions found this way.

Since this is a fundamental change, a long transition period is needed, and
that period could start with a kernel boot parameter telling the kernel not
to do partition table parsing on a particular disk, or a particular type of
disks, or all disks.

This could have been the intro to a patch doing that, but is not.  (It is
just an RFC.)

The tiny patch below prompted the above - it was suggested by Uwe Bonnes
who encountered USB devices without partition table where our present
heuristics did not suffice to stop partition table parsing.  It causes the
kernel to ignore partitions of type 0.  A band-aid.

I think nobody uses such partitions seriously, but nevertheless this should
probably live in -mm for a while to see if anybody complains.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Chris Wright <chrisw@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---

===== fs/partitions/msdos.c 1.26 vs 1.27 =====
--- 1.26/fs/partitions/msdos.c	2004-11-09 12:43:17 -08:00
+++ 1.27/fs/partitions/msdos.c	2005-03-07 20:41:42 -08:00
@@ -114,6 +114,9 @@ parse_extended(struct parsed_partitions 
 		 */
 		for (i=0; i<4; i++, p++) {
 			u32 offs, size, next;
+
+			if (SYS_IND(p) == 0)
+				continue;
 			if (!NR_SECTS(p) || is_extended_partition(p))
 				continue;
 
@@ -430,6 +433,8 @@ int msdos_partition(struct parsed_partit
 	for (slot = 1 ; slot <= 4 ; slot++, p++) {
 		u32 start = START_SECT(p)*sector_size;
 		u32 size = NR_SECTS(p)*sector_size;
+		if (SYS_IND(p) == 0)
+			continue;
 		if (!size)
 			continue;
 		if (is_extended_partition(p)) {
-

  reply	other threads:[~2005-05-03  5:16 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <d4757e6005050219514ece0c0a@mail.gmail.com>
2005-05-03  3:14 ` Empty partition nodes not created (was device node issues with recent mm's and udev) Greg KH
2005-05-03  3:26   ` Randy.Dunlap
2005-05-03  4:18     ` Joe
2005-05-03  5:16       ` Randy.Dunlap [this message]
2005-05-06  8:04       ` Andries Brouwer
2005-05-06 16:43         ` Bryan Henderson
2005-05-03 10:55     ` Paulo Marques
2005-05-03 23:34       ` Joe
2005-05-06  8:00     ` Andries Brouwer
2005-05-06  8:10       ` Chris Wright
2005-05-06  8:43         ` Andries Brouwer
2005-05-06  9:05           ` Andrew Morton
2005-05-06 14:12             ` James Bottomley
2005-05-06 14:26               ` David Woodhouse
2005-05-06 14:34               ` Kay Sievers
2005-05-06 14:18             ` Kay Sievers
2005-05-06 15:50         ` Greg KH
2005-05-06  7:58   ` Andries Brouwer
     [not found] <3ZVNP-5cq-7@gated-at.bofh.it>
     [not found] ` <E1DTAgo-0002uD-F0@be1.7eggert.dyndns.org>
2005-05-04  3:49   ` Joe
2005-05-04  4:47     ` Grant Coady
2005-05-04 11:42     ` Bodo Eggert

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=20050502221607.0db797d2.rddunlap@osdl.org \
    --to=rddunlap@osdl.org \
    --cc=akpm@osdl.org \
    --cc=greg@kroah.com \
    --cc=joecool1029@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox