diff options
author | Gerald Schaefer <geraldsc@de.ibm.com> | 2007-11-05 11:10:09 +0100 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2007-11-05 11:10:16 +0100 |
commit | 931bb68ba6355b7111966c90822ed862c102a9cd (patch) | |
tree | 33899e3be8cfd386a79cc67b72b4bb8b2b963ac2 /drivers/s390/block/dcssblk.c | |
parent | [S390] Fix smsgiucv init on no iucv machines (diff) | |
download | linux-931bb68ba6355b7111966c90822ed862c102a9cd.tar.xz linux-931bb68ba6355b7111966c90822ed862c102a9cd.zip |
[S390] device_schedule_callback() for dcssblk.
Unregistering a device from within a device attribute handler leads to
a deadlock. Need to use device_schedule_callback() to unregister device
in error path.
Signed-off-by: Gerald Schaefer <geraldsc@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/block/dcssblk.c')
-rw-r--r-- | drivers/s390/block/dcssblk.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c index 859f870552e3..5e083d1f57e7 100644 --- a/drivers/s390/block/dcssblk.c +++ b/drivers/s390/block/dcssblk.c @@ -193,6 +193,12 @@ dcssblk_segment_warn(int rc, char* seg_name) } } +static void dcssblk_unregister_callback(struct device *dev) +{ + device_unregister(dev); + put_device(dev); +} + /* * device attribute for switching shared/nonshared (exclusive) * operation (show + store) @@ -276,8 +282,7 @@ removeseg: blk_cleanup_queue(dev_info->dcssblk_queue); dev_info->gd->queue = NULL; put_disk(dev_info->gd); - device_unregister(dev); - put_device(dev); + rc = device_schedule_callback(dev, dcssblk_unregister_callback); out: up_write(&dcssblk_devices_sem); return rc; |