Whamcloud - gitweb
LU-882 quota: Quota code compares unsigned < 0
authorNiu Yawei <niu@whamcloud.com>
Tue, 29 Nov 2011 04:59:38 +0000 (20:59 -0800)
committerJohann Lombardi <johann@whamcloud.com>
Wed, 4 Jan 2012 17:10:17 +0000 (12:10 -0500)
commita1b7b5520612943178570237b5b0462b0395d726
treeb7c87a8d680a74775b8b3e29766ae962601dfe6f
parentcdf199679c1814902f181bec81a5bfe9902b8217
LU-882 quota: Quota code compares unsigned < 0

Port from b23858.

In check_cur_qunit(), it checks "if (limit + record < 0)", however,
the limit is unsigned, so this check will be always false, and when
limit is smaller than -record, following "limit += record" will make
limit a unreasonable large value.

This patch also fixed a similar defect in dqacq_handler().

Signed-off-by: Vladimir Saveliev <vladimir.saveliev@oracle.com>
Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: Ibe1d643ea3b310b2e55c05a8c200ba5e0137ee27
Reviewed-on: http://review.whamcloud.com/1750
Tested-by: Hudson
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
lustre/quota/quota_context.c
lustre/quota/quota_interface.c
lustre/quota/quota_master.c