From: Matt Benjamin Date: Mon, 20 Feb 2017 01:34:31 +0000 (-0500) Subject: rgw_file: rgw_readdir can't list multi-segment dirs X-Git-Tag: v10.2.7~8^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a70e83c90eb42439ba194ca197f507f972a18c3c;p=ceph.git rgw_file: rgw_readdir can't list multi-segment dirs 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 (cherry picked from commit 2cd60ee9712291b906123aca1704288b18a9742b) --- diff --git a/src/rgw/rgw_file.h b/src/rgw/rgw_file.h index bf8d0db599cc..4a66eb2f6333 100644 --- a/src/rgw/rgw_file.h +++ b/src/rgw/rgw_file.h @@ -1099,11 +1099,7 @@ public: 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; } @@ -1204,10 +1200,7 @@ public: 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;