Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creation of a disk file system may fail #88

Closed
billziss-gh opened this issue May 24, 2017 · 31 comments
Closed

Creation of a disk file system may fail #88

billziss-gh opened this issue May 24, 2017 · 31 comments

Comments

@billziss-gh
Copy link
Collaborator

billziss-gh commented May 24, 2017

There is a report that creation of a disk file system on 32-bit Windows may fail with STATUS_NOT_IMPLEMENTED (c000002) during FspFsctlCreateVolume. The issue happens on 32-bit Windows only. See issue hasse69/rar2fs#75.

According to @hasse69 this happens when mounting a cygfuse file system as a "disk" drive (\Device\WinFsp.Disk), but not a "network" drive (\Device\WinFsp.Net). After adding debug log instructions to the WinFsp DLL we were able to isolate this problem in the following DeviceIoControl call:

https://github.com/billziss-gh/winfsp/blob/v1.0/src/dll/fsctl.c#L83-L90

    if (!DeviceIoControl(VolumeHandle, FSP_FSCTL_VOLUME_NAME,
        0, 0,
        VolumeNameBuf, (DWORD)VolumeNameSize,
        &Bytes, 0))
    {
        Result = FspNtStatusFromWin32(GetLastError());
        goto exit;
    }

This fails with ERROR_INVALID_FUNCTION (which gets translated to STATUS_NOT_IMPLEMENTED). The likely reason for the ERROR_INVALID_FUNCTION error return is a STATUS_INVALID_DEVICE_REQUEST response from the FSD.

I am unable to reproduce this problem on any of my local 32-bit VM's. Complete diag.bat output from @hasse69 below:

WINFSP INSTALLATION DIRECTORY AND LAUNCHER REGISTRATIONS

HKEY_LOCAL_MACHINE\SOFTWARE\WinFsp
    InstallDir    REG_SZ    C:\Program Files\WinFsp\

HKEY_LOCAL_MACHINE\SOFTWARE\WinFsp\Services

HKEY_LOCAL_MACHINE\SOFTWARE\WinFsp\Services\memfs-dotnet
    Executable    REG_SZ    C:\Program Files\WinFsp\bin\memfs-dotnet-msil.exe
    CommandLine    REG_SZ    -i -F NTFS -n 65536 -s 67108864 -u %1 -m %2
    Security    REG_SZ    D:P(A;;RPWPLC;;;WD)
    JobControl    REG_DWORD    0x1

HKEY_LOCAL_MACHINE\SOFTWARE\WinFsp\Services\memfs32
    Executable    REG_SZ    C:\Program Files\WinFsp\bin\memfs-x86.exe
    CommandLine    REG_SZ    -i -F NTFS -n 65536 -s 67108864 -u %1 -m %2
    Security    REG_SZ    D:P(A;;RPWPLC;;;WD)
    JobControl    REG_DWORD    0x1

HKEY_LOCAL_MACHINE\SOFTWARE\WinFsp\Services\memfs64
    Executable    REG_SZ    C:\Program Files\WinFsp\bin\memfs-x64.exe
    CommandLine    REG_SZ    -i -F NTFS -n 65536 -s 67108864 -u %1 -m %2
    Security    REG_SZ    D:P(A;;RPWPLC;;;WD)
    JobControl    REG_DWORD    0x1


WINFSP DLL REGISTRATIONS

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order
    ProviderOrder    REG_SZ    LanmanWorkstation,RDPNP,webclient,Dokan1,WinFsp.Np


HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinFsp.Np\NetworkProvider
    Name    REG_SZ    Windows File System Proxy
    ProviderPath    REG_SZ    C:\Program Files\WinFsp\bin\winfsp-x86.dll


HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\WinFsp
    EventMessageFile    REG_SZ    C:\Program Files\WinFsp\bin\winfsp-x86.dll
    TypesSupported    REG_DWORD    0x7


WINFSP FSD CONFIGURATION AND STATUS

SERVICE_NAME: WinFsp
        TYPE               : 2  FILE_SYSTEM_DRIVER
        STATE              : 4  RUNNING
                                (STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0
[SC] QueryServiceConfig SUCCESS

SERVICE_NAME: WinFsp
        TYPE               : 2  FILE_SYSTEM_DRIVER
        START_TYPE         : 3   DEMAND_START
        ERROR_CONTROL      : 1   NORMAL
        BINARY_PATH_NAME   : \??\C:\Program Files\WinFsp\bin\winfsp-x86.sys
        LOAD_ORDER_GROUP   :
        TAG                : 0
        DISPLAY_NAME       : WinFsp
        DEPENDENCIES       :
        SERVICE_START_NAME :

D:(A;;LCRP;;;WD)(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)

WINFSP LAUNCHER SERVICE CONFIGURATION AND STATUS

SERVICE_NAME: WinFsp.Launcher
        TYPE               : 10  WIN32_OWN_PROCESS
        STATE              : 4  RUNNING
                                (STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0
[SC] QueryServiceConfig SUCCESS

SERVICE_NAME: WinFsp.Launcher
        TYPE               : 10  WIN32_OWN_PROCESS
        START_TYPE         : 2   AUTO_START
        ERROR_CONTROL      : 0   IGNORE
        BINARY_PATH_NAME   : "C:\Program Files\WinFsp\bin\launcher-x86.exe"
        LOAD_ORDER_GROUP   :
        TAG                : 0
        DISPLAY_NAME       : WinFsp.Launcher
        DEPENDENCIES       :
        SERVICE_START_NAME : LocalSystem

D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)

OS INFORMATION

Host Name:                 LURCH
OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.14393 N/A Build 14393
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Standalone Workstation
OS Build Type:             Multiprocessor Free
Registered Owner:          Hasse
Registered Organization:
Product ID:                00330-80000-00000-AA460
Original Install Date:     2016-08-09, 07:32:46
System Boot Time:          2017-05-22, 23:43:19
System Manufacturer:       System manufacturer
System Model:              P5K PRO
System Type:               X86-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: x64 Family 6 Model 23 Stepping 7 GenuineIntel ~2830 Mhz
BIOS Version:              American Megatrends Inc. 1303   , 2008-12-16
Windows Directory:         C:\WINDOWS
System Directory:          C:\WINDOWS\system32
Boot Device:               \Device\HarddiskVolume1
System Locale:             sv;Swedish
Input Locale:              sv;Swedish
Time Zone:                 (UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna
Total Physical Memory:     3▒327 MB
Available Physical Memory: 1▒488 MB
Virtual Memory: Max Size:  6▒655 MB
Virtual Memory: Available: 3▒606 MB
Virtual Memory: In Use:    3▒049 MB
Page File Location(s):     C:\pagefile.sys
Domain:                    WORKGROUP
Logon Server:              \\LURCH
Hotfix(s):                 8 Hotfix(s) Installed.
                           [01]: KB3150513
                           [02]: KB3176936
                           [03]: KB3199209
                           [04]: KB3199986
                           [05]: KB3211320
                           [06]: KB4013418
                           [07]: KB4020821
                           [08]: KB4019472
Network Card(s):           2 NIC(s) Installed.
                           [01]: VMware Virtual Ethernet Adapter for VMnet1
                                 Connection Name: Ethernet
                                 DHCP Enabled:    Yes
                                 DHCP Server:     192.168.119.254
                                 IP address(es)
                                 [01]: 192.168.119.1
                                 [02]: fe80::6023:349e:8ad2:ebe8
                           [02]: Marvell Yukon 88E8056 PCI-E Gigabit Ethernet Controller
                                 Connection Name: Local Area Connection
                                 DHCP Enabled:    Yes
                                 DHCP Server:     192.168.0.1
                                 IP address(es)
                                 [01]: 192.168.0.10
                                 [02]: fe80::60f4:ba3b:1d53:3521
Hyper-V Requirements:      VM Monitor Mode Extensions: Yes
                           Virtualization Enabled In Firmware: Yes
                           Second Level Address Translation: No
                           Data Execution Prevention Available: Yes
@billziss-gh billziss-gh changed the title 32-bit cygfuse may fail with STATUS_NOT_IMPLEMENTED 32-bit CYGFUSE may fail with STATUS_NOT_IMPLEMENTED May 24, 2017
@billziss-gh billziss-gh mentioned this issue May 24, 2017
9 tasks
@hasse69
Copy link

hasse69 commented May 24, 2017

According to @hasse69 this happens when mounting a cygfuse file system as a "disk" drive (\Device\WinFsp.Disk), but not a "network" drive (\Device\WinFsp.Net). After adding debug log instructions to the WinFsp DLL we were able to isolate this problem in the following DeviceIoControl call:

Just a minor clarification. It also does not work when mounting to a local folder. It gives the same error as trying to mount as a "disk" drive.

@billziss-gh
Copy link
Collaborator Author

Just a minor clarification. It also does not work when mounting to a local folder. It gives the same error as trying to mount as a "disk" drive.

@hasse69 thanks for the clarification.

[The failing DeviceIoControl happens before "mounting" (but after file system creation), so it makes sense that both drive and directory mounts fail.]

@billziss-gh
Copy link
Collaborator Author

billziss-gh commented May 24, 2017

@hasse69 can you please let me know if this problem also happens with plain MEMFS?

From a cmd.exe prompt please try the following:

> cd \Program Files\WinFsp\bin
> memfs-x86.exe -i -F NTFS -n 65536 -s 67108864 -m M:

This will help us understand whether this is a FUSE/CYGFUSE issue or a general issue on 32-bit Windows.

@hasse69
Copy link

hasse69 commented May 25, 2017

Same problem with memfs-x86.exe

C:\Program Files\WinFsp\bin>memfs-x86.exe -i -F NTFS -n 65536 -s 67108864 -m M:
cannot create MEMFS
The service memfs has failed to start (Status=c0000002).

@billziss-gh
Copy link
Collaborator Author

Same problem with memfs-x86.exe

Thanks. This confirms that the problem is more general than just the FUSE layer.

@billziss-gh billziss-gh changed the title 32-bit CYGFUSE may fail with STATUS_NOT_IMPLEMENTED Creating a file system on 32-bit Windows may fail with STATUS_NOT_IMPLEMENTED May 25, 2017
@billziss-gh billziss-gh changed the title Creating a file system on 32-bit Windows may fail with STATUS_NOT_IMPLEMENTED Creating a disk file system on 32-bit Windows may fail with STATUS_NOT_IMPLEMENTED May 25, 2017
@billziss-gh billziss-gh changed the title Creating a disk file system on 32-bit Windows may fail with STATUS_NOT_IMPLEMENTED Creation of a disk file system on 32-bit Windows may fail May 25, 2017
@bonagerivenkatesh
Copy link

I am encountering the same problem but in my case the issue is not restricted to only 32bit machines. It is not happening on all machines but I am unable to find the pattern or similarities on the failing machines (Have seen on Windows 7, Windows 8 and Windows 10).

Diagnostics result from one of the failing machines


WINFSP INSTALLATION DIRECTORY AND LAUNCHER REGISTRATIONS

HKEY_LOCAL_MACHINE\SOFTWARE\WinFsp
    InstallDir    REG_SZ    C:\Program Files (x86)\WinFsp\


WINFSP DLL REGISTRATIONS

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider\Order
    ProviderOrder    REG_SZ    WinFsp.Np,RDPNP,LanmanWorkstation,webclient


HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WinFsp.Np\NetworkProvider
    Name    REG_SZ    Windows File System Proxy
    ProviderPath    REG_SZ    C:\Program Files (x86)\WinFsp\bin\winfsp-x64.dll
    DeviceName    REG_SZ    \Device\WinFsp.Mup


HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\EventLog\Application\WinFsp
    EventMessageFile    REG_SZ    C:\Program Files (x86)\WinFsp\bin\winfsp-x64.dll
    TypesSupported    REG_DWORD    0x7


WINFSP FSD CONFIGURATION AND STATUS

SERVICE_NAME: WinFsp 
        TYPE               : 2  FILE_SYSTEM_DRIVER  
        STATE              : 4  RUNNING 
                                (STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0
[SC] QueryServiceConfig SUCCESS

SERVICE_NAME: WinFsp
        TYPE               : 2  FILE_SYSTEM_DRIVER 
        START_TYPE         : 3   DEMAND_START
        ERROR_CONTROL      : 1   NORMAL
        BINARY_PATH_NAME   : \??\C:\Program Files (x86)\WinFsp\bin\winfsp-x64.sys
        LOAD_ORDER_GROUP   : 
        TAG                : 0
        DISPLAY_NAME       : WinFsp
        DEPENDENCIES       : 
        SERVICE_START_NAME : 

D:(A;;LCRP;;;WD)(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)S:(AU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD)

WINFSP LAUNCHER SERVICE CONFIGURATION AND STATUS

SERVICE_NAME: WinFsp.Launcher 
        TYPE               : 10  WIN32_OWN_PROCESS  
        STATE              : 4  RUNNING 
                                (STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0
[SC] QueryServiceConfig SUCCESS

SERVICE_NAME: WinFsp.Launcher
        TYPE               : 10  WIN32_OWN_PROCESS 
        START_TYPE         : 2   AUTO_START
        ERROR_CONTROL      : 0   IGNORE
        BINARY_PATH_NAME   : "C:\Program Files (x86)\WinFsp\bin\launcher-x64.exe"
        LOAD_ORDER_GROUP   : 
        TAG                : 0
        DISPLAY_NAME       : WinFsp.Launcher
        DEPENDENCIES       : 
        SERVICE_START_NAME : LocalSystem

D:(A;;CCLCSWRPWPDTLOCRRC;;;SY)(A;;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;BA)(A;;CCLCSWLOCRRC;;;IU)(A;;CCLCSWLOCRRC;;;SU)S:(AU;FA;CCDCLCSWRPWPDTLOCRSDRCWDWO;;;WD)

OS INFORMATION

Host Name:                 FPNB-W08
OS Name:                   Microsoft Windows 10 Pro
OS Version:                10.0.17134 N/A Build 17134
OS Manufacturer:           Microsoft Corporation
OS Configuration:          Member Workstation
OS Build Type:             Multiprocessor Free
Registered Owner:          FPNB
Registered Organization:   
Product ID:                00330-51326-14033-AAOEM
Original Install Date:     10/23/2018, 10:12:14 AM
System Boot Time:          11/25/2018, 6:39:18 PM
System Manufacturer:       HP
System Model:              HP EliteDesk 800 G4 DM 35W
System Type:               x64-based PC
Processor(s):              1 Processor(s) Installed.
                           [01]: Intel64 Family 6 Model 158 Stepping 10 GenuineIntel ~2400 Mhz
BIOS Version:              HP Q21 Ver. 02.04.01, 9/13/2018
Windows Directory:         C:\Windows
System Directory:          C:\Windows\system32
Boot Device:               \Device\HarddiskVolume2
System Locale:             en-us;English (United States)
Input Locale:              en-us;English (United States)
Time Zone:                 (UTC-07:00) Mountain Time (US & Canada)
Total Physical Memory:     16,163 MB
Available Physical Memory: 11,675 MB
Virtual Memory: Max Size:  18,595 MB
Virtual Memory: Available: 13,074 MB
Virtual Memory: In Use:    5,521 MB
Page File Location(s):     C:\pagefile.sys
Domain:                    fpnb.local
Logon Server:              \\FPNB-DCAPP
Hotfix(s):                 6 Hotfix(s) Installed.
                           [01]: KB4100347
                           [02]: KB4456655
                           [03]: KB4457146
                           [04]: KB4462930
                           [05]: KB4477029
                           [06]: KB4462933
Network Card(s):           3 NIC(s) Installed.
                           [01]: Intel(R) Ethernet Connection (7) I219-LM
                                 Connection Name: Ethernet
                                 DHCP Enabled:    Yes
                                 DHCP Server:     10.156.112.1
                                 IP address(es)
                                 [01]: 10.156.112.181
                                 [02]: fe80::9445:af0e:e558:b785
                           [02]: Intel(R) Wireless-AC 9560
                                 Connection Name: Wi-Fi
                                 Status:          Media disconnected
                           [03]: Bluetooth Device (Personal Area Network)
                                 Connection Name: Bluetooth Network Connection
                                 Status:          Media disconnected
Hyper-V Requirements:      VM Monitor Mode Extensions: Yes
                           Virtualization Enabled In Firmware: Yes
                           Second Level Address Translation: Yes
                           Data Execution Prevention Available: Yes


@billziss-gh
Copy link
Collaborator Author

@bonagerivenkatesh can you please confirm that your issue is not related to issue #177?

Have a look at the comments towards the end, especially the comments made by @thinkport.

@billziss-gh
Copy link
Collaborator Author

Also if #177 is not your issue, I would love if I could get debug access (or even just access) to one of the machines that exhibits this problem.

@bonagerivenkatesh
Copy link

@billziss-gh unfortunately the fix for #177 didn't fix the problem. I have sent a private email for you to schedule a call to access the machine with the problem.

@bonagerivenkatesh
Copy link

bonagerivenkatesh commented Mar 7, 2019

@billziss-gh I added some logs to print the file name and number where this error was thrown and it is pointing to

if (!DeviceIoControl(VolumeHandle, FSP_FSCTL_VOLUME_NAME,
        0, 0,
        VolumeNameBuf, (DWORD)VolumeNameSize,
        &Bytes, 0))
    {
        Result = FspNtStatusFromWin32(GetLastError());
        goto exit;
    }

in fsctl.c

I used memfs.exe -i -F NTFS -n 65536 -s 67108864 -m M: -d -1 -D mountLogs.log to mount.

The mount still failed with the error c000002.
The console had the error
image

Please let me know if any of these info helps to narrow down the issue.

@billziss-gh
Copy link
Collaborator Author

@bonagerivenkatesh thanks for the info, but it was already known. Please see top post of this thread.

As said before, I would love to get temporary access to one of the machines exhibiting the problem.

@bonagerivenkatesh
Copy link

@billziss-gh Unfortunately its happening only on my client machines and I am still in search of one who is ready to give the debug access to us.

@billziss-gh
Copy link
Collaborator Author

Understood.

It looks like you are able to run custom builds on those machines so it might be worth trying custom FSD builds to see if we can pinpoint the problem. I am currently on an iPad so I can only type so much detail, but here are some pointers:

  • The kernel side handler for FSP_FSCTL_VOLUME_NAME is FspVolumeGetName. It would be good to add some DbgPrint’s and see if we ever get them using DbgView. Any alternative mechanism to DbgPrint is also acceptable of course.
  • I would also add another DbgPrint here to make sure that the test does not fail for some daft reason.

If we do not see any of these debug prints (and assuming that you have configured things correctly to get debug prints visible on the system) then it must mean that something else intercepts that call and fails it, likely a filter.

So can you also let me know what the fltmc command reports for running filters on the system?

@bonagerivenkatesh
Copy link

@billziss-gh ya I am able to run custom builds on those machine, I will try your suggestion of DbgPrint and update you.
Meanwhile I collected the details of filter drivers and their instances along with the installed applications and services running on that machine. Hope it helps.
filterInstances.txt
filterVolumes.txt
InstalledPrograms.txt
AllDrivers.txt
filterDrivers.txt

@billziss-gh
Copy link
Collaborator Author

@bonagerivenkatesh the filterDrivers.txt file does list a couple of third-party filters:

@billziss-gh
Copy link
Collaborator Author

@hasse69 if you are still on the thread and have access to the system that exhibited the original problem: could you check whether that system has any of the aforementioned filters? (Wrkrn and stcvsm?)

You can use the fltmc command to get installed and running filters.

@hasse69
Copy link

hasse69 commented Mar 12, 2019

Sorry, I upgraded my system to 64-bit a long time ago. I no longer have access to it :(

For what it is worth, here are my filters on my upgraded system

Filter Name                     Num Instances    Altitude    Frame
------------------------------  -------------  ------------  -----
WdFilter                                9       328010         0
storqosflt                              0       244000         0
wcifs                                   1       189900         0
CldFlt                                  0       180451         0
FileCrypt                               0       141100         0
luafv                                   1       135000         0
npsvctrig                               1        46000         0
Wof                                     8        40700         0
FileInfo                                9        40500         0

@bonagerivenkatesh
Copy link

@billziss-gh luckily I was able to reproduce this issue by just installing the ShadowProtect application https://www.storagecraft.com/downloads/trials/spx-windows and then installing winfsp.
We could easily do any debugging if required to fix this.

@billziss-gh
Copy link
Collaborator Author

Let me see if I can easily install this software in one of the VM's I use for kernel debugging.

@bonagerivenkatesh
Copy link

@billziss-gh to add more info to the above the line 81 failed so it never entered the FspVolumeGetName(FsctlDeviceObject, Irp, IrpSp);

@billziss-gh
Copy link
Collaborator Author

billziss-gh commented Mar 12, 2019

Here is my debugging analysis.

In WinDbg I enabled WinFsp debug prints with:

kd> ?? fsp_debug |= fsp_debug_dp
int 0n285212674

Then got the following logs back:

[0] WinFsp!FspFileSystemControl(FFFFF98007902E50, CtlU, IRP_MJ_FILE_SYSTEM_CONTROL[IRP_MN_USER_FS_REQUEST], FSP_FSCTL_VOLUME_NAME, FileObject=FFFFFA8001BD06B0) = STATUS_INVALID_DEVICE_REQUEST[0]
[0] WinFsp!FspCleanup(FFFFF98008F58E50, CtlK, IRP_MJ_CLEANUP, FileObject=FFFFFA8001BD06B0) = STATUS_SUCCESS[0]

These logs make no sense: where is the FspCreate from when the WinFsp's control device (WinFsp.Disk) is opened? I should have seen something along the lines of:

[0] WinFsp!FspCreate(...)                       # open the WinFsp.Disk device
[0] WinFsp!FspFileSystemControl(...)            # send it FSCTL requests
...

It appears that stcvsm is swallowing our IRP_MJ_CREATE, but then forwards other IRP's for the same FILE_OBJECT anyway. The reason we get back STATUS_INVALID_DEVICE_REQUEST from FSP_FSCTL_VOLUME_NAME requests is because this test fails, which ultimately is because we never got the IRP_MJ_CREATE to properly initialize our control device FILE_OBJECT.

Let's confirm our suspicion. I placed a strategic breakpoint in nt!NtCreateFile and started MEMFS with memfs-x64 -m Y:. I also placed a breakpoint in WinFsp's FspCreate. Eventually I arrive at:

kd> k
 # Child-SP          RetAddr           Call Site
00 fffff880`0659b518 fffff800`45e4cd26 stcvsm+0x8fd4
01 fffff880`0659b520 fffff800`45c5a05b nt!IovCallDriver+0x3e6
02 fffff880`0659b570 fffff800`45c56c5d nt!IopParseDevice+0x77b
03 fffff880`0659b760 fffff800`45c5c2b8 nt!ObpLookupObjectName+0x7a1
04 fffff880`0659b890 fffff800`45c6debe nt!ObOpenObjectByName+0x258
05 fffff880`0659b960 fffff800`45c6e609 nt!IopCreateFile+0x37c
06 fffff880`0659ba00 fffff800`45889053 nt!NtCreateFile+0x79
07 fffff880`0659ba90 000007fb`97c430fa nt!KiSystemServiceCopyEnd+0x13
08 00000047`7524e5e8 000007fb`94dd52dc ntdll!NtCreateFile+0xa
09 00000047`7524e5f0 000007fb`94dd5411 KERNELBASE!CreateFileInternal+0x324
0a 00000047`7524e770 000007fb`8b038fb1 KERNELBASE!CreateFileW+0x6d
0b 00000047`7524e7d0 000007fb`8b03fe5d winfsp_x64_7fb8b000000!FspFsctlCreateVolume+0x281 [c:\users\billziss\projects\t\winfsp\src\dll\fsctl.c @ 79]
0c 00000047`7524ef90 000007f7`933dc315 winfsp_x64_7fb8b000000!FspFileSystemCreate+0xfd [c:\users\billziss\projects\t\winfsp\src\dll\fs.c @ 147]
0d 00000047`7524f030 000007f7`93486038 memfs_x64!MemfsCreateFunnel+0x3d5 [c:\users\billziss\projects\t\winfsp\tst\memfs\memfs.cpp @ 2061]

Stcvsm appears to complete the IRP_MJ_CREATE request almost immediately and certainly does not forward the request to WinFsp first (as it should). To me this looks like a problem with stcvsm and I suggest that we contact their developers as the next step.

I may add to this post as I discover additional information.

@billziss-gh
Copy link
Collaborator Author

@billziss-gh to add more info to the above the line 81 failed so it never entered the FspVolumeGetName(FsctlDeviceObject, Irp, IrpSp);

@bonagerivenkatesh thanks for additional info. Yes, I have found the same. I am in the process of debugging this. See comments above.

@billziss-gh
Copy link
Collaborator Author

@bonagerivenkatesh I have updated my debugging analysis, which I posted above. The conclusion:

To me this looks like a problem with stcvsm and I suggest that we contact their developers as the next step.

@billziss-gh
Copy link
Collaborator Author

billziss-gh commented Mar 12, 2019

I am trying to find a bug report or support email on their website, but have not been successful so far.

EDIT: Found this: support@storagecraft.com. I will write an email to them and see where it takes us.

@bonagerivenkatesh
Copy link

@billziss-gh sounds good. I really appreciate your involvement and support.

I found this https://support.storagecraft.com/s/contactsupport (requires registration though to post here)

But on a side note I heard today that some HP software manager also causing this issue (I could not reproduce the issue though), is there anyway the priority of the driver can be changed so that the request directly goes to WinFsp? If that is possible then it would be great as not sure how many legacy drivers are present that might cause similar issues..

@billziss-gh
Copy link
Collaborator Author

But on a side note I heard today that some HP software manager also causing this issue (I could not reproduce the issue though), is there anyway the priority of the driver can be changed so that the request directly goes to WinFsp? If that is possible then it would be great as not sure how many legacy drivers are present that might cause similar issues..

WinFsp is a file system driver and has no "priority". Filters are free to intercept its requests and in some cases they may erroneously handle them. Unfortunately I am not aware of any method to get around that.

@billziss-gh billziss-gh changed the title Creation of a disk file system on 32-bit Windows may fail Creation of a disk file system may fail Mar 12, 2019
@billziss-gh
Copy link
Collaborator Author

billziss-gh commented Mar 12, 2019

Sent a mail to support@storagecraft.com. Will see what happens.

EDIT1:

Thank you for contacting StorageCraft Technical Support. This mailbox is not monitored.

EDIT2:
Created case 00393998 in the StorageCraft ticket system.

@billziss-gh
Copy link
Collaborator Author

StorageCraft resolved this issue a couple of days ago. My thanks to the StorageCraft people if you are reading this!

Their newest product SPX 6.8 includes an stcvsm.sys driver with an altitude of 388250. I have confirmed that SPX 6.8 fixes this issue.

@bonagerivenkatesh can you also confirm so that we can close this issue?

@billziss-gh billziss-gh removed the bug label Mar 20, 2019
@hasse69
Copy link

hasse69 commented Mar 20, 2019

@billziss-gh I will not be able to confirm since I am not even certain the original issue I reported has anything to do with SPX. It might have been another filter driver that caused the issue though but I do not think we will ever know for sure. As for my case, I am fine with closing this.

@bonagerivenkatesh
Copy link

@billziss-gh I was able to confirm that this is fixed in the latest version of SPX.
Thanks a lot for your assistance

@billziss-gh
Copy link
Collaborator Author

@hasse69 thanks. I knew that you had updated that system and you no longer had the original so you could not confirm. If there was another filter driver it will eventually turn up and we might be able to point to a similar cause as being the problem.

@bonagerivenkatesh you are welcome.

Closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants