]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: check type in quota verifier during quotacheck
authorEric Sandeen <sandeen@sandeen.net>
Thu, 28 Jun 2018 20:11:54 +0000 (15:11 -0500)
committerEric Sandeen <sandeen@redhat.com>
Thu, 28 Jun 2018 20:11:54 +0000 (15:11 -0500)
Source kernel commit: 57ab324553bbfedc8e732eb570edfac0f5cfe57e

During quotacheck we send in the quota type, so verify that as well.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
libxfs/xfs_dquot_buf.c

index 1486b2bd98f08d2829550cc9cef6d347f24c3185..50da0191d88d764a0210c69dc4a7d938e0882f86 100644 (file)
@@ -45,7 +45,7 @@ xfs_dquot_verify(
        struct xfs_mount *mp,
        xfs_disk_dquot_t *ddq,
        xfs_dqid_t       id,
-       uint             type)    /* used only when IO_dorepair is true */
+       uint             type)    /* used only during quotacheck */
 {
        /*
         * We can encounter an uninitialized dquot buffer for 2 reasons:
@@ -67,6 +67,8 @@ xfs_dquot_verify(
        if (ddq->d_version != XFS_DQUOT_VERSION)
                return __this_address;
 
+       if (type && ddq->d_flags != type)
+               return __this_address;
        if (ddq->d_flags != XFS_DQ_USER &&
            ddq->d_flags != XFS_DQ_PROJ &&
            ddq->d_flags != XFS_DQ_GROUP)