From: Sage Weil Date: Fri, 19 Feb 2010 22:13:50 +0000 (-0800) Subject: Btrfs: flush data on snapshot creation X-Git-Tag: MMI-PSA29.97-13-9~23937^2~36 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0bdb1db297ab36865a63ee722d35ff0a1f0ae522;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git 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 Signed-off-by: Chris Mason --- diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c index 2a36e236a492..2d654c1c794d 100644 --- a/fs/btrfs/transaction.c +++ b/fs/btrfs/transaction.c @@ -997,13 +997,10 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans, mutex_unlock(&root->fs_info->trans_mutex); - if (flush_on_commit) { + if (flush_on_commit || snap_pending) { btrfs_start_delalloc_inodes(root, 1); ret = btrfs_wait_ordered_extents(root, 0, 1); BUG_ON(ret); - } else if (snap_pending) { - ret = btrfs_wait_ordered_extents(root, 0, 1); - BUG_ON(ret); } /*