X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=fs%2Fbtrfs%2Fsuper.c;h=f3fd7e2cbc383aaefd42be70a02f80c759b6979b;hb=327f4387e39cf7bfe79a673e56dbf5479db3fec9;hp=0a14b495532fcc901d3c3baaa29cb4753d327d7f;hpb=cb7a97d01521797cad9f63e8478403c3e51fea49;p=linux-2.6-omap-h63xx.git diff --git a/fs/btrfs/super.c b/fs/btrfs/super.c index 0a14b495532..f3fd7e2cbc3 100644 --- a/fs/btrfs/super.c +++ b/fs/btrfs/super.c @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include "compat.h" #include "ctree.h" #include "disk-io.h" @@ -51,7 +51,6 @@ #include "export.h" #include "compression.h" -#define BTRFS_SUPER_MAGIC 0x9123683E static struct super_operations btrfs_super_ops; @@ -582,18 +581,20 @@ static long btrfs_control_ioctl(struct file *file, unsigned int cmd, { struct btrfs_ioctl_vol_args *vol; struct btrfs_fs_devices *fs_devices; - int ret = 0; - int len; + int ret = -ENOTTY; if (!capable(CAP_SYS_ADMIN)) return -EPERM; vol = kmalloc(sizeof(*vol), GFP_KERNEL); + if (!vol) + return -ENOMEM; + if (copy_from_user(vol, (void __user *)arg, sizeof(*vol))) { ret = -EFAULT; goto out; } - len = strnlen(vol->name, BTRFS_PATH_NAME_MAX); + switch (cmd) { case BTRFS_IOC_SCAN_DEV: ret = btrfs_scan_one_device(vol->name, FMODE_READ,