Bug 2172002

Summary: [virtio-win][virtiofs] case insensitive doesn't work on some cmd, such as md5sum
Product: Red Hat Enterprise Linux 9 Reporter: xiagao
Component: virtio-winAssignee: Yvugenfi <yvugenfi>
virtio-win sub component: virtio-win-prewhql QA Contact: xiagao
Status: CLOSED MIGRATED Docs Contact:
Severity: medium    
Priority: medium CC: coli, jinzhao, juzhang, lijin, qizhu, viktor, yvugenfi
Version: 9.2Keywords: CustomerScenariosInitiative, MigratedToJIRA, Reopened, Triaged
Target Milestone: rc   
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-07-30 11:29:58 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 2023-02-21 07:28:54 UTC
Description of problem:
After enabling case-insensitive for virtiofs service, md5sum or notepad cmd still fail to open the file with uppercase/lowercase letter.


Version-Release number of selected component (if applicable):
qemu-kvm-7.2.0-8.el9.x86_64
kernel-5.14.0-252.el9.x86_64
edk2-ovmf-20221207gitfff6d81270b5-5.el9.noarch
virtio-win-prewhql-0.1-234

How reproducible:
100%

Steps to Reproduce:
1.start virtiofs daemon
# /usr/libexec/virtiofsd --shared-dir /home/test --socket-path /tmp/sock1 -d

2.boot up win2022 guest
     -chardev socket,id=char_virtiofs_fs,path=/tmp/sock1 \
     -device vhost-user-fs-pci,id=vufs_virtiofs_fs,chardev=char_virtiofs_fs,tag=myfs,queue-size=1024,bus=pcie-root-port-3,addr=0x0 \

3.start virtiofs service and enable case-insensitive
z:\>sc create VirtioFsSvc binpath=virtiofs.exe start=auto depend="WinFsp.Launcher/VirtioFsDrv" DisplayName="Virtio FS Service"
z:\>reg add HKLM\Software\VirtIO-FS /v CaseInsensitive /d 1 /t REG_DWORD

4. reboot guest
5. login guest and create a file on the shared dir, and create a file, try to get md5 checksum for the file.
M:\>type file.txt
hello
M:\>type FILE.txt
"hello"
M:\>md5sum file.txt
c4a246e402c50cd67617e59affd536b1 *file.txt
M:\>md5sum FILE.txt
No such file: FILE.txt

5. Try to repeat step 4 on the file on C: volume.
C:\>md5sum test.txt              
6dd4566eb245627b49f3abb7e4502dd6 *test.txt

C:\>md5sum TEST.txt
6dd4566eb245627b49f3abb7e4502dd6 *test.txt


Actual results:
After step4, md5sum can't get the file with uppercase letter, it's sensitive to uppercase and lowercase letters.

Expected results:
For virtiofs volume,md5sum is insensitive with uppercase and lowercase letters as it does in C:


Additional info:
Notepad, type, dir, etc are insensitive with case letter.

Comment 1 Viktor Prutyanov 2023-02-21 16:29:02 UTC
Hi,

what kind of md5sum are you using? My md5sum is working in the case-insensitive way.

Z:\>md5sum --version
md5sum (GNU coreutils) 8.32

Z:\>cat file.txt
hello

Z:\>cat File.txt
hello

Z:\>md5sum file.txt
6dd4566eb245627b49f3abb7e4502dd6 *file.txt

Z:\>md5sum FILE.TXT
6dd4566eb245627b49f3abb7e4502dd6 *FILE.TXT

Comment 2 xiagao 2023-02-23 06:31:32 UTC
Yes, the md5sum version is too old on my side.
I will try to use the latest one to have a test.

Comment 3 xiagao 2023-02-27 02:26:48 UTC
M:\>c:\"program files"\git\usr\bin\md5sum.exe --version
md5sum (GNU coreutils) 8.32


M:\>c:\"program files"\git\usr\bin\md5sum.exe TEST
5c9597f3c8245907ea71a89d9d39d08e *TEST

It works with the newer md5sum, so I will close this bug.

Btw, for the md5sum tool for windows, I searched online for times, but I'm only able to get it from the git bash. 
Hi Viktor, do you have a better way to get it? Thanks in advance.

Comment 4 Yvugenfi@redhat.com 2023-02-27 08:09:59 UTC
Keeping open in order to investigate root cause with the old version in order not to skip the bug on our side.

Comment 6 Viktor Prutyanov 2023-03-04 20:18:12 UTC
Hi Xiaoling,

What was the old version of md5sum that you used? How to obtain it?

Comment 9 xiagao 2023-03-06 01:48:37 UTC
(In reply to Viktor Prutyanov from comment #6)
> Hi Xiaoling,
> 
> What was the old version of md5sum that you used? How to obtain it?

The version is 1.22, it's an older one and I don't know how to obtain it, it existed in our test tool for a long time.
C:\>md5sum.exe --version
md5sum (PCP patchlevel 2) (GNU textutils) 1.22

Comment 10 Viktor Prutyanov 2023-03-16 13:56:25 UTC
Old md5sum also works somehow:

Z:\>echo hello > file.txt

Z:\>type file.txt
hello

Z:\>type FILE.txt
hello

Z:\>md5sum file.txt FILE.txt
6dd4566eb245627b49f3abb7e4502dd6 *file.txt
6dd4566eb245627b49f3abb7e4502dd6 *FILE.txt

Z:\>C:\md5sum.exe file.txt FILE.txt
6dd4566eb245627b49f3abb7e4502dd6 *file.txt
6dd4566eb245627b49f3abb7e4502dd6 *FILE.txt

Z:\>C:\md5sum.exe --version
md5sum (PCP patchlevel 2) (GNU textutils) 1.22

Comment 12 xiagao 2023-05-04 02:50:41 UTC
Yan, Viktor, do you plan to have this bug fixed in 9.2.Z? And could you help update the 'Internal Target Release' field?
Thanks.

Comment 13 Yvugenfi@redhat.com 2023-05-04 06:40:28 UTC
(In reply to xiagao from comment #12)
> Yan, Viktor, do you plan to have this bug fixed in 9.2.Z? And could you help
> update the 'Internal Target Release' field?
> Thanks.

Hi, this bug is still under investigation. No plans for Z stream.

Comment 14 Viktor Prutyanov 2023-07-02 18:17:11 UTC
Hi Xiaoling,

Could you please reproduce the issue on latest virtio-win by running virtiofs from command-line with '-i' argument?

Comment 15 xiagao 2023-07-03 05:07:05 UTC
(In reply to Viktor Prutyanov from comment #14)
> Hi Xiaoling,
> 
> Could you please reproduce the issue on latest virtio-win by running
> virtiofs from command-line with '-i' argument?

Sure, I have the result with prewhql-238 version.
Unfortunately, it still doesn't work.

Z:\>md5sum tEsT.txt
c9331b63c28e9028bdffd1643a430877 *tEsT.txt

Z:\>md5sum test.txt
No such file: test.txt

Z:\>type test.txt
SFADFASDFDSFDSFSAFDASFDASFD

Comment 16 Viktor Prutyanov 2023-07-03 07:59:34 UTC
Could you please enable debug logging (-d -1 -D ...), perform the same things and share the log with me?

Comment 17 Viktor Prutyanov 2023-07-03 08:35:31 UTC
Also, what is WinFsp version?

Comment 19 xiagao 2023-07-03 08:51:17 UTC
(In reply to Viktor Prutyanov from comment #17)
> Also, what is WinFsp version?

It's 1.12.22339

Comment 20 Viktor Prutyanov 2023-07-03 09:43:25 UTC
I can't reproduce the issue on both Win2019 and Win2022 with WinFsp 1.12.22339, so please share the virtiofs debug logs and daemon logs.

Comment 21 xiagao 2023-07-03 09:51:13 UTC
(In reply to Viktor Prutyanov from comment #20)
> I can't reproduce the issue on both Win2019 and Win2022 with WinFsp
> 1.12.22339, so please share the virtiofs debug logs and daemon logs.

The log is in comment18 for win10 guest, do you want the log for win2019 or win2022?

Comment 22 Yvugenfi@redhat.com 2023-07-17 07:08:38 UTC
Upstream pull request: https://github.com/virtio-win/kvm-guest-drivers-windows/pull/936