]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: optimize MDCache::rejoin_scour_survivor_replicas() 17711/head
authorYan, Zheng <zyan@redhat.com>
Wed, 13 Sep 2017 07:55:46 +0000 (15:55 +0800)
committerPatrick Donnelly <pdonnell@redhat.com>
Thu, 14 Sep 2017 03:22:33 +0000 (20:22 -0700)
avoid iterating dentries if dirfrag is non-auth

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
(cherry picked from commit d32a2376047bc1363b9f7a2ed09060ec84c78b97)

src/mds/MDCache.cc

index 9c718d459aed7ce7e41bf805a32e90bca822ead7..c3a29e56efa4daab84f88e7128329eb8f1ca4646 100644 (file)
@@ -4560,9 +4560,10 @@ void MDCache::rejoin_scour_survivor_replicas(mds_rank_t from, MMDSCacheRejoin *a
         p != dfs.end();
         ++p) {
       CDir *dir = *p;
+      if (!dir->is_auth())
+       continue;
       
-      if (dir->is_auth() &&
-         dir->is_replica(from) &&
+      if (dir->is_replica(from) &&
          (ack == NULL || ack->strong_dirfrags.count(dir->dirfrag()) == 0)) {
        dir->remove_replica(from);
        dout(10) << " rem " << *dir << dendl;