diff options
| author | vmallika <vmallika@redhat.com> | 2015-07-07 16:56:12 +0530 |
|---|---|---|
| committer | Raghavendra G <rgowdapp@redhat.com> | 2015-07-21 03:20:18 -0700 |
| commit | cb8f419fd8e36b6eb5a48db5694e475cb79553c9 (patch) | |
| tree | 1e8ea9e9bc7cdf7452fbecfe9d1f3f73e8cb2e9a /xlators/features/quota/src/quota.h | |
| parent | c5ba8c0c02309a05e2a4fe7e59990144fcccb6dc (diff) | |
quota: Fix crash in quota enforcer
This is a backport of http://review.gluster.org/11510
With multiple hardlinks check_quota_limit is invoked for each parent
each of this check_limit can invoke validation
this can cause frame->local to get corrupted during validation.
Testcase tests/bugs/quota/bug-1235182.t fails spuriously with
this problem
> Change-Id: I53adc54b431fb5f43e67a94248102ddaf0d7978f
> BUG: 1238747
> Signed-off-by: vmallika <vmallika@redhat.com>
> Reviewed-on: http://review.gluster.org/11510
> Tested-by: NetBSD Build System <jenkins@build.gluster.org>
> Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Change-Id: Ia7f57276db034e0fc6cd84dbf618ce0d4fae4321
BUG: 1242898
Signed-off-by: vmallika <vmallika@redhat.com>
Reviewed-on: http://review.gluster.org/11662
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators/features/quota/src/quota.h')
| -rw-r--r-- | xlators/features/quota/src/quota.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/xlators/features/quota/src/quota.h b/xlators/features/quota/src/quota.h index 56876f05c8f..0f8cecd8a59 100644 --- a/xlators/features/quota/src/quota.h +++ b/xlators/features/quota/src/quota.h @@ -102,7 +102,7 @@ STACK_WIND_TAIL (frame, params); \ \ if (_local) \ - quota_local_cleanup (_this, _local); \ + quota_local_cleanup (_local); \ } while (0) #define QUOTA_STACK_UNWIND(fop, frame, params...) \ @@ -115,7 +115,7 @@ frame->local = NULL; \ } \ STACK_UNWIND_STRICT (fop, frame, params); \ - quota_local_cleanup (_this, _local); \ + quota_local_cleanup (_local); \ } while (0) #define QUOTA_FREE_CONTRIBUTION_NODE(_contribution) \ @@ -193,7 +193,6 @@ typedef void struct quota_local { gf_lock_t lock; - uint32_t validate_count; uint32_t link_count; loc_t loc; loc_t oldloc; @@ -219,6 +218,7 @@ struct quota_local { dict_t *validate_xdata; int32_t quotad_conn_retry; xlator_t *this; + call_frame_t *par_frame; }; typedef struct quota_local quota_local_t; @@ -266,6 +266,9 @@ int32_t quota_check_limit (call_frame_t *frame, inode_t *inode, xlator_t *this, char *name, uuid_t par); +inode_t * +do_quota_check_limit (call_frame_t *frame, inode_t *inode, xlator_t *this, + quota_dentry_t *dentry); int quota_fill_inodectx (xlator_t *this, inode_t *inode, dict_t *dict, loc_t *loc, struct iatt *buf, int32_t *op_errno); |
