Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Shushlin <vshushlin@gitlab.com>2021-09-10 13:14:54 +0300
committerVladimir Shushlin <vshushlin@gitlab.com>2021-09-10 13:14:54 +0300
commit32f5682975cabde8923456e7948e17d0992c8fb7 (patch)
tree23978622b7810f5708d07291079d9078b8c46b58
parentb3b02904e20e574634bb8b464ddf2173deea6113 (diff)
parent3db4ac6aa075a157851006d4e23f1d7088a982f6 (diff)
Merge branch 'armhf-fix' into 'master'
fix: unaligned 64-bit atomic operation Closes #624 See merge request gitlab-org/gitlab-pages!571
-rw-r--r--internal/vfs/zip/archive.go2
-rw-r--r--internal/vfs/zip/vfs.go5
2 files changed, 5 insertions, 2 deletions
diff --git a/internal/vfs/zip/archive.go b/internal/vfs/zip/archive.go
index 087ddda8..3d6a9ff1 100644
--- a/internal/vfs/zip/archive.go
+++ b/internal/vfs/zip/archive.go
@@ -69,7 +69,7 @@ func newArchive(fs *zipVFS, openTimeout time.Duration) *zipArchive {
files: make(map[string]*zip.File),
directories: make(map[string]*zip.FileHeader),
openTimeout: openTimeout,
- cacheNamespace: strconv.FormatInt(atomic.AddInt64(&fs.archiveCount, 1), 10) + ":",
+ cacheNamespace: strconv.FormatInt(atomic.AddInt64(fs.archiveCount, 1), 10) + ":",
}
}
diff --git a/internal/vfs/zip/vfs.go b/internal/vfs/zip/vfs.go
index 3dade30f..1617c033 100644
--- a/internal/vfs/zip/vfs.go
+++ b/internal/vfs/zip/vfs.go
@@ -48,7 +48,9 @@ type zipVFS struct {
dataOffsetCache *lruCache
readlinkCache *lruCache
- archiveCount int64
+ // the `int64` needs to be 64bit aligned on some 32bit systems
+ // https://gitlab.com/gitlab-org/gitlab/-/issues/337261
+ archiveCount *int64
httpClient *http.Client
}
@@ -72,6 +74,7 @@ func New(cfg *config.ZipServing) vfs.VFS {
httptransport.DefaultTTFBTimeout,
),
},
+ archiveCount: new(int64),
}
zipVFS.resetCache()