From a73f22131719976d7b07fc0df4deca00460a034f Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Sat, 19 Apr 2025 13:05:51 -0500 Subject: [PATCH] scripts: Fixed issue where rbyd lookups rejected shrub tags This was caused by including the shrub bit in the tag comparison in Rbyd.lookup. Fixed by adding an extra key mask (0xfff). Note this is already how lfsr_rbyd_lookup works in lfs.c. --- scripts/dbgbmap.py | 6 ++++-- scripts/dbgbmapd3.py | 6 ++++-- scripts/dbgbtree.py | 6 ++++-- scripts/dbglfs.py | 6 ++++-- scripts/dbgmtree.py | 6 ++++-- scripts/dbgrbyd.py | 6 ++++-- 6 files changed, 24 insertions(+), 12 deletions(-) diff --git a/scripts/dbgbmap.py b/scripts/dbgbmap.py index 8a963405..a04b3256 100755 --- a/scripts/dbgbmap.py +++ b/scripts/dbgbmap.py @@ -897,7 +897,8 @@ class Rbyd: rid_, rattr_ = r if (rid_ is None or rid_ != rid - or (rattr_.tag & ~mask) != (tag & ~mask)): + or (rattr_.tag & ~mask & 0xfff) + != (tag & ~mask & 0xfff)): if path: return None, path_ else: @@ -965,7 +966,8 @@ class Rbyd: # found end of tree? if (rid_ is None or rid_ != rid - or (rattr_.tag & ~mask) != (tag & ~mask)): + or (rattr_.tag & ~mask & 0xfff) + != (tag & ~mask & 0xfff)): break if path: diff --git a/scripts/dbgbmapd3.py b/scripts/dbgbmapd3.py index 3223e0a5..d162388f 100755 --- a/scripts/dbgbmapd3.py +++ b/scripts/dbgbmapd3.py @@ -927,7 +927,8 @@ class Rbyd: rid_, rattr_ = r if (rid_ is None or rid_ != rid - or (rattr_.tag & ~mask) != (tag & ~mask)): + or (rattr_.tag & ~mask & 0xfff) + != (tag & ~mask & 0xfff)): if path: return None, path_ else: @@ -995,7 +996,8 @@ class Rbyd: # found end of tree? if (rid_ is None or rid_ != rid - or (rattr_.tag & ~mask) != (tag & ~mask)): + or (rattr_.tag & ~mask & 0xfff) + != (tag & ~mask & 0xfff)): break if path: diff --git a/scripts/dbgbtree.py b/scripts/dbgbtree.py index a0aa088f..f2b04a2a 100755 --- a/scripts/dbgbtree.py +++ b/scripts/dbgbtree.py @@ -805,7 +805,8 @@ class Rbyd: rid_, rattr_ = r if (rid_ is None or rid_ != rid - or (rattr_.tag & ~mask) != (tag & ~mask)): + or (rattr_.tag & ~mask & 0xfff) + != (tag & ~mask & 0xfff)): if path: return None, path_ else: @@ -873,7 +874,8 @@ class Rbyd: # found end of tree? if (rid_ is None or rid_ != rid - or (rattr_.tag & ~mask) != (tag & ~mask)): + or (rattr_.tag & ~mask & 0xfff) + != (tag & ~mask & 0xfff)): break if path: diff --git a/scripts/dbglfs.py b/scripts/dbglfs.py index 08589f5e..dc4a0635 100755 --- a/scripts/dbglfs.py +++ b/scripts/dbglfs.py @@ -854,7 +854,8 @@ class Rbyd: rid_, rattr_ = r if (rid_ is None or rid_ != rid - or (rattr_.tag & ~mask) != (tag & ~mask)): + or (rattr_.tag & ~mask & 0xfff) + != (tag & ~mask & 0xfff)): if path: return None, path_ else: @@ -922,7 +923,8 @@ class Rbyd: # found end of tree? if (rid_ is None or rid_ != rid - or (rattr_.tag & ~mask) != (tag & ~mask)): + or (rattr_.tag & ~mask & 0xfff) + != (tag & ~mask & 0xfff)): break if path: diff --git a/scripts/dbgmtree.py b/scripts/dbgmtree.py index b344d137..82b42185 100755 --- a/scripts/dbgmtree.py +++ b/scripts/dbgmtree.py @@ -820,7 +820,8 @@ class Rbyd: rid_, rattr_ = r if (rid_ is None or rid_ != rid - or (rattr_.tag & ~mask) != (tag & ~mask)): + or (rattr_.tag & ~mask & 0xfff) + != (tag & ~mask & 0xfff)): if path: return None, path_ else: @@ -888,7 +889,8 @@ class Rbyd: # found end of tree? if (rid_ is None or rid_ != rid - or (rattr_.tag & ~mask) != (tag & ~mask)): + or (rattr_.tag & ~mask & 0xfff) + != (tag & ~mask & 0xfff)): break if path: diff --git a/scripts/dbgrbyd.py b/scripts/dbgrbyd.py index 889f31e2..8eca91c6 100755 --- a/scripts/dbgrbyd.py +++ b/scripts/dbgrbyd.py @@ -788,7 +788,8 @@ class Rbyd: rid_, rattr_ = r if (rid_ is None or rid_ != rid - or (rattr_.tag & ~mask) != (tag & ~mask)): + or (rattr_.tag & ~mask & 0xfff) + != (tag & ~mask & 0xfff)): if path: return None, path_ else: @@ -856,7 +857,8 @@ class Rbyd: # found end of tree? if (rid_ is None or rid_ != rid - or (rattr_.tag & ~mask) != (tag & ~mask)): + or (rattr_.tag & ~mask & 0xfff) + != (tag & ~mask & 0xfff)): break if path: