]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/cephfs/DataScan.cc: don't set directory inode's size to non-zero
authorYan, Zheng <zyan@redhat.com>
Mon, 14 Mar 2016 12:06:10 +0000 (20:06 +0800)
committerYan, Zheng <zyan@redhat.com>
Tue, 15 Mar 2016 13:12:20 +0000 (21:12 +0800)
directory inode's size should be always zero.

Signed-off-by: Yan, Zheng <zyan@redhat.com>
src/tools/cephfs/DataScan.cc

index bf123a905fb472db83bd994ddd471bd575dc8e7d..96732defc40e69b902ab6ddb45bb6b449af221eb 100644 (file)
@@ -328,9 +328,8 @@ int MetadataDriver::inject_unlinked_inode(
   inode.inode.version = 1;
   inode.inode.xattr_version = 1;
   inode.inode.mode = 0500 | mode;
-  // Fake size to 1, so that the directory doesn't appear to be empty
-  // (we won't actually give the *correct* size here though)
-  inode.inode.size = 1;
+  // Fake dirstat.nfiles to 1, so that the directory doesn't appear to be empty
+  // (we won't actually give the *correct* dirstat here though)
   inode.inode.dirstat.nfiles = 1;
 
   inode.inode.ctime = 
@@ -1415,7 +1414,6 @@ int MetadataDriver::inject_with_backtrace(
         // accurate, but it should avoid functional issues.
 
         ancestor_dentry.inode.dirstat.nfiles = 1;
-        ancestor_dentry.inode.size = 1;
 
         ancestor_dentry.inode.nlink = 1;
         ancestor_dentry.inode.ino = ino;
@@ -1748,9 +1746,7 @@ void MetadataTool::build_dir_dentry(
   assert(out != NULL);
 
   out->inode.mode = 0755 | S_IFDIR;
-  out->inode.size = nfiles;
   out->inode.dirstat.nfiles = nfiles;
-  out->inode.max_size_ever = nfiles;
   out->inode.mtime.tv.tv_sec = mtime;
   out->inode.atime.tv.tv_sec = mtime;
   out->inode.ctime.tv.tv_sec = mtime;