]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: allow negetive rstat
authorYan, Zheng <zheng.z.yan@intel.com>
Sun, 4 May 2014 02:15:36 +0000 (10:15 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Tue, 6 May 2014 23:10:16 +0000 (07:10 +0800)
When splitting dirfrag, delta rstat is always added to the first new
dirfrag. Ancestors of the dirfrag may have nagtive rstat before the
delta rstat has been propagated to them. For example:

inode 100 n(v1 b-4096)
|- dir 100 n(v1 b-4096)
   |- dentry
      |- inode 101 n(v1 b-4096)
         |- dir 101.0* n(v1)/n(v1 b-4096)
         |- dir 101.1* n(v1)

Signed-off-by: Yan, Zheng <zheng.z.yan@intel.com>
src/mds/CInode.cc
src/mds/MDCache.cc

index a7983ecca47da62196741768e4b5fd2aab27edbc..9ca1cf20b287ec284b4f74f8d07d9935a9ca4a8d 100644 (file)
@@ -1929,22 +1929,6 @@ void CInode::finish_scatter_gather_update(int type)
          pi->rstat.version = v;
        }
       }
-
-      if (pi->rstat.rsubdirs < 0 ||
-         pi->rstat.rfiles < 0 ||
-         pi->rstat.rbytes < 0) {
-       clog.error() << "bad/negative rstat on " << ino()
-                    << ", inode has " << pi->rstat << "\n";
-
-       if (pi->rstat.rsubdirs < 0)
-         pi->rstat.rsubdirs = 0;
-       if (pi->rstat.rfiles < 0)
-         pi->rstat.rfiles = 0;
-       if (pi->rstat.rbytes < 0)
-         pi->rstat.rbytes = 0;
-
-       assert(!"bad/negative rstat" == g_conf->mds_verify_scatter);
-      }
     }
     break;
 
index 4312c3312747ca5ee063cdd8f033f4363225689d..1236c96db8c1a268a64737b3afe7e7f2b6879baf 100644 (file)
@@ -1809,9 +1809,6 @@ void MDCache::project_rstat_frag_to_inode(nest_info_t& rstat, nest_info_t& accou
     pi->rstat.add(delta);
     dout(20) << "        result [" << first << "," << last << "] " << pi->rstat << dendl;
 
-    if (pi->rstat.rbytes < 0 && pin->dirfragtree.is_leaf(frag_t()))
-      assert(!"negative rstat rbytes" == g_conf->mds_verify_scatter);
-
     last = first-1;
   }
 }