From 7eca48e58223b6d8d362f78ef3964755307cfbbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8C=B4=E5=AD=90?= Date: Thu, 20 Feb 2025 14:56:29 +0800 Subject: [PATCH] =?UTF-8?q?#1355=20=F0=9F=90=9Bbug:=20fix=20cache=20time?= =?UTF-8?q?=20null=20(#1357)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 +- pkg/fs/client/meta/meta_kv.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6da82d833..da2c4c06c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -44,7 +44,7 @@ jobs: - name: Packaging run: tar -zcvf paddleflow-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz output/ - name: Uploading assets - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: paddleflow-${{ matrix.goos }}-${{ matrix.goarch }} path: paddleflow-${{ matrix.goos }}-${{ matrix.goarch }}.tar.gz diff --git a/pkg/fs/client/meta/meta_kv.go b/pkg/fs/client/meta/meta_kv.go index 7f83f5391..72f36bbbc 100644 --- a/pkg/fs/client/meta/meta_kv.go +++ b/pkg/fs/client/meta/meta_kv.go @@ -955,7 +955,6 @@ func (m *kvMeta) Symlink(ctx *Context, parent Ino, name string, path string, ino // todo:: file mode including type and unix permission, add smode to transe attr.Nlink = 1 attr.Size = uint64(len(path)) - insertInodeItem_.attr = *attr insertInodeItem_.parentIno = parent insertInodeItem_.fileHandles = 1 insertInodeItem_.name = []byte(name) @@ -993,6 +992,8 @@ func (m *kvMeta) Symlink(ctx *Context, parent Ino, name string, path string, ino attr.Mtimensec = uint32(now.Nanosecond()) attr.Ctime = now.Unix() attr.Ctimensec = uint32(now.Nanosecond()) + // 结构体中是没有指针,默认是深拷贝,等待 attr 赋值完成进行深拷贝 + insertInodeItem_.attr = *attr insertEntryItem_ := &entryItem{ ino: ino, mode: attr.Mode,