Skip to contentSkip to conversation

xfs: fix refactor quota limits initialization

PATCH In review Darrick J. Wong 2 participants 2 messages May 16, 2018 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs: fix refactor quota limits initialization

dquot warning fields are be16, not be32. Fix this mistake.

---
 fs/xfs/xfs_qm.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
fs/xfs/xfs_qm.c +3 -3
index 913d46d01bfc..c3e014bfc848 100644
@@ -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);
 }
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Darrick J. Wong

dquot warning fields are be16, not be32. Fix this mistake.

---
 fs/xfs/xfs_qm.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
fs/xfs/xfs_qm.c +0 -0
index 913d46d01bfc..c3e014bfc848 100644
@@ -636,11 +636,11 @@ xfs_qm_init_timelimits(
 	if (ddqp->d_rtbtimer)

fs/xfs/xfs_qm.c xfs_qm_init_timelimits( · line 643

Quoted 10 lines
fs/xfs/xfs_qm.c +3 -3
 		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.

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.

Signature · 2 lines
Dave Chinner
[email protected]