[Vdo-devel] [BUG] Discard not working

Michael Niewöhner foss at mniewoehner.de
Wed Aug 8 11:55:33 UTC 2018


Hi all,

I just realized there's a mailing list so I forward that Github issue [1] here.
It seems discard does not work properly.


OS: Debian 9
Kernel: 4.17.0-0.bpo.1-amd64
VDO: 6.2.0.187


Test Setup 1 (no VDO): disks->ZFS->ZVOL->ext4
Steps:

- create ext4 on VDO, mount with discard option
- zfs list shows ~0G referenced
- create 2G file
- zfs list shows ~2.1G referenced
- delete 2G file
- zfs list shows ~0G referenced

This is expected behavior.


Test Setup 2 (with VDO): disks->ZFS->ZVOL->VDO->ext4
Steps:

- create ext4 on VDO, mount with discard option
- zfs list shows ~0G referenced
- create 2G file
- zfs list shows ~2.1G referenced
- delete 2G file
- zfs list shows unchanged ~2.1G referenced


Looks like discard did not work. Let's discard manually:

- fstrim on ext4
- zfs list shows unchanged ~2.1G referenced
- unmount ext4
- blkdiscard on vdo
- zfs list shows unchanged ~2.1G referenced


One more thing I noticed is that blkdiscard takes just about 10 seconds directly
on zvol but minutes on VDO.



[1] https://github.com/dm-vdo/kvdo/issues/12


Best regards
Michael




More information about the vdo-devel mailing list