From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>,
Daniel Taylor <Daniel.Taylor@wdc.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] fs/partition/msdos: Fix unusable extended partition for > 512B sector
Date: Thu, 11 Mar 2010 00:51:35 +0900 [thread overview]
Message-ID: <87sk88w4xk.fsf_-_@devron.myhome.or.jp> (raw)
In-Reply-To: <87wrxkw52s.fsf_-_@devron.myhome.or.jp> (OGAWA Hirofumi's message of "Thu, 11 Mar 2010 00:48:27 +0900")
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>
next prev parent reply other threads:[~2010-03-10 15:51 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-02-25 3:17 [PATCH] msdos: add support for large disks Daniel Taylor
2010-03-01 22:13 ` Andrew Morton
2010-03-03 14:02 ` OGAWA Hirofumi
2010-03-03 22:50 ` Daniel Taylor
2010-03-03 23:05 ` H. Peter Anvin
2010-03-03 23:24 ` Daniel Taylor
2010-03-04 0:17 ` H. Peter Anvin
2010-03-04 9:18 ` OGAWA Hirofumi
2010-03-04 15:29 ` H. Peter Anvin
2010-03-07 10:59 ` OGAWA Hirofumi
2010-03-07 23:03 ` H. Peter Anvin
2010-03-08 0:09 ` OGAWA Hirofumi
2010-03-08 0:12 ` H. Peter Anvin
2010-03-08 9:36 ` OGAWA Hirofumi
2010-03-10 15:48 ` [PATCH 1/2] fs/partitions/msdos: " OGAWA Hirofumi
2010-03-10 15:51 ` OGAWA Hirofumi [this message]
2010-03-10 23:16 ` [PATCH 2/2] fs/partition/msdos: Fix unusable extended partition for > 512B sector Daniel Taylor
2010-03-11 11:57 ` OGAWA Hirofumi
2010-03-11 21:25 ` Daniel Taylor
2010-03-11 21:58 ` H. Peter Anvin
2010-03-11 22:06 ` Daniel Taylor
2010-03-11 22:09 ` H. Peter Anvin
2010-03-12 23:44 ` Andrew Morton
2010-03-11 22:17 ` OGAWA Hirofumi
2010-03-11 22:27 ` H. Peter Anvin
2010-03-11 22:40 ` OGAWA Hirofumi
2010-03-10 23:12 ` [PATCH 1/2] fs/partitions/msdos: add support for large disks Daniel Taylor
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sk88w4xk.fsf_-_@devron.myhome.or.jp \
--to=hirofumi@mail.parknet.co.jp \
--cc=Daniel.Taylor@wdc.com \
--cc=akpm@linux-foundation.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®