History

Merge branch 'for-linus' of git://oss.sgi.com/xfs/xfs

A fix from Jesper Juhl removes an assignment in an ASSERT when a compare is intended. Two fixes from Mitsuo Hayasaka address off-by-ones in XFS quota enforcement. * 'for-linus' of git://oss.sgi.com/xfs/xfs: xfs: make inode quota check more general xfs: change available ranges of softlimit and hardlimit in quota check XFS: xfs_trans_add_item() - don't assign in ASSERT() when compare is intended

Linus Torvalds committed 14 years ago

Commit bb4c7e92 parents 73c8e67 c922bbc5 files · +25 −23Browse files

Unified · Split

5 files
  1. fs/xfs/xfs_dquot.c +12 −12
  2. fs/xfs/xfs_log_recover.c +3 −3
  3. fs/xfs/xfs_qm_syscalls.c +2 −2
  4. fs/xfs/xfs_trans.c +2 −2
  5. fs/xfs/xfs_trans_dquot.c +6 −4
fs/xfs/xfs_dquot.c+12−12
@@ -139,10 +139,10 @@ xfs_qm_adjust_dqtimers( · 138 unmodified lines
139139
140140 if (!d->d_btimer) {
141141 if ((d->d_blk_softlimit &&
142− (be64_to_cpu(d->d_bcount) >=
142+ (be64_to_cpu(d->d_bcount) >
143143 be64_to_cpu(d->d_blk_softlimit))) ||
144144 (d->d_blk_hardlimit &&
145− (be64_to_cpu(d->d_bcount) >=
145+ (be64_to_cpu(d->d_bcount) >
146146 be64_to_cpu(d->d_blk_hardlimit)))) {
147147 d->d_btimer = cpu_to_be32(get_seconds() +
148148 mp->m_quotainfo->qi_btimelimit);
@@ -151,10 +151,10 @@ xfs_qm_adjust_dqtimers( · 2 unmodified lines
151151 }
152152 } else {
153153 if ((!d->d_blk_softlimit ||
154− (be64_to_cpu(d->d_bcount) <
154+ (be64_to_cpu(d->d_bcount) <=
155155 be64_to_cpu(d->d_blk_softlimit))) &&
156156 (!d->d_blk_hardlimit ||
157− (be64_to_cpu(d->d_bcount) <
157+ (be64_to_cpu(d->d_bcount) <=
158158 be64_to_cpu(d->d_blk_hardlimit)))) {
159159 d->d_btimer = 0;
160160 }
@@ -162,10 +162,10 @@ xfs_qm_adjust_dqtimers( · 1 unmodified line
162162
163163 if (!d->d_itimer) {
164164 if ((d->d_ino_softlimit &&
165− (be64_to_cpu(d->d_icount) >=
165+ (be64_to_cpu(d->d_icount) >
166166 be64_to_cpu(d->d_ino_softlimit))) ||
167167 (d->d_ino_hardlimit &&
168− (be64_to_cpu(d->d_icount) >=
168+ (be64_to_cpu(d->d_icount) >
169169 be64_to_cpu(d->d_ino_hardlimit)))) {
170170 d->d_itimer = cpu_to_be32(get_seconds() +
171171 mp->m_quotainfo->qi_itimelimit);
@@ -174,10 +174,10 @@ xfs_qm_adjust_dqtimers( · 2 unmodified lines
174174 }
175175 } else {
176176 if ((!d->d_ino_softlimit ||
177− (be64_to_cpu(d->d_icount) <
177+ (be64_to_cpu(d->d_icount) <=
178178 be64_to_cpu(d->d_ino_softlimit))) &&
179179 (!d->d_ino_hardlimit ||
180− (be64_to_cpu(d->d_icount) <
180+ (be64_to_cpu(d->d_icount) <=
181181 be64_to_cpu(d->d_ino_hardlimit)))) {
182182 d->d_itimer = 0;
183183 }
@@ -185,10 +185,10 @@ xfs_qm_adjust_dqtimers( · 1 unmodified line
185185
186186 if (!d->d_rtbtimer) {
187187 if ((d->d_rtb_softlimit &&
188− (be64_to_cpu(d->d_rtbcount) >=
188+ (be64_to_cpu(d->d_rtbcount) >
189189 be64_to_cpu(d->d_rtb_softlimit))) ||
190190 (d->d_rtb_hardlimit &&
191− (be64_to_cpu(d->d_rtbcount) >=
191+ (be64_to_cpu(d->d_rtbcount) >
192192 be64_to_cpu(d->d_rtb_hardlimit)))) {
193193 d->d_rtbtimer = cpu_to_be32(get_seconds() +
194194 mp->m_quotainfo->qi_rtbtimelimit);
@@ -197,10 +197,10 @@ xfs_qm_adjust_dqtimers( · 2 unmodified lines
197197 }
198198 } else {
199199 if ((!d->d_rtb_softlimit ||
200− (be64_to_cpu(d->d_rtbcount) <
200+ (be64_to_cpu(d->d_rtbcount) <=
201201 be64_to_cpu(d->d_rtb_softlimit))) &&
202202 (!d->d_rtb_hardlimit ||
203− (be64_to_cpu(d->d_rtbcount) <
203+ (be64_to_cpu(d->d_rtbcount) <=
204204 be64_to_cpu(d->d_rtb_hardlimit)))) {
205205 d->d_rtbtimer = 0;
206206 }
fs/xfs/xfs_log_recover.c+3−3
@@ -1981,7 +1981,7 @@ xfs_qm_dqcheck( · 1980 unmodified lines
19811981
19821982 if (!errs && ddq->d_id) {
19831983 if (ddq->d_blk_softlimit &&
1984− be64_to_cpu(ddq->d_bcount) >=
1984+ be64_to_cpu(ddq->d_bcount) >
19851985 be64_to_cpu(ddq->d_blk_softlimit)) {
19861986 if (!ddq->d_btimer) {
19871987 if (flags & XFS_QMOPT_DOWARN)
@@ -1992,7 +1992,7 @@ xfs_qm_dqcheck( · 4 unmodified lines
19921992 }
19931993 }
19941994 if (ddq->d_ino_softlimit &&
1995− be64_to_cpu(ddq->d_icount) >=
1995+ be64_to_cpu(ddq->d_icount) >
19961996 be64_to_cpu(ddq->d_ino_softlimit)) {
19971997 if (!ddq->d_itimer) {
19981998 if (flags & XFS_QMOPT_DOWARN)
@@ -2003,7 +2003,7 @@ xfs_qm_dqcheck( · 4 unmodified lines
20032003 }
20042004 }
20052005 if (ddq->d_rtb_softlimit &&
2006− be64_to_cpu(ddq->d_rtbcount) >=
2006+ be64_to_cpu(ddq->d_rtbcount) >
20072007 be64_to_cpu(ddq->d_rtb_softlimit)) {
20082008 if (!ddq->d_rtbtimer) {
20092009 if (flags & XFS_QMOPT_DOWARN)
fs/xfs/xfs_qm_syscalls.c+2−2
@@ -813,11 +813,11 @@ xfs_qm_export_dquot( · 812 unmodified lines
813813 (XFS_IS_OQUOTA_ENFORCED(mp) &&
814814 (dst->d_flags & (FS_PROJ_QUOTA | FS_GROUP_QUOTA)))) &&
815815 dst->d_id != 0) {
816− if (((int) dst->d_bcount >= (int) dst->d_blk_softlimit) &&
816+ if (((int) dst->d_bcount > (int) dst->d_blk_softlimit) &&
817817 (dst->d_blk_softlimit > 0)) {
818818 ASSERT(dst->d_btimer != 0);
819819 }
820− if (((int) dst->d_icount >= (int) dst->d_ino_softlimit) &&
820+ if (((int) dst->d_icount > (int) dst->d_ino_softlimit) &&
821821 (dst->d_ino_softlimit > 0)) {
822822 ASSERT(dst->d_itimer != 0);
823823 }
fs/xfs/xfs_trans.c+2−2
@@ -1151,8 +1151,8 @@ xfs_trans_add_item( · 1150 unmodified lines
11511151 {
11521152 struct xfs_log_item_desc *lidp;
11531153
1154− ASSERT(lip->li_mountp = tp->t_mountp);
1155− ASSERT(lip->li_ailp = tp->t_mountp->m_ail);
1154+ ASSERT(lip->li_mountp == tp->t_mountp);
1155+ ASSERT(lip->li_ailp == tp->t_mountp->m_ail);
11561156
11571157 lidp = kmem_zone_zalloc(xfs_log_item_desc_zone, KM_SLEEP | KM_NOFS);
11581158
fs/xfs/xfs_trans_dquot.c+6−4
@@ -649,12 +649,12 @@ xfs_trans_dqresv( · 648 unmodified lines
649649 * nblks.
650650 */
651651 if (hardlimit > 0ULL &&
652− hardlimit <= nblks + *resbcountp) {
652+ hardlimit < nblks + *resbcountp) {
653653 xfs_quota_warn(mp, dqp, QUOTA_NL_BHARDWARN);
654654 goto error_return;
655655 }
656656 if (softlimit > 0ULL &&
657− softlimit <= nblks + *resbcountp) {
657+ softlimit < nblks + *resbcountp) {
658658 if ((timer != 0 && get_seconds() > timer) ||
659659 (warns != 0 && warns >= warnlimit)) {
660660 xfs_quota_warn(mp, dqp,
@@ -677,11 +677,13 @@ xfs_trans_dqresv( · 16 unmodified lines
677677 if (!softlimit)
678678 softlimit = q->qi_isoftlimit;
679679
680− if (hardlimit > 0ULL && count >= hardlimit) {
680+ if (hardlimit > 0ULL &&
681+ hardlimit < ninos + count) {
681682 xfs_quota_warn(mp, dqp, QUOTA_NL_IHARDWARN);
682683 goto error_return;
683684 }
684− if (softlimit > 0ULL && count >= softlimit) {
685+ if (softlimit > 0ULL &&
686+ softlimit < ninos + count) {
685687 if ((timer != 0 && get_seconds() > timer) ||
686688 (warns != 0 && warns >= warnlimit)) {
687689 xfs_quota_warn(mp, dqp,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t