scripts: dbglfs.py: Fixed a couple mid=-1 issues

- Fixed Mtree.lookupleaf accepting mbid=0, which caused dbglfs.py to
  double print all files with mbid=-1

- Fixed grm mids not being mapped to mbid=-1 and related orphan false
  positives
This commit is contained in:
Christopher Haster
2025-04-19 11:56:21 -05:00
parent 2909da9c13
commit 6d97398efc
4 changed files with 19 additions and 7 deletions
+6 -2
View File
@@ -1825,7 +1825,7 @@ class Mtree:
# no mtree? must be inlined in mroot
if self.mtree is None:
if mid.mbid >= (1 << self.mbits):
if mid.mbid != -1:
if path:
return None, path_
else:
@@ -2791,7 +2791,11 @@ class Gstate:
if count <= 2:
for _ in range(count):
mid, d_ = fromleb128(self.data, d); d += d_
rms.append(mtree.mid(mid))
mid = mtree.mid(mid)
# map mbids -> -1 if mroot-inlined
if mtree.mtree is None:
mid = mtree.mid(-1, mid.mrid)
rms.append(mid)
self.count = count
self.rms = rms