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

Bug#283303: [sparc] partman breaks the partition table when swap partition is first on the disk



On Sun, Dec 12, 2004 at 09:30:49PM -0500, Jurij Smakov wrote:
> 
> The functions are nearly identical, except for one essential difference: 
> the do_mkfs() function (which actually works) calls ped_file_system_close()
> on the newly created filesystem and ped_disk_commit() on the disk, where
> the filesystem was created. The parted_server's function does NOT do that.

Yes, this is a crucial difference in the way parted and partman work.
Parted writes everything to disk after each operation and partman
doesn't.

> So, as experiment, I've modified it, according to the patch below:

> --- partman-61/parted_server.c  2004-09-28 20:08:40.000000000 -0400
> +++ partman/parted_server.c     2004-12-12 21:22:43.975091672 -0500
> @@ -1621,7 +1621,10 @@
>                  critical_error("Bad file system type: %s", s_fstype);
>          ped_partition_set_system(part, fstype);
>          deactivate_exception_handler();
> -        fs = timered_file_system_create(&(part->geom), fstype);
> +        if ((fs = timered_file_system_create(&(part->geom), fstype)) != 
> NULL) {
> +               ped_file_system_close(fs);
> +               ped_disk_commit(disk);
> +       }
>          activate_exception_handler();
>          oprintf("OK\n");
>          if (fs != NULL)

Hm, the parted manual was not clear whether the new file system data
structure has to be closed so this can be the problem.

Can you try whether this works if you remove the ped_disk_commit
command?

Anton Zinoviev





Reply to: