[udisks2/f17] Detect rst_pstor devices as drives (#828492)

David Zeuthen davidz at fedoraproject.org
Tue Jun 5 19:10:35 UTC 2012


commit 02ac7b2627079937781440a3f105e2b44917645b
Author: David Zeuthen <zeuthen at gmail.com>
Date:   Tue Jun 5 15:09:39 2012 -0400

    Detect rst_pstor devices as drives (#828492)

 ...has-ID_PATH-set-consider-it-to-be-a-drive.patch |   56 ++++++++++++++++++++
 udisks2.spec                                       |    8 +++-
 2 files changed, 63 insertions(+), 1 deletions(-)
---
diff --git a/udisks-1.97.0-If-a-block-device-has-ID_PATH-set-consider-it-to-be-a-drive.patch b/udisks-1.97.0-If-a-block-device-has-ID_PATH-set-consider-it-to-be-a-drive.patch
new file mode 100644
index 0000000..863967d
--- /dev/null
+++ b/udisks-1.97.0-If-a-block-device-has-ID_PATH-set-consider-it-to-be-a-drive.patch
@@ -0,0 +1,56 @@
+From 93e82ba32dd51d3b8d786060c4bbe44e62a85bb5 Mon Sep 17 00:00:00 2001
+From: David Zeuthen <zeuthen at gmail.com>
+Date: Tue, 5 Jun 2012 14:44:48 -0400
+Subject: [PATCH] If a block device has ID_PATH set, consider it to be a drive
+
+This fixes problems with the devices where ID_SERIAL or
+ID_WWN_WITH_EXTENSION is not set. For example, block devices from the
+rts_pstor driver.
+
+See https://bugzilla.redhat.com/show_bug.cgi?id=828492
+
+Signed-off-by: David Zeuthen <zeuthen at gmail.com>
+---
+ src/udiskslinuxdriveobject.c |   12 ++++++++----
+ 1 file changed, 8 insertions(+), 4 deletions(-)
+
+diff --git a/src/udiskslinuxdriveobject.c b/src/udiskslinuxdriveobject.c
+index 41cc40e..1e8142a 100644
+--- a/src/udiskslinuxdriveobject.c
++++ b/src/udiskslinuxdriveobject.c
+@@ -665,17 +665,17 @@ udisks_linux_drive_object_uevent (UDisksLinuxDriveObject *object,
+ static gchar *
+ check_for_vpd (GUdevDevice *device)
+ {
+-  gchar *ret;
++  gchar *ret = NULL;
+   const gchar *serial;
+   const gchar *wwn;
++  const gchar *path;
+ 
+   g_return_val_if_fail (G_UDEV_IS_DEVICE (device), FALSE);
+ 
+-  ret = NULL;
+-
+-  /* prefer WWN to serial */
++  /* order of preference: WWN, serial, path */
+   serial = g_udev_device_get_property (device, "ID_SERIAL");
+   wwn = g_udev_device_get_property (device, "ID_WWN_WITH_EXTENSION");
++  path = g_udev_device_get_property (device, "ID_PATH");
+   if (wwn != NULL && strlen (wwn) > 0)
+     {
+       ret = g_strdup (wwn);
+@@ -684,6 +684,10 @@ check_for_vpd (GUdevDevice *device)
+     {
+       ret = g_strdup (serial);
+     }
++  else if (path != NULL && strlen (path) > 0)
++    {
++      ret = g_strdup (path);
++    }
+   return ret;
+ }
+ 
+-- 
+1.7.10.2
+
diff --git a/udisks2.spec b/udisks2.spec
index f096f04..ce3fb75 100644
--- a/udisks2.spec
+++ b/udisks2.spec
@@ -8,7 +8,7 @@
 Summary: Disk Manager
 Name: udisks2
 Version: 1.94.0
-Release: 5%{?dist}
+Release: 6%{?dist}
 License: GPLv2+
 Group: System Environment/Libraries
 URL: http://www.freedesktop.org/wiki/Software/udisks
@@ -55,6 +55,8 @@ Patch0: udisks-1.97.0-Add-work-around-to-show-FS-on-CDs-USB-sticks-created.patch
 Patch1: udisks-1.97-Also-check-for-target-is-busy-when-checking-umount-8.patch
 # https://bugs.freedesktop.org/show_bug.cgi?id=49842
 Patch2: udisks2-root-bound-mount-fix.patch
+# https://bugzilla.redhat.com/show_bug.cgi?id=828492
+Patch3: udisks-1.97.0-If-a-block-device-has-ID_PATH-set-consider-it-to-be-a-drive.patch
 
 %description
 udisks provides a daemon, D-Bus API and command line tools for
@@ -88,6 +90,7 @@ daemon. This package is for the udisks 2.x series.
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
+%patch3 -p1
 
 %build
 %configure --enable-gtk-doc
@@ -145,6 +148,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
 
 # Note: please don't forget the %{?dist} in the changelog. Thanks
 %changelog
+* Tue Jun 05 2012 David Zeuthen <davidz at redhat.com> - 1.94.0-6%{?dist}
+- Detect rst_pstor devices as drives (#828492)
+
 * Tue May 22 2012 Peter Robinson <pbrobinson at fedoraproject.org> - 1.94.0-5%{?dist}
 - Add upstream patch to fix issue with rootfs being on a bound mount
 


More information about the scm-commits mailing list