All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Elder <elder@inktank.com>
To: ceph-devel@vger.kernel.org
Subject: [PATCH 4/4] rbd: defer setting the mapping size and features
Date: Sat, 27 Apr 2013 07:33:52 -0500	[thread overview]
Message-ID: <517BC5B0.3040106@inktank.com> (raw)
In-Reply-To: <517BC525.8090403@inktank.com>

There's no need to set the size/features for a mapped device until
we're about to make it available for use.  So wait until then to do
it.

Signed-off-by: Alex Elder <elder@inktank.com>
---
 drivers/block/rbd.c |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 12bc89f..b10348c 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -4712,10 +4712,6 @@ static int rbd_dev_probe_finish(struct rbd_device
*rbd_dev)
 	if (ret)
 		goto err_out_snaps;

-	ret = rbd_dev_set_mapping(rbd_dev);
-	if (ret)
-		goto err_out_snaps;
-
 	/* generate unique id: find highest unique id, add one */
 	rbd_dev_id_get(rbd_dev);

@@ -4774,10 +4770,15 @@ static int rbd_dev_probe_finish(struct
rbd_device *rbd_dev)
 	if (ret)
 		goto err_out_bus;

-	/* Everything's ready.  Announce the disk to the world. */
+	ret = rbd_dev_set_mapping(rbd_dev);
+	if (ret)
+		goto err_out_bus;

 	set_capacity(rbd_dev->disk, rbd_dev->mapping.size / SECTOR_SIZE);
 	set_bit(RBD_DEV_FLAG_EXISTS, &rbd_dev->flags);
+
+	/* 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,
-- 
1.7.9.5


  parent reply	other threads:[~2013-04-27 12:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-27 12:31 [PATCH 0/4] rbd: reorder some setup operations Alex Elder
2013-04-27 12:32 ` [PATCH 1/4] rbd: fix up some sysfs stuff Alex Elder
2013-04-27 12:33 ` [PATCH 2/4] rbd: only set device exists flag when ready Alex Elder
2013-04-27 12:33 ` [PATCH 3/4] rbd: defer setting disk capacity Alex Elder
2013-04-27 12:33 ` Alex Elder [this message]
2013-04-29 19:41 ` [PATCH 0/4] rbd: reorder some setup operations Josh Durgin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=517BC5B0.3040106@inktank.com \
    --to=elder@inktank.com \
    --cc=ceph-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.