diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-06-12 14:06:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-06-12 14:06:36 -0400 |
commit | 3c25fa740e2084a3950f581378ec29a3c307ddfc (patch) | |
tree | 0d41fe11789be7a406e4d29c111713f75548fbc1 /fs/btrfs/ioctl.c | |
parent | 9d6fa8fa7042622f8ed9c0988de665464d4584a6 (diff) | |
parent | 30b4caf5d73af5c99cf1b2b46496d8bc35330992 (diff) |
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/btrfs-unstable:
Btrfs: use join_transaction in btrfs_evict_inode()
Btrfs - use %pU to print fsid
Btrfs: fix extent state leak on failed nodatasum reads
btrfs: fix unlocked access of delalloc_inodes
Btrfs: avoid stack bloat in btrfs_ioctl_fs_info()
btrfs: remove 64bit alignment padding to allow extent_buffer to fit into one fewer cacheline
Btrfs: clear current->journal_info on async transaction commit
Btrfs: make sure to recheck for bitmaps in clusters
btrfs: remove unneeded includes from scrub.c
btrfs: reinitialize scrub workers
btrfs: scrub: errors in tree enumeration
Btrfs: don't map extent buffer if path->skip_locking is set
Btrfs: unlock the trans lock properly
Btrfs: don't map extent buffer if path->skip_locking is set
Btrfs: fix duplicate checking logic
Btrfs: fix the allocator loop logic
Btrfs: fix bitmap regression
Btrfs: don't commit the transaction if we dont have enough pinned bytes
Btrfs: noinline the cluster searching functions
Btrfs: cache bitmaps when searching for a cluster
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r-- | fs/btrfs/ioctl.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index ac37040e426a..b793d112d1f6 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -2054,29 +2054,34 @@ static long btrfs_ioctl_rm_dev(struct btrfs_root *root, void __user *arg) | |||
2054 | 2054 | ||
2055 | static long btrfs_ioctl_fs_info(struct btrfs_root *root, void __user *arg) | 2055 | static long btrfs_ioctl_fs_info(struct btrfs_root *root, void __user *arg) |
2056 | { | 2056 | { |
2057 | struct btrfs_ioctl_fs_info_args fi_args; | 2057 | struct btrfs_ioctl_fs_info_args *fi_args; |
2058 | struct btrfs_device *device; | 2058 | struct btrfs_device *device; |
2059 | struct btrfs_device *next; | 2059 | struct btrfs_device *next; |
2060 | struct btrfs_fs_devices *fs_devices = root->fs_info->fs_devices; | 2060 | struct btrfs_fs_devices *fs_devices = root->fs_info->fs_devices; |
2061 | int ret = 0; | ||
2061 | 2062 | ||
2062 | if (!capable(CAP_SYS_ADMIN)) | 2063 | if (!capable(CAP_SYS_ADMIN)) |
2063 | return -EPERM; | 2064 | return -EPERM; |
2064 | 2065 | ||
2065 | fi_args.num_devices = fs_devices->num_devices; | 2066 | fi_args = kzalloc(sizeof(*fi_args), GFP_KERNEL); |
2066 | fi_args.max_id = 0; | 2067 | if (!fi_args) |
2067 | memcpy(&fi_args.fsid, root->fs_info->fsid, sizeof(fi_args.fsid)); | 2068 | return -ENOMEM; |
2069 | |||
2070 | fi_args->num_devices = fs_devices->num_devices; | ||
2071 | memcpy(&fi_args->fsid, root->fs_info->fsid, sizeof(fi_args->fsid)); | ||
2068 | 2072 | ||
2069 | mutex_lock(&fs_devices->device_list_mutex); | 2073 | mutex_lock(&fs_devices->device_list_mutex); |
2070 | list_for_each_entry_safe(device, next, &fs_devices->devices, dev_list) { | 2074 | list_for_each_entry_safe(device, next, &fs_devices->devices, dev_list) { |
2071 | if (device->devid > fi_args.max_id) | 2075 | if (device->devid > fi_args->max_id) |
2072 | fi_args.max_id = device->devid; | 2076 | fi_args->max_id = device->devid; |
2073 | } | 2077 | } |
2074 | mutex_unlock(&fs_devices->device_list_mutex); | 2078 | mutex_unlock(&fs_devices->device_list_mutex); |
2075 | 2079 | ||
2076 | if (copy_to_user(arg, &fi_args, sizeof(fi_args))) | 2080 | if (copy_to_user(arg, fi_args, sizeof(*fi_args))) |
2077 | return -EFAULT; | 2081 | ret = -EFAULT; |
2078 | 2082 | ||
2079 | return 0; | 2083 | kfree(fi_args); |
2084 | return ret; | ||
2080 | } | 2085 | } |
2081 | 2086 | ||
2082 | static long btrfs_ioctl_dev_info(struct btrfs_root *root, void __user *arg) | 2087 | static long btrfs_ioctl_dev_info(struct btrfs_root *root, void __user *arg) |