diff options
author | Darrick J. Wong <djwong@kernel.org> | 2021-09-01 11:18:02 -0700 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2021-12-15 17:29:18 -0800 |
commit | a3d575d2b91884573628393e234ee6c0781701bd (patch) | |
tree | fb6704d7ee930bdc92743e7f1eaceebd5e1dcfc4 /fs/xfs/xfs_ioctl.c | |
parent | 22291cfb1132e89552db38399ab78dd3bfd0c940 (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.c | 4 |
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) |