From patchwork Mon Jul 27 20:22:09 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Dilger X-Patchwork-Id: 30279 Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id A882DB707B for ; Tue, 28 Jul 2009 06:22:45 +1000 (EST) Received: by ozlabs.org (Postfix) id 98304DDD0B; Tue, 28 Jul 2009 06:22:45 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 1A69EDDD01 for ; Tue, 28 Jul 2009 06:22:45 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752668AbZG0UWm (ORCPT ); Mon, 27 Jul 2009 16:22:42 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752991AbZG0UWm (ORCPT ); Mon, 27 Jul 2009 16:22:42 -0400 Received: from sca-es-mail-2.Sun.COM ([192.18.43.133]:63076 "EHLO sca-es-mail-2.sun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752668AbZG0UWl (ORCPT ); Mon, 27 Jul 2009 16:22:41 -0400 Received: from fe-sfbay-10.sun.com ([192.18.43.129]) by sca-es-mail-2.sun.com (8.13.7+Sun/8.12.9) with ESMTP id n6RKMeHG025862 for ; Mon, 27 Jul 2009 13:22:40 -0700 (PDT) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-disposition: inline Content-type: text/plain; CHARSET=US-ASCII Received: from conversion-daemon.fe-sfbay-10.sun.com by fe-sfbay-10.sun.com (Sun Java(tm) System Messaging Server 7u2-7.02 64bit (built Apr 16 2009)) id <0KNG00500IX8JV00@fe-sfbay-10.sun.com> for linux-ext4@vger.kernel.org; Mon, 27 Jul 2009 13:22:40 -0700 (PDT) Received: from webber.adilger.int ([unknown] [68.147.209.238]) by fe-sfbay-10.sun.com (Sun Java(tm) System Messaging Server 7u2-7.02 64bit (built Apr 16 2009)) with ESMTPSA id <0KNG002U3J9MM430@fe-sfbay-10.sun.com>; Mon, 27 Jul 2009 13:22:35 -0700 (PDT) Date: Mon, 27 Jul 2009 14:22:09 -0600 From: Andreas Dilger Subject: [PATCH] JBD2: round commit timer up to avoid uncommitted transaction To: linux-ext4@vger.kernel.org, "Theodore Ts'o" Cc: Alex Zhuravlev Message-id: <20090727202209.GU4231@webber.adilger.int> X-GPG-Key: 1024D/0D35BED6 X-GPG-Fingerprint: 7A37 5D79 BF1B CECA D44F 8A29 A488 39F5 0D35 BED6 User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org jbd and jbd2 fixes: 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: Alex Zhuravlev (Tomas) Signed-off-by: Andreas Dilger Cheers, Andreas Acked-by: Jan Kara --- Andreas Dilger Sr. Staff Engineer, Lustre Group Sun Microsystems of Canada, Inc. -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux-2.6.27.21-0.1/fs/jbd2/transaction.c =================================================================== --- linux-2.6.27.21-0.1.orig/fs/jbd2/transaction.c 2009-06-10 11:11:41.000000000 -0600 +++ linux-2.6.27.21-0.1/fs/jbd2/transaction.c 2009-06-10 11:12:32.000000000 -0600 @@ -54,7 +54,7 @@ INIT_LIST_HEAD(&transaction->t_inode_list); /* 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);