Seems like xfs of CentOS 6.X occupies much more storage space than desired if fallocate is used against the file. Here is the step to reproduce it:<br><br>By the way, is it normal when the file is moved around after the preallocated region is filled with data? <br>
<br>$ uname -r<br>2.6.32-220.7.1.el6.x86_64<br><br>$fallocate -n --offset 0 -l 1G file ---->Write a little more data than the preallocated size<br><br>$ xfs_bmap -p -vv file<br>file:<br> EXT: FILE-OFFSET BLOCK-RANGE AG AG-OFFSET TOTAL FLAGS<br>
0: [0..2097151]: 2593408088..2595505239 21 (29420144..31517295) 2097152 10000<br><br>$ dd if=/dev/zero of=/tmp/file bs=1M count=1026 conv=fsync<br><br>$ xfs_bmap -p -vv file<br>file:<br> EXT: FILE-OFFSET BLOCK-RANGE AG AG-OFFSET TOTAL FLAGS<br>
0: [0..4194303]: 2709184016..2713378319 22 (23101408..27295711) 4194304 00000<br><br>$ du -h --apparent-size file<br>1.1G file<br><br>$du -h file<br>2.0G<br><br clear="all">best regards,<br>
韩竹(Zhu Han)<br>