summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@lukeshu.com>2023-03-14 19:44:55 -0600
committerLuke Shumaker <lukeshu@lukeshu.com>2023-03-14 19:44:55 -0600
commit34bf167ef33c57b4d6767273f1d265971a4693b9 (patch)
treefaf2cbf955a2b086eec3fef9072a3e47e7dc067a
parent5adefc3b3eef3d15bc57139ccdba7db68cec4c9f (diff)
parent5dcdb9928d6a746dd69f620d96531ae2fcbd2fe1 (diff)
Merge branch 'lukeshu/fix-lsfiles'
-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)