From 3f6e16377f0932fe0eb5b0cc2903e690bf9c95f3 Mon Sep 17 00:00:00 2001 From: slederer Date: Mon, 25 Nov 2024 00:08:44 +0100 Subject: [PATCH] reclaim: Bugfix marking last slot on empty volume on reclaim --- progs/reclaim.pas | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/progs/reclaim.pas b/progs/reclaim.pas index 6c3584d..9983501 100644 --- a/progs/reclaim.pas +++ b/progs/reclaim.pas @@ -62,8 +62,13 @@ begin begin if lastUsed < endSlot then begin + (* if the volume is empty mark the first slot *) + if lastUsed = 0 then + slotNo := reservedCount + else + slotNo := lastUsed + 1; + writeln('Updating directory...'); - slotNo := lastUsed + 1; getdirslot(volid, slotNo, dirslot, error); if error <> IONoError then begin @@ -119,7 +124,7 @@ begin lastUsed := 0; openvolumeid(volid); - i := volumeTable[volid].startSlot; + i := 0; endSlot := volumeTable[volid].part.dirSize - 1; if verbose then