Skip to content

Commit

Permalink
fix(meta): create dentry concurrency cause orphan inodes
Browse files Browse the repository at this point in the history
Signed-off-by: sunjiapeng <[email protected]>
  • Loading branch information
sjp00556 authored and sejust committed Jun 19, 2024
1 parent cef58ab commit 14b7156
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions sdk/meta/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,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 {
Expand Down Expand Up @@ -1645,9 +1643,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
Expand Down

0 comments on commit 14b7156

Please sign in to comment.