Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b1f485f2 authored by Andreas Dilger's avatar Andreas Dilger Committed by Theodore Ts'o
Browse files

jbd2: round commit timer up to avoid uncommitted transaction



fix jiffie rounding in jbd commit timer setup code.  Rounding down
could cause the timer to be fired before the corresponding transaction
has expired.  That transaction can stay not committed forever if no
new transaction is created or expicit sync/umount happens.

Signed-off-by: default avatarAlex Zhuravlev (Tomas) <alex.zhuravlev@sun.com>
Signed-off-by: default avatarAndreas Dilger <adilger@sun.com>
Signed-off-by: default avatar"Theodore Ts'o" <tytso@mit.edu>
parent c333e073
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -57,7 +57,7 @@ jbd2_get_transaction(journal_t *journal, transaction_t *transaction)
	INIT_LIST_HEAD(&transaction->t_private_list);
	INIT_LIST_HEAD(&transaction->t_private_list);


	/* Set up the commit timer for the new transaction. */
	/* Set up the commit timer for the new transaction. */
	journal->j_commit_timer.expires = round_jiffies(transaction->t_expires);
	journal->j_commit_timer.expires = round_jiffies_up(transaction->t_expires);
	add_timer(&journal->j_commit_timer);
	add_timer(&journal->j_commit_timer);


	J_ASSERT(journal->j_running_transaction == NULL);
	J_ASSERT(journal->j_running_transaction == NULL);