parted/0071-parted-check-the-name-of-partition-first-when-to-nam.patch
Brian C. Lane d75d85cc43 - Updating to upstream patches
- tests/t1701-rescue-fs wait for the device to appear. (bcl)
- Increase timeout for rmmod scsi_debug and make it a framework failure (bcl)
- libparted/dasd: add test cases for the new fdasd functions (dongdwdw)
- libparted/dasd: add an exception for changing DASD-LDL partition table (dongdwdw)
- libpartd/dasd: improve flag processing for DASD-LDL (dongdwdw)
- parted/ui: remove unneccesary information of command line (dongdwdw)
- parted: check the name of partition first when to name a partition (dongdwdw)
- Add support for RAM drives (sparschauer)
- Fix crash when localized (psusi)
- libparted: Fix typo in hfs error message (sebras)
- libparted: Fix MacOS boot support (laurent)
- mac: copy partition type and name correctly (saproj)
- libparted: Add support for atari partition tables (glaubitz)
- libparted:tests: Move get_sector_size() to common.c (glaubitz)
- tests: Update t0220 and t0280 for the swap flag. (bcl)
- libparted: set swap flag on GPT partitions (aschnell)
- libparted/dasd: add test cases for the new fdasd functions (dongdwdw)
- libparted/dasd: add new fdasd functions (dongdwdw)
- libparted/dasd: update and improve fdasd functions (dongdwdw)
- libparted/dasd: unify vtoc handling for cdl/ldl (dongdwdw)
- libparted: Don't warn if no HDIO_GET_IDENTITY ioctl (sparschauer)
- libparted: Fix starting CHS in protective MBR (petr.uzel)
- tests: Stop timing t9040 (#1172675) (bcl)
2017-05-02 09:41:50 -07:00

44 lines
1.5 KiB
Diff

From 1a891f6d352d47a6a9422083bbb38a2c4c4e901b Mon Sep 17 00:00:00 2001
From: Wang Dong <dongdwdw@linux.vnet.ibm.com>
Date: Fri, 24 Mar 2017 03:11:08 +0100
Subject: [PATCH 71/75] parted: check the name of partition first when to name
a partition
The previous function works well for the labels supporting naming
partition, but not for these which don't. If the disk label does not
support partition naming, two exceptions will be raised. Even after the first
error indicates it does not support name, parted yet asks user for
name in iteractive mode.
First check if the disk label supports partition naming and if it
does, it will continue; otherwise, it will stop and raise an
exception.
Signed-off-by: Wang Dong <dongdwdw@linux.vnet.ibm.com>
Signed-off-by: Hendrik Brueckner <brueckner@linux.vnet.ibm.com>
---
parted/parted.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/parted/parted.c b/parted/parted.c
index a7fcd3b..d2e1f24 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -870,6 +870,13 @@ do_name (PedDevice** dev, PedDisk** diskp)
if (!*diskp)
goto error;
+ if (!ped_disk_type_check_feature((*diskp)->type, PED_DISK_TYPE_PARTITION_NAME)) {
+ ped_exception_throw (PED_EXCEPTION_ERROR, PED_EXCEPTION_CANCEL,
+ _("%s disk labels do not support partition name."),
+ (*diskp)->type->name);
+ goto error;
+ }
+
if (!command_line_get_partition (_("Partition number?"), *diskp, &part))
goto error;
--
2.9.3