tags 990243 -lfs
retitle 990243 fallocate -d fails on last block if < block size
thanks

Dear maintainer,
I took a closer look at this bug. Please note that I'm using ext4 with
block size=4096.

No need to fetch debian-10.10.0-amd64-DLBD-2.iso iot reproduce this bug.
This file's last block happens to be 2048 zero-bytes, triggering this
bug. I'm seeing the same behavior with a file that consists of a single
zero, or of 4095 zeros. I conclude that it happens whenever the file's
last block contains only zeros, but is shorter than block size.

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.

My suggestion is to fix fallocate, enabling it to unallocate the last
block even if it is shorter than block size.

Best
Kevin

Reply via email to