Skip to content

Commit

Permalink
Merge PR ceph#17291 into master
Browse files Browse the repository at this point in the history
* refs/remotes/upstream/pull/17291/head:
	mds: fix 'dirfrag end' check in Server::handle_client_readdir

Reviewed-by: Patrick Donnelly <[email protected]>
Reviewed-by: huanwen ren <[email protected]>
  • Loading branch information
batrick committed Sep 6, 2017
2 parents 00629ad + 88332c0 commit 28c7813
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/mds/Server.cc
Original file line number Diff line number Diff line change
Expand Up @@ -3666,12 +3666,11 @@ void Server::handle_client_readdir(MDRequestRef& mdr)
bufferlist dnbl;
__u32 numfiles = 0;
bool start = !offset_hash && offset_str.empty();
bool end = (dir->begin() == dir->end());
// skip all dns < dentry_key_t(snapid, offset_str, offset_hash)
dentry_key_t skip_key(snapid, offset_str.c_str(), offset_hash);
for (CDir::map_t::iterator it = start ? dir->begin() : dir->lower_bound(skip_key);
!end && numfiles < max;
end = (it == dir->end())) {
auto it = start ? dir->begin() : dir->lower_bound(skip_key);
bool end = (it == dir->end());
for (; !end && numfiles < max; end = (it == dir->end())) {
CDentry *dn = it->second;
++it;

Expand Down

0 comments on commit 28c7813

Please sign in to comment.