JBD: round commit timer up to avoid uncommitted transaction
authorAndreas Dilger <adilger@sun.com>
Thu, 30 Jul 2009 18:09:46 +0000 (20:09 +0200)
committerJan Kara <jack@suse.cz>
Wed, 16 Sep 2009 15:44:10 +0000 (17:44 +0200)
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>
fs/jbd/transaction.c

index c03ac11f74be1313b8f7d09a24eba88f1d27ceed..833c1675a00c5021853f3790b10e8815c89bd2a1 100644 (file)
@@ -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);