Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 360393
b: refs/heads/master
c: dfd7982
h: refs/heads/master
i:
  360391: be6d46c
v: v3
  • Loading branch information
Miao Xie authored and Josef Bacik committed Feb 20, 2013
1 parent b9714d9 commit 9f5055e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4eee4fa4f8ab8c2b2623c22be4c3cb91d525aa57
refs/heads/master: dfd79829b709af3c2ac55951353a874ae89f41c3
13 changes: 7 additions & 6 deletions trunk/fs/btrfs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1329,9 +1329,6 @@ static noinline int btrfs_ioctl_resize(struct file *file,
int ret = 0;
int mod = 0;

if (root->fs_info->sb->s_flags & MS_RDONLY)
return -EROFS;

if (!capable(CAP_SYS_ADMIN))
return -EPERM;

Expand Down Expand Up @@ -1363,6 +1360,10 @@ static noinline int btrfs_ioctl_resize(struct file *file,
*devstr = '\0';
devstr = vol_args->name;
devid = simple_strtoull(devstr, &end, 10);
if (!devid) {
ret = -EINVAL;
goto out_free;
}
printk(KERN_INFO "btrfs: resizing devid %llu\n",
(unsigned long long)devid);
}
Expand All @@ -1371,15 +1372,15 @@ static noinline int btrfs_ioctl_resize(struct file *file,
if (!device) {
printk(KERN_INFO "btrfs: resizer unable to find device %llu\n",
(unsigned long long)devid);
ret = -EINVAL;
ret = -ENODEV;
goto out_free;
}

if (!device->writeable) {
printk(KERN_INFO "btrfs: resizer unable to apply on "
"readonly device %llu\n",
(unsigned long long)devid);
ret = -EINVAL;
ret = -EPERM;
goto out_free;
}

Expand All @@ -1401,7 +1402,7 @@ static noinline int btrfs_ioctl_resize(struct file *file,
}

if (device->is_tgtdev_for_dev_replace) {
ret = -EINVAL;
ret = -EPERM;
goto out_free;
}

Expand Down

0 comments on commit 9f5055e

Please sign in to comment.