Skip to content

Commit

Permalink
JBD: round commit timer up to avoid uncommitted transaction
Browse files Browse the repository at this point in the history
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
explicit sync/umount happens.

Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: Jan Kara <jack@suse.cz>
  • Loading branch information
Andreas Dilger authored and Jan Kara committed Sep 16, 2009
1 parent ab86e57 commit b449fc6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/jbd/transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ get_transaction(journal_t *journal, transaction_t *transaction)
spin_lock_init(&transaction->t_handle_lock);

/* 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);

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

0 comments on commit b449fc6

Please sign in to comment.