diff options
author | Raghavendra G <raghavendra@gluster.com> | 2011-04-10 10:55:08 +0000 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-04-10 21:22:14 -0700 |
commit | ef19a8ba4c0628566c01ebd247869797a7ba5dde (patch) | |
tree | 836f730988be05fea4447bbdf839c95a40bc1921 /xlators/features/quota/src/quota.h | |
parent | 3ea5bff8dfebbf325daccf81511c5d4534b2ca86 (diff) |
features/quota: Fix race-condition while resuming stub.
- call-stub is resumed in fops calling quota_check_limit and quota_check_limit
when validate_count is zero, indicating no pending validates. During
validates, validate_count was decremented in quota_validate_cbk, but check
for validate_count being zero was done in quota_check_limit (which is
called by quota_validate_cbk). Hence there is a time window b/w decrementing
validate_count in quota_validate_cbk and checking whether
validate_count is zero in quota_check_limit, during which if the
control is passed to code in fop checking for validate_count being zero,
same stub will be resumed twice - once in fop and once in quota_check_limit.
Signed-off-by: Raghavendra G <raghavendra@gluster.com>
Signed-off-by: Anand Avati <avati@gluster.com>
BUG: 2686 ([glusterfs-3.2.0qa8]: nfs server crashed)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2686
Diffstat (limited to 'xlators/features/quota/src/quota.h')
-rw-r--r-- | xlators/features/quota/src/quota.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/xlators/features/quota/src/quota.h b/xlators/features/quota/src/quota.h index d53894ab48f..fce2e54bd60 100644 --- a/xlators/features/quota/src/quota.h +++ b/xlators/features/quota/src/quota.h @@ -134,7 +134,6 @@ struct quota_inode_ctx { int64_t size; int64_t limit; struct iatt buf; - char just_validated; struct list_head parents; struct timeval tv; gf_lock_t lock; @@ -154,6 +153,7 @@ struct quota_local { int32_t op_errno; int64_t size; int64_t limit; + char just_validated; inode_t *inode; call_stub_t *stub; }; |