diff options
author | David Sterba <dsterba@suse.cz> | 2014-04-15 12:50:17 -0400 |
---|---|---|
committer | Chris Mason <clm@fb.com> | 2014-04-24 19:43:32 -0400 |
commit | 3f9e3df8da3c51649c15db249978a10f7374236a (patch) | |
tree | 27c95d85e319fe75e4643fdeaf79ae928bbef6b3 /fs/btrfs/file.c | |
parent | c5f7d0bb29df2e1848a236e58e201daf5b4e0f21 (diff) |
btrfs: replace error code from btrfs_drop_extents
There's a case which clone does not handle and used to BUG_ON instead,
(testcase xfstests/btrfs/035), now returns EINVAL. This error code is
confusing to the ioctl caller, as it normally signifies errorneous
arguments.
Change it to ENOPNOTSUPP which allows a fall back to copy instead of
clone. This does not affect the common reflink operation.
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs/file.c')
-rw-r--r-- | fs/btrfs/file.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c index e7e78fa9085e..1eee3f79d75f 100644 --- a/fs/btrfs/file.c +++ b/fs/btrfs/file.c | |||
@@ -805,7 +805,7 @@ next_slot: | |||
805 | if (start > key.offset && end < extent_end) { | 805 | if (start > key.offset && end < extent_end) { |
806 | BUG_ON(del_nr > 0); | 806 | BUG_ON(del_nr > 0); |
807 | if (extent_type == BTRFS_FILE_EXTENT_INLINE) { | 807 | if (extent_type == BTRFS_FILE_EXTENT_INLINE) { |
808 | ret = -EINVAL; | 808 | ret = -EOPNOTSUPP; |
809 | break; | 809 | break; |
810 | } | 810 | } |
811 | 811 | ||
@@ -851,7 +851,7 @@ next_slot: | |||
851 | */ | 851 | */ |
852 | if (start <= key.offset && end < extent_end) { | 852 | if (start <= key.offset && end < extent_end) { |
853 | if (extent_type == BTRFS_FILE_EXTENT_INLINE) { | 853 | if (extent_type == BTRFS_FILE_EXTENT_INLINE) { |
854 | ret = -EINVAL; | 854 | ret = -EOPNOTSUPP; |
855 | break; | 855 | break; |
856 | } | 856 | } |
857 | 857 | ||
@@ -877,7 +877,7 @@ next_slot: | |||
877 | if (start > key.offset && end >= extent_end) { | 877 | if (start > key.offset && end >= extent_end) { |
878 | BUG_ON(del_nr > 0); | 878 | BUG_ON(del_nr > 0); |
879 | if (extent_type == BTRFS_FILE_EXTENT_INLINE) { | 879 | if (extent_type == BTRFS_FILE_EXTENT_INLINE) { |
880 | ret = -EINVAL; | 880 | ret = -EOPNOTSUPP; |
881 | break; | 881 | break; |
882 | } | 882 | } |
883 | 883 | ||