Skip to content

fix: Use hash if filename too long during assimilate - #352

Merged
aduffeck merged 1 commit into
opencloud-eu:mainfrom
cheneyveron:fix-assimilate-file-path-too-long
Sep 23, 2025
Merged

aduffeck merged 1 commit into
opencloud-eu:mainfrom
cheneyveron:fix-assimilate-file-path-too-long

Conversation

@cheneyveron

Copy link
Copy Markdown

During start OC will scan existing data however if a file's full path is too long the lock file cannot be created.

However we need to ensure that, for the same file the shortened filename is always the same, meanwhile reduce possible conflicts between files.

The solution is: For extra-long full paths, we can use first 240 byte of file full path's sha256.

@butonic

butonic commented Sep 22, 2025 •

Copy link
Copy Markdown
Member

Nice work! I would prefer to either:

  1. use the file id as the filename for the mlock file, or
  2. use nats to lock files

@aduffeck @rhafer opinions?

There have been reports in matrix about this: https://matrix.to/#/!MXIMfhTMMRFPuXSKJZ:matrix.org/$aIs4ORkOnX1RAh3IbVEj24U3ZC1lm7tco24R2omYsXw?via=chat.opencloud.eu&via=matrix.org&via=tchncs.de

@aduffeck

Copy link
Copy Markdown
Member

I agree that using nats for locking would be nice, but that's something for a future change. And when assimilating new files there is no file id to use for locking the metadata yet (like we normally do), so we have to use the path in some form.

lgtm 👍 thanks for your contribution!

@aduffeck
aduffeck merged commit 10791a6 into opencloud-eu:main Sep 23, 2025
@github-project-automation github-project-automation Bot moved this from In Progress to Done in OpenCloud Team Board Sep 23, 2025
@openclouders openclouders mentioned this pull request Sep 23, 2025
1 task
MahdiBaghbani pushed a commit to MahdiBaghbani/reva-opencloud that referenced this pull request Oct 17, 2025
…ud-eu#352)

Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.39.0 to 0.41.0.
- [Commits](golang/crypto@v0.39.0...v0.41.0)

---
updated-dependencies:
- dependency-name: golang.org/x/crypto
  dependency-version: 0.41.0
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants