diff options
author | Alex Elder <elder@inktank.com> | 2012-08-30 00:11:07 +0200 |
---|---|---|
committer | Alex Elder <elder@inktank.com> | 2012-10-01 21:30:52 +0200 |
commit | 3ee4001e0c875ce8ebcdf5ea305e9a105b3687bd (patch) | |
tree | 6506f68e9a517b06a4679ee32ee358daea6ae855 /drivers/block | |
parent | rbd: set initial capacity in rbd_init_disk() (diff) | |
download | linux-3ee4001e0c875ce8ebcdf5ea305e9a105b3687bd.tar.xz linux-3ee4001e0c875ce8ebcdf5ea305e9a105b3687bd.zip |
rbd: set up watch before announcing disk
We're ready to handle header object (refresh) events at the point we
call rbd_bus_add_dev(). Set up the watch request on the rbd image
header just after that, and after we've registered the devices for
the snapshots for the initial snapshot context. Do this before
announce the disk as available for use.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/rbd.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 3274943b2342..61807c32996e 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c @@ -2646,16 +2646,17 @@ static ssize_t rbd_add(struct bus_type *bus, if (rc) goto err_out_bus; + rc = rbd_init_watch_dev(rbd_dev); + if (rc) + goto err_out_bus; + /* Everything's ready. Announce the disk to the world. */ add_disk(rbd_dev->disk); + pr_info("%s: added with size 0x%llx\n", rbd_dev->disk->disk_name, (unsigned long long) rbd_dev->mapping.size); - rc = rbd_init_watch_dev(rbd_dev); - if (rc) - goto err_out_bus; - return count; err_out_bus: |