btrfs: use ASSERT to report logical error in cow_file_range()
authorAnand Jain <anand.jain@oracle.com>
Thu, 15 Feb 2018 10:07:59 +0000 (18:07 +0800)
committerDavid Sterba <dsterba@suse.com>
Mon, 26 Mar 2018 13:09:35 +0000 (15:09 +0200)
commit566b1760b42be7c99c02e894b1ec9a707c2e83d1
tree6cee8bc71b76d1b0c6e43de1f78f28ebaa25cae7
parent3752d22fcea160cc2493e34f5e0e41cdd7fdd921
btrfs: use ASSERT to report logical error in cow_file_range()

Use ASSERT to report logical error in cow_file_range(), also move it a
bit closer to when the num_bytes is derived.

The extent start could be (u64)-1 in some cases, the assert should catch
that we do not accidentally pass it to cow_file_range.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/inode.c