diff mbox

xfs: fix refactor quota limits initialization

Message ID 20180516010108.GA23858@magnolia (mailing list archive)
State New, archived
Headers show

Commit Message

Darrick J. Wong May 16, 2018, 1:01 a.m. UTC
dquot warning fields are be16, not be32.  Fix this mistake.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/xfs_qm.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Dave Chinner May 16, 2018, 1:08 a.m. UTC | #1
On Tue, May 15, 2018 at 06:01:08PM -0700, Darrick J. Wong wrote:
> dquot warning fields are be16, not be32.  Fix this mistake.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  fs/xfs/xfs_qm.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
> index 913d46d01bfc..c3e014bfc848 100644
> --- a/fs/xfs/xfs_qm.c
> +++ b/fs/xfs/xfs_qm.c
> @@ -636,11 +636,11 @@ xfs_qm_init_timelimits(
>  	if (ddqp->d_rtbtimer)
>  		qinf->qi_rtbtimelimit = be32_to_cpu(ddqp->d_rtbtimer);
>  	if (ddqp->d_bwarns)
> -		qinf->qi_bwarnlimit = be32_to_cpu(ddqp->d_bwarns);
> +		qinf->qi_bwarnlimit = be16_to_cpu(ddqp->d_bwarns);
>  	if (ddqp->d_iwarns)
> -		qinf->qi_iwarnlimit = be32_to_cpu(ddqp->d_iwarns);
> +		qinf->qi_iwarnlimit = be16_to_cpu(ddqp->d_iwarns);
>  	if (ddqp->d_rtbwarns)
> -		qinf->qi_rtbwarnlimit = be32_to_cpu(ddqp->d_rtbwarns);
> +		qinf->qi_rtbwarnlimit = be16_to_cpu(ddqp->d_rtbwarns);

Looks good.

Reviewed-by: Dave Chinner <dchinner@redhat.com>

FWIW, this points out that we need to start de-typedef-ing the quota
code as well clean it up. We've been pretty good about this in the
rest of the XFS code over the years, perhaps it's time for the quota
code to catch up?

Cheers,

Dave.
diff mbox

Patch

diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
index 913d46d01bfc..c3e014bfc848 100644
--- a/fs/xfs/xfs_qm.c
+++ b/fs/xfs/xfs_qm.c
@@ -636,11 +636,11 @@  xfs_qm_init_timelimits(
 	if (ddqp->d_rtbtimer)
 		qinf->qi_rtbtimelimit = be32_to_cpu(ddqp->d_rtbtimer);
 	if (ddqp->d_bwarns)
-		qinf->qi_bwarnlimit = be32_to_cpu(ddqp->d_bwarns);
+		qinf->qi_bwarnlimit = be16_to_cpu(ddqp->d_bwarns);
 	if (ddqp->d_iwarns)
-		qinf->qi_iwarnlimit = be32_to_cpu(ddqp->d_iwarns);
+		qinf->qi_iwarnlimit = be16_to_cpu(ddqp->d_iwarns);
 	if (ddqp->d_rtbwarns)
-		qinf->qi_rtbwarnlimit = be32_to_cpu(ddqp->d_rtbwarns);
+		qinf->qi_rtbwarnlimit = be16_to_cpu(ddqp->d_rtbwarns);
 
 	xfs_qm_dqdestroy(dqp);
 }