GNU bug report logs - #15351
[PATCH 09/19] libparted: Avoid dasd as default disk type while probe

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: parted; Reported by: "Brian C. Lane" <bcl@HIDDEN>; Keywords: patch; dated Wed, 11 Sep 2013 20:17:01 UTC; Maintainer for parted is bug-parted@HIDDEN.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 11 Sep 2013 20:16:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 11 16:16:18 2013
Received: from localhost ([127.0.0.1]:56503 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1VJqpl-0004JY-Hg
	for submit <at> debbugs.gnu.org; Wed, 11 Sep 2013 16:16:17 -0400
Received: from eggs.gnu.org ([208.118.235.92]:46198)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <bcl@HIDDEN>) id 1VJqpj-0004JL-4h
 for submit <at> debbugs.gnu.org; Wed, 11 Sep 2013 16:16:15 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <bcl@HIDDEN>) id 1VJqpV-0001pQ-BY
 for submit <at> debbugs.gnu.org; Wed, 11 Sep 2013 16:16:09 -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_40 autolearn=disabled
 version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:39868)
 by eggs.gnu.org with esmtp (Exim 4.71)
 (envelope-from <bcl@HIDDEN>) id 1VJqpV-0001pL-7s
 for submit <at> debbugs.gnu.org; Wed, 11 Sep 2013 16:16:01 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:47686)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <bcl@HIDDEN>) id 1VJqpO-0002uC-Uf
 for bug-parted@HIDDEN; Wed, 11 Sep 2013 16:16:01 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <bcl@HIDDEN>) id 1VJqpI-0001kB-VX
 for bug-parted@HIDDEN; Wed, 11 Sep 2013 16:15:54 -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 <bcl@HIDDEN>) id 1VJqpH-0000sS-Fo
 for bug-parted@HIDDEN; Wed, 11 Sep 2013 16:15:48 -0400
Received: from lister.brianlane.com (localhost [127.0.0.1])
 by lister.brianlane.com (8.14.7/8.14.7) with ESMTP id r8BJPHo2015310
 for <bug-parted@HIDDEN>; Wed, 11 Sep 2013 12:25:17 -0700
Received: (from bcl@localhost)
 by lister.brianlane.com (8.14.7/8.14.7/Submit) id r8BJPHsL015309
 for bug-parted@HIDDEN; Wed, 11 Sep 2013 12:25:17 -0700
From: "Brian C. Lane" <bcl@HIDDEN>
To: bug-parted@HIDDEN
Subject: [PATCH 09/19] libparted: Avoid dasd as default disk type while probe
Date: Wed, 11 Sep 2013 12:24:59 -0700
Message-Id: <1378927509-15215-10-git-send-email-bcl@HIDDEN>
X-Mailer: git-send-email 1.8.3.1
In-Reply-To: <1378927509-15215-1-git-send-email-bcl@HIDDEN>
References: <1378927509-15215-1-git-send-email-bcl@HIDDEN>
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 <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)

From: Nageswara R Sastry <rnsastry@HIDDEN>

This patch avoids setting 'dasd' as a default disk type for
'disk image file' at the time of probe.

Signed-off-by: Nageswara R Sastry <rnsastry@HIDDEN>
---
 include/parted/fdasd.in.h | 1 +
 libparted/labels/fdasd.c  | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/include/parted/fdasd.in.h b/include/parted/fdasd.in.h
index 3692596..6f6a7e0 100644
--- a/include/parted/fdasd.in.h
+++ b/include/parted/fdasd.in.h
@@ -261,6 +261,7 @@ typedef struct fdasd_anchor {
 	struct fdasd_hd_geometry geo;
 	unsigned int label_block;
 	unsigned int FBA_layout;
+	bool is_file;
 } fdasd_anchor_t;
 
 enum offset {lower, upper};
diff --git a/libparted/labels/fdasd.c b/libparted/labels/fdasd.c
index b58b2be..7de5f34 100644
--- a/libparted/labels/fdasd.c
+++ b/libparted/labels/fdasd.c
@@ -301,6 +301,7 @@ fdasd_initialize_anchor (fdasd_anchor_t * anc)
 	}
 	anc->hw_cylinders = 0;
 	anc->formatted_cylinders = 0;
+	anc->is_file = 0;
 }
 
 /*
@@ -890,7 +891,7 @@ fdasd_check_volume (fdasd_anchor_t *anc, int fd)
 		/* Some times LDL formatted disks does not
 		   contain any volume label */
 		return 1;
-	} else {
+	} else if (! anc->is_file) {
 	/* didn't find VOL1 volume label */
 		anc->formatted_cylinders = anc->hw_cylinders;
 		anc->fspace_trk = anc->formatted_cylinders * anc->geo.heads
@@ -974,6 +975,7 @@ fdasd_get_geometry (const PedDevice *dev, fdasd_anchor_t *anc, int f)
 	    dasd_info.FBA_layout = 0;
 	    anc->hw_cylinders = ((st.st_size / blksize) / anc->geo.sectors) /
 				anc->geo.heads;
+	    anc->is_file = 1;
 	} else {
 		if (ioctl(f, HDIO_GETGEO, &anc->geo) != 0)
 			fdasd_error(anc, unable_to_ioctl,
@@ -995,6 +997,8 @@ fdasd_get_geometry (const PedDevice *dev, fdasd_anchor_t *anc, int f)
 			anc->hw_cylinders = characteristics->long_no_cyl;
 		else
 			anc->hw_cylinders = characteristics->no_cyl;
+
+		anc->is_file = 0;
 	}
 
 	anc->dev_type   = dasd_info.dev_type;
-- 
1.8.3.1





Acknowledgement sent to "Brian C. Lane" <bcl@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-parted@HIDDEN. Full text available.
Report forwarded to bug-parted@HIDDEN:
bug#15351; Package parted. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.