Dear Chris! Am 25.06.21 um 15:20 schrieb Chris Hofstaedtler: > * Kevin Price <k...@osnanet.de> [210625 11:00]: >> fallocate -d seems to attempt to unallocate that last block if it >> contains only zeros, and it even updates the file's mtime. The >> unallocation is reported, but doesn't effectively happen. > > Did you verify this is a bug in fallocate and not a bug or > side-effect of the kernel-side implementation, possibly in the used > filesystem? I'm rather convinced the culprit is fallocate from util-linux, because using the same kernel and filesystem:
1. With coreutils (dd, truncate) I'm able to create sparse files with zero blocks and sizes other than multiples of ${block size}. 2. With coreutils (truncate) I'm able to truncate the last block of zeros and re-add it, becoming an unallocated block. That's how I successfully sparsified the last block (containing 2048 zeros) of the debian iso, btw. Is that convincing, or do you request any additional verification? Some strace maybe? > Can the effect still be seen with Linux and util-linux from > bullseye? IDK. I'd need to set up a bullseye machine iot test that. > BTW, which filesystem are you trying this on? I'm using ext4 with block size=4096, running on buster's stock linux-image-4.19.0-17-amd64, version 4.19.194-2. Best Kevin