diff options
| author | James Morris <jmorris@namei.org> | 2010-05-06 10:56:07 +1000 | 
|---|---|---|
| committer | James Morris <jmorris@namei.org> | 2010-05-06 10:56:07 +1000 | 
| commit | 0ffbe2699cda6afbe08501098dff8a8c2fe6ae09 (patch) | |
| tree | 81b1a2305d16c873371b65c5a863c0268036cefe /fs/btrfs/ioctl.c | |
| parent | 4e5d6f7ec3833c0da9cf34fa5c53c6058c5908b6 (diff) | |
| parent | 7ebd467551ed6ae200d7835a84bbda0dcadaa511 (diff) | |
| download | olio-linux-3.10-0ffbe2699cda6afbe08501098dff8a8c2fe6ae09.tar.xz olio-linux-3.10-0ffbe2699cda6afbe08501098dff8a8c2fe6ae09.zip  | |
Merge branch 'master' into next
Diffstat (limited to 'fs/btrfs/ioctl.c')
| -rw-r--r-- | fs/btrfs/ioctl.c | 8 | 
1 files changed, 6 insertions, 2 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 2845c6ceecd..e84ef60ffe3 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c @@ -39,6 +39,7 @@  #include <linux/security.h>  #include <linux/xattr.h>  #include <linux/vmalloc.h> +#include <linux/slab.h>  #include "compat.h"  #include "ctree.h"  #include "disk-io.h" @@ -48,7 +49,6 @@  #include "print-tree.h"  #include "volumes.h"  #include "locking.h" -#include "ctree.h"  /* Mask out flags that are inappropriate for the given type of inode. */  static inline __u32 btrfs_mask_flags(umode_t mode, __u32 flags) @@ -511,7 +511,7 @@ static int should_defrag_range(struct inode *inode, u64 start, u64 len,  		em = btrfs_get_extent(inode, NULL, 0, start, len, 0);  		unlock_extent(io_tree, start, start + len - 1, GFP_NOFS); -		if (!em) +		if (IS_ERR(em))  			return 0;  	} @@ -1212,6 +1212,9 @@ static noinline int btrfs_ioctl_ino_lookup(struct file *file,  		return -EPERM;  	args = kmalloc(sizeof(*args), GFP_KERNEL); +	if (!args) +		return -ENOMEM; +  	if (copy_from_user(args, argp, sizeof(*args))) {  		kfree(args);  		return -EFAULT; @@ -1375,6 +1378,7 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp)  					   sizeof(*range))) {  				ret = -EFAULT;  				kfree(range); +				goto out;  			}  			/* compression requires us to start the IO */  			if ((range->flags & BTRFS_DEFRAG_RANGE_COMPRESS)) {  |