From aeed84995ea6f9687422c22cf5a733c465d44c92 Mon Sep 17 00:00:00 2001 From: CentOS Sources Date: Nov 03 2016 06:04:00 +0000 Subject: import parted-3.1-28.el7 --- diff --git a/SOURCES/0035-tests-Add-udevadm-settle-to-wait_for_-loop-1260664.patch b/SOURCES/0035-tests-Add-udevadm-settle-to-wait_for_-loop-1260664.patch new file mode 100644 index 0000000..1ab2558 --- /dev/null +++ b/SOURCES/0035-tests-Add-udevadm-settle-to-wait_for_-loop-1260664.patch @@ -0,0 +1,119 @@ +From 0d00bd73ba85c18082cbe47dd76e2adeba7e8620 Mon Sep 17 00:00:00 2001 +From: "Brian C. Lane" +Date: Tue, 1 Mar 2016 10:38:26 -0800 +Subject: [PATCH] tests: Add udevadm settle to wait_for_ loop (#1260664) + +Sometimes the device will vanish after the wait_for_dev_to_appear exits. +Add udevadm settle in an attempt to make sure the udev system is done +flapping around and the device will stay in place. + +Related: rhbz#1260664 +--- + tests/t-lib-helpers.sh | 2 ++ + tests/t-local.sh | 2 ++ + tests/t6001-psep.sh | 2 ++ + tests/t6002-dm-many-partitions.sh | 1 + + tests/t6003-dm-uuid.sh | 2 ++ + tests/t6100-mdraid-partitions.sh | 1 + + 6 files changed, 10 insertions(+) + +diff --git a/tests/t-lib-helpers.sh b/tests/t-lib-helpers.sh +index 4b3c122..b65d675 100644 +--- a/tests/t-lib-helpers.sh ++++ b/tests/t-lib-helpers.sh +@@ -371,6 +371,7 @@ wait_for_dev_to_appear_() + local i=0 + local incr=1 + while :; do ++ udevadm settle + ls "$file" > /dev/null 2>&1 && return 0 + sleep .1 2>/dev/null || { sleep 1; incr=10; } + i=$(expr $i + $incr); test $i = 20 && break +@@ -386,6 +387,7 @@ wait_for_dev_to_disappear_() + local i=0 + local incr=1 + while :; do ++ udevadm settle + ls "$file" > /dev/null 2>&1 || return 0 + sleep .1 2>/dev/null || { sleep 1; incr=10; } + i=$(expr $i + $incr); test $i -ge $(expr $n_sec \* 10) && break +diff --git a/tests/t-local.sh b/tests/t-local.sh +index dde1b8d..5305865 100644 +--- a/tests/t-local.sh ++++ b/tests/t-local.sh +@@ -47,6 +47,7 @@ wait_for_dev_to_appear_() + local i=0 + local incr=1 + while :; do ++ udevadm settle + ls "$file" > /dev/null 2>&1 && return 0 + sleep .1 2>/dev/null || { sleep 1; incr=10; } + i=$(expr $i + $incr); test $i = 20 && break +@@ -110,6 +111,7 @@ scsi_debug_setup_() + local i=0 + local new_dev + while :; do ++ udevadm settle + new_dev=$(new_sdX_) && break + sleep .1 2>/dev/null || { sleep 1; incr=10; } + i=$(expr $i + $incr); test $i = 20 && break +diff --git a/tests/t6001-psep.sh b/tests/t6001-psep.sh +index b747732..f22c877 100644 +--- a/tests/t6001-psep.sh ++++ b/tests/t6001-psep.sh +@@ -20,6 +20,8 @@ + . "${srcdir=.}/init.sh"; path_prepend_ ../parted + + require_root_ ++require_udevadm_settle_ ++ + (dmsetup --help) > /dev/null 2>&1 || skip_test_ "No dmsetup installed" + + # Device maps names - should be random to not conflict with existing ones on +diff --git a/tests/t6002-dm-many-partitions.sh b/tests/t6002-dm-many-partitions.sh +index 247c9ee..13894f5 100755 +--- a/tests/t6002-dm-many-partitions.sh ++++ b/tests/t6002-dm-many-partitions.sh +@@ -20,6 +20,7 @@ + . "${srcdir=.}/init.sh"; path_prepend_ ../parted + + require_root_ ++require_udevadm_settle_ + (dmsetup --help) > /dev/null 2>&1 || skip_test_ "No dmsetup installed" + + ss=$sector_size_ +diff --git a/tests/t6003-dm-uuid.sh b/tests/t6003-dm-uuid.sh +index f58cb06..f51e45f 100755 +--- a/tests/t6003-dm-uuid.sh ++++ b/tests/t6003-dm-uuid.sh +@@ -20,6 +20,7 @@ + . "${srcdir=.}/init.sh"; path_prepend_ ../parted + + require_root_ ++require_udevadm_settle_ + (dmsetup --help) > /dev/null 2>&1 || skip_test_ "No dmsetup installed" + + ss=$sector_size_ +@@ -46,6 +47,7 @@ for ((i=1; i<=$n_partitions; i+=1)); do + cmd="$cmd mkpart p$i ${s}s ${s}s" + done + parted -m -a min -s /dev/mapper/$dm_name mklabel gpt $cmd > /dev/null 2>&1 || fail=1 ++wait_for_dev_to_appear_ /dev/mapper/${dm_name}p${n_partitions} || fail=1 + + # Make sure all the partitions have UUIDs + for ((i=1; i<=$n_partitions; i+=1)); do +diff --git a/tests/t6100-mdraid-partitions.sh b/tests/t6100-mdraid-partitions.sh +index d7e7d6a..a74afe0 100755 +--- a/tests/t6100-mdraid-partitions.sh ++++ b/tests/t6100-mdraid-partitions.sh +@@ -38,6 +38,7 @@ parted -s "$scsi_dev" mklabel gpt \ + mkpart p1 ext2 1M 4M \ + mkpart p2 ext2 5M 8M > out 2>&1 || fail=1 + compare /dev/null out || fail=1 ++wait_for_dev_to_appear_ ${scsi_dev}2 || { fail=1; cat /proc/partitions; } + + cleanup_fn_() { + # stop mdraid array +-- +2.5.0 + diff --git a/SOURCES/0036-tests-Add-wait-to-t9042-1257415.patch b/SOURCES/0036-tests-Add-wait-to-t9042-1257415.patch new file mode 100644 index 0000000..be3d0d2 --- /dev/null +++ b/SOURCES/0036-tests-Add-wait-to-t9042-1257415.patch @@ -0,0 +1,31 @@ +From ce7a3fd5e2beeee6b0765decb77ba8ee15867342 Mon Sep 17 00:00:00 2001 +From: "Brian C. Lane" +Date: Tue, 1 Mar 2016 13:51:54 -0800 +Subject: [PATCH] tests: Add wait to t9042 (#1257415) + +Also make the new disklabel and first partition all in one step to +prevent udev problems. + +Resolves: rhbz#1257415 +--- + tests/t9042-dos-partition-limit.sh | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/t9042-dos-partition-limit.sh b/tests/t9042-dos-partition-limit.sh +index 67ea86d..fb2dd72 100644 +--- a/tests/t9042-dos-partition-limit.sh ++++ b/tests/t9042-dos-partition-limit.sh +@@ -44,8 +44,8 @@ printf '%s\n' "BYT;" \ + "1:$((start-2))s:$((n-1))s:$((n-start+2))s:::lba;" \ + > exp || fail=1 + +-parted -s $scsi_dev mklabel msdos || fail=1 +-parted -s -a min $scsi_dev mkpart extended $((start-2))s 100% || fail=1 ++parted -s -a min $scsi_dev mklabel msdos mkpart extended $((start-2))s 100% || fail=1 ++wait_for_dev_to_appear_ ${scsi_dev}1 || fail=1 + + i=1 + while :; do +-- +2.5.0 + diff --git a/SOURCES/0037-tests-Fix-t1700-failing-on-a-host-with-a-4k-xfs-file.patch b/SOURCES/0037-tests-Fix-t1700-failing-on-a-host-with-a-4k-xfs-file.patch new file mode 100644 index 0000000..4fc293c --- /dev/null +++ b/SOURCES/0037-tests-Fix-t1700-failing-on-a-host-with-a-4k-xfs-file.patch @@ -0,0 +1,57 @@ +From 72ed2ef652be536c6752febf4f03cfc5d343e520 Mon Sep 17 00:00:00 2001 +From: "Brian C. Lane" +Date: Mon, 29 Feb 2016 14:31:35 -0800 +Subject: [PATCH] tests: Fix t1700 failing on a host with a 4k xfs filesystem + (#1260664) + +The problem is that mkfs.xfs won't work if the file it is trying to +create is on a filesystem with a sector size larger than the passed +-ssize value. So a host with 4k disks (eg. s390) and the xfs filesystem +will fail with the error message: + illegal sector size 512; hw sector is 4096 + +Failures setting up the environment for the test aren't parted bugs. +This stops treating mkfs and dd errors as test failures, skipping the fs +and logging a warning. + +Related: rhbz#1260664 +--- + tests/t1700-probe-fs.sh | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/tests/t1700-probe-fs.sh b/tests/t1700-probe-fs.sh +index 83e6be4..2b59307 100755 +--- a/tests/t1700-probe-fs.sh ++++ b/tests/t1700-probe-fs.sh +@@ -30,13 +30,13 @@ for type in ext2 ext3 ext4 btrfs xfs nilfs2; do + case $type in ext*) n_sectors=8000 force=-F;; + *) n_sectors=$((512*1024)) force=;; esac + +- # create an $type file system +- if [ "$type" == "xfs" ]; then +- # Work around a problem with s390 +- mkfs.xfs -ssize=$ss -dfile,name=$dev,size=${n_sectors}s || fail=1 ++ # create an $type file system, creation failures are not parted bugs, ++ # skip the filesystem instead of failing the test. ++ if [ "$type" = "xfs" ]; then ++ mkfs.xfs -ssize=$ss -dfile,name=$dev,size=${n_sectors}s || { warn_ "$ME: mkfs.$type failed, skipping"; continue; } + else +- dd if=/dev/zero of=$dev bs=$ss count=$n_sectors >/dev/null || fail=1 +- mkfs.$type $force $dev || { warn_ $ME: mkfs.$type failed; fail=1; continue; } ++ dd if=/dev/null of=$dev bs=$ss seek=$n_sectors >/dev/null || { warn_ "$ME: dd failed, skipping $type"; continue; } ++ mkfs.$type $force $dev || { warn_ "$ME: mkfs.$type failed skipping"; continue; } + fi + + # probe the $type file system +@@ -48,7 +48,7 @@ done + # Some features should indicate ext4 by themselves. + for feature in uninit_bg flex_bg; do + # create an ext3 file system +- dd if=/dev/zero of=$dev bs=1024 count=4096 >/dev/null || fail=1 ++ dd if=/dev/null of=$dev bs=1024 seek=4096 >/dev/null || skip_ "dd failed" + mkfs.ext3 -F $dev >/dev/null || skip_ "mkfs.ext3 failed" + + # set the feature +-- +2.5.0 + diff --git a/SOURCES/0038-libparted-Remove-fdasd-geometry-code-from-alloc_meta.patch b/SOURCES/0038-libparted-Remove-fdasd-geometry-code-from-alloc_meta.patch new file mode 100644 index 0000000..22bc7c3 --- /dev/null +++ b/SOURCES/0038-libparted-Remove-fdasd-geometry-code-from-alloc_meta.patch @@ -0,0 +1,48 @@ +From 9da2f460bebf9a8281fdd52536d3676b0914b8fd Mon Sep 17 00:00:00 2001 +From: "Brian C. Lane" +Date: Mon, 11 Apr 2016 15:10:51 -0700 +Subject: [PATCH 38/39] libparted: Remove fdasd geometry code from + alloc_metadata (#1244833) + +commit db20944f changed how the trailing_metadata_end is calculated in +dasd_alloc_metadata, removing the need for setting up the anchor struct. +But dasd_alloc_metadata can be called in various contexts, and the +arch_specific->fd may or may not be valid during these calls. This can +result in unpredictable crashes when it uses a stale fd and tries to run +the file image code in fdasd_get_geometry instead of the device code. + +The solution is to just drop the unneeded code, and to remember that +arch_specific->fd should only be used when ped_device_open has first +been called. + +Resolves: rhbz#1244833 +--- + libparted/labels/dasd.c | 4 ---- + 1 file changed, 4 deletions(-) + +diff --git a/libparted/labels/dasd.c b/libparted/labels/dasd.c +index 4d533cf..5bffda7 100644 +--- a/libparted/labels/dasd.c ++++ b/libparted/labels/dasd.c +@@ -950,7 +950,6 @@ dasd_alloc_metadata (PedDisk* disk) + PedPartition* part = NULL; /* initialize solely to placate gcc */ + PedPartition* new_part2; + PedSector trailing_meta_start, trailing_meta_end; +- struct fdasd_anchor anchor; + + PED_ASSERT (disk != NULL); + PED_ASSERT (disk->dev != NULL); +@@ -1000,10 +999,7 @@ dasd_alloc_metadata (PedDisk* disk) + backed up, then restored to a larger size disk, etc. + */ + trailing_meta_start = part->geom.end + 1; +- fdasd_initialize_anchor(&anchor); +- fdasd_get_geometry(disk->dev, &anchor, arch_specific->fd); + trailing_meta_end = (long long) disk->dev->length - 1; +- fdasd_cleanup(&anchor); + if (trailing_meta_end >= trailing_meta_start) { + new_part2 = ped_partition_new (disk,PED_PARTITION_METADATA, + NULL, trailing_meta_start, trailing_meta_end); +-- +2.5.5 + diff --git a/SOURCES/0039-docs-Add-list-of-filesystems-for-fs-type-1311596.patch b/SOURCES/0039-docs-Add-list-of-filesystems-for-fs-type-1311596.patch new file mode 100644 index 0000000..fd629c1 --- /dev/null +++ b/SOURCES/0039-docs-Add-list-of-filesystems-for-fs-type-1311596.patch @@ -0,0 +1,29 @@ +From 8e64cda0151fa70195030d5abc0361bd3cd187bb Mon Sep 17 00:00:00 2001 +From: "Brian C. Lane" +Date: Mon, 29 Feb 2016 16:47:18 -0800 +Subject: [PATCH 39/39] docs: Add list of filesystems for fs-type (#1311596) + +Add the most common filesystem types to the parted manpage. + +Resolves: rhbz#1311596 +(cherry picked from commit c9f50a36aee0a4c373b5e1bd3069aeb18fac055d) +--- + doc/C/parted.8 | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/doc/C/parted.8 b/doc/C/parted.8 +index 1ea741e..03bb3a5 100644 +--- a/doc/C/parted.8 ++++ b/doc/C/parted.8 +@@ -76,6 +76,8 @@ should be one of "aix", "amiga", "bsd", "dvh", "gpt", "loop", "mac", "msdos", + .B mkpart \fIpart-type\fP \fI[fs-type]\fP \fIstart\fP \fIend\fP + Make a \fIpart-type\fP partition for filesystem \fIfs-type\fP (if specified), + beginning at \fIstart\fP and ending at \fIend\fP (by default in megabytes). ++\fIfs-type\fP can be one of "btrfs", "ext2", "ext3", "ext4", "fat16", "fat32", ++"hfs", "hfs+", "linux-swap", "ntfs", "reiserfs", or "xfs". + \fIpart-type\fP should be one of "primary", "logical", or "extended". + .TP + .B name \fIpartition\fP \fIname\fP +-- +2.5.5 + diff --git a/SOURCES/0040-partprobe-Open-the-device-once-for-probing-1339705.patch b/SOURCES/0040-partprobe-Open-the-device-once-for-probing-1339705.patch new file mode 100644 index 0000000..d470578 --- /dev/null +++ b/SOURCES/0040-partprobe-Open-the-device-once-for-probing-1339705.patch @@ -0,0 +1,45 @@ +From c34f2e31d804d70332b8be9760ea3f285d480070 Mon Sep 17 00:00:00 2001 +From: "Brian C. Lane" +Date: Wed, 25 May 2016 09:00:04 -0700 +Subject: [PATCH] partprobe: Open the device once for probing (#1339705) + +Previously there were 3 open/close pairs for the device, which may +result in triggering extra udev actions. Instead, open it once at the +start of process_dev and close it at the end. + +Resolves: rhbz#1339705 +--- + partprobe/partprobe.c | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/partprobe/partprobe.c b/partprobe/partprobe.c +index 8bccc4f..c5260c6 100644 +--- a/partprobe/partprobe.c ++++ b/partprobe/partprobe.c +@@ -108,6 +108,9 @@ process_dev (PedDevice* dev) + PedDiskType* disk_type; + PedDisk* disk; + ++ if (!ped_device_open (dev)) ++ return 0; ++ + disk_type = ped_disk_probe (dev); + if (!disk_type || !strcmp (disk_type->name, "loop")) + return 1; +@@ -122,11 +125,13 @@ process_dev (PedDevice* dev) + if (opt_summary) + summary (disk); + ped_disk_destroy (disk); ++ ped_device_close (dev); + return 1; + + error_destroy_disk: + ped_disk_destroy (disk); + error: ++ ped_device_close (dev); + return 0; + } + +-- +2.5.5 + diff --git a/SOURCES/0041-tests-Stop-timing-t9040-1172675.patch b/SOURCES/0041-tests-Stop-timing-t9040-1172675.patch new file mode 100644 index 0000000..77ea916 --- /dev/null +++ b/SOURCES/0041-tests-Stop-timing-t9040-1172675.patch @@ -0,0 +1,45 @@ +From 4e729dc2d3ab4339181f59dc0a51583ecc14c7ab Mon Sep 17 00:00:00 2001 +From: "Brian C. Lane" +Date: Mon, 29 Feb 2016 16:54:05 -0800 +Subject: [PATCH] tests: Stop timing t9040 (#1172675) + +parted doesn't have any control over how long this takes, there is no +reason to consider this a parted bug if it takes longer than expected. + +Resolves: rhbz#1172675 +--- + tests/t9040-many-partitions.sh | 10 ---------- + 1 file changed, 10 deletions(-) + +diff --git a/tests/t9040-many-partitions.sh b/tests/t9040-many-partitions.sh +index 8949310..1f8e201 100644 +--- a/tests/t9040-many-partitions.sh ++++ b/tests/t9040-many-partitions.sh +@@ -53,9 +53,7 @@ while :; do + done + + # Time the actual command: +-t0=$(date +%s.%N) + parted -m -a min -s $scsi_dev mklabel gpt $cmd u s p > out 2>&1 || fail=1 +-t_final=$(date +%s.%N) + + i=1 + while :; do +@@ -64,14 +62,6 @@ while :; do + printf "$i:${s}s:${e}s:${partition_sectors}s::p$i:;\n" >> exp + test $i = $n_partitions && break; i=$((i+1)) + done +- +-# Fail the test if it takes too long. +-# On Fedora 16, this takes about 10 seconds for me. +-# With Fedora-12-era kernels, it typically took more than 150 seconds. +-$AWK "BEGIN {d = $t_final - $t0; n = $n_partitions; st = 60 < d;"\ +-' printf "created %d partitions in %.2f seconds\n", n, d; exit st }' /dev/null \ +- || fail=1 +- + compare exp out || fail=1 + + Exit $fail +-- +2.5.5 + diff --git a/SOURCES/0042-tests-Set-optimal-blocks-to-64-for-scsi_debug-device.patch b/SOURCES/0042-tests-Set-optimal-blocks-to-64-for-scsi_debug-device.patch new file mode 100644 index 0000000..dead2e5 --- /dev/null +++ b/SOURCES/0042-tests-Set-optimal-blocks-to-64-for-scsi_debug-device.patch @@ -0,0 +1,32 @@ +From f648310fbc24186395e1864a48571982e1588435 Mon Sep 17 00:00:00 2001 +From: "Brian C. Lane" +Date: Tue, 23 Aug 2016 08:55:18 -0700 +Subject: [PATCH] tests: Set optimal blocks to 64 for scsi_debug devices + (#1359682) + +The Linux kernel 4.5 changed the optimal blocks count from 64 to 1024 +This causes tests using scsi_debug devices to fail because of alignment +issues. Set the opt_blks to 64 so that we have consistent behavior +across kernels. + +Resolves: rhbz#1359682 +--- + tests/t-local.sh | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tests/t-local.sh b/tests/t-local.sh +index 5305865..93ee0f7 100644 +--- a/tests/t-local.sh ++++ b/tests/t-local.sh +@@ -98,7 +98,7 @@ scsi_debug_setup_() + # It is not trivial to determine the name of the device we're creating. + # Record the names of all /sys/block/sd* devices *before* probing: + touch stamp +- modprobe scsi_debug "$@" || { rm -f stamp; return 1; } ++ modprobe scsi_debug opt_blks=64 "$@" || { rm -f stamp; return 1; } + scsi_debug_modprobe_succeeded_=1 + test "$VERBOSE" = yes \ + && warn_ $ME_ modprobe scsi_debug succeeded +-- +2.7.4 + diff --git a/SPECS/parted.spec b/SPECS/parted.spec index 328941d..749687f 100644 --- a/SPECS/parted.spec +++ b/SPECS/parted.spec @@ -4,7 +4,7 @@ Summary: The GNU disk partition manipulation program Name: parted Version: 3.1 -Release: 23%{?dist} +Release: 28%{?dist} License: GPLv3+ Group: Applications/System URL: http://www.gnu.org/software/parted @@ -50,6 +50,14 @@ Patch31: 0031-tests-Add-a-test-for-device-mapper-partition-sizes-1.patch Patch32: 0032-libparted-device-mapper-uses-512b-sectors-1188431.patch Patch33: 0033-libparted-Use-read-only-when-probing-devices-on-linu.patch Patch34: 0034-tests-Use-wait_for_dev_to_-functions.patch +Patch35: 0035-tests-Add-udevadm-settle-to-wait_for_-loop-1260664.patch +Patch36: 0036-tests-Add-wait-to-t9042-1257415.patch +Patch37: 0037-tests-Fix-t1700-failing-on-a-host-with-a-4k-xfs-file.patch +Patch38: 0038-libparted-Remove-fdasd-geometry-code-from-alloc_meta.patch +Patch39: 0039-docs-Add-list-of-filesystems-for-fs-type-1311596.patch +Patch40: 0040-partprobe-Open-the-device-once-for-probing-1339705.patch +Patch41: 0041-tests-Stop-timing-t9040-1172675.patch +Patch42: 0042-tests-Set-optimal-blocks-to-64-for-scsi_debug-device.patch Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: e2fsprogs-devel @@ -185,6 +193,32 @@ fi %changelog +* Fri Aug 26 2016 Brian C. Lane - 3.1-28 +- tests: Set optimal blocks to 64 for scsi_debug devices + Resolves: rhbz#1359682 + +* Mon Jul 18 2016 Brian C. Lane - 3.1-27 +- tests: Stop timing t9040 + Resolves: rhbz#1172675 + +* Thu May 26 2016 Brian C. Lane - 3.1-26 +- partprobe: Open the device once for probing + Resolves: rhbz#1339705 + +* Tue Apr 12 2016 Brian C. Lane 3.1-25 +- docs: Add list of filesystems for fs-type + Resolves: rhbz#1311596 +- libparted: Remove fdasd geometry code from alloc_metadata + Resolves: rhbz#1244833 + +* Tue Mar 01 2016 Brian C. Lane 3.1-24 +- tests: Add udevadm settle to wait_for_ loop + Related: rhbz#1260664 +- tests: Add-wait-to-t9042 + Resolves: rhbz#1257415 +- tests: Fix t1700 failing on a host with a 4k xfs file + Related: rhbz#1260664 + * Wed Aug 05 2015 Brian C. Lane 3.1-23 - libparted: Use read only when probing devices on linux Resolves: rhbz#1245144