Commit 2c0d0a10 authored by Alex Elder's avatar Alex Elder

rbd: allow null image name

We will know the image id for format 2 parent images, but won't
initially know its image name.  Avoid making the query for an image
id in rbd_dev_image_id() if it's already known.
Signed-off-by: default avatarAlex Elder <elder@inktank.com>
Reviewed-by: default avatarJosh Durgin <josh.durgin@inktank.com>
parent 83a06263
...@@ -3067,6 +3067,14 @@ static int rbd_dev_image_id(struct rbd_device *rbd_dev) ...@@ -3067,6 +3067,14 @@ static int rbd_dev_image_id(struct rbd_device *rbd_dev)
void *response; void *response;
void *p; void *p;
/*
* When probing a parent image, the image id is already
* known (and the image name likely is not). There's no
* need to fetch the image id again in this case.
*/
if (rbd_dev->spec->image_id)
return 0;
/* /*
* First, see if the format 2 image id file exists, and if * First, see if the format 2 image id file exists, and if
* so, get the image's persistent id from it. * so, get the image's persistent id from it.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment