diff options
author | Alex Elder <elder@inktank.com> | 2013-05-06 18:40:33 -0400 |
---|---|---|
committer | Alex Elder <elder@inktank.com> | 2013-05-13 15:12:41 -0400 |
commit | 70cf49cfc7a4d1eb4aeea6cd128b88230be9d0b1 (patch) | |
tree | ecc02aa809064607d872cf4c433cf0489b2f5604 /drivers/block | |
parent | b91f09f17b2a302f07022e2f766969e2536d71b3 (diff) |
rbd: ignore zero-overlap parent
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>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/rbd.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index 5161e80a38ef..b67ecda1e7ef 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
@@ -3665,9 +3665,13 @@ static int rbd_dev_v2_parent_info(struct rbd_device *rbd_dev) | |||
3665 | ceph_decode_64_safe(&p, end, parent_spec->snap_id, out_err); | 3665 | ceph_decode_64_safe(&p, end, parent_spec->snap_id, out_err); |
3666 | ceph_decode_64_safe(&p, end, overlap, out_err); | 3666 | ceph_decode_64_safe(&p, end, overlap, out_err); |
3667 | 3667 | ||
3668 | rbd_dev->parent_overlap = overlap; | 3668 | if (overlap) { |
3669 | rbd_dev->parent_spec = parent_spec; | 3669 | rbd_dev->parent_spec = parent_spec; |
3670 | parent_spec = NULL; /* rbd_dev now owns this */ | 3670 | parent_spec = NULL; /* rbd_dev now owns this */ |
3671 | rbd_dev->parent_overlap = overlap; | ||
3672 | } else { | ||
3673 | rbd_warn(rbd_dev, "ignoring parent of clone with overlap 0\n"); | ||
3674 | } | ||
3671 | out: | 3675 | out: |
3672 | ret = 0; | 3676 | ret = 0; |
3673 | out_err: | 3677 | out_err: |