Skip to content

Commit

Permalink
Btrfs: Fix cow semantic in run_delalloc_nocow()
Browse files Browse the repository at this point in the history
The file preallocation code reversed the logic to force nodatacow.
This fixes it.
  • Loading branch information
Liu Hui authored and Chris Mason committed Dec 2, 2008
1 parent ea6a478 commit ce397c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit ce397c0

Please sign in to comment.