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] [xen-unstable] [BLKTAP] fix sysfs cleanup on error case

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [BLKTAP] fix sysfs cleanup on error case
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 21 Feb 2007 21:10:06 -0800
Delivery-date: Wed, 21 Feb 2007 21:09:53 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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 Jake Wires <jwires@xxxxxxxxxxxxx>
# Date 1172111891 28800
# Node ID f62a052384a54a379580a95aa79a70e3fcf86a6d
# Parent  eb190b1faa527370ac520f3611670664f54ef28d
[BLKTAP] fix sysfs cleanup on error case
Signed-off-by: Jake Wires <jwires@xxxxxxxxxxxxx>
---
 linux-2.6-xen-sparse/drivers/xen/blktap/xenbus.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff -r eb190b1faa52 -r f62a052384a5 
linux-2.6-xen-sparse/drivers/xen/blktap/xenbus.c
--- a/linux-2.6-xen-sparse/drivers/xen/blktap/xenbus.c  Wed Feb 21 20:30:37 
2007 +0000
+++ b/linux-2.6-xen-sparse/drivers/xen/blktap/xenbus.c  Wed Feb 21 18:38:11 
2007 -0800
@@ -47,6 +47,7 @@ struct backend_info
        blkif_t *blkif;
        struct xenbus_watch backend_watch;
        int xenbus_id;
+       int group_added;
 };
 
 
@@ -150,7 +151,12 @@ static struct attribute_group tapstat_gr
 
 int xentap_sysfs_addif(struct xenbus_device *dev)
 {
-       return sysfs_create_group(&dev->dev.kobj, &tapstat_group);
+       int err;
+       struct backend_info *be = dev->dev.driver_data;
+       err = sysfs_create_group(&dev->dev.kobj, &tapstat_group);
+       if (!err)
+               be->group_added = 1;
+       return err;
 }
 
 void xentap_sysfs_delif(struct xenbus_device *dev)
@@ -174,7 +180,8 @@ static int blktap_remove(struct xenbus_d
                tap_blkif_free(be->blkif);
                be->blkif = NULL;
        }
-       xentap_sysfs_delif(be->dev);
+       if (be->group_added)
+               xentap_sysfs_delif(be->dev);
        kfree(be);
        dev->dev.driver_data = NULL;
        return 0;

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [BLKTAP] fix sysfs cleanup on error case, Xen patchbot-unstable <=