]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
xfs: define a flags field for the AG geometry ioctl structure
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 30 Aug 2019 23:30:22 +0000 (16:30 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 4 Sep 2019 04:07:25 +0000 (21:07 -0700)
Define a flags field for the AG geometry ioctl structure.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
fs/xfs/libxfs/xfs_fs.h
fs/xfs/xfs_ioctl.c

index 52d03a3a02a4e4a8b21bae62d0871b494d642e2d..39dd2b90810626b5075e9c5242532390c53f0148 100644 (file)
@@ -287,7 +287,7 @@ struct xfs_ag_geometry {
        uint32_t        ag_ifree;       /* o: inodes free */
        uint32_t        ag_sick;        /* o: sick things in ag */
        uint32_t        ag_checked;     /* o: checked metadata in ag */
-       uint32_t        ag_reserved32;  /* o: zero */
+       uint32_t        ag_flags;       /* i/o: flags for this ag */
        uint64_t        ag_reserved[12];/* o: zero */
 };
 #define XFS_AG_GEOM_SICK_SB    (1 << 0)  /* superblock */
index 9a6823e29661b6ae48893f271bfa460ba22f5a9a..c93501f4267558bca708e6b2b713bb1ec546ee82 100644 (file)
@@ -1038,6 +1038,10 @@ xfs_ioc_ag_geometry(
 
        if (copy_from_user(&ageo, arg, sizeof(ageo)))
                return -EFAULT;
+       if (ageo.ag_flags)
+               return -EINVAL;
+       if (memchr_inv(&ageo.ag_reserved, 0, sizeof(ageo.ag_reserved)))
+               return -EINVAL;
 
        error = xfs_ag_get_geometry(mp, ageo.ag_number, &ageo);
        if (error)