dokan-dev / dokany

User mode file system library for windows with FUSE Wrapper
http://dokan-dev.github.io
5.2k stars 661 forks source link

Can Dokany support lock the same file through diffrent volume #1133

Closed ylgybbz closed 1 year ago

ylgybbz commented 1 year ago

Environment

Check List

Description

I developed a file system using dokany, according to the instructions, no lock-related interfaces have been implemented(Dokan wil handle it). The test is : mount the same filesystem with different volumes lable on a host, I lock the file on volume 1, produce another IO process tries to lock the same file through volume 2, but the lock is also successful. However,I expect the second lock should failed,I wonder Can This scenario supported by dokany kernel without usermode lock-handler?

Logs

Please attach in separate files: mirror output, library logs and kernel logs. In case of BSOD, please attach minidump or dump analyze output.

Liryna commented 1 year ago

Hi @ylgybbz ,

Why would the lock on the second volume should fail ? Both files are different.

ylgybbz commented 1 year ago

Both

Hi @ylgybbz ,

Why would the lock on the second volume should fail ? Both files are different.

actually two volume share the same space/filesystem through network, but just mount twice. so the file is the same one

Liryna commented 1 year ago

Dokan can forward the lock request to userland when DOKAN_OPTION_FILELOCK_USER_MODE mount option is used. After that you will need to implement your own locking of those files through the network when receiving the lock requests.

ylgybbz commented 1 year ago

Dokan can forward the lock request to userland when DOKAN_OPTION_FILELOCK_USER_MODE mount option is used. After that you will need to implement your own locking of those files through the network when receiving the lock requests.

Thanks,I have learned this from the interface description. I just want to confirm whether dokany or the kernel can handle it by itself if this interface is not implemented