[udisks2/f17] Avoid using non-unique WWN for Samsung drives (#838691)

David Zeuthen davidz at fedoraproject.org
Tue Jul 10 21:14:55 UTC 2012


commit e9b83d432dae95045871e92802926ea63db6b43a
Author: David Zeuthen <zeuthen at gmail.com>
Date:   Tue Jul 10 17:14:32 2012 -0400

    Avoid using non-unique WWN for Samsung drives (#838691)

 ...seemingly-invalid-WWN-for-SAMSUNG-SP1604N.patch |   61 ++++++++++++++++++++
 udisks2.spec                                       |    9 +++-
 2 files changed, 69 insertions(+), 1 deletions(-)
---
diff --git a/udisks-1.99.0-Black-list-seemingly-invalid-WWN-for-SAMSUNG-SP1604N.patch b/udisks-1.99.0-Black-list-seemingly-invalid-WWN-for-SAMSUNG-SP1604N.patch
new file mode 100644
index 0000000..31b4800
--- /dev/null
+++ b/udisks-1.99.0-Black-list-seemingly-invalid-WWN-for-SAMSUNG-SP1604N.patch
@@ -0,0 +1,61 @@
+From 076185cd8bc2d912834f0815e4239e9648f760e0 Mon Sep 17 00:00:00 2001
+From: David Zeuthen <zeuthen at gmail.com>
+Date: Tue, 10 Jul 2012 17:09:16 -0400
+Subject: [PATCH] Black-list seemingly invalid WWN for SAMSUNG SP1604N hard
+ disks
+
+In this case, use the serial number as the VPD (the serial number does
+vary) otherwise we'll end up only creating a single Drive object.
+
+This was reported in https://bugzilla.redhat.com/show_bug.cgi?id=838691
+
+Signed-off-by: David Zeuthen <zeuthen at gmail.com>
+---
+ src/udiskslinuxdriveobject.c |   24 +++++++++++++++++++++++-
+ 1 file changed, 23 insertions(+), 1 deletion(-)
+
+diff --git a/src/udiskslinuxdriveobject.c b/src/udiskslinuxdriveobject.c
+index ebde954..1aa58a8 100644
+--- a/src/udiskslinuxdriveobject.c
++++ b/src/udiskslinuxdriveobject.c
+@@ -704,6 +704,28 @@ apply_configuration (UDisksLinuxDriveObject *object)
+ 
+ /* ---------------------------------------------------------------------------------------------------- */
+ 
++/* utility routine to blacklist WWNs that are not suitable to use
++ * for identification purposes
++ */
++static gboolean
++is_wwn_black_listed (const gchar *wwn)
++{
++  g_return_val_if_fail (wwn != NULL, FALSE);
++
++  if (g_str_has_prefix (wwn, "0x") || g_str_has_prefix (wwn, "0X"))
++    wwn += 2;
++
++  if (g_ascii_strcasecmp (wwn, "50f0000000000000") == 0)
++    {
++      /* SAMSUNG SP1604N (PATA), see https://bugzilla.redhat.com/show_bug.cgi?id=838691#c4 */
++      return TRUE;
++    }
++  else
++    {
++      return FALSE;
++    }
++}
++
+ static gchar *
+ check_for_vpd (GUdevDevice *device)
+ {
+@@ -718,7 +740,7 @@ check_for_vpd (GUdevDevice *device)
+   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)
++  if (wwn != NULL && strlen (wwn) > 0 && !is_wwn_black_listed (wwn))
+     {
+       ret = g_strdup (wwn);
+     }
+-- 
+1.7.10.4
+
diff --git a/udisks2.spec b/udisks2.spec
index f31ce9f..2db169b 100644
--- a/udisks2.spec
+++ b/udisks2.spec
@@ -8,7 +8,7 @@
 Summary: Disk Manager
 Name: udisks2
 Version: 1.94.0
-Release: 7%{?dist}
+Release: 8%{?dist}
 License: GPLv2+
 Group: System Environment/Libraries
 URL: http://www.freedesktop.org/wiki/Software/udisks
@@ -60,6 +60,9 @@ 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
 
+# https://bugzilla.redhat.com/show_bug.cgi?id=838691
+Patch4: udisks-1.99.0-Black-list-seemingly-invalid-WWN-for-SAMSUNG-SP1604N.patch
+
 %description
 udisks provides a daemon, D-Bus API and command line tools for
 managing disks and storage devices. This package is for the udisks 2.x
@@ -93,6 +96,7 @@ daemon. This package is for the udisks 2.x series.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 
 %build
 %configure --enable-gtk-doc
@@ -150,6 +154,9 @@ rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
 
 # Note: please don't forget the %{?dist} in the changelog. Thanks
 %changelog
+* Tue Jul 10 2012 David Zeuthen <davidz at redhat.com> - 1.94.0-8%{?dist}
+- Avoid using non-unique WWN for Samsung drives (#838691)
+
 * Thu Jun 14 2012 Peter Robinson <pbrobinson at fedoraproject.org> - 1.94.0-7%{?dist}
 - Add a Requires for eject (#810882)
 


More information about the scm-commits mailing list