A bigger problem would be if Hyper-V is either ignoring memory barriers, or caching writes to the disk and losing them when the Hyper-V service is shutdown. But that would likely affect more than just WSL, so we'd have seen the problem sooner (or so I vehemently hope).
I assumed that had all been fixed by now, but yeah, these things can get tricky fast.
[1]: https://lwn.net/Articles/322823/
[2]: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/317781/...
I used to have occasional problems with this setup, and it was always some kind of drive corruption or mounting issue. I wonder if this is related?
as far as I know when wsl2 is actiavted, hyper-v runs as type-1 and linux, windows are virtual after activating it.
thus if it crashes, you get a bsod
WSL2 being Linux means that, unlike WSL1 which directly uses the host NTFS filesystem, it's probably using an emulated block device to hold its filesystem. If that emulated block device doesn't correctly honor write barrier requests from the Linux kernel, it could explain the corruption.
* the kernel is not properly shutdown (and sometimes some buffers are not flushed)
* the virtual block device and/or its linux driver has bugs