diff options
author | Miao Xie <miaox@cn.fujitsu.com> | 2012-11-01 03:35:23 -0400 |
---|---|---|
committer | Josef Bacik <jbacik@fusionio.com> | 2012-12-12 17:15:22 -0500 |
commit | 5269b67e3d809dcaa4c6763a343423bb1b7b3fe6 (patch) | |
tree | c4bb6f76990b954c3aad8ab140155a0365e6ff38 /fs/btrfs/tree-log.c | |
parent | bbe1426764e5dfaa57e7b12cc954acdb3fb7f94b (diff) |
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 <miaox@cn.fujitsu.com>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r-- | fs/btrfs/tree-log.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index d1947af67bcd..40b9efd20e43 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, | |||
3394 | 3394 | ||
3395 | 3395 | ||
3396 | /* today the code can only do partial logging of directories */ | 3396 | /* today the code can only do partial logging of directories */ |
3397 | if (inode_only == LOG_INODE_EXISTS || S_ISDIR(inode->i_mode)) | 3397 | if (S_ISDIR(inode->i_mode) || |
3398 | (!test_bit(BTRFS_INODE_NEEDS_FULL_SYNC, | ||
3399 | &BTRFS_I(inode)->runtime_flags) && | ||
3400 | inode_only == LOG_INODE_EXISTS)) | ||
3398 | max_key.type = BTRFS_XATTR_ITEM_KEY; | 3401 | max_key.type = BTRFS_XATTR_ITEM_KEY; |
3399 | else | 3402 | else |
3400 | max_key.type = (u8)-1; | 3403 | max_key.type = (u8)-1; |