fix: ensure forward progress in __file_lookup when nr_blk = 0

Draft
ER
4mo ago
+11-1

At __file_lookup, it sets its starting index to look for files using hashes. Unfortunately, in some cases, that points to an uninitialised dir entry, which sets nr_blk to 0, and adds nothing at

_fi += dblock->files[_fi].nr_blk;

which causes a soft lockup in some cases.
This commit fixes that by adding 1 to _fi index when nr_blk is 0, to ensure that the index moves by 1 when nr_blk is 0, which would mean it is an invalid dir entry.


Summary by cubic

Prevent infinite loop in __file_lookup by advancing the file index when nr_blk == 0. Skip the empty entry by 1 to ensure forward progress; otherwise add nr_blk, with clearer inline comments and small style cleanup.