diff options
author | OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> | 2010-03-23 13:35:50 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-04-01 15:58:44 -0700 |
commit | 2a3046b3ac262a2af01b857071401200f876da65 (patch) | |
tree | 5916f9444d67ed0d53accafc354393abfc6e450b /fs/partitions | |
parent | 1abac82345f0b5e8505964854730ee4551926ac0 (diff) |
fs/partition/msdos: fix unusable extended partition for > 512B sector
commit 8e0cc811e0f8029a7225372fb0951fab102c012f upstream.
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>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
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 b78385840a5..90be97f1f5a 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) if (!size) continue; if (is_extended_partition(p)) { - /* prevent someone doing mkfs or mkswap on an - extended partition, but leave room for LILO */ - put_partition(state, slot, start, size == 1 ? 1 : 2); + /* + * prevent someone doing mkfs or mkswap on an + * extended partition, but leave room for LILO + * FIXME: this uses one logical sector for > 512b + * sector, although it may not be enough/proper. + */ + sector_t n = 2; + n = min(size, max(sector_size, n)); + put_partition(state, slot, start, n); + printk(" <"); parse_extended(state, bdev, start, size); printk(" >"); |