From: Yan, Zheng Date: Wed, 18 Nov 2015 13:59:24 +0000 (+0800) Subject: mds: skip scrubbing dentries not modified since last scrub X-Git-Tag: v10.1.0~176^2~1^2~29 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0ea991e45ba0c6681c51eeb537f371bb3b25a66a;p=ceph.git mds: skip scrubbing dentries not modified since last scrub Signed-off-by: Yan, Zheng --- diff --git a/src/mds/CDir.cc b/src/mds/CDir.cc index f4fde58e1e2..e0a06ef4965 100644 --- a/src/mds/CDir.cc +++ b/src/mds/CDir.cc @@ -2947,12 +2947,13 @@ int CDir::_next_dentry_on_set(set& dns, bool missing_okay, MDSInternalContext *cb, CDentry **dnout) { dentry_key_t dnkey; + CDentry *dn; while (!dns.empty()) { set::iterator front = dns.begin(); dnkey = *front; - *dnout = lookup(dnkey.name); - if (!*dnout) { + dn = lookup(dnkey.name); + if (!dn) { if (!is_complete() && (!has_bloom() || is_in_bloom(dnkey.name))) { // need to re-read this dirfrag @@ -2974,6 +2975,13 @@ int CDir::_next_dentry_on_set(set& dns, bool missing_okay, // okay, we got a dentry dns.erase(dnkey); + if (dn->get_projected_version() < scrub_infop->last_recursive.version) { + dout(15) << " skip dentry " << dnkey.name + << ", no change since last scrub" << dendl; + continue; + } + + *dnout = dn; return 0; } *dnout = NULL;