Skip to content

Commit

Permalink
fix: rm uploaded object files if committing meta failed with err code… (
Browse files Browse the repository at this point in the history
  • Loading branch information
daimashusheng authored Sep 25, 2024
1 parent a407c01 commit bd3553f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/vfs/writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,11 @@ func (c *chunkWriter) commitThread() {

f.Lock()
if err != 0 {
if err != syscall.ENOENT && err != syscall.ENOSPC && err != syscall.EDQUOT {
if err == syscall.ENOENT {
go func(id uint64, length int) {
_ = f.w.store.Remove(id, length)
}(s.id, int(s.length))
} else if err != syscall.ENOSPC && err != syscall.EDQUOT {
logger.Warnf("write inode:%d error: %s", f.inode, err)
err = syscall.EIO
}
Expand Down

0 comments on commit bd3553f

Please sign in to comment.