diff options
Diffstat (limited to 'cmd/btrfs-fsck/main.go')
-rw-r--r-- | cmd/btrfs-fsck/main.go | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/cmd/btrfs-fsck/main.go b/cmd/btrfs-fsck/main.go index e1a37ab..7823c8d 100644 --- a/cmd/btrfs-fsck/main.go +++ b/cmd/btrfs-fsck/main.go @@ -57,9 +57,14 @@ func Main(imgfilename string) (err error) { fmt.Printf("Pass 1: ... walking chunk tree\n") visitedChunkNodes := make(map[btrfs.LogicalAddr]struct{}) if err := fs.WalkTree(superblock.Data.ChunkTree, btrfs.WalkTreeHandler{ - MidNode: func(node *util.Ref[btrfs.LogicalAddr, btrfs.Node]) error { - visitedChunkNodes[node.Addr] = struct{}{} - return nil + Node: func(node *util.Ref[btrfs.LogicalAddr, btrfs.Node], err error) error { + if err != nil { + fmt.Printf("Pass 1: ... walk chunk tree: error: %v\n", err) + } + if node != nil { + visitedChunkNodes[node.Addr] = struct{}{} + } + return err }, }); err != nil { fmt.Printf("Pass 1: ... walk chunk tree: error: %v\n", err) |