]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mds: fix root and mdsdir inodes' rsubdirs
authorYan, Zheng <zheng.z.yan@intel.com>
Fri, 2 May 2014 15:08:41 +0000 (23:08 +0800)
committerYan, Zheng <zheng.z.yan@intel.com>
Tue, 6 May 2014 23:10:16 +0000 (07:10 +0800)
inode rstat accounts inode itself.

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

index 342eca0a1fb271464e82ee313913c83d96ad98a5..f74b8b851b3f4646be97e5b70214c982a5af76d8 100644 (file)
@@ -348,6 +348,7 @@ void MDCache::create_empty_hierarchy(C_Gather *gather)
 
   root->inode.dirstat = rootdir->fnode.fragstat;
   root->inode.rstat = rootdir->fnode.rstat;
+  ++root->inode.rstat.rsubdirs;
   root->inode.accounted_rstat = root->inode.rstat;
 
   rootdir->mark_complete();
@@ -398,6 +399,7 @@ void MDCache::create_mydir_hierarchy(C_Gather *gather)
 
   myin->inode.dirstat = mydir->fnode.fragstat;
   myin->inode.rstat = mydir->fnode.rstat;
+  ++myin->inode.rstat.rsubdirs;
   myin->inode.accounted_rstat = myin->inode.rstat;