From d93ed64f65f7680cb25068cfae1844de44ca39b7 Mon Sep 17 00:00:00 2001 From: vmallika Date: Mon, 28 Dec 2015 17:33:26 +0530 Subject: quota: limit xattr for subdir not healed on newly added bricks This is a backport of http://review.gluster.org/#/c/13100/ DHT after creating missing directory, tries to heal the xattrs. This xattrs operation fails as INTERNAL FOP key was not set > Change-Id: I819d373cf7073da014143d9ada908228ddcd140c > BUG: 1294479 > Signed-off-by: vmallika Change-Id: I30345e919bc9ae882fd0e159c7b03ffc50ed5ef7 BUG: 1294608 Signed-off-by: vmallika Reviewed-on: http://review.gluster.org/13108 Tested-by: NetBSD Build System Reviewed-by: Pranith Kumar Karampuri Tested-by: Pranith Kumar Karampuri Reviewed-by: Raghavendra G Tested-by: Raghavendra G NetBSD-regression: NetBSD Build System Smoke: Gluster Build System CentOS-regression: Gluster Build System --- xlators/features/quota/src/quota.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'xlators/features/quota') diff --git a/xlators/features/quota/src/quota.c b/xlators/features/quota/src/quota.c index b65956b2660..8b983715cdf 100644 --- a/xlators/features/quota/src/quota.c +++ b/xlators/features/quota/src/quota.c @@ -3979,14 +3979,15 @@ int quota_setxattr (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *dict, int flags, dict_t *xdata) { - quota_priv_t *priv = NULL; + quota_priv_t *priv = NULL; int op_errno = EINVAL; int op_ret = -1; int64_t hard_lim = -1; int64_t soft_lim = -1; int64_t object_hard_limit = -1; int64_t object_soft_limit = -1; - quota_local_t *local = NULL; + quota_local_t *local = NULL; + gf_boolean_t internal_fop = _gf_false; priv = this->private; @@ -3996,7 +3997,10 @@ quota_setxattr (call_frame_t *frame, xlator_t *this, VALIDATE_OR_GOTO (this, err); VALIDATE_OR_GOTO (loc, err); - if (frame->root->pid >= 0) { + if (xdata && dict_get (xdata, GLUSTERFS_INTERNAL_FOP_KEY)) + internal_fop = _gf_true; + + if (frame->root->pid >= 0 && internal_fop == _gf_false) { GF_IF_INTERNAL_XATTR_GOTO ("trusted.glusterfs.quota*", dict, op_errno, err); GF_IF_INTERNAL_XATTR_GOTO ("trusted.pgfid*", dict, op_errno, -- cgit