lkml.org 
[lkml]   [2010]   [Mar]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[083/116] fs/partition/msdos: fix unusable extended partition for > 512B sector
    2.6.32-stable review patch.  If anyone has any objections, please let us know.

    ------------------

    From: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>

    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>

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

    --- a/fs/partitions/msdos.c
    +++ b/fs/partitions/msdos.c
    @@ -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(" >");



    \
     
     \ /
      Last update: 2010-03-31 01:51    [W:4.016 / U:0.012 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site