Skip to content

Commit

Permalink
Merge branch 'wip-16561' into wip-mgolub-testing
Browse files Browse the repository at this point in the history
 librbd: failed assertion after shrinking a clone image twice #10072
  • Loading branch information
Mykola Golub committed Jul 2, 2016
2 parents 7cff281 + 34d2297 commit 8a9b3d0
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 15 deletions.
11 changes: 0 additions & 11 deletions src/librbd/ImageCtx.cc
Expand Up @@ -663,17 +663,6 @@ struct C_InvalidateCache : public Context {
return -ENOENT;
}

uint64_t ImageCtx::get_copyup_snap_id() const
{
assert(snap_lock.is_locked());
// copyup requires the largest possible parent overlap,
// which is always the oldest snapshot (if any).
if (!snaps.empty()) {
return snaps.back();
}
return CEPH_NOSNAP;
}

void ImageCtx::aio_read_from_cache(object_t o, uint64_t object_no,
bufferlist *bl, size_t len,
uint64_t off, Context *onfinish,
Expand Down
1 change: 0 additions & 1 deletion src/librbd/ImageCtx.h
Expand Up @@ -256,7 +256,6 @@ namespace librbd {
uint64_t get_parent_snap_id(librados::snap_t in_snap_id) const;
int get_parent_overlap(librados::snap_t in_snap_id,
uint64_t *overlap) const;
uint64_t get_copyup_snap_id() const;
void aio_read_from_cache(object_t o, uint64_t object_no, bufferlist *bl,
size_t len, uint64_t off, Context *onfinish,
int fadvise_flags);
Expand Down
3 changes: 1 addition & 2 deletions src/librbd/operation/TrimRequest.cc
Expand Up @@ -194,8 +194,7 @@ void TrimRequest<I>::send_copyup_objects() {

snapc = image_ctx.snapc;
has_snapshots = !image_ctx.snaps.empty();
int r = image_ctx.get_parent_overlap(image_ctx.get_copyup_snap_id(),
&parent_overlap);
int r = image_ctx.get_parent_overlap(CEPH_NOSNAP, &parent_overlap);
assert(r == 0);
}

Expand Down
3 changes: 2 additions & 1 deletion src/test/librbd/test_internal.cc
Expand Up @@ -601,7 +601,6 @@ TEST_F(TestInternal, ResizeCopyup)

librbd::ImageCtx *ictx2;
ASSERT_EQ(0, open_image(clone_name, &ictx2));

ASSERT_EQ(0, snap_create(*ictx2, "snap1"));

bufferptr read_ptr(bl.length());
Expand All @@ -612,6 +611,8 @@ TEST_F(TestInternal, ResizeCopyup)
librbd::NoOpProgressContext no_op;
ASSERT_EQ(0, ictx2->operations->resize(m_image_size - (1 << order) - 32,
no_op));
ASSERT_EQ(0, ictx2->operations->resize(m_image_size - (2 << order) - 32,
no_op));
ASSERT_EQ(0, librbd::snap_set(ictx2, "snap1"));

{
Expand Down

0 comments on commit 8a9b3d0

Please sign in to comment.