Skip to content

Commit 0e06322

Browse files
committed
Fix scan issue
1 parent 03e76b2 commit 0e06322

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

ext4/htree.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -455,11 +455,15 @@ def lookup(self, name: str | bytes) -> int | None:
455455
while current_idx < len(leaf_entries):
456456
entry = leaf_entries[current_idx]
457457
blocks_to_scan.append(entry.block) # pyright: ignore[reportAny]
458-
if not (entry.hash & 1): # pyright: ignore[reportAny] # collision bit clear
458+
next_idx = current_idx + 1
459+
if (
460+
next_idx >= len(leaf_entries)
461+
or not (leaf_entries[next_idx].hash & 1) # pyright: ignore[reportAny]
462+
or (leaf_entries[next_idx].hash & ~1) != (hash_val & ~1) # pyright: ignore[reportAny]
463+
):
459464
break
460465

461-
current_idx += 1
462-
466+
current_idx = next_idx
463467
else:
464468
blocks_to_scan = [block_num]
465469

ext4/volume.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class Inodes:
3434
"_group_cache",
3535
"_offset_cache",
3636
"volume",
37+
"__dict__",
3738
)
3839

3940
def __init__(self, volume: Volume) -> None:

0 commit comments

Comments
 (0)