summaryrefslogtreecommitdiff
path: root/drivers/block
diff options
context:
space:
mode:
authorAlex Elder <elder@inktank.com>2013-05-06 07:40:30 -0500
committerAlex Elder <elder@inktank.com>2013-05-08 07:48:11 -0500
commitc734b79655a91a24afcae73738a43a0db09a801a (patch)
treec255a42846def7922e5c99c8610dfd42f632c111 /drivers/block
parent29334ba49c3e3defd9a2697cd4a199c597c30dc9 (diff)
rbd: don't print warning if not mapping a parent
The presence of the LAYERING bit in an rbd image's feature mask does not guarantee the image actually has a parent image. Currently that bit is set only when a clone (i.e., image with a parent) is created, but it is (currently) not cleared if that clone gets flattened back into a "normal" image. A "parent_id" query will leave the parent_spec for the image being mapped a null pointer, but will not return an error. Currently, whenever an image with the LAYERED feature gets mapped, a warning about the use of layered images gets printed. But we don't want to do this for a flattened image, so print the warning only if we find there is a parent spec after the probe. Signed-off-by: Alex Elder <elder@inktank.com> Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/rbd.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index 4c9869545073..2d34aea772be 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -4567,13 +4567,14 @@ static int rbd_dev_v2_probe(struct rbd_device *rbd_dev)
ret = rbd_dev_v2_parent_info(rbd_dev);
if (ret)
goto out_err;
-
/*
- * Don't print a warning for parent images. We can
- * tell this point because we won't know its pool
- * name yet (just its pool id).
+ * Print a warning if this image has a parent.
+ * Don't print it if the image now being probed
+ * is itself a parent. We can tell at this point
+ * because we won't know its pool name yet (just its
+ * pool id).
*/
- if (rbd_dev->spec->pool_name)
+ if (rbd_dev->parent_spec && rbd_dev->spec->pool_name)
rbd_warn(rbd_dev, "WARNING: kernel layering "
"is EXPERIMENTAL!");
}