ia64/xen-unstable

changeset 15179:0fd2bf14f38a

[BLKTAP] Ensure blktap doesn't try to re-create extant sysfs entries
Signed-off-by: Jake Wires <jwires@xensource.com>
author Jake Wires <jwires@xensource.com>
date Sat May 19 10:54:01 2007 -0700 (2007-05-19)
parents 1c232243a457
children b9da101ed945
files linux-2.6-xen-sparse/drivers/xen/blktap/xenbus.c
line diff
     1.1 --- a/linux-2.6-xen-sparse/drivers/xen/blktap/xenbus.c	Fri May 18 17:01:20 2007 +0100
     1.2 +++ b/linux-2.6-xen-sparse/drivers/xen/blktap/xenbus.c	Sat May 19 10:54:01 2007 -0700
     1.3 @@ -161,7 +161,9 @@ int xentap_sysfs_addif(struct xenbus_dev
     1.4  
     1.5  void xentap_sysfs_delif(struct xenbus_device *dev)
     1.6  {
     1.7 +	struct backend_info *be = dev->dev.driver_data;
     1.8  	sysfs_remove_group(&dev->dev.kobj, &tapstat_group);
     1.9 +	be->group_added = 0;
    1.10  }
    1.11  
    1.12  static int blktap_remove(struct xenbus_device *dev)
    1.13 @@ -212,11 +214,13 @@ static void tap_update_blkif_status(blki
    1.14  		return;
    1.15  	}
    1.16  
    1.17 -	err = xentap_sysfs_addif(blkif->be->dev);
    1.18 -	if (err) {
    1.19 -		xenbus_dev_fatal(blkif->be->dev, err, 
    1.20 -				 "creating sysfs entries");
    1.21 -		return;
    1.22 +	if (!blkif->be->group_added) {
    1.23 +		err = xentap_sysfs_addif(blkif->be->dev);
    1.24 +		if (err) {
    1.25 +			xenbus_dev_fatal(blkif->be->dev, err, 
    1.26 +					 "creating sysfs entries");
    1.27 +			return;
    1.28 +		}
    1.29  	}
    1.30  
    1.31  	blkif->xenblkd = kthread_run(tap_blkif_schedule, blkif, name);