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:
Vitaliy Filippov
2020-10-24 01:08:33 +03:00
parent 99c45bb5ed
commit 5fbe36198a
6 changed files with 50 additions and 21 deletions
-1
View File
@@ -148,7 +148,6 @@ resume_5:
{
mark_rolled_back(*v);
}
journal.trim();
// Acknowledge op
op->retval = 0;
FINISH_OP(op);