From 03de9a90fb16e1d1c47f03b0298a0fff8139e749 Mon Sep 17 00:00:00 2001 From: sunjiapeng <782615313@qq.com> Date: Mon, 11 Mar 2024 14:54:34 +0800 Subject: [PATCH] fix(meta): create dentry concurrency cause orphan inodes Signed-off-by: sunjiapeng <782615313@qq.com> --- sdk/meta/api.go | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/sdk/meta/api.go b/sdk/meta/api.go index f9c9e033cb..60962fd6b5 100644 --- a/sdk/meta/api.go +++ b/sdk/meta/api.go @@ -324,10 +324,8 @@ create_dentry: } return nil, statusToErrno(status) } else if status != statusOK { - if status != statusExist { - mw.iunlink(mp, info.Inode, mw.Client.GetLatestVer(), 0, fullPath) - mw.ievict(mp, info.Inode, fullPath) - } + mw.iunlink(mp, info.Inode, mw.Client.GetLatestVer(), 0, fullPath) + mw.ievict(mp, info.Inode, fullPath) return nil, statusToErrno(status) } if mw.EnableSummary { @@ -1657,9 +1655,7 @@ func (mw *MetaWrapper) link(parentID uint64, name string, ino uint64, fullPath s if err != nil { return nil, statusToErrno(status) } else if status != statusOK { - if status != statusExist { - mw.iunlink(mp, ino, mw.Client.GetLatestVer(), 0, fullPath) - } + mw.iunlink(mp, ino, mw.Client.GetLatestVer(), 0, fullPath) return nil, statusToErrno(status) } return info, nil