Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 931bb68b authored by Gerald Schaefer's avatar Gerald Schaefer Committed by Martin Schwidefsky
Browse files

[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: default avatarGerald Schaefer <geraldsc@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 0fc3ddd6
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -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 @@ dcssblk_shared_store(struct device *dev, struct device_attribute *attr, const ch
	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;