Bug 2026299

Summary: [virtiofs] Virtiofs support for case-insensitivity on windows guest
Product: Red Hat Enterprise Linux 9 Reporter: xiagao
Component: virtio-winAssignee: Virtualization Maintenance <virt-maint>
virtio-win sub component: virtio-win-prewhql QA Contact: xiagao
Status: CLOSED ERRATA Docs Contact:
Severity: medium    
Priority: medium CC: vrozenfe, yvugenfi
Version: 9.0Keywords: Triaged
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: ---   
Hardware: x86_64   
OS: Windows   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-05-09 07:55:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description xiagao 2021-11-24 10:21:26 UTC
Description of problem:
For windows guest,it isn't sensitive with uppercase letter, but linux does.
So if we create a file name with uppercase letter, and then read with lowercase letter on windows guest,it will show "The system cannot find the file specified"

Issue described in upstream.
"
Currently if a linux case-sensitive filesystem is mapped to Windows guest using virtiofs then a lot of programs doesn't work trying to access files on this mapped disk because of genius developers unable to stick to single file casing at different parts of program.
eg. one function loads one.DLL while different function uses One.dll and so on.
"

Version-Release number of selected component (if applicable):
kernel-5.14.0-5.el9.x86_64
qemu-kvm-6.1.0-6.el9.x86_64
virtio-win-prewhql.0.1-214

How reproducible:
100%

Steps to Reproduce:
1.boot up guest with shared dir
# /usr/libexec/virtiofsd --socket-path=/tmp/vhostqemu -o source=/home/virtiofs_test -o cache=always
-smp 8 \  -m 4G \  
-object memory-backend-file,id=mem,size=4G,mem-path=/dev/shm,share=on \  
-numa node,memdev=mem \  -chardev socket,id=char0,path=/tmp/vhostqemu \  
-device vhost-user-fs-pci,queue-size=1024,chardev=char0,tag=myfs \  
...
2.install viofs driver and winfsp tool

3.run virtiofs.exe server,and z: volume is shown.

4.Create a file,name contains uppercase letter, and then read it with lowercase letter
Z:>echo testing > TEST.txt 
Z:>type test.txt 
The system cannot find the file specified.  



Actual results:
can't read test.txt
The system cannot find the file specified.  


Expected results:
it should behavior like native ntfs file syste,be insensitive with uppercase letter. 
Z:>echo testing > c:\TEST.txt 
Z:>type c:\test.txt 
testing

Additional info:

Comment 1 Yvugenfi@redhat.com 2022-09-29 06:07:33 UTC
Upstream pull request: https://github.com/virtio-win/kvm-guest-drivers-windows/pull/832

Comment 2 Viktor Prutyanov 2022-10-19 10:48:29 UTC
There is how to turn on case insensitivity:
https://github.com/virtio-win/kvm-guest-drivers-windows/wiki/VirtIO-FS:-Shared-file-system#options

Comment 4 Vadim Rozenfeld 2022-10-25 06:08:30 UTC
please check with build 228
https://brewweb.engineering.redhat.com/brew/buildinfo?buildID=2226327

Comment 6 xiagao 2022-10-26 09:51:16 UTC
Test on virtio-win-prewhql-0.1-228, shared volume still have case-sensitive issue.

C:\Users\Administrator>"c:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe" start virtiofs vfsa myfs a:
OK

C:\Users\Administrator>"c:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe" start virtiofs vfsb myfs1 b:
OK

C:\Users\Administrator>echo aaa > file

C:\Users\Administrator>type file
aaa

C:\Users\Administrator>type FILE
aaa
---------------> Above is the local disk behavior.
C:\Users\Administrator>echo aaa > a:\file

C:\Users\Administrator>type a:\file
aaa

C:\Users\Administrator>type a:\FILE
The system cannot find the file specified.
---------------> Virtiofs mounted volume still be case-sensitive.

Comment 7 Yvugenfi@redhat.com 2022-10-26 10:58:13 UTC
(In reply to xiagao from comment #6)
> Test on virtio-win-prewhql-0.1-228, shared volume still have case-sensitive
> issue.
> 
> C:\Users\Administrator>"c:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe"
> start virtiofs vfsa myfs a:
> OK
> 
> C:\Users\Administrator>"c:\Program Files (x86)\WinFsp\bin\launchctl-x64.exe"
> start virtiofs vfsb myfs1 b:
> OK
> 
> C:\Users\Administrator>echo aaa > file
> 
> C:\Users\Administrator>type file
> aaa
> 
> C:\Users\Administrator>type FILE
> aaa
> ---------------> Above is the local disk behavior.
> C:\Users\Administrator>echo aaa > a:\file
> 
> C:\Users\Administrator>type a:\file
> aaa
> 
> C:\Users\Administrator>type a:\FILE
> The system cannot find the file specified.
> ---------------> Virtiofs mounted volume still be case-sensitive.

Did you enable case insensitivity support according to https://github.com/virtio-win/kvm-guest-drivers-windows/wiki/VirtIO-FS:-Shared-file-system#options ?
The support is off by default. This is by design. Same as with Samba.

Thanks,
Yan.

Comment 8 xiagao 2022-10-27 07:04:54 UTC
Yes, case insensitive is enabled with parameter "-i" or add it to register with "reg add HKLM\Software\VirtIO-FS /v CaseInsensitive /d 1 /t REG_DWORD"

1. create a file in shared dir on host, such as
# echo test > Test.txt

2. Be able to get it with all lower_letter in mounted volume on win11 guest.
> type test.txt
test

So it can be verified.

Comment 9 Yvugenfi@redhat.com 2022-10-27 07:56:59 UTC
Documentation should be added on how to turn on case insensitive: https://github.com/virtio-win/kvm-guest-drivers-windows/wiki/VirtIO-FS:-Shared-file-system#options

Comment 14 errata-xmlrpc 2023-05-09 07:55:10 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (virtio-win bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2023:2451