svn commit: r260827 - stable/10/sys/ufs/ufs
Kirk McKusick
mckusick at FreeBSD.org
Fri Jan 17 16:17:08 UTC 2014
Author: mckusick
Date: Fri Jan 17 16:17:07 2014
New Revision: 260827
URL: http://svnweb.freebsd.org/changeset/base/260827
Log:
MFC of 260079:
Properly handle unsigned comparison.
Modified:
stable/10/sys/ufs/ufs/ufs_quota.c
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/ufs/ufs/ufs_quota.c
==============================================================================
--- stable/10/sys/ufs/ufs/ufs_quota.c Fri Jan 17 15:01:50 2014 (r260826)
+++ stable/10/sys/ufs/ufs/ufs_quota.c Fri Jan 17 16:17:07 2014 (r260827)
@@ -307,7 +307,6 @@ int
chkiq(struct inode *ip, int change, struct ucred *cred, int flags)
{
struct dquot *dq;
- ino_t ncurinodes;
int i, error, warn, do_check;
#ifdef DIAGNOSTIC
@@ -322,10 +321,8 @@ chkiq(struct inode *ip, int change, stru
continue;
DQI_LOCK(dq);
DQI_WAIT(dq, PINOD+1, "chkiq1");
- ncurinodes = dq->dq_curinodes + change;
- /* XXX: ncurinodes is unsigned */
- if (dq->dq_curinodes != 0 && ncurinodes >= 0)
- dq->dq_curinodes = ncurinodes;
+ if (dq->dq_curinodes >= -change)
+ dq->dq_curinodes += change;
else
dq->dq_curinodes = 0;
dq->dq_flags &= ~DQ_INODS;
@@ -359,11 +356,8 @@ chkiq(struct inode *ip, int change, stru
continue;
DQI_LOCK(dq);
DQI_WAIT(dq, PINOD+1, "chkiq3");
- ncurinodes = dq->dq_curinodes - change;
- /* XXX: ncurinodes is unsigned */
- if (dq->dq_curinodes != 0 &&
- ncurinodes >= 0)
- dq->dq_curinodes = ncurinodes;
+ if (dq->dq_curinodes >= change)
+ dq->dq_curinodes -= change;
else
dq->dq_curinodes = 0;
dq->dq_flags &= ~DQ_INODS;
More information about the svn-src-stable-10
mailing list