diff --git a/changelog/unreleased/fix-flock-warning.md b/changelog/unreleased/fix-flock-warning.md new file mode 100644 index 0000000000..2e3635ab85 --- /dev/null +++ b/changelog/unreleased/fix-flock-warning.md @@ -0,0 +1,5 @@ +Bugfix: Avoid warning about missing .flock files + +These flock files appear randomly because of file locking. We can savely ignore them. + +https://github.com/cs3org/reva/pull/2645 diff --git a/pkg/storage/utils/decomposedfs/spaces.go b/pkg/storage/utils/decomposedfs/spaces.go index 2421db8afe..aa33f1d360 100644 --- a/pkg/storage/utils/decomposedfs/spaces.go +++ b/pkg/storage/utils/decomposedfs/spaces.go @@ -333,6 +333,10 @@ func (fs *Decomposedfs) ListStorageSpaces(ctx context.Context, filter []*provide for i := range matches { var err error + // do not investigate flock files any further. They indicate file locks but are not relevant here. + if strings.HasSuffix(matches[i], ".flock") { + continue + } // always read link in case storage space id != node id spaceID, nodeID, err = readSpaceAndNodeFromSpaceTypeLink(matches[i]) if err != nil {