Fix journal trimming
1) Update journal's used_start in memory only after updating journal superblock. Doing the opposite is incorrect because part of the journal will be lost if writers overwrite its old beginning. 2) Sync journal device after updating the superblock. 3) Do not trim in rollback and init because trimming there would also require updating the superblock. And the only reason to trim in both those places was to unblock writers. And a guaranteed unblocking method will follow in the next commit :)
This commit is contained in:
@@ -399,8 +399,6 @@ resume_1:
|
||||
}
|
||||
}
|
||||
}
|
||||
// Trim journal on start so we don't stall when all entries are older
|
||||
bs->journal.trim();
|
||||
bs->journal.dirty_start = bs->journal.next_free;
|
||||
printf(
|
||||
"Journal entries loaded: %lu, free journal space: %lu bytes (%08lx..%08lx is used), free blocks: %lu / %lu\n",
|
||||
|
||||
Reference in New Issue
Block a user