From unknown Thu Jun 19 14:25:22 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#15349 <15349@debbugs.gnu.org> To: bug#15349 <15349@debbugs.gnu.org> Subject: Status: [PATCH 10/19] libparted: mklabel to support EDEV DASD Reply-To: bug#15349 <15349@debbugs.gnu.org> Date: Thu, 19 Jun 2025 21:25:22 +0000 retitle 15349 [PATCH 10/19] libparted: mklabel to support EDEV DASD reassign 15349 parted submitter 15349 "Brian C. Lane" severity 15349 normal tag 15349 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Wed Sep 11 16:15:32 2013 Received: (at submit) by debbugs.gnu.org; 11 Sep 2013 20:15:32 +0000 Received: from localhost ([127.0.0.1]:56491 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VJqp2-0004H7-1d for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:15:32 -0400 Received: from eggs.gnu.org ([208.118.235.92]:45646) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VJqp0-0004Gi-Jd for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:15:30 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJqon-0001Wn-4x for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:15:25 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=BAYES_20 autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:52121) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqon-0001Wf-2W for submit@debbugs.gnu.org; Wed, 11 Sep 2013 16:15:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47121) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqog-0002Wg-PU for bug-parted@gnu.org; Wed, 11 Sep 2013 16:15:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VJqoa-0001Mm-ES for bug-parted@gnu.org; Wed, 11 Sep 2013 16:15:10 -0400 Received: from neil.brianlane.com ([24.113.37.65]:44100 helo=lister.brianlane.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VJqoa-0000sS-3j for bug-parted@gnu.org; Wed, 11 Sep 2013 16:15:04 -0400 Received: from lister.brianlane.com (localhost [127.0.0.1]) by lister.brianlane.com (8.14.7/8.14.7) with ESMTP id r8BJPIXI015314 for ; Wed, 11 Sep 2013 12:25:18 -0700 Received: (from bcl@localhost) by lister.brianlane.com (8.14.7/8.14.7/Submit) id r8BJPHMP015313 for bug-parted@gnu.org; Wed, 11 Sep 2013 12:25:17 -0700 From: "Brian C. Lane" To: bug-parted@gnu.org Subject: [PATCH 10/19] libparted: mklabel to support EDEV DASD Date: Wed, 11 Sep 2013 12:25:00 -0700 Message-Id: <1378927509-15215-11-git-send-email-bcl@redhat.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1378927509-15215-1-git-send-email-bcl@redhat.com> References: <1378927509-15215-1-git-send-email-bcl@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) From: Nageswara R Sastry Fixed Block Access (FBA) DASDs are mainframe-specific disk devices which are layed out as a sequence of 512-byte sectors. This patch adds support for mklabel to properly handle FBA devices. Signed-off-by: Nageswara R Sastry --- libparted/labels/fdasd.c | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/libparted/labels/fdasd.c b/libparted/labels/fdasd.c index 7de5f34..1f87937 100644 --- a/libparted/labels/fdasd.c +++ b/libparted/labels/fdasd.c @@ -870,19 +870,21 @@ fdasd_check_volume (fdasd_anchor_t *anc, int fd) vtoc_read_volume_label (fd, anc->label_pos, v); if (strncmp(v->vollbl, vtoc_ebcdic_enc ("VOL1", str, 4), 4) == 0) { - /* found VOL1 volume label */ - b = (cchhb2blk (&v->vtoc, &anc->geo) - 1) * anc->blksize; - - if (b > 0) { - int rc; - rc = fdasd_valid_vtoc_pointer (anc, b, fd); - - if (rc < 0) - return 1; - else - return 0; - } else { - fdasd_invalid_vtoc_pointer(anc); + if (anc->FBA_layout != 1 ) { + /* found VOL1 volume label */ + b = (cchhb2blk (&v->vtoc, &anc->geo) - 1) * anc->blksize; + + if (b > 0) { + int rc; + rc = fdasd_valid_vtoc_pointer (anc, b, fd); + + if (rc < 0) + return 1; + else + return 0; + } else { + fdasd_invalid_vtoc_pointer(anc); + } } } else if (strncmp (v->volkey, vtoc_ebcdic_enc ("LNX1", str, 4), 4) == 0 || strncmp (v->volkey, vtoc_ebcdic_enc ("CMS1", str, 4), 4) == 0) { -- 1.8.3.1