Hello community,

here is the log from the commit of package udev for openSUSE:12.2 checked in at 
2012-08-04 22:25:12
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.2/udev (Old)
 and      /work/SRC/openSUSE:12.2/.udev.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "udev", Maintainer is "rmila...@suse.com"

Changes:
--------
--- /work/SRC/openSUSE:12.2/udev/udev.changes   2012-07-25 16:21:25.000000000 
+0200
+++ /work/SRC/openSUSE:12.2/.udev.new/udev.changes      2012-08-05 
00:32:44.000000000 +0200
@@ -1,0 +2,14 @@
+Fri Aug  3 10:19:12 UTC 2012 - rmila...@suse.com
+
+- Simplify function open_queue_file.
+    add: 0024-libudev-queue.c-simplified-open_queue_file.patch
+
+-------------------------------------------------------------------
+Thu Aug  2 11:44:09 UTC 2012 - rmila...@suse.com
+
+- Rework 0013-re-enable-by_path-links-for-ata-devices.patch to handle
+  by-path links similar to the scsi devices.
+  Fix rules timestamp race (bnc#772075)
+    add: 0023-udev-fix-rules-timestamp-race.patch
+
+-------------------------------------------------------------------

New:
----
  0023-udev-fix-rules-timestamp-race.patch
  0024-libudev-queue.c-simplified-open_queue_file.patch

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ udev.spec ++++++
--- /var/tmp/diff_new_pack.Pluw7I/_old  2012-08-05 00:33:27.000000000 +0200
+++ /var/tmp/diff_new_pack.Pluw7I/_new  2012-08-05 00:33:27.000000000 +0200
@@ -96,6 +96,10 @@
 Patch21:        0021-keymap-Add-Dell-Latitude-force-release-quirk.patch
 # PATCH-FIX-UPSTREAM 
0022-keymap-Broaden-ThinkPad-X2.-tablet-match-to-also-app.patch
 Patch22:        0022-keymap-Broaden-ThinkPad-X2.-tablet-match-to-also-app.patch
+# PATCH-FIX-OPENSUSE 0023-udev-fix-rules-timestamp-race.patch
+Patch23:        0023-udev-fix-rules-timestamp-race.patch
+# PATCH-FIX-UPSTREAM 0024-libudev-queue.c-simplified-open_queue_file.patch
+Patch24:        0024-libudev-queue.c-simplified-open_queue_file.patch
 
 # Upstream First - Policy:
 # Never add any patches to this package without the upstream commit id
@@ -187,6 +191,8 @@
 %patch20 -p1
 %patch21 -p1
 %patch22 -p1
+%patch23 -p1
+%patch24 -p1
 
 %build
 autoreconf -vfi

++++++ 0013-re-enable-by_path-links-for-ata-devices.patch ++++++
--- /var/tmp/diff_new_pack.Pluw7I/_old  2012-08-05 00:33:27.000000000 +0200
+++ /var/tmp/diff_new_pack.Pluw7I/_new  2012-08-05 00:33:27.000000000 +0200
@@ -2,7 +2,7 @@
 ===================================================================
 --- udev-182.orig/src/udev-builtin-path_id.c
 +++ udev-182/src/udev-builtin-path_id.c
-@@ -286,6 +286,26 @@ out:
+@@ -286,6 +286,85 @@ out:
          return hostdev;
  }
  
@@ -11,40 +11,95 @@
 +        struct udev_device *hostdev;
 +        int host, bus, target, lun;
 +        const char *name;
++        char *base;
++        char *pos;
++        DIR *dir;
++        struct dirent *dent;
++        int basenum, len;
 +
 +        hostdev = udev_device_get_parent_with_subsystem_devtype(parent, 
"scsi", "scsi_host");
-+
 +        if (hostdev == NULL)
 +                return NULL;
 +
 +        name = udev_device_get_sysname(parent);
-+
 +        if (sscanf(name, "%d:%d:%d:%d", &host, &bus, &target, &lun) != 4)
 +                return NULL;
 +
++        /* rebase ata offset to get the local relative number */
++        basenum = -1;
++        base = strdup(udev_device_get_syspath(hostdev));
++        if (base == NULL)
++                return NULL;
++        pos = strrchr(base, '/');
++        if (pos == NULL) {
++                parent = NULL;
++                goto out;
++        }
++        pos[0] = '\0';
++        len = strlen(base) - 5;
++        if (len <= 0) {
++                parent = NULL;
++                goto out;
++        }
++        base[len] = '\0';
++        dir = opendir(base);
++        if (dir == NULL) {
++                parent = NULL;
++                goto out;
++        }
++        for (dent = readdir(dir); dent != NULL; dent = readdir(dir)) {
++                char *rest;
++                int i;
++
++                if (dent->d_name[0] == '.')
++                        continue;
++                if (dent->d_type != DT_DIR && dent->d_type != DT_LNK)
++                        continue;
++                if (strncmp(dent->d_name, "ata", 3) != 0)
++                        continue;
++                i = strtoul(&dent->d_name[3], &rest, 10);
++
++                /* ata devices start with 1, so decrease by 1 if i is bigger 
then 0 */
++                if (i > 0)
++                        i--;
++                if (rest[0] != '\0')
++                        continue;
++                /*
++                 * find the smallest number; the host really needs to export 
its
++                 * own instance number per parent device; relying on the 
global host
++                 * enumeration and plainly rebasing the numbers sounds 
unreliable
++                 */
++                if (basenum == -1 || i < basenum)
++                        basenum = i;
++        }
++        closedir(dir);
++        if (basenum == -1) {
++                parent = NULL;
++                goto out;
++        }
++        host -= basenum;
++
 +        path_prepend(path, "scsi-%u:%u:%u:%u", host, bus, target, lun);
-+        return parent;
++out:
++        free(base);
++        return hostdev;
 +}
 +
  static struct udev_device *handle_scsi(struct udev_device *parent, char 
**path)
  {
          const char *devtype;
-@@ -323,15 +343,14 @@ static struct udev_device *handle_scsi(s
+@@ -322,16 +401,8 @@ static struct udev_device *handle_scsi(s
+                 goto out;
          }
  
-         /*
+-        /*
 -         * We do not support the ATA transport class, it creates duplicated 
link
 -         * names as the fake SCSI host adapters are all separated, they are 
all
 -         * re-based as host == 0. ATA should just stop faking two duplicated
 -         * hierarchies for a single topology and leave the SCSI stuff alone;
 -         * until that happens, there are no by-path/ links for ATA devices 
behind
 -         * an ATA transport class.
-+         * Ugly way to make by-path links for ata devices.
-+         * Using the handle_scsi_default function make all host
-+         * equal to 0 which is a problem.
-+         *
-          */
-+
+-         */
          if (strstr(name, "/ata") != NULL) {
 -                parent = NULL;
 +                parent = handle_ata(parent, path);

++++++ 0019-udev-path_id-export-path-for-platform-block-devices.patch ++++++
--- /var/tmp/diff_new_pack.Pluw7I/_old  2012-08-05 00:33:27.000000000 +0200
+++ /var/tmp/diff_new_pack.Pluw7I/_new  2012-08-05 00:33:27.000000000 +0200
@@ -19,7 +19,7 @@
 ===================================================================
 --- udev-182.orig/src/udev-builtin-path_id.c
 +++ udev-182/src/udev-builtin-path_id.c
-@@ -477,6 +477,7 @@ static int builtin_path_id(struct udev_d
+@@ -529,6 +529,7 @@ static int builtin_path_id(struct udev_d
                  } else if (strcmp(subsys, "platform") == 0) {
                          path_prepend(&path, "platform-%s", 
udev_device_get_sysname(parent));
                          parent = skip_subsystem(parent, "platform");

++++++ 0023-udev-fix-rules-timestamp-race.patch ++++++
--- udev-182.orig/src/udev-rules.c.orig 2012-08-01 14:23:16.000000000 +0000
+++ udev-182/src/udev-rules.c   2012-08-01 14:26:48.000000000 +0000
@@ -1754,6 +1754,7 @@ struct udev_rules *udev_rules_new(struct
         struct udev_list_entry *file_loop;
         struct token end_token;
         char **s;
+        unsigned long long *stamp_usec;
 
         rules = calloc(1, sizeof(struct udev_rules));
         if (rules == NULL)
@@ -1795,8 +1796,12 @@ struct udev_rules *udev_rules_new(struct
         memset(rules->trie_nodes, 0x00, sizeof(struct trie_node));
         rules->trie_nodes_cur = 1;
 
-        for (udev_get_rules_path(udev, &s, NULL); *s != NULL; s++)
+        for (udev_get_rules_path(udev, &s, &stamp_usec); *s != NULL; s++, 
stamp_usec++) {
+                struct stat stats;
+                if (stat(*s, &stats) == 0)
+                        *stamp_usec = ts_usec(&stats.st_mtim);
                 add_matching_files(udev, &file_list, *s, ".rules");
+        }
 
         /* add all filenames to the string buffer */
         udev_list_entry_foreach(file_loop, udev_list_get_entry(&file_list)) {
++++++ 0024-libudev-queue.c-simplified-open_queue_file.patch ++++++
>From a267bebf464cbb339d3411370f2e984dfc063567 Mon Sep 17 00:00:00 2001
From: Arvydas Sidorenko <asi...@gmail.com>
Date: Tue, 31 Jul 2012 11:38:08 +0200
Subject: [PATCH] libudev-queue.c: simplified open_queue_file

There is no apparent justification for using util_strscpyl
on the filename since it's a plain hardcoded path.
Older versions used:
util_strscpyl(filename, sizeof(filename), SOME_DIR, "/queue.bin", NULL);
and when changed nobody bothered to simplify it.

Index: udev-182/src/libudev-queue.c
===================================================================
--- udev-182.orig/src/libudev-queue.c
+++ udev-182/src/libudev-queue.c
@@ -208,11 +208,9 @@ ssize_t udev_queue_read_devpath(FILE *qu
 
 static FILE *open_queue_file(struct udev_queue *udev_queue, unsigned long long 
int *seqnum_start)
 {
-        char filename[UTIL_PATH_SIZE];
         FILE *queue_file;
 
-        util_strscpyl(filename, sizeof(filename), 
udev_get_run_path(udev_queue->udev), "/queue.bin", NULL);
-        queue_file = fopen(filename, "re");
+        queue_file = fopen("/run/udev/queue.bin", "re");
         if (queue_file == NULL)
                 return NULL;
 
-- 
To unsubscribe, e-mail: opensuse-commit+unsubscr...@opensuse.org
For additional commands, e-mail: opensuse-commit+h...@opensuse.org

Reply via email to