diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-29 22:14:49 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-30 00:11:50 -0600 |
commit | 755ac780df4f653879cb376d27cad7ff8e8d7b0f (patch) | |
tree | dbb9cc24a2ed4c800bf489101aad13e86fd703e4 /lib/btrfs/btrfstree/node_exp.go | |
parent | 9317e6ec41ebafe1a6950a2996dcd8c4e35650fd (diff) |
btrfstree: Maximum node level is 8
Diffstat (limited to 'lib/btrfs/btrfstree/node_exp.go')
-rw-r--r-- | lib/btrfs/btrfstree/node_exp.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/btrfs/btrfstree/node_exp.go b/lib/btrfs/btrfstree/node_exp.go index 5311ea0..dec6dbb 100644 --- a/lib/btrfs/btrfstree/node_exp.go +++ b/lib/btrfs/btrfstree/node_exp.go @@ -35,6 +35,10 @@ func (exp NodeExpectations) Check(node *Node) error { errs = append(errs, fmt.Errorf("expected level=%v but claims to be level=%v", exp.Level.Val, node.Head.Level)) } + if node.Head.Level > MaxLevel { + errs = append(errs, fmt.Errorf("maximum level=%v but claims to be level=%v", + MaxLevel, node.Head.Level)) + } if exp.Generation.OK && node.Head.Generation != exp.Generation.Val { errs = append(errs, fmt.Errorf("expected generation=%v but claims to be generation=%v", exp.Generation.Val, node.Head.Generation)) |