libvmm
libvmm copied to clipboard
virtio-block filesystem corruption
On a guest VM with virtio-block, creating 100 folders with:
cd /mnt/testing && rm -rf * && sync && for i in $(seq 1 100); do mkdir "$i"; done && sync && ls
yields the expected result:
1 15 21 28 34 40 47 53 6 66 72 79 85 91 98
10 16 22 29 35 41 48 54 60 67 73 8 86 92 99
100 17 23 3 36 42 49 55 61 68 74 80 87 93
11 18 24 30 37 43 5 56 62 69 75 81 88 94
12 19 25 31 38 44 50 57 63 7 76 82 89 95
13 2 26 32 39 45 51 58 64 70 77 83 9 96
14 20 27 33 4 46 52 59 65 71 78 84 90 97
But powering the guest off cleanly with poweroff, power-cycling the board then ls /mnt/testing does not display the full set of folders as before (or dropping the Linux caches)
1 11 13 2 4 6 79 80 82 84 86 88 9 91 93
10 12 14 3 5 7 8 81 83 85 87 89 90 92 94
The same bug occurs in QEMU, so it's unlikely to be a bug in the imx sdhc driver. (and it doesn't occur in the native LionsOS fileio python repl).
We should try using Eric's fixes to the virtio-blk driver: https://github.com/au-ts/libvmm/pull/128, as it's possible that changes to Linux have broken the driver.
Originally posted by @dreamliner787-9 in https://github.com/au-ts/sddf/pull/368#issuecomment-2709435879