Skip to content

Commit 640df63

Browse files
move deadlock comment
1 parent 94af6e6 commit 640df63

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pkg/meta/sql.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5094,14 +5094,13 @@ func (m *dbMeta) doBatchClone(ctx Context, srcParent Ino, dstParent Ino, entries
50945094
dstNode node // Destination node (modified copy)
50955095
}
50965096

5097-
cloneInfos := make([]*cloneInfo, len(entries))
5098-
50995097
// Phase 2: Allocate destination inodes BEFORE the transaction
5100-
// (nextInode can call incrCounter which needs txn - would deadlock if inside txn)
5098+
cloneInfos := make([]*cloneInfo, len(entries))
51015099
srcInodes := make([]Ino, 0, len(entries))
51025100
srcInodeSet := make(map[Ino]struct{})
51035101

51045102
for i, entry := range entries {
5103+
// (nextInode can call incrCounter which needs txn - would deadlock if inside txn)
51055104
dstIno, err := m.nextInode()
51065105
if err != nil {
51075106
return errno(err)

0 commit comments

Comments
 (0)