summaryrefslogtreecommitdiff
path: root/fs/btrfs/ioctl.c
diff options
context:
space:
mode:
authorCatalin Marinas <catalin.marinas@arm.com>2012-11-13 17:36:07 +0000
committerCatalin Marinas <catalin.marinas@arm.com>2012-11-13 17:36:07 +0000
commit6097a07411005c0184cf90256743c784079198fc (patch)
tree0c6496aa7de5f00a60ed8e7bac4b34f5acc7e30a /fs/btrfs/ioctl.c
parent6a872777ffff6184f4ac10bd71d926d5e6f2491e (diff)
parent77b67063bb6bce6d475e910d3b886a606d0d91f7 (diff)
Merge tag 'v3.7-rc5' into execve
Linux 3.7-rc5 Conflicts: arch/arm64/kernel/process.c
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 61168805f175..8fcf9a59c28d 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)