mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-15 23:25:07 +00:00
Btrfs: flush data on snapshot creation
Flush any delalloc extents when we create a snapshot, so that recently written file data is always included in the snapshot. A later commit will add the ability to snapshot without the flush, but most people expect flushing. Signed-off-by: Sage Weil <sage@newdream.net> Signed-off-by: Chris Mason <chris.mason@oracle.com>
This commit is contained in:
parent
bd4d108889
commit
0bdb1db297
1 changed files with 1 additions and 4 deletions
|
@ -997,13 +997,10 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
|
||||||
|
|
||||||
mutex_unlock(&root->fs_info->trans_mutex);
|
mutex_unlock(&root->fs_info->trans_mutex);
|
||||||
|
|
||||||
if (flush_on_commit) {
|
if (flush_on_commit || snap_pending) {
|
||||||
btrfs_start_delalloc_inodes(root, 1);
|
btrfs_start_delalloc_inodes(root, 1);
|
||||||
ret = btrfs_wait_ordered_extents(root, 0, 1);
|
ret = btrfs_wait_ordered_extents(root, 0, 1);
|
||||||
BUG_ON(ret);
|
BUG_ON(ret);
|
||||||
} else if (snap_pending) {
|
|
||||||
ret = btrfs_wait_ordered_extents(root, 0, 1);
|
|
||||||
BUG_ON(ret);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Reference in a new issue