Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359650
b: refs/heads/master
c: a14ea26
h: refs/heads/master
v: v3
  • Loading branch information
Alex Elder authored and Sage Weil committed Feb 14, 2013
1 parent eebc302 commit e9f75c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 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: 9cbb1d7268afa997a7f96d779470cc57d28e1a13
refs/heads/master: a14ea269dd6b5e48a2941ba73b202cd7cd5d716d
12 changes: 6 additions & 6 deletions trunk/drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -394,12 +394,12 @@ static int rbd_open(struct block_device *bdev, fmode_t mode)
if ((mode & FMODE_WRITE) && rbd_dev->mapping.read_only)
return -EROFS;

spin_lock(&rbd_dev->lock);
spin_lock_irq(&rbd_dev->lock);
if (test_bit(RBD_DEV_FLAG_REMOVING, &rbd_dev->flags))
removing = true;
else
rbd_dev->open_count++;
spin_unlock(&rbd_dev->lock);
spin_unlock_irq(&rbd_dev->lock);
if (removing)
return -ENOENT;

Expand All @@ -416,9 +416,9 @@ static int rbd_release(struct gendisk *disk, fmode_t mode)
struct rbd_device *rbd_dev = disk->private_data;
unsigned long open_count_before;

spin_lock(&rbd_dev->lock);
spin_lock_irq(&rbd_dev->lock);
open_count_before = rbd_dev->open_count--;
spin_unlock(&rbd_dev->lock);
spin_unlock_irq(&rbd_dev->lock);
rbd_assert(open_count_before > 0);

mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING);
Expand Down Expand Up @@ -4099,12 +4099,12 @@ static ssize_t rbd_remove(struct bus_type *bus,
goto done;
}

spin_lock(&rbd_dev->lock);
spin_lock_irq(&rbd_dev->lock);
if (rbd_dev->open_count)
ret = -EBUSY;
else
set_bit(RBD_DEV_FLAG_REMOVING, &rbd_dev->flags);
spin_unlock(&rbd_dev->lock);
spin_unlock_irq(&rbd_dev->lock);
if (ret < 0)
goto done;

Expand Down

0 comments on commit e9f75c6

Please sign in to comment.