]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
[PATCH] add partitions-msdosc.patch
authorchrisw@osdl.org <chrisw@osdl.org>
Thu, 7 Apr 2005 16:56:34 +0000 (09:56 -0700)
committerGreg KH <gregkh@suse.de>
Thu, 12 May 2005 05:16:08 +0000 (22:16 -0700)
queue/partitions-msdosc.patch [new file with mode: 0644]

diff --git a/queue/partitions-msdosc.patch b/queue/partitions-msdosc.patch
new file mode 100644 (file)
index 0000000..24f67ef
--- /dev/null
@@ -0,0 +1,66 @@
+From erik@debian.franken.de
+Date: Thu, 07 Apr 2005 17:14:22 +0200
+From: Erik Tews <erik@debian.franken.de>
+To: Chris Wright <chrisw@osdl.org>
+Subject: [PATCH] partitions/msdos.c fix
+
+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>
+---
+
+===== 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)) {