microsoft / microsoft/VFSForGit

Mac: Detect new folders sooner in the vnode op event handler, remove NeedsNewFolderCreateNotification, and try enabling NeedsNewFolderCreateNotification functional tests

Open
#1,339 0 comments 0 reactions 1 assignee View on GitHub

@wilbaker is already working on this.

Since Jul 19, 2019.

domain: kext platform: macOS
Dominant language
C#
Stars
6.1k
Forks
474
Avg merge
2d 4h
Merged PRs (30d)
8

Description

Possibly fixes #360 and possibly allows NeedsNewFolderCreateNotification tests to be enabled on Mac.

A few changes are needed:

  1. Update ShouldHandleVnodeOpEvent to check the vnode cache rather than the FileFlags_IsInVirtualizationRoot flag when deciding if an event should be handled.

  2. In the directory handling if/else code blocks here:

    if (isDirectory)
    {
        if (isRename ||
            ActionBitIsSet(
                action,
                KAUTH_VNODE_LIST_DIRECTORY |
                KAUTH_VNODE_SEARCH |
                KAUTH_VNODE_READ_SECURITY |
                KAUTH_VNODE_READ_ATTRIBUTES |
                KAUTH_VNODE_READ_EXTATTRIBUTES))
        {

https://github.com/microsoft/VFSForGit/blob/16deac4d57ab5b287de5a06ee366f1b8d4481cc2/ProjFS.Mac/PrjFSKext/KauthHandler.cpp#L533

Use if (!FileFlagsBitIsSet(currentVnodeFileFlags, FileFlags_IsInVirtualizationRoot)) to detect new folders and notify VFS4G.

  1. With the above changes we should be able to remove FindNewFoldersInRootAndNotifyProvider and its associated code.

  2. See if NeedsNewFolderCreateNotification can be enabled (still TBD if we're guaranteed to get a vnode op callback from simply creating a directory).

  3. If with this change FileFlags_IsInVirtualizationRoot is only used to track if the provider knows about the file, rename the flag to something like FileFlags_IsTrackedByProvider

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.