Pre Merge pull request !46 from wangzhiqiang/openEuler-22.03-LTS
This commit is contained in:
commit
f2cc170ec3
88
0010-parted-remove-patch-which-modifid-cyl-size.patch
Normal file
88
0010-parted-remove-patch-which-modifid-cyl-size.patch
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
From bfce75fd13dd72c6300f0ac3d739e40df90f7dce Mon Sep 17 00:00:00 2001
|
||||||
|
From: lixiaokeng <lixiaokeng@huawei.com>
|
||||||
|
Date: Sun, 7 Jun 2020 15:18:00 +0000
|
||||||
|
Subject: [PATCH] parted: remove patch which modified cyl size
|
||||||
|
|
||||||
|
The cyl size was changed which leaded to "parted /dev/sdb -s mkpart primary 0cyl 128cyl"
|
||||||
|
could not perform as expected. Remove the patch "Use BLKSSZGET to get device sector size
|
||||||
|
in _device_probe_geometry()".
|
||||||
|
|
||||||
|
Signed-off-by:lixiaokeng<lixiaokeng@huawei.com>
|
||||||
|
---
|
||||||
|
linux.c | 52 ++++++++++++++++++----------------------------------
|
||||||
|
1 file changed, 18 insertions(+), 34 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c
|
||||||
|
index 37cf555..0d8149d 100644
|
||||||
|
--- a/libparted/arch/linux.c
|
||||||
|
+++ b/libparted/arch/linux.c
|
||||||
|
@@ -868,7 +868,6 @@ _device_probe_geometry (PedDevice* dev)
|
||||||
|
struct stat dev_stat;
|
||||||
|
struct hd_geometry geometry;
|
||||||
|
int geometry_is_valid = 0;
|
||||||
|
- int sector_size = 0;
|
||||||
|
|
||||||
|
if (!_device_stat (dev, &dev_stat))
|
||||||
|
return 0;
|
||||||
|
@@ -880,41 +879,26 @@ _device_probe_geometry (PedDevice* dev)
|
||||||
|
if (!dev->length)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
- /* initialize the bios_geom values to something */
|
||||||
|
- dev->bios_geom.sectors = 0;
|
||||||
|
- dev->bios_geom.heads = 0;
|
||||||
|
- dev->bios_geom.cylinders = 0;
|
||||||
|
-
|
||||||
|
- geometry_is_valid = !ioctl (arch_specific->fd, HDIO_GETGEO, &geometry)
|
||||||
|
- && geometry.sectors && geometry.heads;
|
||||||
|
-
|
||||||
|
-#if defined __s390__ || defined __s390x__
|
||||||
|
- if (geometry_is_valid) {
|
||||||
|
-#else
|
||||||
|
- if (!ioctl (arch_specific->fd, BLKSSZGET, §or_size)) {
|
||||||
|
- /* get the sector count first */
|
||||||
|
- dev->bios_geom.sectors = 1 + (sector_size / PED_SECTOR_SIZE_DEFAULT);
|
||||||
|
- dev->bios_geom.heads = 255;
|
||||||
|
- } else if (geometry_is_valid) {
|
||||||
|
- /* if BLKSSZGET failed, use deprecated HDIO_GETGEO result */
|
||||||
|
-#endif
|
||||||
|
- dev->bios_geom.sectors = geometry.sectors;
|
||||||
|
- dev->bios_geom.heads = geometry.heads;
|
||||||
|
+ /* The GETGEO ioctl is no longer useful (as of linux 2.6.x). We could
|
||||||
|
+ * still use it in 2.4.x, but this is contentious. Perhaps we should
|
||||||
|
+ * move to EDD. */
|
||||||
|
+ dev->bios_geom.sectors = 63;
|
||||||
|
+ dev->bios_geom.heads = 255;
|
||||||
|
+ dev->bios_geom.cylinders
|
||||||
|
+ = dev->length / (63 * 255);
|
||||||
|
+
|
||||||
|
+ /* FIXME: what should we put here? (TODO: discuss on linux-kernel) */
|
||||||
|
+ if (!ioctl (arch_specific->fd, HDIO_GETGEO, &geometry)
|
||||||
|
+ && geometry.sectors && geometry.heads) {
|
||||||
|
+ dev->hw_geom.sectors = geometry.sectors;
|
||||||
|
+ dev->hw_geom.heads = geometry.heads;
|
||||||
|
+ dev->hw_geom.cylinders
|
||||||
|
+ = dev->length / (dev->hw_geom.heads
|
||||||
|
+ * dev->hw_geom.sectors);
|
||||||
|
} else {
|
||||||
|
- ped_exception_throw (
|
||||||
|
- PED_EXCEPTION_WARNING,
|
||||||
|
- PED_EXCEPTION_OK,
|
||||||
|
- _("Could not determine sector size for %s: %s.\n"
|
||||||
|
- "Using the default sector size (%lld)."),
|
||||||
|
- dev->path, strerror (errno), PED_SECTOR_SIZE_DEFAULT);
|
||||||
|
- dev->bios_geom.sectors = 2;
|
||||||
|
- dev->bios_geom.heads = 255;
|
||||||
|
+ dev->hw_geom = dev->bios_geom;
|
||||||
|
}
|
||||||
|
|
||||||
|
- dev->bios_geom.cylinders
|
||||||
|
- = dev->length / (dev->bios_geom.heads
|
||||||
|
- * dev->bios_geom.sectors);
|
||||||
|
- dev->hw_geom = dev->bios_geom;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
--
|
||||||
|
1.8.3.1
|
||||||
|
|
||||||
@ -16,7 +16,7 @@
|
|||||||
Summary: The GNU disk partition manipulation program
|
Summary: The GNU disk partition manipulation program
|
||||||
Name: parted
|
Name: parted
|
||||||
Version: 3.4
|
Version: 3.4
|
||||||
Release: 4
|
Release: 5
|
||||||
URL: https://www.gnu.org/software/parted/
|
URL: https://www.gnu.org/software/parted/
|
||||||
Source0: ftp://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz
|
Source0: ftp://ftp.gnu.org/gnu/%{name}/%{name}-%{version}.tar.xz
|
||||||
License: GPLv3+
|
License: GPLv3+
|
||||||
@ -35,6 +35,7 @@ Patch6: 0006-scsi_get_product_info-fix-memleak-and-avoid-to-use-N.patch
|
|||||||
Patch7: 0007-fat_op_context_new-free-ctx-remap-and-goto-correct-l.patch
|
Patch7: 0007-fat_op_context_new-free-ctx-remap-and-goto-correct-l.patch
|
||||||
Patch8: 0008-hfsplus_cache_from_extent-fix-memleak.patch
|
Patch8: 0008-hfsplus_cache_from_extent-fix-memleak.patch
|
||||||
Patch9: 0009-fat_clobber-set-boot_sector-NULL-and-free-boot_secto.patch
|
Patch9: 0009-fat_clobber-set-boot_sector-NULL-and-free-boot_secto.patch
|
||||||
|
Patch10:0010-parted-remove-patch-which-modifid-cyl-size.patch
|
||||||
|
|
||||||
%description
|
%description
|
||||||
The GNU Parted program allows you to create, destroy, resize, move,
|
The GNU Parted program allows you to create, destroy, resize, move,
|
||||||
@ -119,6 +120,9 @@ fi
|
|||||||
%{_libdir}/pkgconfig/libparted*.pc
|
%{_libdir}/pkgconfig/libparted*.pc
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Dec 15 2023 wangzhiqiang <wangzhiqiang95@huawei.com> - 3.4-5
|
||||||
|
- remove patch which modify cyl-size
|
||||||
|
|
||||||
* Thu Mar 3 2022 Li Jinlin <lijinlin3@huawei.com> - 3.4-4
|
* Thu Mar 3 2022 Li Jinlin <lijinlin3@huawei.com> - 3.4-4
|
||||||
- fix memory leak in libparted
|
- fix memory leak in libparted
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user