diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 13:25:24 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-13 13:25:24 -0500 |
commit | a1703154200c390ab03c10224c586e815d3e31e8 (patch) | |
tree | df90865eed3cfdf7af8664b5453a90e09d17480a /drivers/block | |
parent | 67b5ad9a63caa2ce56ddd2b22b802dae00d72c13 (diff) | |
parent | 766fc43973b16f9becb6b7402b3e052dbb84adee (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client:
rbd: fix cleanup when trying to mount inexistent image
net/ceph: make ceph_msgr_wq non-reentrant
ceph: fsc->*_wq's aren't used in memory reclaim path
ceph: Always free allocated memory in osdmap_decode()
ceph: Makefile: Remove unnessary code
ceph: associate requests with opening sessions
ceph: drop redundant r_mds field
ceph: implement DIRLAYOUTHASH feature to get dir layout from MDS
ceph: add dir_layout to inode
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/rbd.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 008d4a00b50d..e1e38b11f48a 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
@@ -1790,18 +1790,29 @@ static ssize_t rbd_add(struct bus_type *bus, const char *buf, size_t count) | |||
1790 | 1790 | ||
1791 | rc = rbd_bus_add_dev(rbd_dev); | 1791 | rc = rbd_bus_add_dev(rbd_dev); |
1792 | if (rc) | 1792 | if (rc) |
1793 | goto err_out_disk; | 1793 | goto err_out_blkdev; |
1794 | |||
1794 | /* set up and announce blkdev mapping */ | 1795 | /* set up and announce blkdev mapping */ |
1795 | rc = rbd_init_disk(rbd_dev); | 1796 | rc = rbd_init_disk(rbd_dev); |
1796 | if (rc) | 1797 | if (rc) |
1797 | goto err_out_blkdev; | 1798 | goto err_out_bus; |
1798 | 1799 | ||
1799 | return count; | 1800 | return count; |
1800 | 1801 | ||
1802 | err_out_bus: | ||
1803 | mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); | ||
1804 | list_del_init(&rbd_dev->node); | ||
1805 | mutex_unlock(&ctl_mutex); | ||
1806 | |||
1807 | /* this will also clean up rest of rbd_dev stuff */ | ||
1808 | |||
1809 | rbd_bus_del_dev(rbd_dev); | ||
1810 | kfree(options); | ||
1811 | kfree(mon_dev_name); | ||
1812 | return rc; | ||
1813 | |||
1801 | err_out_blkdev: | 1814 | err_out_blkdev: |
1802 | unregister_blkdev(rbd_dev->major, rbd_dev->name); | 1815 | unregister_blkdev(rbd_dev->major, rbd_dev->name); |
1803 | err_out_disk: | ||
1804 | rbd_free_disk(rbd_dev); | ||
1805 | err_out_client: | 1816 | err_out_client: |
1806 | rbd_put_client(rbd_dev); | 1817 | rbd_put_client(rbd_dev); |
1807 | mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); | 1818 | mutex_lock_nested(&ctl_mutex, SINGLE_DEPTH_NESTING); |