summaryrefslogtreecommitdiff
path: root/drivers/block/rbd.c
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-04-26 15:44:36 -0500
committerSage Weil <sage@inktank.com>2013-05-01 21:19:47 -0700
commit129b79d4498581e52175ac5c3ef2168f616b0e5e (patch)
tree0231155bab376aec91d0a99ccefd3bb2a7b505d9 /drivers/block/rbd.c
parentfc71d8330e39ef3af816a9c869150250952cb712 (diff)
downloadlwn-129b79d4498581e52175ac5c3ef2168f616b0e5e.tar.gz
lwn-129b79d4498581e52175ac5c3ef2168f616b0e5e.zip
rbd: only set device exists flag when ready
Hold off setting the EXISTS rbd device flag until just before we announce the disk as available for use. There's no point in doing so any earlier than that, and at that point the device truly is fully set up and ready to use. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'drivers/block/rbd.c')
-rw-r--r--drivers/block/rbd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 65d021be6c9e..f84a11ed25a4 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -881,7 +881,6 @@ static int rbd_dev_set_mapping(struct rbd_device *rbd_dev)
rbd_dev->mapping.features = snap->features;
rbd_dev->mapping.read_only = true;
}
- set_bit(RBD_DEV_FLAG_EXISTS, &rbd_dev->flags);
return 0;
}
@@ -4785,6 +4784,7 @@ static int rbd_dev_probe_finish(struct rbd_device *rbd_dev)
/* Everything's ready. Announce the disk to the world. */
+ set_bit(RBD_DEV_FLAG_EXISTS, &rbd_dev->flags);
add_disk(rbd_dev->disk);
pr_info("%s: added with size 0x%llx\n", rbd_dev->disk->disk_name,