From 9b523db0b23dc42b47f71e82526e41543b1c4822 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Thu, 14 Nov 2024 16:29:28 +0100 Subject: [PATCH] do not delete mlock files after update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- changelog/unreleased/no-delete-lock.md | 6 ++++++ pkg/storage/utils/decomposedfs/upload/store.go | 7 ++----- 2 files changed, 8 insertions(+), 5 deletions(-) create mode 100644 changelog/unreleased/no-delete-lock.md 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)