quota: limit xattr for subdir not healed on newly added bricks
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 <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/13100 Reviewed-by: Susant Palai <spalai@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org>
This commit is contained in:
parent
4c1b667201
commit
72e7366131
@ -646,6 +646,7 @@ dht_selfheal_dir_xattr_persubvol (call_frame_t *frame, loc_t *loc,
|
||||
{
|
||||
xlator_t *subvol = NULL;
|
||||
dict_t *xattr = NULL;
|
||||
dict_t *xdata = NULL;
|
||||
int ret = 0;
|
||||
xlator_t *this = NULL;
|
||||
int32_t *disk_layout = NULL;
|
||||
@ -674,6 +675,19 @@ dht_selfheal_dir_xattr_persubvol (call_frame_t *frame, loc_t *loc,
|
||||
goto err;
|
||||
}
|
||||
|
||||
xdata = dict_new ();
|
||||
if (!xdata)
|
||||
goto err;
|
||||
|
||||
ret = dict_set_str (xdata, GLUSTERFS_INTERNAL_FOP_KEY, "yes");
|
||||
if (ret < 0) {
|
||||
gf_msg (this->name, GF_LOG_WARNING, 0, DHT_MSG_DICT_SET_FAILED,
|
||||
"%s: Failed to set dictionary value: key = %s,"
|
||||
" gfid = %s", loc->path,
|
||||
GLUSTERFS_INTERNAL_FOP_KEY, gfid);
|
||||
goto err;
|
||||
}
|
||||
|
||||
gf_uuid_unparse(loc->inode->gfid, gfid);
|
||||
|
||||
ret = dht_disk_layout_extract (this, layout, i, &disk_layout);
|
||||
@ -723,9 +737,10 @@ dht_selfheal_dir_xattr_persubvol (call_frame_t *frame, loc_t *loc,
|
||||
|
||||
STACK_WIND (frame, dht_selfheal_dir_xattr_cbk,
|
||||
subvol, subvol->fops->setxattr,
|
||||
loc, xattr, 0, NULL);
|
||||
loc, xattr, 0, xdata);
|
||||
|
||||
dict_unref (xattr);
|
||||
dict_unref (xdata);
|
||||
|
||||
return 0;
|
||||
|
||||
@ -733,6 +748,9 @@ err:
|
||||
if (xattr)
|
||||
dict_destroy (xattr);
|
||||
|
||||
if (xdata)
|
||||
dict_unref (xdata);
|
||||
|
||||
GF_FREE (disk_layout);
|
||||
|
||||
dht_selfheal_dir_xattr_cbk (frame, subvol, frame->this,
|
||||
|
@ -3977,14 +3977,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;
|
||||
|
||||
@ -3994,7 +3995,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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user