Accepting request 491638 from home:sparschauer:branches:Base:System

libparted: Don't warn if no HDIO_GET_IDENTITY ioctl

OBS-URL: https://build.opensuse.org/request/show/491638
OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=124
This commit is contained in:
Sebastian Parschauer 2017-04-27 16:00:58 +00:00 committed by Git OBS Bridge
parent 01fe17fce4
commit 5568719e10
4 changed files with 57 additions and 10 deletions

View File

@ -0,0 +1,38 @@
From: Sebastian Parschauer <sparschauer@suse.de>
Date: Tue, 4 Oct 2016 10:30:37 +0200
Subject: libparted: Don't warn if no HDIO_GET_IDENTITY ioctl
References: bsc#964012, bsc#1001967
Patch-mainline: v3.3
Git-commit: 3df498541058e933881190677b4cf10193f6aa68
Fully virtualized Xen VMs (HVM) use Linux IDE devices which don't
support the HDIO_GET_IDENTITY ioctl. EINVAL is returned, a warning
is printed and the device model is set to "Generic IDE" in that
case. The problem is seeing the warning all the time. So drop it
for this case.
Signed-off-by: Sebastian Parschauer <sparschauer@suse.de>
---
--- a/libparted/arch/linux.c
+++ b/libparted/arch/linux.c
@@ -937,6 +937,7 @@ init_ide (PedDevice* dev)
PedExceptionOption ex_status;
char hdi_buf[41];
int sector_multiplier = 0;
+ int r;
if (!_device_stat (dev, &dev_stat))
goto error;
@@ -944,7 +945,11 @@ init_ide (PedDevice* dev)
if (!_device_open_ro (dev))
goto error;
- if (ioctl (arch_specific->fd, HDIO_GET_IDENTITY, &hdi)) {
+ r = ioctl (arch_specific->fd, HDIO_GET_IDENTITY, &hdi);
+ if (r && errno == EINVAL) {
+ /* silently ignore unsupported ioctl */
+ dev->model = strdup(_("Generic IDE"));
+ } else if (r) {
ex_status = ped_exception_throw (
PED_EXCEPTION_WARNING,
PED_EXCEPTION_IGNORE_CANCEL,

View File

@ -1,19 +1,18 @@
From b9420b8e618c8ad988c410e4289273ac962ec918 Mon Sep 17 00:00:00 2001
From: Petr Uzel <petr.uzel@suse.cz>
Date: Thu, 26 May 2016 09:28:21 +0200
Subject: [PATCH] libparted: open the device RO and lazily switch to RW only if
Subject: libparted: open the device RO and lazily switch to RW only if
necessary
[sparschauer: Use _flush_cache() also for reads, don't switch to RW
in _flush_cache() to avoid a possible recursion (bnc#989751), open
partitions in _flush_cache() O_RDONLY instead of O_WRONLY]
Signed-off-by: Sebastian Parschauer <sparschauer@suse.de>
References: bsc#979275
Patch-mainline: not yet
Avoid useless udev events triggered by opening the device RW
for purely read-only operations.
References: https://bugzilla.novell.com/show_bug.cgi?id=979275
Author: Michael Matz <matz@suse.de>
[sparschauer: Use _flush_cache() also for reads, don't switch to RW
in _flush_cache() to avoid a possible recursion (bnc#989751), open
partitions in _flush_cache() O_RDONLY instead of O_WRONLY]
Signed-off-by: Sebastian Parschauer <sparschauer@suse.de>
---
libparted/arch/linux.c | 33 ++++++++++++++++++++++++++++++---
libparted/arch/linux.h | 1 +

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Thu Apr 27 17:37:19 CEST 2017 - sparschauer@suse.de
- libparted: Don't warn if the HDIO_GET_IDENTITY ioctl isn't
supported (bsc#964012, bsc#1001967)
- add: libparted-dont-warn-if-no-HDIO_GET_IDENTITY.patch
- Amend patch description:
- libparted-open-the-device-RO-and-lazily-switch-to-RW.patch
-------------------------------------------------------------------
Tue Aug 9 14:36:20 CEST 2016 - sparschauer@suse.de

View File

@ -1,7 +1,7 @@
#
# spec file for package parted
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -59,10 +59,10 @@ Patch31: parted-do-not-warn-when-shrinking-in-script-mode.patch
Patch32: libparted-Use-read-only-when-probing-devices-on-linu.patch
Patch33: libparted-open-the-device-RO-and-lazily-switch-to-RW.patch
Patch34: parted-implement-wipesignatures-option.patch
# bsc#982169
Patch35: libparted-Add-support-for-NVMe-devices.patch
Patch36: libparted-fix-nvme-partition-naming.patch
Patch37: libparted-dont-warn-if-no-HDIO_GET_IDENTITY.patch
Patch100: parted-fatresize-autoconf.patch
BuildRequires: check-devel
BuildRequires: device-mapper-devel >= 1.02.33
@ -142,6 +142,7 @@ to develop applications that require these.
%patch34 -p1
%patch35 -p1
%patch36 -p1
%patch37 -p1
%patch100 -p1
%build