Whamcloud - gitweb
LU-882 quota: Quota code compares unsigned < 0
authorNiu Yawei <niu@whamcloud.com>
Mon, 19 Dec 2011 10:01:36 +0000 (02:01 -0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 4 Jan 2012 14:10:54 +0000 (09:10 -0500)
commit82b79742c8e86650d1441828ef727c21e88faff8
tree72fa81a168ec2bb3e8250b3fdc7efdeed6ce984c
parentf6d84d790c63bc200f8f25ac40b3f72321f62190
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: Iea02143dae5542f1a9f9cc823a684a18031b8a03
Reviewed-on: http://review.whamcloud.com/1889
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/quota/quota_context.c
lustre/quota/quota_interface.c
lustre/quota/quota_master.c