[Top][All Lists]

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

Re: [RFC/PATCH 0/2] support for CMS-formatted disks on the s/390 archite

From: Jim Meyering
Subject: Re: [RFC/PATCH 0/2] support for CMS-formatted disks on the s/390 architecture
Date: Wed, 21 Apr 2010 19:01:23 +0200

Stephen Powell wrote:
>> My goal is to write a portable shell script that triggers
>> the flaw, and use that to show your fix solves the problem.
> I'm working on that, and I will have something for you shortly,
> but in the mean time I've been doing some regression testing, and
> I have discovered a problem.  It seems my fix is not quite
> complete.  But I'm not sure what to do about it.  I need the
> assistance of a real C programmer again.  (Believe it or not, I
> am an experienced programmer.  I know s390 assembler language,
> PL/I, and FORTRAN well.  I just don't know C.  Arrg!)  Anyway,
> here's the problem.  I get an error message about overlapping
> partitions for non-reserved CMS disks or LDL disks with a
> block size less than 4096.  Here's some example output:
> ----------
> debian3:~# parted /dev/dasde print
> Error: can't have overlapping partitions.  <--------------.
> Model: IBM S390 DASD drive (dasd)                         |
> Disk /dev/dasde: 645kB                                    |
> Sector size (logical/physical): 512B/2048B                |
> Partition Table: dasd                                     |
>                                                           |
> Number  Start  End    Size   File system  Flags           |
>  1      6144B  645kB  639kB  ext2                         |
>                                                           |
> debian3:~#                                                |
>                                                           |
> ----------                                                |
>                                                           |
> Notice the first line of output.  ------------------------'
> This example is for an ldl format disk with a block size of 2048.
> The problem seems to be that the pseudo-vtoc overlaps with
> the implicit partition.  In libparted/labels/dasd.c,
> in subroutine dasd_alloc_metadata, we have the statement
>    if (disk_specific->format_type == 1)
>            vtoc_end = 23;

Is there a formal specification somewhere for this format?
I'm wondering if the VTOC size varies depending on the block size.
I suspect that 24 is the smallest valid starting sector number
or a partition in an LDL-formatted table.

> Originally, the "start" variable was hard coded as 24; so

When iterating over partitions, "start" is set to the
starting sector number of each.  Thus, unless you're
guaranteed somehow that the first partition always starts
at the lowest possible sector, you don't really want to use
the partition starting sector number here.

If you really do want to use the start sector of partition #1,
we can pursue that separately.

If there's not a specification, can you deduce what vtoc_end
must be for a 2048-byte block size by looking at what other tools do?

reply via email to

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