aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorGui Hecheng <guihc.fnst@cn.fujitsu.com>2014-05-28 21:19:58 -0400
committerChris Mason <clm@fb.com>2014-06-09 20:21:07 -0400
commit902c68a4da74442f0ab1c0b458f7723a68dfd3b1 (patch)
tree50aec3bffcc19ab3ddfe66448eb3a03333460692 /fs/btrfs
parentb05fd8742f6291b67571ad0fdad4da6b6eb98025 (diff)
btrfs: replace EINVAL with ERANGE for resize when ULLONG_MAX
To be accurate about the error case, if the new size is beyond ULLONG_MAX, return ERANGE instead of EINVAL. Signed-off-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/ioctl.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 219e26fa9069..55f4d717d541 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -1593,7 +1593,7 @@ static noinline int btrfs_ioctl_resize(struct file *file,
1593 new_size = old_size - new_size; 1593 new_size = old_size - new_size;
1594 } else if (mod > 0) { 1594 } else if (mod > 0) {
1595 if (new_size > ULLONG_MAX - old_size) { 1595 if (new_size > ULLONG_MAX - old_size) {
1596 ret = -EINVAL; 1596 ret = -ERANGE;
1597 goto out_free; 1597 goto out_free;
1598 } 1598 }
1599 new_size = old_size + new_size; 1599 new_size = old_size + new_size;