aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorHorst Hummel <horst.hummel@de.ibm.com>2006-04-11 01:53:47 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-04-11 09:18:38 -0400
commitdafd87aaef7d95a6ad3ff92e0d512e5b166c0716 (patch)
treee60cb58ab85a874c07e9a1d93ffc8b5c94858aa1 /drivers/s390
parent06fbcb104ad16c22eb5718ae598b306c777be8af (diff)
[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: Horst Hummel <horst.hummel@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/block/dasd.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
index 0a9f12c4e911..170aae004ceb 100644
--- a/drivers/s390/block/dasd.c
+++ b/drivers/s390/block/dasd.c
@@ -1968,7 +1968,7 @@ int
1968dasd_generic_set_offline (struct ccw_device *cdev) 1968dasd_generic_set_offline (struct ccw_device *cdev)
1969{ 1969{
1970 struct dasd_device *device; 1970 struct dasd_device *device;
1971 int max_count; 1971 int max_count, open_count;
1972 1972
1973 device = dasd_device_from_cdev(cdev); 1973 device = dasd_device_from_cdev(cdev);
1974 if (IS_ERR(device)) 1974 if (IS_ERR(device))
@@ -1985,10 +1985,16 @@ dasd_generic_set_offline (struct ccw_device *cdev)
1985 * in the other openers. 1985 * in the other openers.
1986 */ 1986 */
1987 max_count = device->bdev ? 0 : -1; 1987 max_count = device->bdev ? 0 : -1;
1988 if (atomic_read(&device->open_count) > max_count) { 1988 open_count = (int) atomic_read(&device->open_count);
1989 printk (KERN_WARNING "Can't offline dasd device with open" 1989 if (open_count > max_count) {
1990 " count = %i.\n", 1990 if (open_count > 0)
1991 atomic_read(&device->open_count)); 1991 printk (KERN_WARNING "Can't offline dasd device with "
1992 "open count = %i.\n",
1993 open_count);
1994 else
1995 printk (KERN_WARNING "%s",
1996 "Can't offline dasd device due to internal "
1997 "use\n");
1992 clear_bit(DASD_FLAG_OFFLINE, &device->flags); 1998 clear_bit(DASD_FLAG_OFFLINE, &device->flags);
1993 dasd_put_device(device); 1999 dasd_put_device(device);
1994 return -EBUSY; 2000 return -EBUSY;