summaryrefslogtreecommitdiff
path: root/fs/btrfs/ioctl.c
diff options
context:
space:
mode:
authorKukjin Kim <kgene.kim@samsung.com>2012-11-19 04:18:47 (GMT)
committerKukjin Kim <kgene.kim@samsung.com>2012-11-19 04:18:47 (GMT)
commit326f3abf19360014dfae968aa3ab891d25599618 (patch)
treea57251231cb889e4e6b0f26d023990578b7bd98e /fs/btrfs/ioctl.c
parentef405e04abd0d4bc3f7082d241517f6db3f5c06d (diff)
parent64a574344dadbee5d01819d9d73b594d3cbe448e (diff)
downloadlinux-326f3abf19360014dfae968aa3ab891d25599618.tar.xz
Merge branch 'next/dt-exynos4x12' into next/dt-samsung
Conflicts: arch/arm/boot/dts/exynos4210.dtsi
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r--fs/btrfs/ioctl.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 6116880..8fcf9a5 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -343,7 +343,8 @@ static noinline int btrfs_ioctl_fitrim(struct file *file, void __user *arg)
return -EOPNOTSUPP;
if (copy_from_user(&range, arg, sizeof(range)))
return -EFAULT;
- if (range.start > total_bytes)
+ if (range.start > total_bytes ||
+ range.len < fs_info->sb->s_blocksize)
return -EINVAL;
range.len = min(range.len, total_bytes - range.start);
@@ -570,7 +571,8 @@ static int create_snapshot(struct btrfs_root *root, struct dentry *dentry,
ret = btrfs_commit_transaction(trans,
root->fs_info->extent_root);
}
- BUG_ON(ret);
+ if (ret)
+ goto fail;
ret = pending_snapshot->error;
if (ret)