Skip to content

posix: with enable_fs_revisions every upload fails at finalize #840

Open

Description

@Mortimer-RR

Description

pkg/storage/fs/posix/blobstore/blobstore.go, Upload, renames the upload source into
place on the default (same-device) path (os.Rename(source, tempName)). Later, when
copyTarget != "", it calls os.Open(source) to write the "current" copy. The source no
longer exists, so Upload returns an error after the blob was already stored.
Tree.WriteBlob passes a non-empty copyTarget exactly when EnableFSRevisions
(STORAGE_USERS_POSIX_ENABLE_FS_REVISIONS) is set, so finalizing every upload fails and the
file stays in processing.

Separately, Blobstore.canUseRenameForUpload is a plain bool written by concurrent
uploads when a rename fails with EXDEV: a data race.

Steps to reproduce

  1. Set STORAGE_USERS_POSIX_ENABLE_FS_REVISIONS=true (posix driver).
  2. Upload a file.

Or call Blobstore.Upload(n, source, copyTarget) with a copy target on the rename path;
see the test in the linked PR.

Expected behavior

The upload finalizes; the file and its "current" copy match the uploaded content.

Actual behavior

could not open source file '<upload>' for reading; WriteBlob fails and the upload is
not finalized. go test -race with concurrent cross-device uploads reports a race on
canUseRenameForUpload (written at blobstore.go:77, read at :70).

Setup

reva 11d87fb6b985, posix driver. The option is off by default.

Activity

  1. NickWalters commented on Oct 14, 2026

    @NickWalters

    The first part of this is fixed by #807, merged on 2026-10-13. It is the same bug as opencloud-eu/opencloud#3462, which is closed now. Upload keeps a handle on the stored blob and writes the copy target from it, so uploads with enable_fs_revisions finalize again.

    The data race is still there. On main, canUseRenameForUpload is a plain bool (blobstore.go:49), read at line 70 and written at line 77. #841 also changes the copy-target code, so it overlaps with #807.

  2. Mortimer-RR commented on Oct 14, 2026

    @Mortimer-RR
    Author

    Thank you! #841 (comment) I've updated #841 to remove the changes to the copy-target code.

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