diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-22 17:25:54 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-23 18:36:55 -0600 |
commit | 418553acc64567ebc95122e28b07657526c92923 (patch) | |
tree | 9cb910940a1e16982f5c5012a4fbeb37ba172f82 /lib/btrfsutil/old_rebuilt_forrest.go | |
parent | d11a5357df7d155a7a3e92a67971d3d52ff6ad86 (diff) |
btrfs: Consider the generation when checking if a node owner is OK
Diffstat (limited to 'lib/btrfsutil/old_rebuilt_forrest.go')
-rw-r--r-- | lib/btrfsutil/old_rebuilt_forrest.go | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/btrfsutil/old_rebuilt_forrest.go b/lib/btrfsutil/old_rebuilt_forrest.go index a3fc0e2..5b99892 100644 --- a/lib/btrfsutil/old_rebuilt_forrest.go +++ b/lib/btrfsutil/old_rebuilt_forrest.go @@ -240,10 +240,11 @@ func (bt *OldRebuiltForrest) readNode(nodeInfo nodeInfo) *btrfstree.Node { LAddr: containers.OptionalValue(nodeInfo.LAddr), Level: containers.OptionalValue(nodeInfo.Level), Generation: containers.OptionalValue(nodeInfo.Generation), - Owner: func(treeID btrfsprim.ObjID, _ btrfsprim.Generation) error { - if treeID != nodeInfo.Owner { - return fmt.Errorf("expected owner=%v but claims to have owner=%v", - nodeInfo.Owner, treeID) + Owner: func(treeID btrfsprim.ObjID, gen btrfsprim.Generation) error { + if treeID != nodeInfo.Owner || gen != nodeInfo.Generation { + return fmt.Errorf("expected owner=%v generation=%v but claims to have owner=%v generation=%v", + nodeInfo.Owner, nodeInfo.Generation, + treeID, gen) } return nil }, |