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)
committerAndreas Dilger <adilger@whamcloud.com>
Fri, 22 Jun 2012 15:56:45 +0000 (11:56 -0400)
commitb916544be6a57296aa2c4e55c02c45ff7495a77c
treed78fd4efbb3d0284225cf594e34b0b8a72c07c05
parentbc4c89e0608893ec8fe15012f9477de173ad41d3
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