diff options
author | Stephen Powell <zlinuxman@wowway.com> | 2010-05-08 09:39:24 +0200 |
---|---|---|
committer | Jim Meyering <meyering@redhat.com> | 2011-02-23 10:30:59 +0100 |
commit | 2e9383d725482188e47f35df368604a813ea16f8 (patch) | |
tree | 59a6a8e0864685d3118e020245ea92b5b75ac264 /libparted/labels/fdasd.c | |
parent | 52e1fdf3849c60a35e90e644ffcee4fa31aab5ac (diff) | |
download | parted-2e9383d725482188e47f35df368604a813ea16f8.tar.gz |
s390: improve/correct DASD support
The long title would be "corrections to partition size and location
calculations for type 1 partitions for s390 dasd".
This could be treated as two separate fixes, one to make corrections
for LDL formatted disks and one to add support for CMS formatted
disks. I see CMS formatted disks as a variant of LDL formatted
disks, with the additional twist that CMS formatted disks can
be reserved or recomped, which LDL formatted disks cannot be.
This affects the size and location of the partition.
With these patches, parted matches the behavior of the Linux kernel
in recognizing partitions on CMS- and LDL-formatted disks, as documented
in the Linux kernel source code in routine fs/partitions/ibm.c.
Calculation of the metadata has also been changed so that parted will
show no free space on such a disk. In some cases there are now two
non-contiguous metadata extents: one at the beginning of the disk and
one at the end.
As before, parted only supports CKD DASD using the ECKD driver.
FBA DASD and CKD DASD using the DIAG driver are still not supported.
In my regression testing I have discovered some problems in the area
of recognizing file system options. However, since I can duplicate
these errors on a version of parted which does not contain my changes,
I have concluded that my changes did not cause this and therefore
this is an unrelated bug.
Diffstat (limited to 'libparted/labels/fdasd.c')
-rw-r--r-- | libparted/labels/fdasd.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/libparted/labels/fdasd.c b/libparted/labels/fdasd.c index 6397f27..62baa52 100644 --- a/libparted/labels/fdasd.c +++ b/libparted/labels/fdasd.c @@ -698,15 +698,15 @@ fdasd_valid_vtoc_pointer(fdasd_anchor_t *anc, unsigned long b, int fd) /* VOL1 label contains valid VTOC pointer */ vtoc_read_label (fd, b, NULL, anc->f4, NULL, NULL); - if (anc->f4->DS4IDFMT != 0xf4) { - if (strncmp(anc->vlabel->volkey,vtoc_ebcdic_enc("LNX1",str,4),4) == 0) - return 0; - fdasd_error(anc, wrong_disk_format, _("Invalid VTOC.")); - } else { + if (anc->f4->DS4IDFMT == 0xf4) { fdasd_process_valid_vtoc (anc, b, fd); + return 0; } + if (strncmp(anc->vlabel->volkey, vtoc_ebcdic_enc("LNX1",str,4),4) == 0 || + strncmp(anc->vlabel->volkey, vtoc_ebcdic_enc("CMS1",str,4),4) == 0) + return 0; - return 0; + fdasd_error(anc, wrong_disk_format, _("Invalid VTOC.")); } /* @@ -737,7 +737,8 @@ fdasd_check_volume (fdasd_anchor_t *anc, int fd) } else { return 1; } - } else if (strncmp (v->volkey, vtoc_ebcdic_enc ("LNX1", str, 4), 4) == 0) { + } else if (strncmp (v->volkey, vtoc_ebcdic_enc ("LNX1", str, 4), 4) == 0 || + strncmp (v->volkey, vtoc_ebcdic_enc ("CMS1", str, 4), 4) == 0) { return 0; } |