[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>
This commit is contained in:
Gerald Schaefer 2007-11-05 11:10:09 +01:00 коммит произвёл Martin Schwidefsky
Родитель 0fc3ddd67a
Коммит 931bb68ba6
1 изменённых файлов: 7 добавлений и 2 удалений

Просмотреть файл

@ -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) * device attribute for switching shared/nonshared (exclusive)
* operation (show + store) * operation (show + store)
@ -276,8 +282,7 @@ removeseg:
blk_cleanup_queue(dev_info->dcssblk_queue); blk_cleanup_queue(dev_info->dcssblk_queue);
dev_info->gd->queue = NULL; dev_info->gd->queue = NULL;
put_disk(dev_info->gd); put_disk(dev_info->gd);
device_unregister(dev); rc = device_schedule_callback(dev, dcssblk_unregister_callback);
put_device(dev);
out: out:
up_write(&dcssblk_devices_sem); up_write(&dcssblk_devices_sem);
return rc; return rc;