diff options
Diffstat (limited to 'fs/btrfs/tree-log.c')
-rw-r--r-- | fs/btrfs/tree-log.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 43758e30aa7a..c1509547c762 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c | |||
@@ -4827,6 +4827,7 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans, | |||
4827 | struct extent_map_tree *em_tree = &inode->extent_tree; | 4827 | struct extent_map_tree *em_tree = &inode->extent_tree; |
4828 | u64 logged_isize = 0; | 4828 | u64 logged_isize = 0; |
4829 | bool need_log_inode_item = true; | 4829 | bool need_log_inode_item = true; |
4830 | bool xattrs_logged = false; | ||
4830 | 4831 | ||
4831 | path = btrfs_alloc_path(); | 4832 | path = btrfs_alloc_path(); |
4832 | if (!path) | 4833 | if (!path) |
@@ -5128,6 +5129,7 @@ next_key: | |||
5128 | err = btrfs_log_all_xattrs(trans, root, inode, path, dst_path); | 5129 | err = btrfs_log_all_xattrs(trans, root, inode, path, dst_path); |
5129 | if (err) | 5130 | if (err) |
5130 | goto out_unlock; | 5131 | goto out_unlock; |
5132 | xattrs_logged = true; | ||
5131 | if (max_key.type >= BTRFS_EXTENT_DATA_KEY && !fast_search) { | 5133 | if (max_key.type >= BTRFS_EXTENT_DATA_KEY && !fast_search) { |
5132 | btrfs_release_path(path); | 5134 | btrfs_release_path(path); |
5133 | btrfs_release_path(dst_path); | 5135 | btrfs_release_path(dst_path); |
@@ -5140,6 +5142,11 @@ log_extents: | |||
5140 | btrfs_release_path(dst_path); | 5142 | btrfs_release_path(dst_path); |
5141 | if (need_log_inode_item) { | 5143 | if (need_log_inode_item) { |
5142 | err = log_inode_item(trans, log, dst_path, inode); | 5144 | err = log_inode_item(trans, log, dst_path, inode); |
5145 | if (!err && !xattrs_logged) { | ||
5146 | err = btrfs_log_all_xattrs(trans, root, inode, path, | ||
5147 | dst_path); | ||
5148 | btrfs_release_path(path); | ||
5149 | } | ||
5143 | if (err) | 5150 | if (err) |
5144 | goto out_unlock; | 5151 | goto out_unlock; |
5145 | } | 5152 | } |