diff options
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r-- | fs/btrfs/tree-log.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 1ce80c1c4eb6..76c4f9d1b80a 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c | |||
@@ -4155,6 +4155,7 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans, | |||
4155 | u64 ino = btrfs_ino(inode); | 4155 | u64 ino = btrfs_ino(inode); |
4156 | struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree; | 4156 | struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree; |
4157 | u64 logged_isize = 0; | 4157 | u64 logged_isize = 0; |
4158 | bool need_log_inode_item = true; | ||
4158 | 4159 | ||
4159 | path = btrfs_alloc_path(); | 4160 | path = btrfs_alloc_path(); |
4160 | if (!path) | 4161 | if (!path) |
@@ -4263,11 +4264,6 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans, | |||
4263 | } else { | 4264 | } else { |
4264 | if (inode_only == LOG_INODE_ALL) | 4265 | if (inode_only == LOG_INODE_ALL) |
4265 | fast_search = true; | 4266 | fast_search = true; |
4266 | ret = log_inode_item(trans, log, dst_path, inode); | ||
4267 | if (ret) { | ||
4268 | err = ret; | ||
4269 | goto out_unlock; | ||
4270 | } | ||
4271 | goto log_extents; | 4267 | goto log_extents; |
4272 | } | 4268 | } |
4273 | 4269 | ||
@@ -4290,6 +4286,9 @@ again: | |||
4290 | if (min_key.type > max_key.type) | 4286 | if (min_key.type > max_key.type) |
4291 | break; | 4287 | break; |
4292 | 4288 | ||
4289 | if (min_key.type == BTRFS_INODE_ITEM_KEY) | ||
4290 | need_log_inode_item = false; | ||
4291 | |||
4293 | src = path->nodes[0]; | 4292 | src = path->nodes[0]; |
4294 | if (ins_nr && ins_start_slot + ins_nr == path->slots[0]) { | 4293 | if (ins_nr && ins_start_slot + ins_nr == path->slots[0]) { |
4295 | ins_nr++; | 4294 | ins_nr++; |
@@ -4360,6 +4359,11 @@ next_slot: | |||
4360 | log_extents: | 4359 | log_extents: |
4361 | btrfs_release_path(path); | 4360 | btrfs_release_path(path); |
4362 | btrfs_release_path(dst_path); | 4361 | btrfs_release_path(dst_path); |
4362 | if (need_log_inode_item) { | ||
4363 | err = log_inode_item(trans, log, dst_path, inode); | ||
4364 | if (err) | ||
4365 | goto out_unlock; | ||
4366 | } | ||
4363 | if (fast_search) { | 4367 | if (fast_search) { |
4364 | /* | 4368 | /* |
4365 | * Some ordered extents started by fsync might have completed | 4369 | * Some ordered extents started by fsync might have completed |