From: Eric Sandeen Date: Thu, 28 Jun 2018 20:11:54 +0000 (-0500) Subject: xfs: check type in quota verifier during quotacheck X-Git-Tag: v4.18.0-rc0~64 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c87d9122e8d6801bdc99097a88c2f107cf457319;p=thirdparty%2Fxfsprogs-dev.git xfs: check type in quota verifier during quotacheck Source kernel commit: 57ab324553bbfedc8e732eb570edfac0f5cfe57e During quotacheck we send in the quota type, so verify that as well. Signed-off-by: Eric Sandeen Reviewed-by: Christoph Hellwig Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong Signed-off-by: Eric Sandeen --- diff --git a/libxfs/xfs_dquot_buf.c b/libxfs/xfs_dquot_buf.c index 1486b2bd9..50da0191d 100644 --- a/libxfs/xfs_dquot_buf.c +++ b/libxfs/xfs_dquot_buf.c @@ -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)