All of lore.kernel.org
 help / color / mirror / Atom feed
From: Itaru Kitayama <kitayama@cl.bb4u.ne.jp>
To: linux-btrfs@vger.kernel.org
Cc: chris.mason@oracle.com
Subject: [PATCH] Log parent inode if it is newer than the last commit
Date: Sat, 6 Nov 2010 20:03:05 +0900	[thread overview]
Message-ID: <20101106200305.5d9eb7e0.kitayama@cl.bb4u.ne.jp> (raw)


In the file sync path, file's parent inode is logged if it is newer than the last
commit. This patch checks also the last_trans field as well as generation.

As btrfs_log_inode updates the logged_trans field of parent dir's inode, tree-log
lookup operations are suppressed upon unlink.

The patch is for the latest btrfs-unstable tree.

Signed-off-by: Itaru Kitayama <kitayama@cl.bb4u.ne.jp>

---
 fs/btrfs/tree-log.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

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)
-- 
1.7.2.3

             reply	other threads:[~2010-11-06 11:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-06 11:03 Itaru Kitayama [this message]
2010-11-06 14:19 ` [PATCH] Log parent inode if it is newer than the last commit Josef Bacik
2010-11-08 13:50 ` Chris Mason
2010-11-08 14:27   ` Itaru Kitayama
2010-11-08 20:26     ` Chris Mason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20101106200305.5d9eb7e0.kitayama@cl.bb4u.ne.jp \
    --to=kitayama@cl.bb4u.ne.jp \
    --cc=chris.mason@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.