public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] make kernel ignore bogus partitions
@ 2006-05-03 21:00 Mike Miller (OS Dev)
  2006-05-08  7:27 ` Andries Brouwer
  2006-05-09 19:41 ` [PATCH] make kernel ignore bogus partitions Andrew Morton
  0 siblings, 2 replies; 21+ messages in thread
From: Mike Miller (OS Dev) @ 2006-05-03 21:00 UTC (permalink / raw)
  To: linux-kernel, linux-scsi; +Cc: aeb

Patch 1/1
Sometimes partitions claim to be larger than the reported capacity of a
disk device. This patch makes the kernel ignore those partitions.

Signed-off-by: Mike Miller <mike.miller@hp.com>
Signed-off-by: Stephen Cameron <steve.cameron@hp.com>

Please consider this for inclusion.


 fs/partitions/check.c |    5 +++++
 1 files changed, 5 insertions(+)

--- linux-2.6.14/fs/partitions/check.c~partition_vs_capacity	2006-01-06 09:32:14.000000000 -0600
+++ linux-2.6.14-root/fs/partitions/check.c	2006-01-06 11:24:50.000000000 -0600
@@ -382,6 +382,11 @@ int rescan_partitions(struct gendisk *di
 		sector_t from = state->parts[p].from;
 		if (!size)
 			continue;
+		if (from+size-1 > get_capacity(disk)) {
+			printk(" %s: p%d exceeds device capacity, ignoring.\n", 
+				disk->disk_name, p);
+			continue;
+		}
 		add_partition(disk, p, from, size);
 #ifdef CONFIG_BLK_DEV_MD
 		if (state->parts[p].flags)

_


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2006-10-30 21:48 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-03 21:00 [PATCH] make kernel ignore bogus partitions Mike Miller (OS Dev)
2006-05-08  7:27 ` Andries Brouwer
2006-05-08 15:00   ` Douglas Gilbert
2006-05-08 15:33   ` David Greaves
2006-05-08 20:20     ` Jan Engelhardt
2006-05-08 20:46       ` reiser4 bug [was Re: 2.6.17-rc3-mm1] Alexander Gran
2006-05-08 23:21         ` Joe Feise
2006-05-09  0:13           ` Alexander Gran
2006-05-09 19:41 ` [PATCH] make kernel ignore bogus partitions Andrew Morton
2006-05-09 22:48   ` Andries Brouwer
2006-05-11 11:00     ` Andrew Morton
2006-05-11 11:51       ` Andries Brouwer
2006-05-11 16:04         ` Mike Miller (OS Dev)
2006-05-11 23:08         ` Daniel Barkalow
2006-05-12 10:32           ` Jan Engelhardt
2006-10-30 19:45             ` Phillip Susi
2006-10-30 21:48               ` Christian Schmidt
2006-05-11 21:47       ` Mike Miller (OS Dev)
2006-05-11 16:17   ` Mike Miller (OS Dev)
2006-05-11 16:27     ` Andrew Morton
2006-05-11 17:09       ` Alan Cox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox