diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-09-24 19:13:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-09-24 19:13:49 -0400 |
commit | bee2d97b2c4583c2471aa65ab9c189a0011f62b3 (patch) | |
tree | 74bcd6a17f3db312268b4ad25aa05a1912ff174f /drivers | |
parent | 979570e02981d4a8fc20b3cc8fd651856c98ee9d (diff) | |
parent | 5ce765a540f34d1e2005e1210f49f67fdf11e997 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client
Pull two ceph fixes from Sage Weil:
"The first fixes a leak in the rbd setup error path, and the second
fixes a more serious problem with mismatched kmap/kunmap that surfaced
after the recent refactoring work."
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
libceph: only kunmap kmapped pages
rbd: drop dev reference on error in rbd_open()
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/block/rbd.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 9917943a3572..54a55f03115d 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
@@ -246,13 +246,12 @@ static int rbd_open(struct block_device *bdev, fmode_t mode) | |||
246 | { | 246 | { |
247 | struct rbd_device *rbd_dev = bdev->bd_disk->private_data; | 247 | struct rbd_device *rbd_dev = bdev->bd_disk->private_data; |
248 | 248 | ||
249 | rbd_get_dev(rbd_dev); | ||
250 | |||
251 | set_device_ro(bdev, rbd_dev->read_only); | ||
252 | |||
253 | if ((mode & FMODE_WRITE) && rbd_dev->read_only) | 249 | if ((mode & FMODE_WRITE) && rbd_dev->read_only) |
254 | return -EROFS; | 250 | return -EROFS; |
255 | 251 | ||
252 | rbd_get_dev(rbd_dev); | ||
253 | set_device_ro(bdev, rbd_dev->read_only); | ||
254 | |||
256 | return 0; | 255 | return 0; |
257 | } | 256 | } |
258 | 257 | ||