diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-04-02 21:11:23 -0600 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-04-02 22:40:13 -0600 |
commit | 2bdf2ac12d3fc2770cd101cc30c221255a7fdff6 (patch) | |
tree | f39eb32871a91288697475e6bb7bc8f249507f60 /lib/btrfsutil | |
parent | 489eeb7da06700fdfadba337cb4ad6aa33b6f99b (diff) |
btrfsutil: noopRebuiltForrestCallbacks: Add a missing failure-check
Diffstat (limited to 'lib/btrfsutil')
-rw-r--r-- | lib/btrfsutil/rebuilt_forrest.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/btrfsutil/rebuilt_forrest.go b/lib/btrfsutil/rebuilt_forrest.go index 60f3010..fcfb353 100644 --- a/lib/btrfsutil/rebuilt_forrest.go +++ b/lib/btrfsutil/rebuilt_forrest.go @@ -47,6 +47,9 @@ func (cb noopRebuiltForrestCallbacks) LookupRoot(ctx context.Context, tree btrfs key.Offset = 0 return tgt.Compare(key) }) + if !ok { + return 0, btrfsitem.Root{}, false + } itemBody := cb.forrest.readItem(ctx, itemPtr) defer itemBody.Free() switch itemBody := itemBody.(type) { |