Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buffer: fix internal iterator invalidation on rebuild, get_contiguous #6962

Merged
merged 2 commits into from Dec 31, 2015

Conversation

liewegas
Copy link
Member

No description provided.

When we rebuild we implicitly invalidate any iterator into the
old list of bufferptrs.  Reset the internal last_p iterator to
fix.

The test to reproduce the bug is tricky: we need to get into
a situation where last_p is initialized and p points to
_buffers.begin() (not .end()), e.g.,

  bufferlist bl, bl2;
  bl2.append("bar");
  bl.swap(bl2);

and then rebuild the buffer, so that none of the checks in the
copy_out path reset last_p for some other reason.

Signed-off-by: Sage Weil <sage@redhat.com>
This may modify _buffers.

Signed-off-by: Sage Weil <sage@redhat.com>
@liewegas
Copy link
Member Author

this should get backported

@athanatos
Copy link
Contributor

lgtm

liewegas added a commit that referenced this pull request Dec 31, 2015
buffer: fix internal iterator invalidation on rebuild, get_contiguous

Reviewed-by: Samuel Just <sjust@redhat.com>
@liewegas liewegas merged commit d5b9767 into ceph:master Dec 31, 2015
@liewegas liewegas deleted the wip-buffer-lastp branch December 31, 2015 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants