Skip to content

Do real revalidation of "remote" file systems #4

Closed

Description

@nlacasse

Re this item in the FAQ:

I can’t see a file copied with docker cp.

For performance reasons, gVisor caches directory contents, and therefore it may not realize a new file was copied to a given directory. To invalidate the cache and force a refresh, create a file under the directory in question and list the contents again.

DirentOperations (akin to dentry_operations in Linux; embedded in MountOperations, which are about to be renamed MountSourceOperations, and are akin to super_operations) currently have Revalidate and Keep methods.

In Linux, revalidation will stat the inode to see if anything has changed. If it has, it re-walks to that node.

In gVisor, revalidation always returns false for host files, so the sandbox will notice the new file either when it falls out of the Dirent cache or when you readdir the containing directory. For Gofer files, revalidation is controlled by whether Dirents are cached or not, which should also not be the case.

We should be following Linux more closely here, which would also resolve the above problem. For Gofers, we should provide a configuration option to say "don't revalidate" that one can use as a performance optimization if they know only gVisor has access to that mount and nothing else can add/change/remove files.

Activity

  1. added a commit that references this issue on Nov 14, 2019
  2. added a commit that references this issue on Aug 20, 2020
  3. nlacasse commented on Jun 8, 2021

    @nlacasse
    ContributorAuthor

    This is fixed in VFS2.

  4. mtaku3 commented on Jul 19, 2023

    @mtaku3

    I'm aware that this issue isn't fixed.
    Creating container and copying files works just fine, but after executing some commands using execInstance it suddenly became unable to copy.

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

Metadata

Metadata

Assignees

Labels

area: container runtimeIssue related to docker, kubernetes, OCI runtimearea: filesystemIssue related to filesystemarea: integrationIssue related to third party integrationspriority: p2Normal prioritytype: bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions