summaryrefslogtreecommitdiff
path: root/fs/xfs/xfs_ioctl.c
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2021-09-01 11:18:02 -0700
committerDarrick J. Wong <djwong@kernel.org>2021-12-15 17:29:18 -0800
commita3d575d2b91884573628393e234ee6c0781701bd (patch)
treefb6704d7ee930bdc92743e7f1eaceebd5e1dcfc4 /fs/xfs/xfs_ioctl.c
parent22291cfb1132e89552db38399ab78dd3bfd0c940 (diff)
xfs: enable userspace to hide an AG from allocation
Add an administrative interface so that userspace can hide an allocation group from block allocation. Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Diffstat (limited to 'fs/xfs/xfs_ioctl.c')
-rw-r--r--fs/xfs/xfs_ioctl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/xfs/xfs_ioctl.c b/fs/xfs/xfs_ioctl.c
index 4e9faa48e364..a16c13297fd6 100644
--- a/fs/xfs/xfs_ioctl.c
+++ b/fs/xfs/xfs_ioctl.c
@@ -1043,10 +1043,12 @@ xfs_ioc_ag_geometry(
if (copy_from_user(&ageo, arg, sizeof(ageo)))
return -EFAULT;
- if (ageo.ag_flags)
+ if (ageo.ag_flags & ~XFS_AG_FLAG_ALL)
return -EINVAL;
if (memchr_inv(&ageo.ag_reserved, 0, sizeof(ageo.ag_reserved)))
return -EINVAL;
+ if ((ageo.ag_flags & XFS_AG_FLAG_UPDATE) && !capable(CAP_SYS_ADMIN))
+ return -EPERM;
error = xfs_ag_get_geometry(mp, ageo.ag_number, &ageo);
if (error)