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>
Fri, 16 Mar 2012 01:46:04 +0000 (21:46 -0400)
commitc73f100ffce3bd596be922d2bf071eeeab32ba38
tree7f8aadde04590dbd057e4412980046893f2fa3da
parent91be8aaf0f711759f9aafd4e3ce6eb764f910b5a
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