Page MenuHomeFreeBSD

bhyve: virtio DISCARD doesn't work for 'sectorsize=512/4096'
ClosedPublic

Authored by gusev.vitaliy_gmail.com on Nov 3 2020, 1:58 PM.
Tags
Referenced Files
Unknown Object (File)
Tue, Nov 5, 12:32 AM
Unknown Object (File)
Sun, Nov 3, 8:34 AM
Unknown Object (File)
Sep 20 2024, 8:26 PM
Unknown Object (File)
Sep 19 2024, 1:58 AM
Unknown Object (File)
Sep 7 2024, 7:53 AM
Unknown Object (File)
Sep 3 2024, 4:22 PM
Unknown Object (File)
Jun 26 2024, 8:16 AM
Unknown Object (File)
May 26 2024, 1:57 PM

Details

Summary

If bhyve is used to emulate 512e access in guest OS, then discard addresses should be properly aligned. Otherwise ioctl DIOCGDELETE fails with 4K geom devices (look at g_dev_ioctl() in sys/geom/geom_dev.c).

So take into account the physical sector size as well.

Test Plan

Assign zvol with 4K volblocksize via geom to VM with different sector size argument: 512/4096, 4096/4096, etc.

All cases work fine with patch.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Skipped
Unit
Tests Skipped