<div>Hi, Dave,</div><div>Thank you very much. I got some results:</div><div><div># xfs_db -xr  /dev/sda4                        </div><div>xfs_db> convert agno 1 agino 78272 ino</div><div>0x800131c0 (2147561920)</div><div>xfs_db> inode 2147561920</div><div>xfs_db> p</div><div>core.magic = 0x494e</div><div>core.mode = 0100600</div><div>core.version = 2</div><div>core.format = 2 (extents)</div><div>core.nlinkv2 = 0</div><div>core.onlink = 0</div><div>core.projid_lo = 26286</div><div>core.projid_hi = 0</div><div>core.uid = 30000</div><div>core.gid = 100</div><div>core.flushiter = 30</div><div>core.atime.sec = Tue Oct 20 13:51:58 2015</div><div>core.atime.nsec = 104938956</div><div>core.mtime.sec = Tue Oct 20 13:53:58 2015</div><div>core.mtime.nsec = 824941455</div><div>core.ctime.sec = Tue Oct 20 14:21:59 2015</div><div>core.ctime.nsec = 062660227</div><div>core.size = 41041920</div><div>core.nblocks = 10020</div><div>core.extsize = 0</div><div>core.nextents = 2</div><div>core.naextents = 0</div><div>core.forkoff = 0</div><div>core.aformat = 2 (extents)</div><div>core.dmevmask = 0</div><div>core.dmstate = 0</div><div>core.newrtbm = 0</div><div>core.prealloc = 0</div><div>core.realtime = 0</div><div>core.immutable = 0</div><div>core.append = 0</div><div>core.sync = 0</div><div>core.noatime = 0</div><div>core.nodump = 0</div><div>core.rtinherit = 0</div><div>core.projinherit = 1</div><div>core.nosymlinks = 0</div><div>core.extsz = 0</div><div>core.extszinherit = 0</div><div>core.nodefrag = 0</div><div>core.filestream = 0</div><div>core.gen = 1194777008</div><div>next_unlinked = 75712</div><div>u.bmx[0-1] = [startoff,startblock,blockcount,extentflag] 0:[0,135330882,32,0] 1:[32,146117410,9988,0]</div></div><div><br></div><div><br></div><div><div>However, I want to ask how this situation to happen?</div><div><br></div><div>From the output,  we can see "<span style="line-height: 1.5;">core.nlinkv2 = 0". But I can't reapper this:</span></div><div><span style="line-height: 1.5;"><br></span></div><div><span style="line-height: 1.5;"><div># dd if=/dev/zero of=/data/test.data bs=4k count=1024</div><div>1024+0 records in</div><div>1024+0 records out</div><div>4194304 bytes (4.2 MB) copied, 0.00476946 s, 879 MB/s</div><div><br></div><div># stat /data/test.data </div><div>  File: `/data/test.data'</div><div>  Size: 4194304         Blocks: 8192       IO Block: 4096   regular file</div><div>Device: 804h/2052d      Inode: 29409295    Links: 1</div><div>Access: (0644/-rw-r--r--)  Uid: (    0/    root)   Gid: (    0/    root)</div><div>Access: 2015-10-21 16:05:45.201679018 +0800</div><div>Modify: 2015-10-21 16:05:45.205679018 +0800</div><div>Change: 2015-10-21 16:05:45.205679018 +0800</div><div><br></div><div># xfs_db -xr -c 'inode 29409295' -c p /dev/sda4                                      </div><div>core.magic = 0x494e</div><div>core.mode = 0100644</div><div>core.version = 2</div><div>core.format = 2 (extents)</div><div>core.nlinkv2 = 1</div><div>core.onlink = 0</div><div>core.projid_lo = 0</div><div>core.projid_hi = 0</div><div>core.uid = 0</div><div>core.gid = 0</div><div>core.flushiter = 12</div><div>core.atime.sec = Wed Oct 21 16:05:45 2015</div><div>core.atime.nsec = 201679018</div><div>core.mtime.sec = Wed Oct 21 16:05:45 2015</div><div>core.mtime.nsec = 205679018</div><div>core.ctime.sec = Wed Oct 21 16:05:45 2015</div><div>core.ctime.nsec = 205679018</div><div>core.size = 4194304</div><div>core.nblocks = 1024</div><div>core.extsize = 0</div><div>core.nextents = 1</div><div>core.naextents = 0</div><div>core.forkoff = 0</div><div>core.aformat = 2 (extents)</div><div>core.dmevmask = 0</div><div>core.dmstate = 0</div><div>core.newrtbm = 0</div><div>core.prealloc = 0</div><div>core.realtime = 0</div><div>core.immutable = 0</div><div>core.append = 0</div><div>core.sync = 0</div><div>core.noatime = 0</div><div>core.nodump = 0</div><div>core.rtinherit = 0</div><div>core.projinherit = 0</div><div>core.nosymlinks = 0</div><div>core.extsz = 0</div><div>core.extszinherit = 0</div><div>core.nodefrag = 0</div><div>core.filestream = 0</div><div>core.gen = 3722739155</div><div>next_unlinked = null</div><div>u.bmx[0] = [startoff,startblock,blockcount,extentflag] 0:[0,5943235,1024,0]</div><div><br></div><div># tail -f /data/test.data &</div><div>[1] 27598</div><div># unlink /data/test.data </div><div><br></div><div># xfs_db -xr -c 'inode 29409295' -c p /dev/sda4</div><div>core.magic = 0x494e</div><div>core.mode = 0100644</div><div>core.version = 2</div><div>core.format = 2 (extents)</div><div>core.nlinkv2 = 1</div><div>core.onlink = 0</div><div>core.projid_lo = 0</div><div>core.projid_hi = 0</div><div>core.uid = 0</div><div>core.gid = 0</div><div>core.flushiter = 12</div><div>core.atime.sec = Wed Oct 21 16:05:45 2015</div><div>core.atime.nsec = 201679018</div><div>core.mtime.sec = Wed Oct 21 16:05:45 2015</div><div>core.mtime.nsec = 205679018</div><div>core.ctime.sec = Wed Oct 21 16:05:45 2015</div><div>core.ctime.nsec = 205679018</div><div>core.size = 4194304</div><div>core.nblocks = 1024</div><div>core.extsize = 0</div><div>core.nextents = 1</div><div>core.naextents = 0</div><div>core.forkoff = 0</div><div>core.aformat = 2 (extents)</div><div>core.dmevmask = 0</div><div>core.dmstate = 0</div><div>core.newrtbm = 0</div><div>core.prealloc = 0</div><div>core.realtime = 0</div><div>core.immutable = 0</div><div>core.append = 0</div><div>core.sync = 0</div><div>core.noatime = 0</div><div>core.nodump = 0</div><div>core.rtinherit = 0</div><div>core.projinherit = 0</div><div>core.nosymlinks = 0</div><div>core.extsz = 0</div><div>core.extszinherit = 0</div><div>core.nodefrag = 0</div><div>core.filestream = 0</div><div>core.gen = 3722739155</div><div>next_unlinked = null</div><div>u.bmx[0] = [startoff,startblock,blockcount,extentflag] 0:[0,5943235,1024,0]</div><div><br></div></span></div><div>As we can see, <span style="line-height: 1.5;">core.nlinkv2 is still "1" after I unlink /data/test.data.</span></div><div><span style="line-height: 1.5;"><br></span></div><div><span style="line-height: 1.5;">Thanks,</span></div><div><span style="line-height: 1.5;">Ye</span></div><div><span style="line-height: 1.5;"><br></span></div><div style="font-size: 12px;font-family: Arial Narrow;padding:2px 0 2px 0;">------------------ Original ------------------</div><div style="font-size: 12px;background:#efefef;padding:8px;"><div><b>From: </b> "Dave Chinner";<david@fromorbit.com>;</div><div><b>Date: </b> Wed, Oct 21, 2015 03:13 PM</div><div><b>To: </b> "YeYin"<eyniy@qq.com>; <wbr></div><div><b>Cc: </b> "Eric Sandeen"<sandeen@sandeen.net>; "xfs"<xfs@oss.sgi.com>; <wbr></div><div><b>Subject: </b> Re: du result is smaller than xfs_quota report</div></div><div><br></div>On Wed, Oct 21, 2015 at 02:37:04PM +0800, YeYin wrote:<br>> > Is anything mounted under that directory hierarchy, and hiding files from du's view?<br>> <br>> <br>> No, Thanks. I found some unlinked inodes, but I can't get some useful information:<br>> <br>> <br>> # xfs_db -xr -c 'agi 1' -c p /dev/sda4  <br>....<br>> unlinked[0-63] = 0:78272 ....<br><br>> # xfs_db -xr -c 'inode 78272' -c p /dev/sda4<br><br>That's because 78272 isn't an real inode number. It's a AG relative<br>inode number ("agino") of 78272. The global inode number folds in<br>the AG number to it, and this is from AG 1. So:<br><br>xfs_db> convert agno 1 agino 78272 ino<br><inum><br>xfs_db> inode <inum><br>xfs_db> p<br>....<br><br>Cheers,<br><br>Dave.<br>-- <br>Dave Chinner<br>david@fromorbit.com<br></div>