Gah; or not. what is going on here... Doing just steps 1, 2, 3, 4
(ending on the extending truncate):
# xfs_io -c "pwrite -S 0x11 -b 4096 0 4096" -c "mmap -r 0 512" -c "mread
0 512" -c "munmap" -c "truncate 256" -c "truncate 514" -t -d -f
/mnt/scratch/testfile
# xfs_bmap -v /mnt/scratch/testfile
/mnt/scratch/testfile:
EXT: FILE-OFFSET BLOCK-RANGE AG AG-OFFSET TOTAL
0: [0..0]: 63..63 0 (63..63) 1
1: [1..1]: hole 1
It looks like what I expect, at this point. But then:
# sync
# xfs_bmap -v /mnt/scratch/testfile
/mnt/scratch/testfile:
EXT: FILE-OFFSET BLOCK-RANGE AG AG-OFFSET TOTAL
0: [0..1]: 63..64 0 (63..64) 2
Um, why'd that last block get mapped in? mmap vs. direct IO I'm
guessing... w/o the mmap read this does not happen.