From f3c744756859705b3f30d7b862cf45250adbf235 Mon Sep 17 00:00:00 2001 From: luoyuedong Date: Wed, 6 Mar 2024 14:44:21 +0800 Subject: [PATCH] =?UTF-8?q?fuse=20=E9=81=8D=E5=8E=86=E7=9B=AE=E5=BD=95?= =?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99inode=E8=8A=82=E7=82=B9=E5=8F=AF?= =?UTF-8?q?=E8=83=BD=E8=A2=AB=E5=88=A0=E9=99=A4=E5=AF=BC=E8=87=B4panic?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D=20(#1329)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fuse 遍历目录的时候inode节点可能被删除导致panic问题修复 * fuse 遍历目录的时候inode节点可能被删除导致panic问题修复 --- pkg/fs/client/meta/meta_kv.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/fs/client/meta/meta_kv.go b/pkg/fs/client/meta/meta_kv.go index d88b8cbc8..90f9c0707 100644 --- a/pkg/fs/client/meta/meta_kv.go +++ b/pkg/fs/client/meta/meta_kv.go @@ -1471,6 +1471,10 @@ func (m *kvMeta) Readdir(ctx *Context, inode Ino, entries *[]*Entry) syscall.Err } err := m.txn(func(tx kv.KvTxn) error { buf := tx.Get(m.inodeKey(inode)) + if buf == nil { + log.Errorf("get attr dir inode %v empty", inode) + return syscall.ENOENT + } m.parseInode(buf, dirInodeItem) parentIno = dirInodeItem.parentIno entry := tx.Get(m.entryKey(parentIno, string(dirInodeItem.name)))