From: Miao Xie Date: Thu, 1 Nov 2012 07:35:23 +0000 (+0000) Subject: Btrfs: fix missing log when BTRFS_INODE_NEEDS_FULL_SYNC is set X-Git-Tag: v3.8-rc7~6^2~97 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5269b67e3d809dcaa4c6763a343423bb1b7b3fe6;p=profile%2Fcommon%2Fkernel-common.git Btrfs: fix missing log when BTRFS_INODE_NEEDS_FULL_SYNC is set If we set BTRFS_INODE_NEEDS_FULL_SYNC, we should log all the extent, but now we forget to take it into account, and set a wrong max key, if so, we will skip the file extent metadata when doing logging. Fix it. Signed-off-by: Miao Xie Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index d1947af..40b9efd 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c @@ -3394,7 +3394,10 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans, /* today the code can only do partial logging of directories */ - if (inode_only == LOG_INODE_EXISTS || S_ISDIR(inode->i_mode)) + if (S_ISDIR(inode->i_mode) || + (!test_bit(BTRFS_INODE_NEEDS_FULL_SYNC, + &BTRFS_I(inode)->runtime_flags) && + inode_only == LOG_INODE_EXISTS)) max_key.type = BTRFS_XATTR_ITEM_KEY; else max_key.type = (u8)-1;