[PATCH 2/4] rbd: only set device exists flag when ready

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxxx>
---
 drivers/block/rbd.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index b6f32c2..b04e3e1 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;
 }
@@ -4779,6 +4778,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,
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux