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

rgw_file: implement variant offset readdir processing #18335

Merged
merged 2 commits into from Oct 20, 2017

Conversation

mattbenjamin
Copy link
Contributor

Introduce new rgw_readdir2(...), which in which continues
from an arbitrary dirent name, which presumably has been
seen in a prior partial enumeration.

Add single-file unit test for READDIR cases, librgw_file_marker.cc.

Signed-off-by: Matt Benjamin mbenjamin@redhat.com

RGWFileHandle::readdir_offset const &offset)
{
if (unlikely(!! get<uint64_t*>(&offset))) {
uint64_t* ioff = get<uint64_t*>(offset);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confused here - the first call to get() passes &offset while the others pass offset

also probably worth qualifying as boost::get - i'm guessing that this resolves to std::get, so i'm surprised that it compiles

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a wired-in idiom of boost::variant: the versions that take a pointer argument do not throw and return either a pointer to the stored object, or nullptr if the type coercion fails; the versions that take a reference return either a reference to the stored object or throw boost::bad_get. The apparent alternative is to code to typeid or an interface "which()" that returns an integer index into the defined variants--pretty ugly. I will specify boost::get.

Introduce new rgw_readdir2(...), which in which continues
from an arbitrary dirent name, which presumably has been
seen in a prior partial enumeration.

Add single-file unit test for READDIR cases, librgw_file_marker.cc.

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
a. upstream motivating behavior no longer reproduces
b. incorrect stat behavior observed, traced to exact match enforcement

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
@ktdreyer
Copy link
Member

Let's make sure this goes into luminous - mind filing a tracker ticket?

@mattbenjamin
Copy link
Contributor Author

@mattbenjamin
Copy link
Contributor Author

@oritwas , @cbodley could one of you review this speedily? :)

@cbodley
Copy link
Contributor

cbodley commented Oct 20, 2017

jenkins test docs

@cbodley cbodley merged commit 1a2db61 into ceph:master Oct 20, 2017
@mattbenjamin
Copy link
Contributor Author

thanks @cbodley

@ktdreyer
Copy link
Member

ktdreyer commented Nov 2, 2017

@mattbenjamin do we need to revert "rgw_file: disable FLAG_EXACT_MATCH enforcement" here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants