summaryrefslogtreecommitdiffstats
path: root/fs/jbd
diff options
context:
space:
mode:
authorAndreas Dilger <adilger@sun.com>2009-07-30 20:09:46 +0200
committerJan Kara <jack@suse.cz>2009-09-16 17:44:10 +0200
commitb449fc6fcc07a392c69f3c1db9a4ad4dda8cbcba (patch)
treecc748936233e62cb8ae3325505e84805fb08b5ad /fs/jbd
parentab86e5765d41a5eb4239a1c04d613db87bea5ed8 (diff)
downloadlinux-b449fc6fcc07a392c69f3c1db9a4ad4dda8cbcba.tar.bz2
JBD: 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 explicit sync/umount happens. Signed-off-by: Andreas Dilger <adilger@sun.com> Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/jbd')
-rw-r--r--fs/jbd/transaction.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c
index c03ac11f74be..833c1675a00c 100644
--- a/fs/jbd/transaction.c
+++ b/fs/jbd/transaction.c
@@ -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);