[parted-devel] [PATCH] libparted/dasd: add an exception for changing DASD-LDL partition table

Wang Dong dongdwdw at linux.vnet.ibm.com
Fri Mar 24 02:11:09 UTC 2017


The partition table of DASD-LDL device with the dasd disk label
should not be changed according to its character in Linux.
When the user tries to modify the partition table, an exception
will be raised to inform user of this character.

Signed-off-by: Wang Dong <dongdwdw at linux.vnet.ibm.com>
Signed-off-by: Hendrik Brueckner <brueckner at linux.vnet.ibm.com>
---
 gnulib                  | 2 +-
 libparted/labels/dasd.c | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/gnulib b/gnulib
index 98ca2c0..71d39c1 160000
--- a/gnulib
+++ b/gnulib
@@ -1 +1 @@
-Subproject commit 98ca2c063cfe019b673fd0ce81448c919e9c989c
+Subproject commit 71d39c1644762745b94e9449c45bfd716a79a5eb
diff --git a/libparted/labels/dasd.c b/libparted/labels/dasd.c
index 7594e96..a8849a9 100644
--- a/libparted/labels/dasd.c
+++ b/libparted/labels/dasd.c
@@ -619,9 +619,11 @@ dasd_write (const PedDisk* disk)
 	PDEBUG;
 
 	/* If not formated in CDL, don't write anything. */
-	if (disk_specific->format_type == 1)
+	if (disk_specific->format_type == 1) {
+		ped_exception_throw (PED_EXCEPTION_WARNING, PED_EXCEPTION_CANCEL,
+				     _("The partition table of DASD-LDL device cannot be changed.\n"));
 		return 1;
+	}
 
 	/* initialize the anchor */
 	fdasd_initialize_anchor(&anchor);
-- 
2.8.4




More information about the parted-devel mailing list