Il 14/03/2014 13:42, Richard W.M. Jones ha scritto:
I worked around this in any case by rearranging the test [2]:
Doing:
rm /a_big_file
fstrim /
sync
umount /
[shut down qemu]
would only trim 64 KB on the host.
Doing:
rm /a_big_file
umount / # added
mount -o nodiscard /dev/sda / # added
fstrim /
sync
umount /
[shut down qemu]
would trim the expected amount (around 10 MB).
I've no idea why this is (looks like an ext4/kernel bug to me), but in
any case the tests now use the second method[2].
Could be a race condition (something going on in the background between
rm and fstrim). Try syncing before fstrim, not after. In fact the sync
before umount should not be necessary.
Paolo