ldv changed the topic of #strace to: https://strace.io | https://strace.io/logs/ | strace 5.2 is out | strace-devel@lists.strace.io for dev discussions
<pchaigno> ldv: I thought sparse files were the other way around: apparent size larger than actual size on disk
<pchaigno> do you know why the tests may be generating these?
<ldv> pchaigno: see create_sample() in tests/xstatx.c
mjw has joined #strace
<ldv> pchaigno: I've actually managed to read your question. In my tests "du -sh stat.sample" shows 0 and "du -sh --apparent-size stat.sample" shows 41G.
<ldv> pchaigno: "stat -c %s stat.sample" prints 43147718418 and "stat -c %b stat.sample" prints 0
<pchaigno> weird that I've got the reverse behavior :s
<pchaigno> I'll check stat
<pchaigno> I've got "stat -c %s stat.sample" returning 0 and "stat -c %b stat.sample" returning 1237176 on an ongoing fstat test (the file is still growing)
<ldv> pchaigno: what is your "stat --version | head -1" ?
<pchaigno> stat (GNU coreutils) 8.28
<pchaigno> the tests take a lot longer than usual (I have to kill them) which makes me think it's not just an issue with reporting of file sizes
<ldv> "strace -e/stat -P stat.sample stat -c %s stat.sample"?
<ldv> and "strace -e/statfs -P stat.sample stat -f stat.sample
<ldv> "?
<pchaigno> lstat("stat.sample", {st_mode=S_IFREG|0640, st_size=0, ...}) = 0
<pchaigno> strace: Requested path 'stat.sample' resolved into '/home/paul/git/strace/tests/fstat.dir/stat.sample'
<pchaigno> $ strace -e/stat -P stat.sample stat -c %s stat.sample
<pchaigno> 0
<pchaigno> +++ exited with 0 +++
<pchaigno> $ strace -e/statfs -P stat.sample stat -c %s stat.sample
<pchaigno> strace: Requested path 'stat.sample' resolved into '/home/paul/git/strace/tests/fstat.dir/stat.sample'
<pchaigno> 0
<pchaigno> +++ exited with 0 +++
<ldv> -f, not -c %s
<ldv> something is odd with the filesystem
<pchaigno> $ strace -e/stat -P stat.sample stat -f stat.sample
<pchaigno> strace: Requested path 'stat.sample' resolved into '/home/paul/git/strace/tests/fstat.dir/stat.sample'
<pchaigno> statfs("stat.sample", {f_type=ECRYPTFS_SUPER_MAGIC, f_bsize=4096, f_blocks=7347455, f_bfree=1933979, f_bavail=1554984, f_files=1875968, f_ffree=1324986, f_fsid={val=[3943010034, 635917939]}, f_namelen=143, f_frsize=4096, f_flags=ST_VALID|ST_NOSUID|ST_NODEV|ST_RELATIME}) = 0
<pchaigno> File: "stat.sample"
<pchaigno> ID: eb058ef225e75673 Namelen: 143 Type: ecryptfs
<pchaigno> Block size: 4096 Fundamental block size: 4096
<pchaigno> Blocks: Total: 7347455 Free: 1933979 Available: 1554984
<pchaigno> Inodes: Total: 1875968 Free: 1324986
<pchaigno> +++ exited with 0 +++
<ldv> Does ecryptfs support sparse files?
<pchaigno> kinda, looks like this is the issue
<pchaigno> "Sparse files written to eCryptfs will produce larger, non-sparse encrypted files in the lower directory."
<pchaigno> so I need to run tests outside my encrypted home dir
<ldv> yes, I suggest creating a separate tmpfs for that
<pchaigno> is there an option to change the tests' output directory?
<ldv> no, but you can do out-of-tree builds
<pchaigno> ok, I'll do that instead
<pchaigno> thanks a lot for your help ldv!
<ldv> you are welcome :)
mjw has quit [Quit: Leaving]