Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 331671
b: refs/heads/master
c: 0f308a3
h: refs/heads/master
i:
  331669: d30539d
  331667: 2ef40f1
  331663: e7d3c35
v: v3
  • Loading branch information
Alex Elder committed Oct 1, 2012
1 parent 7840bac commit e27f32d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 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: 85ae8926751db5e09b9a12ee44609ee9e74b7aad
refs/heads/master: 0f308a3188b37f36bc5a078f5fe039a41714476e
16 changes: 9 additions & 7 deletions trunk/drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2623,10 +2623,16 @@ static ssize_t rbd_add(struct bus_type *bus,
goto err_out_id;
rbd_dev->major = rc;

rc = rbd_bus_add_dev(rbd_dev);
/* Set up the blkdev mapping. */

rc = rbd_init_disk(rbd_dev);
if (rc)
goto err_out_blkdev;

rc = rbd_bus_add_dev(rbd_dev);
if (rc)
goto err_out_disk;

/*
* At this point cleanup in the event of an error is the job
* of the sysfs code (initiated by rbd_bus_del_dev()).
Expand All @@ -2638,12 +2644,6 @@ static ssize_t rbd_add(struct bus_type *bus,
if (rc)
goto err_out_bus;

/* Set up the blkdev mapping. */

rc = rbd_init_disk(rbd_dev);
if (rc)
goto err_out_bus;

/* Everything's ready. Announce the disk to the world. */

set_capacity(rbd_dev->disk, rbd_dev->mapping.size / SECTOR_SIZE);
Expand All @@ -2664,6 +2664,8 @@ static ssize_t rbd_add(struct bus_type *bus,
kfree(options);
return rc;

err_out_disk:
rbd_free_disk(rbd_dev);
err_out_blkdev:
unregister_blkdev(rbd_dev->major, rbd_dev->name);
err_out_id:
Expand Down

0 comments on commit e27f32d

Please sign in to comment.