lkml.org 
[lkml]   [2010]   [Mar]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/2] fs/partition/msdos: Fix unusable extended partition for > 512B sector
Date
We can drop this patch, if we want to delay until someone notice this
and have some real requests to this.




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>
---

fs/partitions/msdos.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)

diff -puN fs/partitions/msdos.c~part-support-4k-block-fix fs/partitions/msdos.c
--- linux-2.6/fs/partitions/msdos.c~part-support-4k-block-fix 2010-03-08 20:11:39.000000000 +0900
+++ linux-2.6-hirofumi/fs/partitions/msdos.c 2010-03-08 20:32:19.000000000 +0900
@@ -492,9 +492,16 @@ int msdos_partition(struct parsed_partit
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(" >");
_
--
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>


\
 
 \ /
  Last update: 2010-03-10 16:53    [W:0.095 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site