summaryrefslogtreecommitdiffstats
path: root/xlators/cluster
diff options
context:
space:
mode:
authorvmallika <vmallika@redhat.com>2015-12-28 17:33:26 +0530
committerRaghavendra G <rgowdapp@redhat.com>2016-01-25 22:26:29 -0800
commitd93ed64f65f7680cb25068cfae1844de44ca39b7 (patch)
tree408ab743d137f5611ab46e3f269bcd6ef9b7de81 /xlators/cluster
parent195548f55b09bf71db92929b7b734407b863093c (diff)
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 <vmallika@redhat.com> Change-Id: I30345e919bc9ae882fd0e159c7b03ffc50ed5ef7 BUG: 1294608 Signed-off-by: vmallika <vmallika@redhat.com> Reviewed-on: http://review.gluster.org/13108 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.com> CentOS-regression: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/cluster')
-rw-r--r--xlators/cluster/dht/src/dht-selfheal.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/xlators/cluster/dht/src/dht-selfheal.c b/xlators/cluster/dht/src/dht-selfheal.c
index d7d68ab621e..cce963a18d6 100644
--- a/xlators/cluster/dht/src/dht-selfheal.c
+++ b/xlators/cluster/dht/src/dht-selfheal.c
@@ -651,6 +651,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;
@@ -679,6 +680,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);
@@ -727,9 +741,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;
@@ -737,6 +752,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,