-
Notifications
You must be signed in to change notification settings - Fork 674
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
Creating a file after deleting it may fail #998
Comments
@zqlustc Hi, Thank you for the report. Could you provide a small sample code or manual steps to reproduce the issue ? |
A small sample code:
It can excuted success in the NTFS disk folder, After the file is deleted, the file was created in 5 seconds. But it failed in mirrorfs folder |
@zqlustc I will not have much to look into this in the next days sorry. |
OK, if you have any progress ,please let me know. Thanks very much! |
Hello, this problem still pester me, could you reproduce it by the POC and have a look, thanks very much?@Liryna Lines 691 to 693 in 685aab7
In other word, IF the file is not existed, we should allow apps create the file. |
Hello @zqlustc You did not posted the (whole, textual) log from ProcMon, and only a picture of small part of the log. You mention the
https://docs.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-deletefilea IOW your description of an application ( I believe you better to re-think WHAT your application is trying to achive and to do it in some legit way. |
@the-Arioch Here SetDispositionInformationFile is used to mark the file for deletion and the handle looks to be closed right after. |
oooops, my lapse! I was assuming even offset deletion would still yeild a procmon-detectable deletefile call. Did not look into params. My bad.
And that contradicts to the workflow zqlustc outlines. So, frankly, i expect race conditions or something in his app, where the handle is eventually closed by SOME worker in indeterministic async way. I'll see if i be really fired up in October to write his sample code in Pascal ( i really hate how C-like code looks, sorry ) and make a try on real NTFS. I do not expect that to be actually working, according to my reading of MSDN. MSDN somehow draws a line between DELETE and RENAME rights, and it is a known distinction between FAT and NTFS that you can (usually) rename EXE and DLLs of running application on NTFS but not FAT. I wonder if NTFS to an extent follows UNIX semantics that filename is just a shortcut, a hardlink to file (a void* pointer), and file is anonymous byte storage somewhere (output of malloc, that can be remmbered or lost). NT is actually an VMS offspring not UNIx one, and i next to never met VMS. For DOS and Windows filename and file was one and the same object. For NTFS i am not sure, especialyl that later NTFS versions even introduced symlinks... BTW, this might be a way out, to try zqlustc 's sample on other filesystems - FAT, UDF, exFAT. Would it universally work there? If not, is there an obligation upon Dokany to implement it? NTFS has many features like alt-streams, ext-attrs, junction points (folder hardlinks) and per-file compression. And i can use them in my application - but then i concisely make that my app bound to NTFS and do not have rights to demand other FSes become NTFS clones. |
BTW, do you by chance instantly remember if Dokany implements another auto-delete-on-close semantics, the I speculate, IF there actually is missynchronization of reference counting in Dokany, then i would expect it to also surface there too. |
I haven't tested it but I think I do remember something like NTFS does allow you to (re)create a file between |
That being said, mirror'ed disks are reported as NTFS drives. I said above
But then, if some disk reports being NTFS and does not act like true NTFS - what should such an app do? Sorry, i feel tired and have a good night, i am out for today. Just few words... that "baskslah issue" would mean hardening (in defensive programming sense) your driver which is not easy, and especially not easy as you seem to not having Dokan driver API documentation even for yourselves. Idea that dokanlets should have their own copy of dokan1.dll also leads to that, you have to have a stable driver API even if DLL API would be changing. and that mean driver API should be documented. Drankly, i'd rather have it the opposite way, stabilze DLL API and had freedom to change driver-to-DLL interface as often as i see fit. |
@the-Arioch There is one driver installer for X apps with possible diff versions of the library. You cannot have the freedom to change the drive-to-DLL interface as you want.
Do not forget that this is open source. Anyone can send patch or open an issue. I am always open to review anything and give help. |
Sorry, seems I am afraid i feel sick so sorry if I am not coherent.
But i believe when you make some API stable and rely upon it it has to be
documented. Maybe not publicly but at least among devs.
In case you have a bug, you often find two parts of your system talking
different languages, but which is in the wrong, which one to be fixed?
Without some consensus fixed in writing it becomes hard to figure it out.
Yes, I know how cursed all calls to write the doc sound, I know...
|
@the-Arioch Exact, it is important to have doc and we should all write it. |
Hi, @Liryna, @the-Arioch |
You can build a frame and we can fill in the content of each chapter. I am also happy to do something like this |
Feature request can skip this form. Bug report must complete it.
Check List
must be 100% match or it will be automatically closed without further discussion. Please remove this line.Environment
Check List
Description
I ues the PickerHost.exe to edit the picture and save as A31.jpg(It is located in dokan mount disk). It probabilistic failed. ProcessMonitor trace as show:
So I use the mirror to test. After I delete a file(CreateFile -> DeleteFile, there is no CloseFile), I create the file immediately. It will fail in mirrorfs.I find it failed here through the dokan1.sys driver debug.
dokany/sys/create.c
Lines 691 to 693 in 685aab7
but it will success in NTFS. Could we support it as same as NTFS? Thanks.@Liryna
Logs
Please attach in separate files: mirror output, library logs and kernel logs.
In case of BSOD, please attach minidump or dump analyze output.
The text was updated successfully, but these errors were encountered: