diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 83268d8f48c4d7b9789ed9ec1581b1fe5916fde9..7158b5b77c9de0778022e36f10a4783ea4af6184 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -1532,12 +1532,11 @@ static noinline int run_delalloc_nocow(struct inode *inode, } btrfs_release_path(path); - if (cur_offset <= end && cow_start == (u64)-1) { + if (cur_offset <= end && cow_start == (u64)-1) cow_start = cur_offset; - cur_offset = end; - } if (cow_start != (u64)-1) { + cur_offset = end; ret = cow_file_range(inode, locked_page, cow_start, end, end, page_started, nr_written, 1, NULL); if (ret)