diff options
author | OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> | 2010-03-23 16:35:50 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-03-24 19:31:22 -0400 |
commit | 8e0cc811e0f8029a7225372fb0951fab102c012f (patch) | |
tree | 05fa64ca2e4f5087552a799fcea899a40dd9e19a /fs/partitions | |
parent | 3fbf586cf7f245392142e5407c2a56f1cff979b6 (diff) |
fs/partition/msdos: fix unusable extended partition for > 512B sector
Smaller size than a minimum blocksize can't be used, after all it's
handled like 0 size.
For extended partition itself, this makes sure to use bigger size than one
logical sector size at least.
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Cc: Daniel Taylor <Daniel.Taylor@wdc.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/partitions')
-rw-r--r-- | fs/partitions/msdos.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/partitions/msdos.c b/fs/partitions/msdos.c index b78385840a55..90be97f1f5a8 100644 --- a/fs/partitions/msdos.c +++ b/fs/partitions/msdos.c | |||
@@ -492,9 +492,16 @@ int msdos_partition(struct parsed_partitions *state, struct block_device *bdev) | |||
492 | if (!size) | 492 | if (!size) |
493 | continue; | 493 | continue; |
494 | if (is_extended_partition(p)) { | 494 | if (is_extended_partition(p)) { |
495 | /* prevent someone doing mkfs or mkswap on an | 495 | /* |
496 | extended partition, but leave room for LILO */ | 496 | * prevent someone doing mkfs or mkswap on an |
497 | put_partition(state, slot, start, size == 1 ? 1 : 2); | 497 | * extended partition, but leave room for LILO |
498 | * FIXME: this uses one logical sector for > 512b | ||
499 | * sector, although it may not be enough/proper. | ||
500 | */ | ||
501 | sector_t n = 2; | ||
502 | n = min(size, max(sector_size, n)); | ||
503 | put_partition(state, slot, start, n); | ||
504 | |||
498 | printk(" <"); | 505 | printk(" <"); |
499 | parse_extended(state, bdev, start, size); | 506 | parse_extended(state, bdev, start, size); |
500 | printk(" >"); | 507 | printk(" >"); |