diff options
-rw-r--r-- | fs/btrfs/ioctl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c index 829999dafd93..8d4457f329f5 100644 --- a/fs/btrfs/ioctl.c +++ b/fs/btrfs/ioctl.c | |||
@@ -1574,6 +1574,12 @@ static noinline int btrfs_ioctl_snap_create_transid(struct file *file, | |||
1574 | btrfs_info(BTRFS_I(src_inode)->root->fs_info, | 1574 | btrfs_info(BTRFS_I(src_inode)->root->fs_info, |
1575 | "Snapshot src from another FS"); | 1575 | "Snapshot src from another FS"); |
1576 | ret = -EINVAL; | 1576 | ret = -EINVAL; |
1577 | } else if (!inode_owner_or_capable(src_inode)) { | ||
1578 | /* | ||
1579 | * Subvolume creation is not restricted, but snapshots | ||
1580 | * are limited to own subvolumes only | ||
1581 | */ | ||
1582 | ret = -EPERM; | ||
1577 | } else { | 1583 | } else { |
1578 | ret = btrfs_mksubvol(&file->f_path, name, namelen, | 1584 | ret = btrfs_mksubvol(&file->f_path, name, namelen, |
1579 | BTRFS_I(src_inode)->root, | 1585 | BTRFS_I(src_inode)->root, |