Re: [PATCH 4/4] sysfs: make suicidal nodes just do it directly

Cornelia Huck
2007-09-28T13:55:57Z

On Thu, 20 Sep 2007 16:26:15 +0900,
Tejun Heo <htejun@gmail.com> wrote:

> Sysfs now allows direct suicide. Make suicidial sysfs nodes to use
> it and remove now unncessary callback mechanism.
>
> Signed-off-by: Tejun Heo <htejun@gmail.com>
> ---
> drivers/base/core.c | 33 ----------------------
> drivers/s390/cio/ccwgroup.c | 25 +++-------------
> drivers/scsi/scsi_sysfs.c | 13 +--------
> fs/sysfs/file.c | 63 -------------------------------------------
> include/linux/device.h | 6 ----
> include/linux/sysfs.h | 9 ------
> 6 files changed, 6 insertions(+), 143 deletions(-)

ccwgroup was implicitly relying on a held reference, fix that.

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>

---
drivers/s390/cio/ccwgroup.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletion(-)

--- linux-2.6.orig/drivers/s390/cio/ccwgroup.c
+++ linux-2.6/drivers/s390/cio/ccwgroup.c
@@ -72,7 +72,7 @@ ccwgroup_ungroup_store(struct device *de
struct ccwgroup_device *gdev;
int rc;

- gdev = to_ccwgroupdev(dev);
+ gdev = to_ccwgroupdev(get_device(dev));

if (gdev->state != CCWGROUP_OFFLINE)
return -EINVAL;
@@ -81,6 +81,7 @@ ccwgroup_ungroup_store(struct device *de
__ccwgroup_remove_symlinks(gdev);
device_unregister(dev);
mutex_unlock(&gdev->reg_mutex);
+ put_device(dev);

return count;
}