|
@@ -1574,6 +1574,12 @@ static noinline int btrfs_ioctl_snap_create_transid(struct file *file,
|
|
|
btrfs_info(BTRFS_I(src_inode)->root->fs_info,
|
|
|
"Snapshot src from another FS");
|
|
|
ret = -EINVAL;
|
|
|
+ } else if (!inode_owner_or_capable(src_inode)) {
|
|
|
+ /*
|
|
|
+ * Subvolume creation is not restricted, but snapshots
|
|
|
+ * are limited to own subvolumes only
|
|
|
+ */
|
|
|
+ ret = -EPERM;
|
|
|
} else {
|
|
|
ret = btrfs_mksubvol(&file->f_path, name, namelen,
|
|
|
BTRFS_I(src_inode)->root,
|