From patchwork Sat Nov 6 11:03:05 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Itaru Kitayama X-Patchwork-Id: 305482 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oA6B9oAR010530 for ; Sat, 6 Nov 2010 11:09:50 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754927Ab0KFLJq (ORCPT ); Sat, 6 Nov 2010 07:09:46 -0400 Received: from irs1ma.bb4u.ne.jp ([202.229.9.180]:52443 "HELO irs1m.bias.ne.jp" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with SMTP id S1754690Ab0KFLJq (ORCPT ); Sat, 6 Nov 2010 07:09:46 -0400 X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Sat, 06 Nov 2010 11:09:51 +0000 (UTC) X-Greylist: delayed 396 seconds by postgrey-1.27 at vger.kernel.org; Sat, 06 Nov 2010 07:09:45 EDT Received: (qmail 1909 invoked from network); 6 Nov 2010 11:03:05 -0000 Received: from unknown (HELO prime) (58.89.220.15) by 0 with SMTP; Sat, 06 Nov 2010 20:03:05 +0900 Date: Sat, 6 Nov 2010 20:03:05 +0900 From: Itaru Kitayama To: linux-btrfs@vger.kernel.org Cc: chris.mason@oracle.com Subject: [PATCH] Log parent inode if it is newer than the last commit Message-Id: <20101106200305.5d9eb7e0.kitayama@cl.bb4u.ne.jp> X-Mailer: Sylpheed 3.0.2 (GTK+ 2.20.1; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Sender: linux-btrfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-btrfs@vger.kernel.org diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index a29f193..db63ae4 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -3007,7 +3007,7 @@ int btrfs_log_inode_parent(struct btrfs_trans_handle *trans, if (root != BTRFS_I(inode)->root) break; - if (BTRFS_I(inode)->generation > + if (max(BTRFS_I(inode)->generation, BTRFS_I(inode)->last_trans) > root->fs_info->last_trans_committed) { ret = btrfs_log_inode(trans, root, inode, inode_only); if (ret)