aboutsummaryrefslogtreecommitdiff
path: root/fs/btrfs/ioctl.c
diff options
context:
space:
mode:
authorGravatar Mark Brown <broonie@kernel.org> 2024-02-01 17:45:32 +0000
committerGravatar Mark Brown <broonie@kernel.org> 2024-02-01 17:45:32 +0000
commite81fdba0208666b65bafeaba814874b4d6e5edde (patch)
tree5de26e8be4ca1801ca27bffe25c129d29b13dba9 /fs/btrfs/ioctl.c
parentASoC: amd: acp: Fix support for a Huawei Matebook laptop (diff)
parentALSA: hda: cs35l56: Remove unused test stub function (diff)
downloadlinux-e81fdba0208666b65bafeaba814874b4d6e5edde.tar.gz
linux-e81fdba0208666b65bafeaba814874b4d6e5edde.tar.bz2
linux-e81fdba0208666b65bafeaba814874b4d6e5edde.zip
ALSA: Various fixes for Cirrus Logic CS35L56 support
Merge series from Richard Fitzgerald <rf@opensource.cirrus.com>: These patches fixe various things that were undocumented, unknown or uncertain when the original driver code was written. And also a few things that were just bugs.
Diffstat (limited to 'fs/btrfs/ioctl.c')
-rw-r--r--fs/btrfs/ioctl.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index 41b479861b3c..dfed9dd9c2d7 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -790,6 +790,9 @@ static int create_snapshot(struct btrfs_root *root, struct inode *dir,
return -EOPNOTSUPP;
}
+ if (btrfs_root_refs(&root->root_item) == 0)
+ return -ENOENT;
+
if (!test_bit(BTRFS_ROOT_SHAREABLE, &root->state))
return -EINVAL;
@@ -2608,6 +2611,10 @@ static int btrfs_ioctl_defrag(struct file *file, void __user *argp)
ret = -EFAULT;
goto out;
}
+ if (range.flags & ~BTRFS_DEFRAG_RANGE_FLAGS_SUPP) {
+ ret = -EOPNOTSUPP;
+ goto out;
+ }
/* compression requires us to start the IO */
if ((range.flags & BTRFS_DEFRAG_RANGE_COMPRESS)) {
range.flags |= BTRFS_DEFRAG_RANGE_START_IO;