summaryrefslogtreecommitdiff
path: root/fs/btrfs/ioctl.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2012-11-15 16:41:21 (GMT)
committerArnd Bergmann <arnd@arndb.de>2012-11-15 16:41:21 (GMT)
commit8dbd2879e33be37adf40f747a5fb80ef1a6cd150 (patch)
treec688d7980be8c1c0dbf5e411caaf2c102120102e /fs/btrfs/ioctl.c
parentb770ea523d95837e968d46c7fe09a3f5edd9bb27 (diff)
parentd308ba50a1234b299a00e63a95e61fdeb2f1a2df (diff)
downloadlinux-fsl-qoriq-8dbd2879e33be37adf40f747a5fb80ef1a6cd150.tar.xz
Merge branch 'omap/dt' into next/drivers
Needed for the omap timer changes. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
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)