summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSage Weil <sage@newdream.net>2009-07-24 13:17:44 -0400
committerChris Mason <chris.mason@oracle.com>2009-07-24 13:17:44 -0400
commitebecd3d9d2adba144c15f1d35c78e0c26ead1bfd (patch)
tree605fdb3fcc3c9543d0a69987fcfd89ad3c7fb144
parentd717aa1d31c36cb56059e97966cb76f0be021969 (diff)
downloadop-kernel-dev-ebecd3d9d2adba144c15f1d35c78e0c26ead1bfd.zip
op-kernel-dev-ebecd3d9d2adba144c15f1d35c78e0c26ead1bfd.tar.gz
Btrfs: make flushoncommit mount option correctly wait on ordered_extents
The commit_transaction call to wait_ordered_extents when snap_pending passes nocow_only=1 to process only NOCOW or PREALLOC extents. This isn't correct for the 'flushoncommit' mode, as it skips extents we just started IO on in start_delalloc_inodes. So, in the flushoncommit case, wait on all ordered extents. Otherwise, only pass the nocow_only flag to wait_ordered_extents if snap_pending. Signed-off-by: Sage Weil <sage@newdream.net> Signed-off-by: Chris Mason <chris.mason@oracle.com>
-rw-r--r--fs/btrfs/transaction.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 32454d1c..e51d2bc 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -942,9 +942,11 @@ int btrfs_commit_transaction(struct btrfs_trans_handle *trans,
mutex_unlock(&root->fs_info->trans_mutex);
- if (flush_on_commit || snap_pending) {
- if (flush_on_commit)
- btrfs_start_delalloc_inodes(root);
+ if (flush_on_commit) {
+ btrfs_start_delalloc_inodes(root);
+ ret = btrfs_wait_ordered_extents(root, 0);
+ BUG_ON(ret);
+ } else if (snap_pending) {
ret = btrfs_wait_ordered_extents(root, 1);
BUG_ON(ret);
}
OpenPOWER on IntegriCloud