diff --git a/changelog/unreleased/no-delete-lock.md b/changelog/unreleased/no-delete-lock.md new file mode 100644 index 0000000000..89fc607560 --- /dev/null +++ b/changelog/unreleased/no-delete-lock.md @@ -0,0 +1,6 @@ +Bugfix: Do not delete mlock files + +To prevent stale NFS file handles we no longer delete empty mlock files after updating the metadata. + +https://github.com/cs3org/reva/pull/4936 +https://github.com/cs3org/reva/pull/4924 \ No newline at end of file diff --git a/pkg/storage/utils/decomposedfs/upload/store.go b/pkg/storage/utils/decomposedfs/upload/store.go index 1264512205..d170fc5d87 100644 --- a/pkg/storage/utils/decomposedfs/upload/store.go +++ b/pkg/storage/utils/decomposedfs/upload/store.go @@ -312,11 +312,8 @@ func (store OcisStore) updateExistingNode(ctx context.Context, session *OcisSess } unlock := func() error { - err := f.Close() - if err != nil { - return err - } - return os.Remove(store.lu.MetadataBackend().LockfilePath(targetPath)) + // NOTE: to prevent stale NFS file handles do not remove lock file! + return f.Close() } old, _ := node.ReadNode(ctx, store.lu, spaceID, n.ID, false, nil, false)