This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: FUSE for Cygwin - was: Re: Fork and Windows Heap


Hello, Jeffrey:

On 6/18/16, 1:19 PM, "Jeffrey Altman" <cygwin-owner@cygwin.com on behalf
of jaltman@secure-endpoints.com> wrote:


>On 6/18/2016 4:03 PM, Bill Zissimopoulos wrote:
>> * A directory cannot be renamed if it or any of its subdirectories
>> contains a file that has open handles (except in the batch-oplock case
>> described earlier).
>> 
>> 
>> In particular the third bullet point mandates that the FSD keeps
>> information not only about files that are open, but also of their
>> hierarchical relationships. The easiest way to do this on Windows is to
>> maintain a mapping of file names to open files.
>
>This is not how my file system redirector enforces the rule.  The file
>control block (representing the handle) for an open file maintains a
>reference to the directory object through which it was opened.  As long
>as the directory object has outstanding references the redirector fails
>the rename request.

Thank you for your very useful pointer. I have a question. In your file
system redirector if the file "\comp1\comp2\name.extâ gets opened, do you
also open (internally) the directories "\comp1" and "\comp1\comp2â? It
sounds like you do.

I understand that this is what UNIX VFS does, but it is my understanding
that Windows does not require this. WinFsp avoids it so that it will not
send extraneous requests to the user mode file system. WinFsp only knows
about files that have been explicitly opened using IRP_MJ_CREATE.

But perhaps I misunderstand what you are suggesting. Apologies for being
thick, but can you please elaborate?

>File path maps to specific files in fact do not work because the file
>can be hard linked into more than one directory.  Only the directory
>that was used to create a file handle is restricted from renaming.

I agree. But my FSD does not currently support hard links. If/when it does
I will have to revisit this design.

Many thanks for your insight. BTW, if your redirector is public/opensource
I would love to take a look.

Bill


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]