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

Commit dafd87aa authored by Horst Hummel's avatar Horst Hummel Committed by Linus Torvalds
Browse files

[PATCH] s390: dasd device offline messages



The dasd driver sometimes print the misleading message "Can't offline dasd
device with open count = 0".  The reason why it can't offline the device in
this case is that the device is still in the startup phase.  Print a more
meaningful message.

Signed-off-by: default avatarHorst Hummel <horst.hummel@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 06fbcb10
Loading
Loading
Loading
Loading
+11 −5
Original line number Original line Diff line number Diff line
@@ -1968,7 +1968,7 @@ int
dasd_generic_set_offline (struct ccw_device *cdev)
dasd_generic_set_offline (struct ccw_device *cdev)
{
{
	struct dasd_device *device;
	struct dasd_device *device;
	int max_count;
	int max_count, open_count;


	device = dasd_device_from_cdev(cdev);
	device = dasd_device_from_cdev(cdev);
	if (IS_ERR(device))
	if (IS_ERR(device))
@@ -1985,10 +1985,16 @@ dasd_generic_set_offline (struct ccw_device *cdev)
	 * in the other openers.
	 * in the other openers.
	 */
	 */
	max_count = device->bdev ? 0 : -1;
	max_count = device->bdev ? 0 : -1;
	if (atomic_read(&device->open_count) > max_count) {
	open_count = (int) atomic_read(&device->open_count);
		printk (KERN_WARNING "Can't offline dasd device with open"
	if (open_count > max_count) {
			" count = %i.\n",
		if (open_count > 0)
			atomic_read(&device->open_count));
			printk (KERN_WARNING "Can't offline dasd device with "
				"open count = %i.\n",
				open_count);
		else
			printk (KERN_WARNING "%s",
				"Can't offline dasd device due to internal "
				"use\n");
		clear_bit(DASD_FLAG_OFFLINE, &device->flags);
		clear_bit(DASD_FLAG_OFFLINE, &device->flags);
		dasd_put_device(device);
		dasd_put_device(device);
		return -EBUSY;
		return -EBUSY;