Skip to content

posix: files in a folder renamed on disk can't be found by id #855

Closed

Description

@NickWalters

Problem

With the posix driver and the watcher on, rename a folder on disk. Afterwards, the files inside it can't be found by id. Shares, public links, favourites and fileid URLs that point at those files fail until someone opens the folder in OpenCloud or the service restarts.

It only affects folders that a scan already passed, which after a restart is every existing folder.

Steps to reproduce

  1. Start OpenCloud with a posixfs space and the watcher on. Create a folder a with a file a/f.txt, and create a public link to a/f.txt.
  2. Restart, so the startup scan marks every folder as clean.
  3. Run mv a b on disk.
  4. Open the public link.

Expected: the link shows the file.

Actual: the link fails, because the id cache has no path for the file. A fileid URL or a share to the file fails the same way.

Cause

After a move, assimilate updates the cached paths of the children with WarmupIDCache(item.Path, false, true). With onlyDirty set the walk skips clean folders. A folder moved on disk is not marked dirty, so the walk skips it and never reaches the children. Tree.Move walks in full (onlyDirty=false) for moves through the API.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions