All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] rbd: ignore zero-overlap parent
@ 2013-05-11 17:38 Alex Elder
  2013-05-11 19:29 ` Josh Durgin
  0 siblings, 1 reply; 2+ messages in thread
From: Alex Elder @ 2013-05-11 17:38 UTC (permalink / raw)
  To: ceph-devel

An rbd clone image that has an overlap with its parent of 0 is
effectively not a layered image at all.  Detect this case and treat
such an image as non-layered.  Issue a warning to be sure the user
knows what's going on.

This resolves:
    http://tracker.ceph.com/issues/5028

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

diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
index b9221a0..3a8135f 100644
--- a/drivers/block/rbd.c
+++ b/drivers/block/rbd.c
@@ -3655,9 +3655,13 @@ static int rbd_dev_v2_parent_info(struct
rbd_device *rbd_dev)
 	ceph_decode_64_safe(&p, end, parent_spec->snap_id, out_err);
 	ceph_decode_64_safe(&p, end, overlap, out_err);

-	rbd_dev->parent_overlap = overlap;
-	rbd_dev->parent_spec = parent_spec;
-	parent_spec = NULL;	/* rbd_dev now owns this */
+	if (overlap) {
+		rbd_dev->parent_spec = parent_spec;
+		parent_spec = NULL;	/* rbd_dev now owns this */
+		rbd_dev->parent_overlap = overlap;
+	} else {
+		rbd_warn(rbd_dev, "ignoring parent of clone with overlap 0\n");
+	}
 out:
 	ret = 0;
 out_err:
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] rbd: ignore zero-overlap parent
  2013-05-11 17:38 [PATCH] rbd: ignore zero-overlap parent Alex Elder
@ 2013-05-11 19:29 ` Josh Durgin
  0 siblings, 0 replies; 2+ messages in thread
From: Josh Durgin @ 2013-05-11 19:29 UTC (permalink / raw)
  To: Alex Elder; +Cc: ceph-devel

Reviewed-by: Josh Durgin <josh.durgin@inktank.com>

On 05/11/2013 10:38 AM, Alex Elder wrote:
> An rbd clone image that has an overlap with its parent of 0 is
> effectively not a layered image at all.  Detect this case and treat
> such an image as non-layered.  Issue a warning to be sure the user
> knows what's going on.
>
> This resolves:
>      http://tracker.ceph.com/issues/5028
>
> Signed-off-by: Alex Elder <elder@inktank.com>
> ---
>   drivers/block/rbd.c |   10 +++++++---
>   1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c
> index b9221a0..3a8135f 100644
> --- a/drivers/block/rbd.c
> +++ b/drivers/block/rbd.c
> @@ -3655,9 +3655,13 @@ static int rbd_dev_v2_parent_info(struct
> rbd_device *rbd_dev)
>   	ceph_decode_64_safe(&p, end, parent_spec->snap_id, out_err);
>   	ceph_decode_64_safe(&p, end, overlap, out_err);
>
> -	rbd_dev->parent_overlap = overlap;
> -	rbd_dev->parent_spec = parent_spec;
> -	parent_spec = NULL;	/* rbd_dev now owns this */
> +	if (overlap) {
> +		rbd_dev->parent_spec = parent_spec;
> +		parent_spec = NULL;	/* rbd_dev now owns this */
> +		rbd_dev->parent_overlap = overlap;
> +	} else {
> +		rbd_warn(rbd_dev, "ignoring parent of clone with overlap 0\n");
> +	}
>   out:
>   	ret = 0;
>   out_err:
>


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-05-11 19:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-11 17:38 [PATCH] rbd: ignore zero-overlap parent Alex Elder
2013-05-11 19:29 ` Josh Durgin

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.