Skip to content

Commit

Permalink
rgw_file: rgw_readdir can't list multi-segment dirs
Browse files Browse the repository at this point in the history
This issue has one root cause in librgw, namely that the marker
argument to these requests was incorrectly formatted (though the
marker cache was working as intended).

Secondarily, for nfs-ganesha users, there is a compounding issue
that the RGW fsal was required by "temporary" convention to
populate the entire dirent cache for a directory on a single
readdir() invocation--the cache_inode/mdcache implementations
invariantly pass (before future 2.5 changesets, currently in
progress) a null pointer for the start cookie offset, intended
to convey this.

Fixes: http://tracker.ceph.com/issues/18991

Signed-off-by: Matt Benjamin <mbenjamin@redhat.com>
(cherry picked from commit 2cd60ee)
  • Loading branch information
mattbenjamin authored and smithfarm committed Jul 4, 2017
1 parent 2e27aa9 commit c613ee7
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions src/rgw/rgw_file.h
Original file line number Diff line number Diff line change
Expand Up @@ -1098,11 +1098,7 @@ class RGWListBucketsRequest : public RGWLibRequest,
cb_arg(_cb_arg), rcb(_rcb), ix(0) {
const std::string& sm = rgw_fh->find_marker(*offset);
if (sm.size() > 0) {
RGWListBuckets::marker =
rgw_fh->relative_object_name();
if (marker.back() != '/')
marker += "/";
marker += sm;
marker = sm;
}
op = this;
}
Expand Down Expand Up @@ -1203,10 +1199,7 @@ class RGWListBucketsRequest : public RGWLibRequest,
cb_arg(_cb_arg), rcb(_rcb), ix(0) {
const std::string& sm{rgw_fh->find_marker(*offset)};
if (sm.size() > 0) {
RGWListBucket::marker = {rgw_fh->relative_object_name(), ""};
if (marker.name.back() != '/')
marker.name += "/";
marker.name += sm;
marker = sm;
}
default_max = 1000; // XXX was being omitted
op = this;
Expand Down

0 comments on commit c613ee7

Please sign in to comment.