diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-01-03 21:40:38 -0700 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-01-05 19:48:18 -0700 |
commit | 3a7a736d1a6dd574a03e31ca7bcde2ea60767fd6 (patch) | |
tree | 080b59eac18dc50e3dec13b2a06a90f788da5727 /lib | |
parent | 2aa2b9de6c9f967437dacd8f105e5a66c9bdc667 (diff) |
rebuildnodes: Don't store negative results that are unlikely to come up again
Diffstat (limited to 'lib')
-rw-r--r-- | lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go b/lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go index 87d9f35..9a4bfab 100644 --- a/lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go +++ b/lib/btrfsprogs/btrfsinspect/rebuildnodes/rebuild.go @@ -515,6 +515,10 @@ func (treeQueue *treeAugmentQueue) has(wantKey string) bool { } func (treeQueue *treeAugmentQueue) store(wantKey string, choices containers.Set[btrfsvol.LogicalAddr]) { + if len(choices) == 0 && (strings.Contains(wantKey, " name=") || strings.Contains(wantKey, "-")) { + // This wantKey is unlikely to come up again, so it's not worth storing a negative result. + return + } wantKey = shortenWantKey(wantKey) beg := treeQueue.keyBuf.Len() if treeQueue.keyBuf.Cap()-beg < len(wantKey) { |