aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/block/dasd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/block/dasd.c')
-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;