WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Fix xenbus_cleanup_devices() to cleanup proper subdirect

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] Fix xenbus_cleanup_devices() to cleanup proper subdirectories
From: Xen patchbot -unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 13 Jan 2006 18:28:14 +0000
Delivery-date: Fri, 13 Jan 2006 18:36:25 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User kaf24@xxxxxxxxxxxxxxxxxxxx
# Node ID e888f9b28a5b9dd2e19326f32b483e1c084704ec
# Parent  956bf08c91c36e6734d9c38d2e481732c976d32b
Fix xenbus_cleanup_devices() to cleanup proper subdirectories
of the deleted path, not merely paths mwith matching prefixes.

Signed-off-by: Keir Fraser <keir@xxxxxxxxxxxxx>

diff -r 956bf08c91c3 -r e888f9b28a5b 
linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c
--- a/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c    Fri Jan 13 
14:09:39 2006
+++ b/linux-2.6-xen-sparse/drivers/xen/xenbus/xenbus_probe.c    Fri Jan 13 
14:22:36 2006
@@ -470,12 +470,17 @@
 
        DPRINTK("%s", info->nodename);
 
-       if (!strncmp(xendev->nodename, info->nodename, len)) {
-               info->dev = xendev;
-               get_device(dev);
-               return 1;
-       }
-       return 0;
+       /* Match the info->nodename path, or any subdirectory of that path. */
+       if (strncmp(xendev->nodename, info->nodename, len))
+               return 0;
+
+       /* If the node name is longer, ensure it really is a subdirectory. */
+       if ((strlen(xendev->nodename) > len) && (xendev->nodename[len] != '/'))
+               return 0;
+
+       info->dev = xendev;
+       get_device(dev);
+       return 1;
 }
 
 static void xenbus_cleanup_devices(const char *path, struct bus_type *bus)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] Fix xenbus_cleanup_devices() to cleanup proper subdirectories, Xen patchbot -unstable <=