Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks

2010-12-17 Thread Stephen Powell
On Thu, 16 Dec 2010 07:30:14 -0500 (EST), Jim Meyering wrote:
> Stephen Powell wrote:
>> ... do you have an s390 environment in which to test?
> 
> Yes, if an s390x will do.  On one, uname -a reports this:
> Linux xxx 2.6.32-19.el6.s390x #1 SMP Tue Mar 9 19:03:48 EST 2010 s390x s390x 
> s390x GNU/Linux

I am treating s390 and s390x as synonymous for purposes of this discussion.
In fact, in Debian, the implementation is a hybrid one.  The kernel space
is 64-bit (runs an s390x kernel) but the user space is 31-bit (uses s390
packages in 31-bit mode).

>> Does it have both CKD and FBA DASD?
>> Does it run as a guest under z/VM?  Does your
>> system have the DIAG driver?  Do you have
>> access to a CMS system from which you can FORMAT and/or
>> RESERVE the disks in CMS format?  The answer might not be
>> "yes" to all those questions, and getting such an environment
>> will take time.
> 
> I don't know, for any of the above.
> If you describe how to determine the answer
> in a way that is easy to automate, the goal
> would be to run a script that checks for required
> pieces and then runs whichever tests it can.

You can tell what the DASD type is by a combination of

   cat /proc/dasd/devices

and poking around in the sysfs file system.  For example:

   st...@debian3:~$ cat /proc/dasd/devices
   0.0.0200(DIAG) at ( 94: 0) is dasda   : active at blocksize: 4096, 
54 blocks, 2109 MB
   0.0.0201(ECKD) at ( 94: 4) is dasdb   : active at blocksize: 4096, 
13500 blocks, 52 MB
   0.0.0202(DIAG) at ( 94: 8) is dasdc   : active at blocksize: 4096, 
9 blocks, 351 MB
   0.0.0203(DIAG) at ( 94:12) is dasdd   : active at blocksize: 4096, 
9 blocks, 351 MB
   st...@debian3:~$

(The output of the above command shows devices that are online, but not
necessarily mounted.)  The output shows the correspondence between s390
device numbers (0.0., where  is the hex device number), kernel-space
major and minor device numbers, user-space block special file names
(/dev/dasda, etc.) and drivers (dasd_eckd_mod, dasd_fba_mod, dasd_diag_mod).
It also shows the effective block size, number of blocks, and size in MB.
In the above example, three of the four DASD devices are using the DIAG
driver and one is using the ECKD driver.  If the ECKD driver is being used,
it is CKD DASD.  If the FBA driver is being used, it is FBA DASD.  If the
DIAG driver is being used, it could be either CKD or FBA DASD.  You can't
tell from here.  For that, you need to probe the sysfs pseudo file system.
For example:

   st...@debian3:~$ cat /sys/bus/ccw/devices/0.0.0200/devtype
   3390/0a
   st...@debian3:~$

If the first four characters of output are 3370 or 9336, it's FBA DASD.
Otherwise, it's CKD DASD.

Make sure that your Linux kernel contains the FBA patch.  Look at fs/partitions/
ibm.c, C function ibm_partition.  About 40 lines down from the beginning
of the function, you should see logic similar to the following:

   /*
* Special case for FBA disks: label sector does not depend on
* blocksize.
*/
   if ((info->cu_type == 0x6310 && info->dev_type == 0x9336) ||
   (info->cu_type == 0x3880 && info->dev_type == 0x3370))
   labelsect = info->label_block;
   else
   labelsect = info->label_block * (blocksize >> 9);

If that code isn't in there, you will need to update your kernel.  If your
kernel doesn't have this fix, then parted and the Linux kernel will report
different starting sector numbers and number of sectors for FBA DASD in CMS
RESERVED format under certain conditions, and the kernel will be wrong
and parted will be right!  See Debian bug report 582281
(http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=582281) for details.

If I recall correctly, upstream kernel source 2.6.32-20 was the first
to add this fix; so I don't know about your 2.6.32-19.el6.s390x
distribution kernel.  Unless it contains distribution specific patches
to fix this problem, it probably won't work right.

The basic testing idea is to compare the starting sector number and
number of sectors for the partition as reported by parted and
the starting sector number and number of sectors reported by the
Linux kernel via the sysfs file system.  You can also compare parted's
reported file system type vs. what is reported by "mount" (if the
partition is mounted) or "cat /proc/swaps" (if the partition is an
active swap partition).  For example, on my "debian3" test system,
I have four DASD devices, all 3390 minidisks, formatted by CMS with
a blocksize of 4096, and processed with the CMS RESERVE command.
The number of cylinders varies from one disk to another:

   st...@debian3:~$ su
   Password: 
   debian3:/home/steve# cd
   debian3:~# parted /dev/dasda unit s print free
   Model: IBM S390 DASD drive (dasd)
   Disk /dev/dasda: 432s
   Sector size (logical/physical): 512B/4096B
   Partition Table: dasd

   Number  Start  End   Size  File System  Flags
1  4552s  4319991s  4315440s  ex

Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks

2010-12-16 Thread Jim Meyering
Stephen Powell wrote:
> On Tue, 14 Dec 2010 10:46:18 -0500 (EST), Jim Meyering wrote:
>> Stephen Powell wrote:
>>> How is your testing going?
>>
>> Finding time for parted has been a challenge recently.
>>>
>>> It's unclear to me from what you wrote.  Are you asking me
>>> to provide a test case?
>>
>> If you can, that'd be great and would accelerate the process.
>> I would no longer have an excuse not to push your patches.
>> I nearly pushed without a test case, but your changes are
>> large enough that I cannot do that in good conscience.
>>
>> I didn't want to require you to write a test, but in the end
>> my time constraints appear to be having the same effect.
>> Sorry about that.
>
> Hmm.  Well, as I see it, there are two main options.  I can
> write a test script, providing you with expected output,

Thanks for persevering.

> and you can run it too, checking to see that it produces the
> same output for you.  On the plus side, you testing it
> yourself gives you the maximum assurances that it is correct.
> On the minus side, you have to be able to reproduce my
> testing environment.  For example, do you have an s390
> environment in which to test?

Yes, if an s390x will do.  On one, uname -a reports this:
Linux xxx 2.6.32-19.el6.s390x #1 SMP Tue Mar 9 19:03:48 EST 2010 s390x s390x 
s390x GNU/Linux

> Does it have both CKD and FBA DASD?
> Does it run as a guest under z/VM?  Does your
> system have the DIAG driver?  Do you have
> access to a CMS system from which you can FORMAT and/or
> RESERVE the disks in CMS format?  The answer might not be
> "yes" to all those questions, and getting such an environment
> will take time.

I don't know, for any of the above.
If you describe how to determine the answer
in a way that is easy to automate, the goal
would be to run a script that checks for required
pieces and then runs whichever tests it can.

> The other option is for me to test it for you.  On the plus
> side, that requires less time on your part.  On the minus
> side, I will need a copy of the exact source code that you
> are using (which also carries a side benefit in that I will
> get to see if my patches applied to your source as expected.)
> Another minus is that you have to take my word for it, which
> is not as reassuring to you.  Which option do you choose?
> Or do you have a third option in mind?

The best is to put into version control some script
that someone with the right equipment can run via "make check"
(probably with a couple envvars specifying things that cannot
or must not be guessed, like the name of a partition to clobber,
or a device to format).

But if it's really not feasible, I'm sure we'll find a reasonable
middle ground.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks

2010-12-16 Thread Stephen Powell
On Tue, 14 Dec 2010 10:46:18 -0500 (EST), Jim Meyering wrote:
> Stephen Powell wrote:
>> How is your testing going?
> 
> Finding time for parted has been a challenge recently.
>>
>> It's unclear to me from what you wrote.  Are you asking me
>> to provide a test case?
> 
> If you can, that'd be great and would accelerate the process.
> I would no longer have an excuse not to push your patches.
> I nearly pushed without a test case, but your changes are
> large enough that I cannot do that in good conscience.
> 
> I didn't want to require you to write a test, but in the end
> my time constraints appear to be having the same effect.
> Sorry about that.

Hmm.  Well, as I see it, there are two main options.  I can
write a test script, providing you with expected output,
and you can run it too, checking to see that it produces the
same output for you.  On the plus side, you testing it
yourself gives you the maximum assurances that it is correct.
On the minus side, you have to be able to reproduce my
testing environment.  For example, do you have an s390
environment in which to test?  Does it have both CKD and
FBA DASD?  Does it run as a guest under z/VM?  Does your
system have the DIAG driver?  Do you have
access to a CMS system from which you can FORMAT and/or
RESERVE the disks in CMS format?  The answer might not be
"yes" to all those questions, and getting such an environment
will take time.

The other option is for me to test it for you.  On the plus
side, that requires less time on your part.  On the minus
side, I will need a copy of the exact source code that you
are using (which also carries a side benefit in that I will
get to see if my patches applied to your source as expected.)
Another minus is that you have to take my word for it, which
is not as reassuring to you.  Which option do you choose?
Or do you have a third option in mind?

-- 
  .''`. Stephen Powell
 : :'  :
 `. `'`
   `-



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks

2010-12-14 Thread Jim Meyering
Stephen Powell wrote:
> On Thu, 25 Nov 2010 10:49:06 -0500 (EST), Jim Meyering wrote:
>> Thanks for the fix.
>> Until today I had not compiled your changes on an s390x.
>> When I did, there were 3 other minor problems, addressed
>> by the patch below, just after the one you suggested.
>>
>> That got past "make check" as a non-privileged user.
>> However, running "make check" as root exercises several
>> other cases that cannot be tested as a regular user, and
>> at least two of those are failing.  Those failures
>> are not due to your changes, so as soon as I have
>> a test or two to exercise your changes I'll feel
>> comfortable pushing the result.  I expect to use
>> the same mechanism as used in a few other tests
>> whereby you specify a device and its size like this:
>>
>> sudo make check DEVICE_TO_ERASE=/dev/sdd DEVICE_TO_ERASE_SIZE=999MB
>>
>> But it won't be this weekend, so maybe next week...
>
> How is your testing going?  It's unclear to me from what

Finding time for parted has been a challenge recently.

> you wrote.  Are you asking me to provide a test case?

If you can, that'd be great and would accelerate the process.  I would
no longer have an excuse not to push your patches.  I nearly pushed
without a test case, but your changes are large enough that I cannot
do that in good conscience.

I didn't want to require you to write a test, but in the end my time
constraints appear to be having the same effect.  Sorry about that.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks

2010-12-11 Thread Stephen Powell
On Thu, 25 Nov 2010 10:49:06 -0500 (EST), Jim Meyering wrote:
> 
> Thanks for the fix.
> Until today I had not compiled your changes on an s390x.
> When I did, there were 3 other minor problems, addressed
> by the patch below, just after the one you suggested.
> 
> That got past "make check" as a non-privileged user.
> However, running "make check" as root exercises several
> other cases that cannot be tested as a regular user, and
> at least two of those are failing.  Those failures
> are not due to your changes, so as soon as I have
> a test or two to exercise your changes I'll feel
> comfortable pushing the result.  I expect to use
> the same mechanism as used in a few other tests
> whereby you specify a device and its size like this:
> 
> sudo make check DEVICE_TO_ERASE=/dev/sdd DEVICE_TO_ERASE_SIZE=999MB
> 
> But it won't be this weekend, so maybe next week...

How is your testing going?  It's unclear to me from what
you wrote.  Are you asking me to provide a test case?

-- 
  .''`. Stephen Powell
 : :'  :
 `. `'`
   `-



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks

2010-11-25 Thread Jim Meyering
Stephen Powell wrote:
...
> In the process of checking out the results, I discovered a bug in my code.
> In include/parted/vtoc.h, at or near line 105, as part of the structure
> declaration for ldl_volume_label, there is a line that says
>
> char ldl_version;   /* Version number, valid for ldl format  
> */
>
> It should say
>
> char ldl_version[1];/* Version number, valid for ldl format  
> */
>
> I was clued into this by a bunch of compile warnings in 
> libparted/labels/dasd.c
> complaining about conversion of integer to pointer without a cast,
> or something like that.

Hi Stephen,

Thanks for the fix.
Until today I had not compiled your changes on an s390x.
When I did, there were 3 other minor problems, addressed
by the patch below, just after the one you suggested.

That got past "make check" as a non-privileged user.
However, running "make check" as root exercises several
other cases that cannot be tested as a regular user, and
at least two of those are failing.  Those failures
are not due to your changes, so as soon as I have
a test or two to exercise your changes I'll feel
comfortable pushing the result.  I expect to use
the same mechanism as used in a few other tests
whereby you specify a device and its size like this:

sudo make check DEVICE_TO_ERASE=/dev/sdd DEVICE_TO_ERASE_SIZE=999MB

But it won't be this weekend, so maybe next week...


>From a0fd447e13ec76fa16a51bfd88b67af705d08c05 Mon Sep 17 00:00:00 2001
From: Stephen Powell 
Date: Thu, 25 Nov 2010 15:52:21 +0100
Subject: [PATCH 1/2] tweak ldl_version member decl

* include/parted/vtoc.h [struct ldl_volume_label] (ldl_version):
Declare as array of length 1, not as a scalar.
---
 include/parted/vtoc.h |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/parted/vtoc.h b/include/parted/vtoc.h
index 5ed40b5..d79ce39 100644
--- a/include/parted/vtoc.h
+++ b/include/parted/vtoc.h
@@ -102,7 +102,7 @@ struct __attribute__ ((packed)) ldl_volume_label {
char vollbl[4]; /* Label identifier ("LNX1" in EBCDIC)   */
 char volid[6];  /* Volume identifier */
 char res3[69];  /* Reserved field*/
-char ldl_version;   /* Version number, valid for ldl format  */
+char ldl_version[1];/* Version number, valid for ldl format  */
 u_int64_t formatted_blocks;  /* valid when ldl_version >= "2" (in
 EBCDIC)  */
 };
--
1.7.3.2.765.g642a8


>From 668956027eebd9204e486fdd75e67a981ead5ac5 Mon Sep 17 00:00:00 2001
From: Jim Meyering 
Date: Thu, 25 Nov 2010 15:57:00 +0100
Subject: [PATCH 2/2] s390: avoid warnings

* libparted/labels/vtoc.c (vtoc_read_volume_label): Remove decl
of unused var.
* libparted/labels/fdasd.c (fdasd_valid_vtoc_pointer): Return
a value also when successful.
* libparted/labels/dasd.c (dasd_alloc_metadata): Initialize "part"
to NULL solely to avoid a spurious used-uninitialized warning.
---
 libparted/labels/dasd.c  |2 +-
 libparted/labels/fdasd.c |1 +
 libparted/labels/vtoc.c  |1 -
 3 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libparted/labels/dasd.c b/libparted/labels/dasd.c
index 8114347..bca1662 100644
--- a/libparted/labels/dasd.c
+++ b/libparted/labels/dasd.c
@@ -906,7 +906,7 @@ dasd_alloc_metadata (PedDisk* disk)
PedSector vtoc_end;
LinuxSpecific* arch_specific;
DasdDiskSpecific* disk_specific;
-   PedPartition* part;
+   PedPartition* part = NULL; /* initialize solely to placate gcc */
PedPartition* new_part2;
PedSector trailing_meta_start, trailing_meta_end;
struct fdasd_anchor anchor;
diff --git a/libparted/labels/fdasd.c b/libparted/labels/fdasd.c
index 8da7b1f..6d708f6 100644
--- a/libparted/labels/fdasd.c
+++ b/libparted/labels/fdasd.c
@@ -707,6 +707,7 @@ fdasd_valid_vtoc_pointer(fdasd_anchor_t *anc, unsigned long 
b, int fd)
return 0;

fdasd_error(anc, wrong_disk_format, _("Invalid VTOC."));
+   return 1;
 }

 /*
diff --git a/libparted/labels/vtoc.c b/libparted/labels/vtoc.c
index dab5181..cf2990e 100644
--- a/libparted/labels/vtoc.c
+++ b/libparted/labels/vtoc.c
@@ -290,7 +290,6 @@ vtoc_read_volume_label (int f, unsigned long vlabel_start,
bogus_label_t *bogus_ptr = &mybogus;
vollabel_t *union_ptr = &bogus_ptr->actual_label;
volume_label_t *cdl_ptr = &union_ptr->cdl;
-   cms_volume_label_t *cms_ptr = &union_ptr->cms;

PDEBUG
int rc;
--
1.7.3.2.765.g642a8



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks

2010-11-25 Thread Stephen Powell
On Thu, 28 Oct 2010 12:26:00 -0400 (EDT), Jim Meyering wrote:
> Stephen Powell wrote:
>>
>> OK, here is the new patch:
>>
>>http://www.wowway.com/~zlinuxman/parted/parted_fba_diag_patch.diff
> 
> Thank you.
> I confirmed that it applies and doesn't cause any trouble on x86_64/linux.
> I'll actually look at the code and make sure tests pass on an
> s390x next week, assuming I can get access.

Debian came out with an update to parted version 2.3 recently.  Their package
version is called 2.3-4.  I fetched their updated source package and
reapplied the original four context diff patches to their respective
source files:

   http://www.wowway.com/~zlinuxman/parted/dasd.c.diff -> 
libparted/labels/dasd.c
   http://www.wowway.com/~zlinuxman/parted/fdasd.c.diff -> 
libparted/labels/fdasd.c
   http://www.wowway.com/~zlinuxman/parted/vtoc.c.diff -> 
libparted/labels/vtoc.c
   http://www.wowway.com/~zlinuxman/parted/vtoc.h.diff -> include/parted/vtoc.h

then applied the unified diff file

   http://www.wowway.com/~zlinuxman/parted/parted_fba_diag_patch.diff

and I ran into some apply problems.  The first four patches applied OK, but
the first two hunks of the unified patch did not apply for some reason.
Not knowing enough about the internals of the structure of a diff file to
fix the problem, I manually re-made the changes.  

In the process of checking out the results, I discovered a bug in my code.
In include/parted/vtoc.h, at or near line 105, as part of the structure
declaration for ldl_volume_label, there is a line that says

char ldl_version;   /* Version number, valid for ldl format  */

It should say

char ldl_version[1];/* Version number, valid for ldl format  */

I was clued into this by a bunch of compile warnings in libparted/labels/dasd.c
complaining about conversion of integer to pointer without a cast,
or something like that.

So, how is your testing coming?

-- 
  .''`. Stephen Powell
 : :'  :
 `. `'`
   `-



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks

2010-10-28 Thread Stephen Powell
On Thu, 28 Oct 2010 12:26:00 -0400 (EDT), Jim Meyering wrote:
> Thank you.
> I confirmed that it applies and doesn't cause any trouble on x86_64/linux.
> I'll actually look at the code and make sure tests pass on an
> s390x next week, assuming I can get access.
> 
> Speaking of tests, can you outline a couple
> that will exercise some (more the merrier) of this new code?

I primarily use the print command for testing.  For example,
suppose that device number 0200 is /dev/dasda.  I would issue
the command

   parted /dev/dasda unit s print free

and compare the starting sector and number of sectors to the
output of

   cat /sys/bus/ccw/devices/0.0.0200/block/dasda/dasda1/start

and

   cat /sys/bus/ccw/devices/0.0.0200/block/dasda/dasda1/size

to check to see if parted is calculating the size of the
partition the same way as the Linux kernel does.  (Believe it
or not I found a bug in the Linux kernel this way about five
months ago.  See

   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=582281

for details.)  The key, of course, is to try as many different
combinations of DASD type (CKD and FBA), DASD format (CDL, LDL,
CMS non-reserved, and CMS reserved), and DASD driver (ECKD, FBA,
and DIAG) as possible.  Only the following combinations are supported
by the Linux kernel:

   DASD type DASD format DASD driver
   - --- ---
   CKD   CDL ECKD
   CKD   LDL ECKD
   CKD   LDL DIAG
   CKD   CMS-NR  ECKD
   CKD   CMS-NR  DIAG
   CKD   CMS-R   ECKD
   CKD   CMS-R   DIAG
   FBA   CMS-NR  FBA
   FBA   CMS-NR  DIAG
   FBA   CMS-R   FBA
   FBA   CMS-R   DIAG

The DIAG driver can only be used when Linux for s390 is
running in a virtual machine under z/VM.  And the CMS DASD format
can only be created by the CMS operating system, which only
runs in a virtual machine under z/VM.  So nine of the eleven
combinations will require z/VM in some way to test them.

parted only supports the first combination for read-write operations.
The others are supported read-only.  By read-only I mean that
a new partition cannot be created, the pre-existing partition
cannot be deleted, and the pre-existing partition cannot be
moved or changed in size.  I do not mean
that write operations cannot be performed on the data in the
partition.  They can.  For example, a file system or swap space
can be created on the partition.

The other variant is the block size of the disk.  The block size
can be 512, 1024, 2048, or 4096.  With 11 combinations of
DASD type, DASD format, and driver times 4 possible block sizes
that yields 44 possible configurations for exhaustive testing.
And that does not take into account variations in the size of
the disk.

I have tested all combinations that do not involve the CDL
format, since I didn't touch that code.  One thing I did discover
during testing: it is essential to take the disk offline

   echo 0 >/sys/bus/ccw/devices/0.0./online

where  is the device number, and
bring it online again

   echo 1 >/sys/bus/ccw/devices/0.0./online

after changing the block size of the disk.
Simply refreshing the operating system's view of the partition
table is not sufficient.  (Of course, all partitions on the
disk that are currently mounted must be unmounted before the
disk can be taken offline; but you wouldn't normally
re-format the disk while partitions are mounted anyway.
Similarly, any active swap spaces on the disk must be
deactivated before taking the disk offline.)

-- 
  .''`. Stephen Powell
 : :'  :
 `. `'`
   `-



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks

2010-10-23 Thread Jim Meyering
Stephen Powell wrote:
> As promised earlier today, I now have the following patch files on my
> web site ready for download:
>
> http://www.wowway.com/~zlinuxman/parted/vtoc.h.diff   (apply to 
> include/parted/vtoc.h)
> http://www.wowway.com/~zlinuxman/parted/dasd.c.diff   (apply to 
> libparted/labels/dasd.c)
> http://www.wowway.com/~zlinuxman/parted/fdasd.c.diff  (apply to 
> libparted/labels/fdasd.c)
> http://www.wowway.com/~zlinuxman/parted/vtoc.c.diff   (apply to 
> libparted/labels/vtoc.c)
>
> I have not made any updates to NEWS.  You can edit that as you see
> fit.  These are ordinary "context diffs", with three lines of context.
> I don't understand this "git" stuff.  I've never used it.  Sorry.
> My starting point was the Debian source package for parted, version 2.2-5.
...

Thanks for your patience, Stephen.
I've applied your patches locally, made some tiny changes
and included the result below.
(I moved 2 decls "down", and made indentation more consistent)

Two things remain to be done:

  - add a sentence or two for NEWS; the idea is to be as brief as possible
  while still giving enough of the details so people don't have to
  go look at the commit logs or -- gasp! -- the code.

  - a recipe or two (the more the merrier) for tests that fail
  without your patch, but pass with it.
  For a change of this size and complexity, I would be remiss
  not to include at least one or two patches.  It's ok (expected
  even) that the tests will run only on an s390 and will be skipped
  on other systems.

I've lightly modified words from your email to make the log
message below.  If you'd like something different there, let me know.

I haven't tested these changes at all, but should be able
to do so next week.

Jim

>From 7fd0768feda02e0d51956cddac0eaf6d80fb4ebe Mon Sep 17 00:00:00 2001
From: Stephen Powell 
Date: Sat, 8 May 2010 09:39:24 +0200
Subject: [PATCH] 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.
---
 include/parted/vtoc.h|   56 -
 libparted/labels/dasd.c  |  106 -
 libparted/labels/fdasd.c |   15 ---
 libparted/labels/vtoc.c  |   14 --
 4 files changed, 166 insertions(+), 25 deletions(-)

diff --git a/include/parted/vtoc.h b/include/parted/vtoc.h
index 6b41584..5ed40b5 100644
--- a/include/parted/vtoc.h
+++ b/include/parted/vtoc.h
@@ -49,6 +49,8 @@ typedef struct cchhbcchhb_t;
 typedef struct cchh cchh_t;
 typedef struct labeldatelabeldate_t;
 typedef struct volume_label volume_label_t;
+typedef struct cms_volume_label cms_volume_label_t;
+typedef struct ldl_volume_label ldl_volume_label_t;
 typedef struct extent   extent_t;
 typedef struct dev_constdev_const_t;
 typedef struct format1_labelformat1_label_t;
@@ -81,7 +83,7 @@ struct __attribute__ ((packed)) labeldate {

 struct __attribute__ ((packed)) volume_label {
char volkey[4]; /* volume key = volume label */
-   char vollbl[4]; /* volume label  */
+   char vollbl[4]; /* volume label ("VOL1" in EBCDIC)   */
char volid[6];  /* volume identifier */
u_int8_t security;  /* security byte */
cchhb_t vtoc;   /* VTOC address  */
@@ -93,6 +95,58 @@ struct __attribute__ ((packed)) volume_label {
char res2[4];   /* reserved  */
char lvtoc[14]; /* owner code for LVTOC  */
  

Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks

2010-08-03 Thread Jim Meyering
Stephen Powell wrote:
> I haven't heard anything for a while.  I just thought I would touch base
> after a couple of months.  Is anything happening?

Hi Stephen.
I'll be able to review your patches in 2-3 weeks.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks

2010-08-03 Thread Stephen Powell
I haven't heard anything for a while.  I just thought I would touch base
after a couple of months.  Is anything happening?

-- 
  .''`. Stephen Powell
 : :'  :
 `. `'`
   `-



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks

2010-06-07 Thread Stephen Powell
On Sat, 05 Jun 2010 05:51:52 -0400 (EDT), Jim Meyering wrote:
> Stephen Powell wrote:
>> Well, my paperwork just came through today for assignment of copyright.
>> And it's just in time.  Here is a link to my second round of enhancements.
>>
>>http://www.wowway.com/~zlinuxman/parted/dasd_complete.diff
>>
>> These changes require my previous changes as a prerequisite.  Let me
>> know if you have any trouble with them.  The enhancement is
>>
>> * Support all valid combinations of DASD format (CDL, LDL, and CMS),
>>   DASD type (CKD and FBA), and DASD driver (ECKD, FBA, and DIAG) supported
>>   by the Linux kernel.  Only CDL format on CKD DASD using the ECKD
>>   driver is supported for read/write operations on partitions
>>   (create, delete, move, and resize).  For all other combinations
>>   of DASD format, DASD type, and DASD driver that are supported by the
>>   Linux kernel, parted recognizes the pre-existing implicit partition;
>>   but it does not allow that partition to be deleted, moved, or resized;
>>   nor does it allow the creation of another partition on that DASD device.
> 
> Hi Stephen,
> 
> Now that your paperwork has gone through and I've released parted-2.3,
> we can work on getting your changes committed.

Great!
> 
> Would you please outline a few sets of shell/parted commands
> that I can run on a dasd disk to exercise as much of this new
> code as possible?
> 

During development, I tested things primarily with the command

   parted /dev/dasde print free

This assumes that /dev/dasde is the device being looked at.  Substitute
the appropriate Linux device name as appropriate.  There are variables
in the /sys file system in the Linux kernel that can be used for comparison
purposes to see if parted is returning the same partition start and size as
the Linux kernel.  For example, if the device number is 0400 and the device
name is /dev/dasde, then the disk size can be examined by means of

   cat /sys/bus/ccw/devices/0.0.0400/block/dasde/size

the starting sector of the first partition can be examined by means of

   cat /sys/bus/ccw/devices/0.0.0400/block/dasde/dasde1/start

and the size of the first partition can be examined by means of

   cat /sys/bus/ccw/devices/0.0.0400/block/dasde/dasde1/size

(This testing was done using a 2.6.32 kernel and version 1.8.3 of s390-tools.)
The units used for measurement in all three of the above variables
are 512-byte pseudo-sectors, with the sectors numbered starting with zero.
Remember that parted reports output in decimal K (10**3), decimal M (10**6)
and decimal G (10**9); not binary K (2**10), binary M (2**20), or binary G 
(2**30).

The only other command that I issued was

   parted /dev/dasde print 1

but it was that command that brought my attention to the problems that
parted has with file systems.  I didn't touch the file system code,
only code related to recognizing partitions.  I got errors related
to file systems even on disk formats, such as CDL, that I didn't
touch.  Someone needs to look at that.

To summarize, here are all the supported combinations of dasd type,
driver, and disk format that parted now recognizes.  These are the
same combinations recognized by the Linux kernel.

Dasd type   Driver   Disk formatType of support
=   ==   ======
CKD ECKD CDLread-write*
CKD ECKD LDLread-only*
CKD ECKD CMS non-reserved   read-only
CKD ECKD CMS reserved   read-only
CKD DIAG LDLread-only
CKD DIAG CMS non-reserved   read-only
CKD DIAG CMS reserved   read-only
FBA FBA  CMS non-reserved   read-only
FBA FBA  CMS reserved   read-only
FBA DIAG CMS non-reserved   read-only
FBA DIAG CMS reserved   read-only

* supported by parted 2.2

read-write means that partitions can be created, deleted, moved, or resized,
and that up to three partitions may exist on the device.  read-only means
that the single pre-existing partition is recognized, but it cannot
be deleted, moved, or resized, nor can another partition be added.  read-only
does not mean that no write operations can be performed.  For example,
parted should be able to make a file system on the partition.  It just can't
alter the definition of the partition itself or create another partition.

Also, keep in mind that there is a bug in the kernel that keeps certain types
of devices from working properly.  To be specific, CMS reserved disks on FBA
DASD using the DIAG driver with a logical block size greater than 512 are
not properly recognized by the Linux kernel.  See Debian bug report
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=582281 for details.
Parted assumes that this kernel bug has been fixed.  There is a link
to a patch file for this kernel bug in the Debian bug report log.

> Thanks for all your work.
> 
> Jim

You're welcome.
> 
> P.S. Please 

Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks

2010-06-05 Thread Jim Meyering
Stephen Powell wrote:
> Well, my paperwork just came through today for assignment of copyright.
> And it's just in time.  Here is a link to my second round of enhancements.
>
>http://www.wowway.com/~zlinuxman/parted/dasd_complete.diff
>
> These changes require my previous changes as a prerequisite.  Let me
> know if you have any trouble with them.  The enhancement is
>
> * Support all valid combinations of DASD format (CDL, LDL, and CMS),
>   DASD type (CKD and FBA), and DASD driver (ECKD, FBA, and DIAG) supported
>   by the Linux kernel.  Only CDL format on CKD DASD using the ECKD
>   driver is supported for read/write operations on partitions
>   (create, delete, move, and resize).  For all other combinations
>   of DASD format, DASD type, and DASD driver that are supported by the
>   Linux kernel, parted recognizes the pre-existing implicit partition;
>   but it does not allow that partition to be deleted, moved, or resized;
>   nor does it allow the creation of another partition on that DASD device.

Hi Stephen,

Now that your paperwork has gone through and I've released parted-2.3,
we can work on getting your changes committed.

Would you please outline a few sets of shell/parted commands
that I can run on a dasd disk to exercise as much of this new
code as possible?

Thanks for all your work.

Jim

P.S. Please excuse the high latency.
I'll be available only sporadically for the next couple months.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks

2010-05-25 Thread Stephen Powell
Well, my paperwork just came through today for assignment of copyright.
And it's just in time.  Here is a link to my second round of enhancements.

   http://www.wowway.com/~zlinuxman/parted/dasd_complete.diff

These changes require my previous changes as a prerequisite.  Let me
know if you have any trouble with them.  The enhancement is

* Support all valid combinations of DASD format (CDL, LDL, and CMS),
  DASD type (CKD and FBA), and DASD driver (ECKD, FBA, and DIAG) supported
  by the Linux kernel.  Only CDL format on CKD DASD using the ECKD
  driver is supported for read/write operations on partitions
  (create, delete, move, and resize).  For all other combinations
  of DASD format, DASD type, and DASD driver that are supported by the
  Linux kernel, parted recognizes the pre-existing implicit partition;
  but it does not allow that partition to be deleted, moved, or resized;
  nor does it allow the creation of another partition on that DASD device.

-- 
  .''`. Stephen Powell
 : :'  :
 `. `'`
   `-



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks

2010-05-24 Thread Stephen Powell
On Mon, 24 May 2010 03:26:43 -0400 (EDT), Jim Meyering wrote:
> Stephen Powell wrote:
>> Praise the Lord!  I do believe I've got it now.  Parted now supports all
>> DASD types (CKD and FBA), drivers (ECKD, FBA, and DIAG) and disk formats
>> (CDL, LDL, and CMS) that are supported by the Linux kernel on the s390
>> architecture.
> 
> Nice.
> Sounds promising.
>>
>> ...
>> I intend to put the changed code through some fairly extensive
>> final tests next week, and after that I will upload a unified diff
>> with all my changes.
>> ...
> 
> Considering the number of different formats involved,
> I'd guess that your changes include several bug fixes.

Not really.  The only bug fix is one that is included in my
first set of updates.  (LDL support only works for a blocksize
of 4096).  The rest was enhancements.  Before my changes,
parted supported only CDL and LDL format, supported only
CKD DASD, and supported only the ECKD driver.  (All of this
discussion is assumed to be in the context of the s390 architecture.)
And the LDL support only worked for a blocksize of 4096.
My first set of changes fixed that bug and added support for
CMS disk format.  But it still supported only CKD DASD and
only the ECKD driver.  This second set of changes supports
FBA DASD and the FBA and DIAG drivers.  My goal was to support
everything that the Linux kernel supports in the way of mainframe
DASD.  And I believe that I have accomplished my goal.

-- 
  .''`. Stephen Powell
 : :'  :
 `. `'`
   `-



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks

2010-05-24 Thread Jim Meyering
Stephen Powell wrote:
> Praise the Lord!  I do believe I've got it now.  Parted now supports all
> DASD types (CKD and FBA), drivers (ECKD, FBA, and DIAG) and disk formats

Nice.
Sounds promising.

> (CDL, LDL, and CMS) that are supported by the Linux kernel on the s390
...
> I intend to put the changed code through some fairly extensive
> final tests next week, and after that I will upload a unified diff
> with all my changes.  It will, however, have my original changes

Considering the number of different formats involved,
I'd guess that your changes include several bug fixes.

If you can find a way to make this into a series of patches,
I would be most grateful.  Teasing one big unified diff into
a series of largely-independent patches can be tedious,
but when done properly, it makes reviewing and maintenance
(e.g., future bisection) a lot easier.

> published via the context diffs as a prerequisite.  Sorry.  I'm
> a novice at this.  In fact, my only qualifications for making these
> changes seems to be that (a) I need the new functionality, and
> (b) I have the necessary hardware with which to test.  Programming
> skills, Linux knowledge, C knowledge, knowledge of "how things are
> done procedurally", etc. are probably all sub-par.  I ask for your
> patience and forbearance as I slowly and painfully learn all that
> stuff.

Also, please include as much as you can in the way of test recipes.
I.e., for each bug, what commands did you run to trigger it,
and what were the symptoms before it was fixed.

Thanks!



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks

2010-05-21 Thread Stephen Powell
Praise the Lord!  I do believe I've got it now.  Parted now supports all
DASD types (CKD and FBA), drivers (ECKD, FBA, and DIAG) and disk formats
(CDL, LDL, and CMS) that are supported by the Linux kernel on the s390
architecture.  I even have that last remaining case covered: old LDL
disk format (pre version 2) on CKD DASD using the DIAG driver.  It was
the only case left that required knowledge of device geometry when device
geometry was bogus.  disk->dev->length proved to be the key to solving
that problem.  This is the size of the disk in 512-byte sectors and is
correct even when device geometry (cylinders, heads, and sectors per
track) is bogus.

Only CDL format on CKD DASD using the ECKD driver is supported for
actual partition editing (create, delete, move, re-size, etc.)  The
other combinations are read-only.  That is, parted recognizes the
preexisting partition, but it cannot be deleted, moved, or re-sized.
New partitions cannot be added either.  You should be able to make
a file system on the pre-existing partition with parted though.

Speaking of file systems, I think there may be a bug in the file system
code.  I haven't touched that portion of the code, but when I issue
a command like

   parted /dev/dasde print 1

for a disk on which a file system has been created on the partition
directly by Linux (such as with mke2fs) I get funny errors.  (For
some reason I have to take the device offline and bring it back
online again after I run mke2fs in order for parted to see the file
system.)  For example, the output of the above command is

   Error: File system has an incompatible feature enabled.  Compatible
   features are has_journal, dir_index, filetype, sparse_super, and
   large_file.  Use tune2fs or debugfs to remove features.

I just made this file system seconds ago.  And it was made with a
native file system tool.  How can it be invalid already?
Someone ought to take a look at that.  I have the same problem with
the original code; so I don't think I broke it.

I intend to put the changed code through some fairly extensive
final tests next week, and after that I will upload a unified diff
with all my changes.  It will, however, have my original changes
published via the context diffs as a prerequisite.  Sorry.  I'm
a novice at this.  In fact, my only qualifications for making these
changes seems to be that (a) I need the new functionality, and
(b) I have the necessary hardware with which to test.  Programming
skills, Linux knowledge, C knowledge, knowledge of "how things are
done procedurally", etc. are probably all sub-par.  I ask for your
patience and forbearance as I slowly and painfully learn all that
stuff.

-- 
  .''`. Stephen Powell
 : :'  :
 `. `'`
   `-



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks

2010-05-21 Thread Stephen Powell
In the process of testing and verifying my changes to parted, I have
discovered a bona-fide bug in the Linux kernel, one that prevents it
from reading the disk label in some cases.  See Debian bug report
582281 for details.

   http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=582281

I will write the parted code the correct way.  In other words, it
will assume that this kernel bug has been fixed.  If it hasn't,
the kernel and parted will disagree about the starting location
and size of the partition in some circumstances.  But parted
will be right and the kernel will be wrong.

-- 
  .''`. Stephen Powell
 : :'  :
 `. `'`
   `-



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks

2010-05-18 Thread Stephen Powell
OK, I have FBA DASD working with the DIAG driver now.  The only thing
that doesn't yet work is LDL disks on CKD DASD using the DIAG driver
that have been formatted with an old version of dasdfmt (which does not
include formatted_blocks in the label).  That's the only remaining case
where the partition size calculation depends on device geometry, which
is bogus when using the DIAG driver.  Nevertheless, parted does know
the correct size of the disk in sectors when using the DIAG driver.
It uses that information to calculate free space, which it annoyingly displays
if I don't create the metadata partitions properly.  So it may be possible
to eliminate that last remaining dependency on device geometry.  I'll
give it a shot.

(Of course, I am speaking in the context of LDL and CMS formatted disks.
CDL formatted disks still have a dependency on device geometry, and always
will.  But CDL formatted disks can only be created on CKD DASD and they
cannot use the DIAG driver; so obtaining the device geometry is no problem.)

-- 
  .''`. Stephen Powell
 : :'  :
 `. `'`
   `-



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks

2010-05-14 Thread Stephen Powell
OK, I have LDL disks working with the DIAG driver in parted now.
The reason I was having trouble yesterday was that the LDL disk I
was using for testing was formatted by a very old version of dasdfmt.
Debian Squeeze currently uses version 1.6.2 of s390-tools.  I upgraded
to version 1.8.3 from Sid and reformatted the disk.  This version uses
the "version 2" format of an LDL disk label, which contains the number
of formatted blocks in the label.  Without this information in the label,
which the old version of dasdfmt did not supply, parted relies on
device geometry to calculate the size of the partition.  And device
geometry is all bogus when using the DIAG driver.  Upgrading to a
newer version of s390-tools and reformatting the disk solved the problem.

Now on to the final frontier: FBA DASD.

-- 
  .''`. Stephen Powell
 : :'  :
 `. `'`
   `-



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks

2010-05-13 Thread Stephen Powell
Well, I have parted working with the DIAG driver now, at least for
CMS disks on CKD devices.  LDL disks don't work with the DIAG driver
yet.  I haven't done anything with FBA disks yet.  My efforts continue.

-- 
  .''`. Stephen Powell
 : :'  :
 `. `'`
   `-



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks

2010-05-11 Thread Stephen Powell
Now that CMS minidisk support on CKD DASD using the ECKD driver is
working, there are three remaining frontiers:  CMS minidisk support on
FBA DASD using the FBA driver, CMS minidisk support on either
CKD or FBA DASD using the DIAG driver, and LDL disk support on CKD
DASD using the DIAG driver.  If I can get those three things
working, then parted on the s390 architecture will support all DASD devices
and all drivers supported by the Linux kernel on the s390 architecture,
which of course is the ultimate goal.  (CMS format is the only format
supported on FBA DASD by the Linux kernel.  CDL and LDL both require
CKD DASD.)

I don't have any FBA DASD with which to test.  However, z/VM can
emulate FBA DASD by using something called "Virtual Disks in Storage".
That should be good enough.  I have no idea whether or not I will
be successful.  I may have bitten off more than I can chew.  But I'm
going to give it the good old college try, and we'll see what happens.
Maybe I'll get lucky.

-- 
  .''`. Stephen Powell
 : :'  :
 `. `'`
   `-



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks

2010-05-11 Thread Jim Meyering
Stephen Powell wrote:
...
> Now, for the specific "bullet points" for NEWS:
>
> o Fixed a bug in which the starting block for the implicit partition
>   of LDL disks was miscalculated if the disk was formatted at a block
>   size other than 4096.  The program now calculates the starting block
>   of the partition correctly, regardless of whether the disk has a
>   block size of 512, 1024, 2048, or 4096.  (These are all the valid
>   block sizes.)
>
> o Enhanced LDL support to use the "formatted blocks" field of an LDL-
>   format disk label (for version 2 and above LDL formats) to determine
>   the size of the partition, rather than relying on disk geometry.
>   This will allow parted to determine the correct partition size if,
>   for example, an image copy backup of a 3390-3 volume is taken at
>   the home site and restored to a 3390-9 volume at a disaster recovery
>   hot site.  The extra space at the end of the 3390-9 volume is not
>   part of the partition, and parted now knows that.
>
> o Added support for CMS-formatted minidisks, both non-reserved and
>   reserved, provided that they are on CKD DASD.  CMS minidisks on
>   FBA DASD are not supported at this time.  Also, CMS minidisks on
>   CKD DASD which use the DIAG driver are not supported either.  The
>   ECKD driver must be used.
>
> The changes to function dasd_alloc_metadata in dasd.c are necessary to
> support both the bug fix and the enhancements.  It is important that
> no metadata/partition overlap occurs, and it is important that all
> sectors on an LDL or CMS disk be covered either by the partition or by
> metadata.

Thanks for the detailed explanation.
I'll add it to NEWS once the paperwork has gone through.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks

2010-05-08 Thread Stephen Powell
On Sat, 08 May 2010 04:06:16 -0400 (EDT), Jim Meyering wrote:
> Stephen Powell wrote:
>> As promised earlier today, I now have the following patch files on my
>> web site ready for download:
>> ...
> 
> I don't often see context diffs, as opposed to unified diffs.
> Most people prefer to read the latter.  You can generate them with diff -u
> if you're using GNU diff, or with git diff if you ever get around
> to using git.

Jonathan Nieder explained to me how to make unified diffs in more detail
in a private e-mail.  Thanks to both you and Jonathan.  I apologize for
not following the normal conventions.  This stuff is all new to me.
I'm used to applications programming in an IBM mainframe shop using PL/I.
The whole GNU/Linux world is a total paradigm shift for me.  The operating
system, the programming language, the tools, etc. are all completely
new to me.  What I do have to offer is basic programming aptitudes
and a knowledge of IBM mainframe hardware architecture, especially when
running in a virtual machine under z/VM.  But everything else is totally
different.  Please be patient with me as I learn.
> 
> I've confirmed that those patches do apply locally and removed a couple
> of trialing spaces so "make syntax-check" still passes.

That's another tool I know nothing about.  :-(  I use front-ends like
dpkg-buildpackage, which no doubt use make "under the covers", but
I never directly invoke make.

>
> Once I have confirmation that the FSF has received your paperwork,
> I'll review and test.

I mailed the paperwork today.  I can send you an e-mail with a PDF file
attached that has copies of the paperwork, if that will speed things up.
> 
> One way that you can help in the mean time is by writing a slightly
> more detailed summary of what changed.  For example
>   * what is it that would fail without your patch, but works with it?
>   * how does your improvement make things better?
> That is the sort of information I'd like to put in NEWS.
> Does this count as a bug fix?  It seems so, but there's also
> the free-space change that looks more like an improvement than a bug fix.
> I haven't looked at details yet...

Necessity is the mother of invention.  What prompted me to look into
this in the first place was a desire to install Debian GNU/Linux for s390
onto reserved CMS minidisks in a virtual machine under z/VM.  Reserved CMS
minidisks are advantageous to use when Linux is run in a virtual machine
under z/VM primarily for two reasons: (1) reserved CMS minidisks can be
accessed and manipulated read/write by both CMS and the Linux kernel,
and (2) reserved CMS minidisks are eligible for use by the DIAG driver,
a high-performance disk driver usable only when GNU/Linux is running in
a virtual machine under IBM's z/VM operating system.  But the Debian
installer would not work with CMS minidisks.

I opened a wishlist bug report against the Debian installer years ago,
but no action ensued until recently.  Someone looked into it and said that
the reason that the Debian installer didn't work with CMS minidisks is that
parted didn't recognize them.  So my goal was to enhance parted so that
I could install Debian directly to CMS minidisks.  (See
http://www.wowway.com/~zlinuxman/diag250.htm for the convoluted way I
have to go about installing Debian to CMS minidisks due to the lack
of CMS minidisk support in parted.)

I really didn't feel adequate for the job of changing parted, a program
written in C, a language that I don't know.  But Debian is a volunteer
organization.  They don't have the money to go out and buy IBM mainframes,
license z/VM, and do their own development and testing.  I already had
all that, but did not possess C knowledge.  It was easier for me to
acquire enough C knowledge to make the changes than it was for Debian
to acquire a real mainframe and a z/VM license.  In the process of making
these changes I discovered some bugs in the existing code for LDL disks,
to which CMS disks are closely related.

Now, for the specific "bullet points" for NEWS:

o Fixed a bug in which the starting block for the implicit partition
  of LDL disks was miscalculated if the disk was formatted at a block
  size other than 4096.  The program now calculates the starting block
  of the partition correctly, regardless of whether the disk has a
  block size of 512, 1024, 2048, or 4096.  (These are all the valid
  block sizes.)

o Enhanced LDL support to use the "formatted blocks" field of an LDL-
  format disk label (for version 2 and above LDL formats) to determine
  the size of the partition, rather than relying on disk geometry.
  This will allow parted to determine the correct partition size if,
  for example, an image copy backup of a 3390-3 volume is taken at
  the home site and restored to a 3390-9 volume at a disaster recovery
  hot site.  The extra space at the end of the 3390-9 volume is not
  part of the partition, and parted now knows that.

o Added support for CMS-formatted minidisks, both non-reserved and
 

Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks

2010-05-08 Thread Jim Meyering
Stephen Powell wrote:
> As promised earlier today, I now have the following patch files on my
> web site ready for download:
>
> http://www.wowway.com/~zlinuxman/parted/vtoc.h.diff   (apply to 
> include/parted/vtoc.h)
> http://www.wowway.com/~zlinuxman/parted/dasd.c.diff   (apply to 
> libparted/labels/dasd.c)
> http://www.wowway.com/~zlinuxman/parted/fdasd.c.diff  (apply to 
> libparted/labels/fdasd.c)
> http://www.wowway.com/~zlinuxman/parted/vtoc.c.diff   (apply to 
> libparted/labels/vtoc.c)
>
> I have not made any updates to NEWS.  You can edit that as you see
> fit.  These are ordinary "context diffs", with three lines of context.
> I don't understand this "git" stuff.  I've never used it.  Sorry.
> My starting point was the Debian source package for parted, version 2.2-5.
>
> To my way of thinking, these patches are logically one fix, which I
> would describe as "corrections to partition size and location
> calculations for type 1 partitions for s390 dasd".  If you want to

I don't often see context diffs, as opposed to unified diffs.
Most people prefer to read the latter.  You can generate them with diff -u
if you're using GNU diff, or with git diff if you ever get around
to using git.

I've confirmed that those patches do apply locally and removed a couple
of trialing spaces so "make syntax-check" still passes.

Once I have confirmation that the FSF has received your paperwork,
I'll review and test.

One way that you can help in the mean time is by writing a slightly
more detailed summary of what changed.  For example
  * what is it that would fail without your patch, but works with it?
  * how does your improvement make things better?
That is the sort of information I'd like to put in NEWS.
Does this count as a bug fix?  It seems so, but there's also
the free-space change that looks more like an improvement than a bug fix.
I haven't looked at details yet...



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks in parted

2010-05-08 Thread Jim Meyering
Stephen Powell wrote:

> On Wed, 21 Apr 2010 13:44:59 -0400 (EDT), Jim Meyering wrote:
>>
>> Your patch is large enough that we have to require
>> a signed copyright assignment.
>>
>> Here's the relevant section from HACKING:
>>
>>   http://git.debian.org/?p=parted/parted.git;a=blob;f=HACKING#l428
>>
>> Sorry for the hassle (it'll mean you sending an email,
>> waiting for snail/paper mail, and signing and sending that
>> back to the FSF), but it's for a good cause.
>
> Well it took a while, and some lobbying, and two days ago I didn't
> think it was going to fly.  But a miracle has occurred.  The CIO
> signed the "Employer Disclaimer of Rights" form today!  I have the
> original signed form in my possession!  I will send you my final
> patches this evening.  (Regression testing has revealed additional
> problems, which I have fixed.)  Thank you for your patience and your
> encouragement.

Good news!
Thanks for pursuing this.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks

2010-05-07 Thread Stephen Powell
As promised earlier today, I now have the following patch files on my
web site ready for download:

http://www.wowway.com/~zlinuxman/parted/vtoc.h.diff   (apply to 
include/parted/vtoc.h)
http://www.wowway.com/~zlinuxman/parted/dasd.c.diff   (apply to 
libparted/labels/dasd.c)
http://www.wowway.com/~zlinuxman/parted/fdasd.c.diff  (apply to 
libparted/labels/fdasd.c)
http://www.wowway.com/~zlinuxman/parted/vtoc.c.diff   (apply to 
libparted/labels/vtoc.c)

I have not made any updates to NEWS.  You can edit that as you see
fit.  These are ordinary "context diffs", with three lines of context.
I don't understand this "git" stuff.  I've never used it.  Sorry.
My starting point was the Debian source package for parted, version 2.2-5.

To my way of thinking, these patches are logically one fix, which I
would describe as "corrections to partition size and location
calculations for type 1 partitions for s390 dasd".  If you want to
treat it as two separate fixes, one to make corrections for LDL
formatted disks and one to add support for CMS formatted disks, that's
up to you.  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.
Someday I may work on that.  Maybe.  But not today.

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.

I make no claim to be a C programmer.  I'm just starting to learn C.
You C experts might want to take a look at my code.  It does seem to
work, but that doesn't necessarily mean that it's well written.  There
may be a better way to do what I did.  Feel free to change it, as long
as the end result is the same.

If you have any questions, please feel free to ask.

-- 
  .''`. Stephen Powell
 : :'  :
 `. `'`
   `-



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks in parted

2010-05-07 Thread Stephen Powell
On Wed, 21 Apr 2010 13:44:59 -0400 (EDT), Jim Meyering wrote:
> 
> Your patch is large enough that we have to require
> a signed copyright assignment.
> 
> Here's the relevant section from HACKING:
> 
>   http://git.debian.org/?p=parted/parted.git;a=blob;f=HACKING#l428
> 
> Sorry for the hassle (it'll mean you sending an email,
> waiting for snail/paper mail, and signing and sending that
> back to the FSF), but it's for a good cause.

Well it took a while, and some lobbying, and two days ago I didn't
think it was going to fly.  But a miracle has occurred.  The CIO
signed the "Employer Disclaimer of Rights" form today!  I have the
original signed form in my possession!  I will send you my final
patches this evening.  (Regression testing has revealed additional
problems, which I have fixed.)  Thank you for your patience and your
encouragement.

(Jim, please note the CC list is back on.)

-- 
  .''`. Stephen Powell
 : :'  :
 `. `'`
   `-



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks in parted

2010-04-21 Thread Stephen Powell
On Wed, 21 Apr 2010 13:44:59 -0400 (EDT), Jim Meyering wrote:
> Your patch is large enough that we have to require
> a signed copyright assignment.
> 
> Here's the relevant section from HACKING:
> 
>   http://git.debian.org/?p=parted/parted.git;a=blob;f=HACKING#l428
> 
> Sorry for the hassle (it'll mean you sending an email,
> waiting for snail/paper mail, and signing and sending that
> back to the FSF), but it's for a good cause.

Well, I started the paperwork process, but I'm a little concerned about
one of the questions on the form: Do you have an employer who might
claim to own your changes?  (Or words to that effect.)  Yes, I do have
an employer.  And yes, I did test the changes on their mainframe; so
if they want to be obnoxious about it, they could, in theory, cause
trouble.  I guarantee you they don't care.  They don't know, and they
don't want to know.  But if FSF insists on my employer signing a
copyright assignment or a quit claim, then we may have trouble.  I
guarantee my employer doesn't care.  But managers tends to think
like this:  "If I sign this form, I might possibly get in trouble
later with my boss.  But if I don't sign this form, there's no way
I'll ever get in trouble.  There's no benefit to me if I sign it,
and there's no hurt to me if I don't sign it.  Hmm.  What should I
do?"

What would you do?

I'll continue working on this, but you may have to derive the
enhancements yourself from scratch based on the published specs
in "Device Drivers, Features, and Commands" and the Linux kernel
source if FSF or my employer gives me trouble.  It's not that I don't
want to help.  It's just that ... well, I think you understand the
situation I'm in.

-- 
  .''`. Stephen Powell
 : :'  :
 `. `'`
   `-



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks in parted

2010-04-21 Thread Jim Meyering
Stephen Powell wrote:
...
> OK, I'll do the paperwork.  But did you start with my raw changes, or

Thanks.

So far I have applied no changes, but rather looked through
the patches Jonathan posted.  From what he said, his modifications
were insubstantial, but I did not try to verify that.

> did you start with Jonathan Nieder's modifications to my changes?
> If the latter, perhaps he needs to sign off too?  I submitted
> my changes to Debian.  Jonathan saw the bug report, massaged those
> changes a little bit, then submitted them to upstream.  If you
> got the changes directly from my web site via the links in the
> Debian bug report, then Jonathan is not involved, except as an
> interested party.  But if you started with Jonathan's modifications
> to my changes, then he may need to sign off too.



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks in parted

2010-04-21 Thread Stephen Powell
On Wed, 21 Apr 2010 13:44:59 -0400 (EDT), Jim Meyering wrote:
> Stephen Powell wrote:
>> I'm not a lawyer, but I hereby grant to FSF all rights that they want or need
>> in order to include any of my code under the same license that parted 
>> currently
>> uses.  If you're worried about IBM, the closest thing to IBM code that I
>> used was the structure mapping of the CMS volume label, which was taken
>> from the linux kernel source tree (arch/s390/include/asm/vtoc.h).  I changed
>> the data types to correspond to the user-defined data types that parted uses,
>> but the structure mapping and field names were taken from there.  So there
>> should be no problem with IBM.  If there's anything else you need, let me
>> know.
> 
> Your patch is large enough that we have to require
> a signed copyright assignment.
> 
> Here's the relevant section from HACKING:
> 
>   http://git.debian.org/?p=parted/parted.git;a=blob;f=HACKING#l428
> 
> Sorry for the hassle (it'll mean you sending an email,
> waiting for snail/paper mail, and signing and sending that
> back to the FSF), but it's for a good cause.

OK, I'll do the paperwork.  But did you start with my raw changes, or
did you start with Jonathan Nieder's modifications to my changes?
If the latter, perhaps he needs to sign off too?  I submitted
my changes to Debian.  Jonathan saw the bug report, massaged those
changes a little bit, then submitted them to upstream.  If you
got the changes directly from my web site via the links in the
Debian bug report, then Jonathan is not involved, except as an
interested party.  But if you started with Jonathan's modifications
to my changes, then he may need to sign off too.

-- 
  .''`. Stephen Powell
 : :'  :
 `. `'`
   `-



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org



Bug#578097: [parted-devel] [Parted-maintainers] Debian Bug #578097: No support for CMS-formatted disks in parted

2010-04-21 Thread Jim Meyering
Stephen Powell wrote:

> On Sat, 17 Apr 2010 11:45:58 -0400 (EDT), Otavio Salvador wrote:
>> Hello Jonathan and Stephen,
>>
>> First, thank for both of you.
>>
>> Stephen, from what I saw in your patch it will require copyright assignment
>> to FSF so while Jim and others with more experience in s390 take a look on
>> that, it would be good to start the paper work to get the copyright
>> assignment done and allow it to be included in upstream repository.
>
> I'm not a lawyer, but I hereby grant to FSF all rights that they want or need
> in order to include any of my code under the same license that parted 
> currently
> uses.  If you're worried about IBM, the closest thing to IBM code that I
> used was the structure mapping of the CMS volume label, which was taken
> from the linux kernel source tree (arch/s390/include/asm/vtoc.h).  I changed
> the data types to correspond to the user-defined data types that parted uses,
> but the structure mapping and field names were taken from there.  So there
> should be no problem with IBM.  If there's anything else you need, let me
> know.

Hi Stephen,

Your patch is large enough that we have to require
a signed copyright assignment.

Here's the relevant section from HACKING:

  http://git.debian.org/?p=parted/parted.git;a=blob;f=HACKING#l428

Sorry for the hassle (it'll mean you sending an email,
waiting for snail/paper mail, and signing and sending that
back to the FSF), but it's for a good cause.

Jim



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org