Whamcloud - gitweb
LU-1493 quota: extra release caused by race
authorNiu Yawei <niu@whamcloud.com>
Mon, 11 Jun 2012 10:55:32 +0000 (03:55 -0700)
committerOleg Drokin <green@whamcloud.com>
Wed, 25 Jul 2012 15:57:57 +0000 (11:57 -0400)
commit3848454a461d86a70e9535d3949a71a4c8fd9c9c
tree0d82454a4c9d5ef763a0d4057472cec9507e7615
parent0b41d429b31553ba3ee6545d4d470c0a155ff6b2
LU-1493 quota: extra release caused by race

There is a race between the check_cur_qunit() and the
dqacq_completion(): check_cur_qunit() read hardlimit
and calculate how much quota need be acquired/released
based on the hardlimit, however, the hardlimit can be
changed by the dqacq_completion() at anytime. So that
could result in extra quota acquire/release when there
is inflight dqacq.

In general, such extra dqacq dosen't bring fatal error,
unless an extra release is going to release more than
'hardlimit' quota.

To minimize the code changes (anyway, it'll be totally
rewritten in the new quota design), we just do one more
check here to avoid the extra release which could bring
fatal error. A better solution could be calculating the
qd_count here and removing the lqs_blk/ino_rec stuff.

Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: I0ad5ff0f32e39f32872c201ad1d545fbd9d1a57d
Reviewed-on: http://review.whamcloud.com/3074
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Johann Lombardi <johann@whamcloud.com>
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
lustre/quota/quota_context.c