]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
xfs: check type in quota verifier during quotacheck
authorEric Sandeen <sandeen@sandeen.net>
Mon, 7 May 2018 16:20:17 +0000 (09:20 -0700)
committerDarrick J. Wong <darrick.wong@oracle.com>
Wed, 9 May 2018 17:04:01 +0000 (10:04 -0700)
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>
fs/xfs/libxfs/xfs_dquot_buf.c

index a926058f7b0cd83137e4daf5bdf194440c688eb5..c00174f32f0d22feee8f4caab46a9dec007cfe90 100644 (file)
@@ -47,7 +47,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:
@@ -69,6 +69,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)