fix: prevent panic in unaligned 64-bit atomic (#2637)

* fix(net): prevent panic in unaligned 64-bit atomic on ARMv7

Convert int64 fields written and readingID to atomic.Int64
guarantees 8-byte alignment on 32-bit ARM architectures.

Unaligned 64-bit atomics fault with SIGILL on armv5/armv6
and armv7. Fixes file copy operations.

* fix(atomic): migrate more atomic useage

* fix(alias): improve link handling and add Clone method for Link struct

* fix warn

* fix(mem): simplify memory reservation handling in MemoryGrowCheck

* fix(link): simplify link handling by using Clone method

* fix bug

* fix(hash): typo

Signed-off-by: Yinan Qin <a.elysia@proton.me>

---------

Signed-off-by: Yinan Qin <a.elysia@proton.me>
Co-authored-by: Elysia <a.elysia@proton.me>
Co-authored-by: j2rong4cn <j2rong@qq.com>
This commit is contained in:
yunxuan
2026-06-22 14:37:44 +08:00
committed by GitHub
parent 3abdf7990b
commit d403f75da2
27 changed files with 169 additions and 143 deletions
+3 -3
View File
@@ -111,13 +111,13 @@ func GetPathHierarchy(path string) []string {
hierarchy := []string{"/"}
parts := strings.SplitSeq(path, "/")
var currentPath strings.Builder
for part := range parts {
for part := range strings.SplitSeq(path, "/") {
if part == "" {
continue
}
currentPath.WriteString("/" + part)
currentPath.WriteString("/")
currentPath.WriteString(part)
hierarchy = append(hierarchy, currentPath.String())
}