提交 129b79d4 编写于 作者: A Alex Elder 提交者: Sage Weil

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: NAlex Elder <elder@inktank.com>
Reviewed-by: NJosh Durgin <josh.durgin@inktank.com>
上级 fc71d833
...@@ -881,7 +881,6 @@ static int rbd_dev_set_mapping(struct rbd_device *rbd_dev) ...@@ -881,7 +881,6 @@ static int rbd_dev_set_mapping(struct rbd_device *rbd_dev)
rbd_dev->mapping.features = snap->features; rbd_dev->mapping.features = snap->features;
rbd_dev->mapping.read_only = true; rbd_dev->mapping.read_only = true;
} }
set_bit(RBD_DEV_FLAG_EXISTS, &rbd_dev->flags);
return 0; return 0;
} }
...@@ -4785,6 +4784,7 @@ static int rbd_dev_probe_finish(struct rbd_device *rbd_dev) ...@@ -4785,6 +4784,7 @@ static int rbd_dev_probe_finish(struct rbd_device *rbd_dev)
/* Everything's ready. Announce the disk to the world. */ /* Everything's ready. Announce the disk to the world. */
set_bit(RBD_DEV_FLAG_EXISTS, &rbd_dev->flags);
add_disk(rbd_dev->disk); add_disk(rbd_dev->disk);
pr_info("%s: added with size 0x%llx\n", rbd_dev->disk->disk_name, pr_info("%s: added with size 0x%llx\n", rbd_dev->disk->disk_name,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册