Commit d006a048 authored by Josef Bacik's avatar Josef Bacik Committed by Chris Mason

Btrfs: only drop modified extents if we logged the whole inode

If we fsync, seek and write, rename and then fsync again we will lose the
modified hole extent because the rename will drop all of the modified extents
since we didn't do the fast search.  We need to only drop the modified extents
if we didn't do the fast search and we were logging the entire inode as we don't
need them anymore, otherwise this is being premature.  Thanks,
Signed-off-by: default avatarJosef Bacik <jbacik@fusionio.com>
Signed-off-by: default avatarChris Mason <chris.mason@fusionio.com>
parent 6cfab851
...@@ -3802,7 +3802,7 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans, ...@@ -3802,7 +3802,7 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans,
err = ret; err = ret;
goto out_unlock; goto out_unlock;
} }
} else { } else if (inode_only == LOG_INODE_ALL) {
struct extent_map_tree *tree = &BTRFS_I(inode)->extent_tree; struct extent_map_tree *tree = &BTRFS_I(inode)->extent_tree;
struct extent_map *em, *n; struct extent_map *em, *n;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment