bug-parted
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug] mkpartfs (really this time)


From: Neal H Walfield
Subject: [bug] mkpartfs (really this time)
Date: Sun, 5 Aug 2001 02:49:10 +0200
User-agent: Mutt/1.3.18i

This is the bug against mkpartfs.  The last one should have been called
``[bug] extended partition'' or something like that.  Oops.

Anyway.  If you try to create an extended partition using mkpartfs,
partfs will try to do it but assert out:


        address@hidden:~/parted-1.5.3/build (0)$ parted/parted /tmp/bar
        GNU Parted 1.5.3
        EXPERIMENTAL RELEASE - DO NOT USE ON VALUABLE DATA!!!

        [ chop ]

        Using /tmp/bar
        (parted) print
        Disk geometry for /tmp/bar: 0.000-10.000 megabytes
        Disk label type: msdos
        Minor    Start       End     Type      Filesystem  Flags
        1          0.016      1.000  primary   ext2        
        2          1.000      2.000  primary   ext2        
        3          2.000      3.000  primary   ext2        
        (parted) mkpartfs
        Partition type? extended
        Start? 3
        End? 9.99
        You found a bug in GNU Parted.  Please email a bug report to 
address@hidden containing the version (1.5.3), and the following message:
        
        Assertion (type != NULL) at ../../libparted/filesys.c:288 in function
        ped_file_system_create() failed.
        Ignore/Cancel? c
        (parted) quit
        address@hidden:~/parted-1.5.3/build (0)$

Taking a look at the code:

static int
do_mkpartfs (PedDevice** dev)
{

        [ chop ]

        if (!command_line_get_new_part_type (_("Partition type?"), disk,
                                             &part_type))
                goto error_destroy_disk;

        if (part_type == PED_PARTITION_EXTENDED) {
                fs_type = NULL;
        } else {
                fs_type = command_line_get_fs_type (_("File system type?"),
                                                    def_type);
                if (!fs_type)
                        goto error_destroy_constraint;
        }

        if (!command_line_get_sector (_("Start?"), 0, &start))
                goto error_destroy_constraint;

We should not set fs_type to NULL.  Instead, we should error out.  This
triggers the assert a few lines later when we call
ped_file_system_create.

Cheers.

Attachment: pgpKBUh4_eca1.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]