From: Liu Hui Date: Tue, 2 Dec 2008 01:31:40 +0000 (-0500) Subject: Btrfs: Fix cow semantic in run_delalloc_nocow() X-Git-Tag: v2.6.29-rc1~27^2~9^2~47 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=ce397c0616de9bfb678569f1dfa655838a711594;p=linux-2.6-omap-h63xx.git Btrfs: Fix cow semantic in run_delalloc_nocow() The file preallocation code reversed the logic to force nodatacow. This fixes it. --- diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 7a8ad4292f7..b3d4078b69a 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -1114,10 +1114,10 @@ static int run_delalloc_range(struct inode *inode, struct page *locked_page, if (btrfs_test_opt(root, NODATACOW) || btrfs_test_flag(inode, NODATACOW)) ret = run_delalloc_nocow(inode, locked_page, start, end, - page_started, 0, nr_written); + page_started, 1, nr_written); else if (btrfs_test_flag(inode, PREALLOC)) ret = run_delalloc_nocow(inode, locked_page, start, end, - page_started, 1, nr_written); + page_started, 0, nr_written); else ret = cow_file_range_async(inode, locked_page, start, end, page_started, nr_written);