Skip to content

Commit

Permalink
rbd: ignore zero-overlap parent
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alex Elder committed May 13, 2013
1 parent b91f09f commit 70cf49c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions drivers/block/rbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3665,9 +3665,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:
Expand Down

0 comments on commit 70cf49c

Please sign in to comment.