diff options
author | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-20 13:36:37 -0400 |
---|---|---|
committer | Luke Shumaker <lukeshu@lukeshu.com> | 2023-03-21 12:05:30 -0400 |
commit | d3dbadaa2eb3f14f2ad918a3ccd44a1ac224c853 (patch) | |
tree | f38f478982c4b9c0d00f198117dd244e24b12f81 /lib/btrfs/btrfstree | |
parent | 62a9588ff563f569469d5cf7b3b594bf109af085 (diff) |
btrfstree: Observe io/fs.SkipDir for PreKeyPointer
Diffstat (limited to 'lib/btrfs/btrfstree')
-rw-r--r-- | lib/btrfs/btrfstree/btree.go | 2 | ||||
-rw-r--r-- | lib/btrfs/btrfstree/btree_tree.go | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/btrfs/btrfstree/btree.go b/lib/btrfs/btrfstree/btree.go index 9713295..0e02a06 100644 --- a/lib/btrfs/btrfstree/btree.go +++ b/lib/btrfs/btrfstree/btree.go @@ -34,7 +34,7 @@ type TreeWalkHandler struct { BadNode func(Path, *Node, error) error PostNode func(Path, *Node) error // Callbacks for items on interior nodes - PreKeyPointer func(Path, KeyPointer) error + PreKeyPointer func(Path, KeyPointer) error // io/fs.SkipDir causes the KP to not be traversed PostKeyPointer func(Path, KeyPointer) error // Callbacks for items on leaf nodes Item func(Path, Item) error diff --git a/lib/btrfs/btrfstree/btree_tree.go b/lib/btrfs/btrfstree/btree_tree.go index e16e1c8..6ef195b 100644 --- a/lib/btrfs/btrfstree/btree_tree.go +++ b/lib/btrfs/btrfstree/btree_tree.go @@ -96,6 +96,9 @@ func (tree *RawTree) walk(ctx context.Context, path Path, errHandle func(*TreeEr }) if cbs.PreKeyPointer != nil { if err := cbs.PreKeyPointer(itemPath, item); err != nil { + if errors.Is(err, iofs.SkipDir) { + continue + } errHandle(&TreeError{Path: itemPath, Err: err}) } if ctx.Err() != nil { |