Blame SOURCES/parted-3.1-libparted-mklabel-edev.patch

8dc857
Subject: [PATCH] libparted: mklabel to support EDEV DASD
8dc857
8dc857
From: Nageswara R Sastry <rnsastry@linux.vnet.ibm.com>
8dc857
8dc857
Fixed Block Access (FBA) DASDs are mainframe-specific disk devices
8dc857
which are layed out as a sequence of 512-byte sectors. This patch adds
8dc857
support for mklabel to properly handle FBA devices.
8dc857
8dc857
Signed-off-by: Nageswara R Sastry <rnsastry@linux.vnet.ibm.com>
8dc857
---
8dc857
 libparted/labels/fdasd.c |   24 +++++++++++++-----------
8dc857
 1 file changed, 13 insertions(+), 11 deletions(-)
8dc857
8dc857
--- a/libparted/labels/fdasd.c
8dc857
+++ b/libparted/labels/fdasd.c
8dc857
@@ -869,19 +869,21 @@ fdasd_check_volume (fdasd_anchor_t *anc,
8dc857
 	vtoc_read_volume_label (fd, anc->label_pos, v);
8dc857
 
8dc857
 	if (strncmp(v->vollbl, vtoc_ebcdic_enc ("VOL1", str, 4), 4) == 0) {
8dc857
-		/* found VOL1 volume label */
8dc857
-		b = (cchhb2blk (&v->vtoc, &anc->geo) - 1) * anc->blksize;
8dc857
+		if (anc->FBA_layout != 1 ) {
8dc857
+			/* found VOL1 volume label */
8dc857
+			b = (cchhb2blk (&v->vtoc, &anc->geo) - 1) * anc->blksize;
8dc857
 
8dc857
-		if (b > 0) {
8dc857
-			int rc;
8dc857
-			rc = fdasd_valid_vtoc_pointer (anc, b, fd);
8dc857
+			if (b > 0) {
8dc857
+				int rc;
8dc857
+				rc = fdasd_valid_vtoc_pointer (anc, b, fd);
8dc857
 
8dc857
-			if (rc < 0)
8dc857
-				return 1;
8dc857
-			else
8dc857
-				return 0;
8dc857
-		} else {
8dc857
-			fdasd_invalid_vtoc_pointer(anc);
8dc857
+				if (rc < 0)
8dc857
+					return 1;
8dc857
+				else
8dc857
+					return 0;
8dc857
+			} else {
8dc857
+				fdasd_invalid_vtoc_pointer(anc);
8dc857
+			}
8dc857
 		}
8dc857
 	} else if (strncmp (v->volkey, vtoc_ebcdic_enc ("LNX1", str, 4), 4) == 0 ||
8dc857
 	           strncmp (v->volkey, vtoc_ebcdic_enc ("CMS1", str, 4), 4) == 0) {