Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 25485
b: refs/heads/master
c: dafd87a
h: refs/heads/master
i:
  25483: 2214fec
v: v3
  • Loading branch information
Horst Hummel authored and Linus Torvalds committed Apr 11, 2006
1 parent 48a6f20 commit 878fe26
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 06fbcb104ad16c22eb5718ae598b306c777be8af
refs/heads/master: dafd87aaef7d95a6ad3ff92e0d512e5b166c0716
16 changes: 11 additions & 5 deletions trunk/drivers/s390/block/dasd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1968,7 +1968,7 @@ int
dasd_generic_set_offline (struct ccw_device *cdev)
{
struct dasd_device *device;
int max_count;
int max_count, open_count;

device = dasd_device_from_cdev(cdev);
if (IS_ERR(device))
Expand All @@ -1985,10 +1985,16 @@ dasd_generic_set_offline (struct ccw_device *cdev)
* in the other openers.
*/
max_count = device->bdev ? 0 : -1;
if (atomic_read(&device->open_count) > max_count) {
printk (KERN_WARNING "Can't offline dasd device with open"
" count = %i.\n",
atomic_read(&device->open_count));
open_count = (int) atomic_read(&device->open_count);
if (open_count > max_count) {
if (open_count > 0)
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);
dasd_put_device(device);
return -EBUSY;
Expand Down

0 comments on commit 878fe26

Please sign in to comment.