Skip to content

Commit

Permalink
Merge pull request #4936 from butonic/no-delete-lock
Browse files Browse the repository at this point in the history
do not delete mlock files after update
  • Loading branch information
micbar authored Nov 19, 2024
2 parents d341028 + 9b523db commit a57d65d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
6 changes: 6 additions & 0 deletions changelog/unreleased/no-delete-lock.md
Original file line number Diff line number Diff line change
@@ -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
7 changes: 2 additions & 5 deletions pkg/storage/utils/decomposedfs/upload/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a57d65d

Please sign in to comment.