• Andries E. Brouwer's avatar
    [PATCH] partitions/msdos.c fix · 909c3178
    Andries E. Brouwer authored
    A well-known kernel bug is that it guesses at the partition type and the
    partitions on any disk it encounters.  This is bad because needless I/O is
    done, slowing down the boot, sometimes quite a lot, especially when I/O
    errors occur.  And it is bad because sometimes we guess wrong.
    
    In other words, we need the user space command `partition', where
    "partition -t dos /dev/sda" reads a DOS-type partition table.  (And
    "partition /dev/sda" tries all known heuristics to decide what type of
    partitioning might be present.) The two variants are: (i) partition tells
    the kernel to do the partition table reading, and (ii) partition uses partx
    to read the partition table and tells the kernel one-by-one about the
    partitions found this way.
    
    Since this is a fundamental change, a long transition period is needed, and
    that period could start with a kernel boot parameter telling the kernel not
    to do partition table parsing on a particular disk, or a particular type of
    disks, or all disks.
    
    This could have been the intro to a patch doing that, but is not.  (It is
    just an RFC.)
    
    The tiny patch below prompted the above - it was suggested by Uwe Bonnes
    who encountered USB devices without partition table where our present
    heuristics did not suffice to stop partition table parsing.  It causes the
    kernel to ignore partitions of type 0.  A band-aid.
    
    I think nobody uses such partitions seriously, but nevertheless this should
    probably live in -mm for a while to see if anybody complains.
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    909c3178
msdos.c 12.7 KB