summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cmd/btrfs-rec/inspect_lsfiles.go8
-rw-r--r--lib/btrfsprogs/btrfsutil/broken_btree.go1
2 files changed, 5 insertions, 4 deletions
diff --git a/cmd/btrfs-rec/inspect_lsfiles.go b/cmd/btrfs-rec/inspect_lsfiles.go
index 395f60a..7ecaaf0 100644
--- a/cmd/btrfs-rec/inspect_lsfiles.go
+++ b/cmd/btrfs-rec/inspect_lsfiles.go
@@ -40,9 +40,9 @@ func init() {
}
}()
defer func() {
- if r := derror.PanicToError(recover()); r != nil {
- textui.Fprintf(out, "\n\n%+v\n", r)
- err = fmt.Errorf("panicked")
+ if _err := derror.PanicToError(recover()); _err != nil {
+ textui.Fprintf(out, "\n\n%+v\n", _err)
+ err = _err
}
}()
ctx := cmd.Context()
@@ -215,7 +215,7 @@ func printDirEntry(out io.Writer, prefix string, isLast bool, subvol *btrfs.Subv
}
printPipe(out, prefix, isLast, name, file)
default:
- panic(fmt.Errorf("TODO: I don't know how to handle an fileType=%v: %q",
+ panic(fmt.Errorf("TODO: I don't know how to handle a fileType=%v: %q",
entry.Type, name))
}
}
diff --git a/lib/btrfsprogs/btrfsutil/broken_btree.go b/lib/btrfsprogs/btrfsutil/broken_btree.go
index 15641ab..b7663fa 100644
--- a/lib/btrfsprogs/btrfsutil/broken_btree.go
+++ b/lib/btrfsprogs/btrfsutil/broken_btree.go
@@ -281,6 +281,7 @@ func (bt *brokenTrees) TreeSearchAll(treeID btrfsprim.ObjID, fn func(btrfsprim.K
}
}
ret[i] = node.Data.BodyLeaf[itemPath.Node(-1).FromItemIdx]
+ ret[i].Body = ret[i].Body.CloneItem()
}
btrfstree.FreeNodeRef(node)