]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mds: skip size recovery on non-file inodes
authorJohn Spray <john.spray@redhat.com>
Wed, 6 Apr 2016 12:00:00 +0000 (13:00 +0100)
committerJohn Spray <john.spray@redhat.com>
Wed, 6 Apr 2016 12:05:17 +0000 (13:05 +0100)
Previously even directories were getting added to the
list of inodes to check in rejoin.  This was a (small)
waste of time, with these dir inodes getting passed
all the way down into check_inode_max_size for no purpose.

Signed-off-by: John Spray <john.spray@redhat.com>
src/mds/Locker.cc
src/mds/MDCache.cc

index ddd99b28a78fe0e7371e011e714f6113fc62f894..84e0e4897944874a0d4da6004f8e1cae15eec681 100644 (file)
@@ -2187,6 +2187,7 @@ bool Locker::check_inode_max_size(CInode *in, bool force_wrlock,
                                  utime_t new_mtime)
 {
   assert(in->is_auth());
+  assert(in->is_file());
 
   inode_t *latest = in->get_projected_inode();
   map<client_t, client_writeable_range_t> new_ranges;
index d9e59018f618c5059ae479472feddab8fe8836e5..152b47b85ae4afd6ba19ef3c69c32cae234ea5dc 100644 (file)
@@ -6038,6 +6038,11 @@ void MDCache::identify_files_to_recover(vector<CInode*>& recover_q, vector<CInod
     CInode *in = p->second;
     if (!in->is_auth())
       continue;
+
+    // Only normal files need file size recovery
+    if (!in->is_file()) {
+      continue;
+    }
     
     bool recover = false;
     for (map<client_t,client_writeable_range_t>::iterator p = in->inode.client_ranges.begin();