|
@@ -4155,6 +4155,7 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans,
|
|
u64 ino = btrfs_ino(inode);
|
|
u64 ino = btrfs_ino(inode);
|
|
struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree;
|
|
struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree;
|
|
u64 logged_isize = 0;
|
|
u64 logged_isize = 0;
|
|
|
|
+ bool need_log_inode_item = true;
|
|
|
|
|
|
path = btrfs_alloc_path();
|
|
path = btrfs_alloc_path();
|
|
if (!path)
|
|
if (!path)
|
|
@@ -4263,11 +4264,6 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans,
|
|
} else {
|
|
} else {
|
|
if (inode_only == LOG_INODE_ALL)
|
|
if (inode_only == LOG_INODE_ALL)
|
|
fast_search = true;
|
|
fast_search = true;
|
|
- ret = log_inode_item(trans, log, dst_path, inode);
|
|
|
|
- if (ret) {
|
|
|
|
- err = ret;
|
|
|
|
- goto out_unlock;
|
|
|
|
- }
|
|
|
|
goto log_extents;
|
|
goto log_extents;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -4290,6 +4286,9 @@ again:
|
|
if (min_key.type > max_key.type)
|
|
if (min_key.type > max_key.type)
|
|
break;
|
|
break;
|
|
|
|
|
|
|
|
+ if (min_key.type == BTRFS_INODE_ITEM_KEY)
|
|
|
|
+ need_log_inode_item = false;
|
|
|
|
+
|
|
src = path->nodes[0];
|
|
src = path->nodes[0];
|
|
if (ins_nr && ins_start_slot + ins_nr == path->slots[0]) {
|
|
if (ins_nr && ins_start_slot + ins_nr == path->slots[0]) {
|
|
ins_nr++;
|
|
ins_nr++;
|
|
@@ -4360,6 +4359,11 @@ next_slot:
|
|
log_extents:
|
|
log_extents:
|
|
btrfs_release_path(path);
|
|
btrfs_release_path(path);
|
|
btrfs_release_path(dst_path);
|
|
btrfs_release_path(dst_path);
|
|
|
|
+ if (need_log_inode_item) {
|
|
|
|
+ err = log_inode_item(trans, log, dst_path, inode);
|
|
|
|
+ if (err)
|
|
|
|
+ goto out_unlock;
|
|
|
|
+ }
|
|
if (fast_search) {
|
|
if (fast_search) {
|
|
/*
|
|
/*
|
|
* Some ordered extents started by fsync might have completed
|
|
* Some ordered extents started by fsync might have completed
|