summaryrefslogtreecommitdiffstats
path: root/xlators/features/quota/src/quota.h
diff options
context:
space:
mode:
authorvmallika <vmallika@redhat.com>2015-07-07 16:56:12 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-07-14 04:04:03 -0700
commit84ecb016cd2f1c8853c22e2df7d44d6c7bf32ed7 (patch)
treebac025174b974bd9e45e7e53975bc0d962dc7db4 /xlators/features/quota/src/quota.h
parente73db5e7fe1dba5a071725ef3480a4a1d5c7bef7 (diff)
quota: Fix crash in quota enforcer
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>
Diffstat (limited to 'xlators/features/quota/src/quota.h')
-rw-r--r--xlators/features/quota/src/quota.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/xlators/features/quota/src/quota.h b/xlators/features/quota/src/quota.h
index 0022089daa0..e7b109d9f15 100644
--- a/xlators/features/quota/src/quota.h
+++ b/xlators/features/quota/src/quota.h
@@ -97,7 +97,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...) \
@@ -110,7 +110,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) \
@@ -188,7 +188,6 @@ typedef void
struct quota_local {
gf_lock_t lock;
- uint32_t validate_count;
uint32_t link_count;
loc_t loc;
loc_t oldloc;
@@ -214,6 +213,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;
@@ -261,6 +261,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);