virtio-win / kvm-guest-drivers-windows

Windows paravirtualized drivers for QEMU\KVM
https://www.linux-kvm.org/page/WindowsGuestDrivers
BSD 3-Clause "New" or "Revised" License
1.92k stars 377 forks source link

[virtio-fs] `rm -rf`'ing a directory silently fails #985

Open vs49688 opened 9 months ago

vs49688 commented 9 months ago

Describe the bug

rm -rf'ing a directory via Git Bash (Git for Windows) silently fails.

To Reproduce Steps to reproduce the behaviour:

Expected behavior

The directory and all contents to be rm -rf'd.

Host:

VM:

Additional context:

Zane@DESKTOP-9I31DUC MINGW64 /z
$ mkdir -p dira/diraa

Zane@DESKTOP-9I31DUC MINGW64 /z
$ mkdir -p dira/dirab

Zane@DESKTOP-9I31DUC MINGW64 /z
$ touch dira/diraa/file1.txt

Zane@DESKTOP-9I31DUC MINGW64 /z
$ rm -rf dira/

Zane@DESKTOP-9I31DUC MINGW64 /z
$ stat dira
  File: dira
  Size: 0               Blocks: 12         IO Block: 65536  directory
Device: 4ff35ba0h/1341348768d   Inode: 8569920397848429488  Links: 1
Access: (0755/drwxr-xr-x)  Uid: (197609/    Zane)   Gid: (197121/ UNKNOWN)
Access: 2023-09-22 16:51:47.589998000 +1000
Modify: 2023-09-22 16:51:50.859078400 +1000
Change: 2023-09-22 16:51:50.859078400 +1000
 Birth: 2023-09-22 16:51:50.859078400 +1000

Zane@DESKTOP-9I31DUC MINGW64 /z
$ rm -rf dira/

Zane@DESKTOP-9I31DUC MINGW64 /z
$ echo $?
0

Zane@DESKTOP-9I31DUC MINGW64 /z
$ stat dira
  File: dira
  Size: 0               Blocks: 12         IO Block: 65536  directory
Device: 4ff35ba0h/1341348768d   Inode: 8569920397848429488  Links: 1
Access: (0755/drwxr-xr-x)  Uid: (197609/    Zane)   Gid: (197121/ UNKNOWN)
Access: 2023-09-22 16:51:47.589998000 +1000
Modify: 2023-09-22 16:51:50.859078400 +1000
Change: 2023-09-22 16:51:50.859078400 +1000
 Birth: 2023-09-22 16:51:50.859078400 +1000
vs49688 commented 9 months ago

Forgot to add, the directory can be deleted via Explorer, and rm -rf'ing in Git Bash works on a non-virtiofs drive.

viktor-prutyanov commented 9 months ago

virtiofsd version, please

viktor-prutyanov commented 9 months ago

Can't reproduce with Git Bash 2.33.1.1

vs49688 commented 9 months ago

virtiofsd version, please

There's no version info in the resources, and no --version flag or equivalent that I can find.

Not sure if it helps:

Name: virtiofs.exe
Size: 231432 bytes (226 KiB)
CRC32: FF185EB9
CRC64: EFD9407467CAD562
SHA256: 96e37085ac1f039bf1827ff017686f903426785aff7f13e9a5e22276aaf91d62
SHA1: 865d36610711f9f92bb55a1903d9b6f10a61eeed
BLAKE2sp: 6d53bda222650adf00de868df87dcfe17293e273809efd1b298867f0bc95b1c6

This is in virtio-win-0.1.240.iso from here.

Name: virtio-win-0.1.240.iso
Size: 627519488 bytes (598 MiB)
CRC32: 537F31A0
CRC64: EBA9E44F8E31BEA8
SHA256: ebd48258668f7f78e026ed276c28a9d19d83e020ffa080ad69910dc86bbcbcc6
SHA1: fc7522b0079f2d1563e5658deabd6dbed04d641c
BLAKE2sp: b74fe3d57ecf03efc59b04a78c8533bc3b2b8d1b4557ecffd4cab46e005f02b8

Can't reproduce with Git Bash 2.33.1.1

Here's a log from when I hit on the rm -rf. The command used was:

& "C:\Program Files\Virtio-Win\VioFS\virtiofs.exe" -d -1 -D - -F NTFS -t XXXX -m \\.\Z:

virtiofs-rmrf.log

viktor-prutyanov commented 9 months ago

Virtiofsd is the host daemon

vs49688 commented 9 months ago

Virtiofsd is the host daemon

Oh derp, my bad:

$ virtiofsd --version
virtiofsd 1.8.0
vs49688 commented 9 months ago

The exact revision is the v1.8.0 tag from Git:

nix-repl> nixosConfigurations.MORNINGSTAR.pkgs.virtiofsd.src.gitRepoUrl
"https://gitlab.com/virtio-fs/virtiofsd.git"

nix-repl> nixosConfigurations.MORNINGSTAR.pkgs.virtiofsd.src.rev
"v1.8.0"
xiagao commented 9 months ago

I can reproduce this issue with Git-2.42.0.2-64-bit.exe @viktor-prutyanov I'll report an internal bug and let you know it.

xiagao commented 5 months ago

This issue seems gone with the following pkgs.

virtio-win-prewhql-0.1-247 virtiofsd-1.7.2-1.el9.x86_64 qemu-kvm-8.2.0-2.el9.x86_64 host kernel: 5.14.0-408.el9.x86_6 guest: win11 23h2 Git-2.43.0-64-bit.exe/Git-2.35.3-64-bit.exe

A screeshot of the result git-bash

vs49688 commented 5 months ago

Since I filed this issue, my host has updated, but the VM remains untouched and the problem remains. Host:

$ virtiofsd --version
virtiofsd 1.10.1

$ nix repl
Welcome to Nix 2.18.1. Type :? for help.

nix-repl> :lf .
Added 18 variables.

nix-repl> nixosConfigurations.MORNINGSTAR.pkgs.virtiofsd.src.gitRepoUrl
"https://gitlab.com/virtio-fs/virtiofsd.git"

nix-repl> nixosConfigurations.MORNINGSTAR.pkgs.virtiofsd.src.rev
"v1.10.1"

nix-repl>

$ uname -srv
Linux 6.6.14 #1-NixOS SMP PREEMPT_DYNAMIC Thu Jan 25 23:36:01 UTC 2024

Are there binaries of the updated drivers somewhere I could download? I'm not set up to build them currently.

I'm reluctant to update anything else on the host as this specific software combination is a good reproducer.