summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2016-02-27 23:08:06 +0530
committerKaushal M <kaushal@redhat.com>2016-04-12 04:57:36 -0700
commite1396f078aec7dee9007f35c074a90391bdaf64f (patch)
tree0e621abe9b4a8fd0f51c585a3e13704b394ff42b /xlators/cluster/afr
parentc9c2c08d34003f49bc3a509757a135665fb20518 (diff)
cluster/afr: Don't delete gfid-req from lookup request
Problem: Afr does dict_ref of the xattr_req that comes to it and deletes "gfid-req" key. Dht uses same dict to send lookup to other subvolumes. So in case of directories and more than 1 dht subvolumes, second subvolume till the last subvolume won't get a lookup request with "gfid-req". So gfid reset never happens on the directories in distributed replicate subvolume for 2nd till last subvolumes. Fix: Make a copy of lookup xattr request. Also fixed replies_wipe possibly resetting gfid to NULL gfid >BUG: 1312816 >Change-Id: Ic16260e5a4664837d069c1dc05b9e96ca05bda88 >Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> >Reviewed-on: http://review.gluster.org/13545 >Smoke: Gluster Build System <jenkins@build.gluster.com> >NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> >CentOS-regression: Gluster Build System <jenkins@build.gluster.com> >Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com> >(cherry picked from commit 9b022c3a3f2f774904b5b458ae065425b46cc15d) Change-Id: Ia68193b559ec1dfd841cc5a22ef1fa801b866200 BUG: 1313693 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/13574 CentOS-regression: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'xlators/cluster/afr')
-rw-r--r--xlators/cluster/afr/src/afr-common.c10
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-name.c4
2 files changed, 9 insertions, 5 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index 1c786d59d5b..dcbab2347b6 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -2548,12 +2548,16 @@ afr_lookup (call_frame_t *frame, xlator_t *this, loc_t *loc, dict_t *xattr_req)
if (xattr_req) {
/* If xattr_req was null, afr_lookup_xattr_req_prepare() will
allocate one for us */
- ret = dict_get_ptr (xattr_req, "gfid-req", &gfid_req);
+ local->xattr_req = dict_copy_with_ref (xattr_req, NULL);
+ if (!local->xattr_req) {
+ op_errno = ENOMEM;
+ goto out;
+ }
+ ret = dict_get_ptr (local->xattr_req, "gfid-req", &gfid_req);
if (ret == 0) {
gf_uuid_copy (local->cont.lookup.gfid_req, gfid_req);
- dict_del (xattr_req, "gfid-req");
+ dict_del (local->xattr_req, "gfid-req");
}
- local->xattr_req = dict_ref (xattr_req);
}
afr_read_subvol_get (loc->parent, this, NULL, &event,
diff --git a/xlators/cluster/afr/src/afr-self-heal-name.c b/xlators/cluster/afr/src/afr-self-heal-name.c
index e32b81c46a4..6155298c7c6 100644
--- a/xlators/cluster/afr/src/afr-self-heal-name.c
+++ b/xlators/cluster/afr/src/afr-self-heal-name.c
@@ -88,11 +88,11 @@ __afr_selfheal_assign_gfid (xlator_t *this, inode_t *parent, uuid_t pargfid,
* __afr_selfheal_name_impunge().
*/
- afr_replies_wipe (replies, priv->child_count);
-
AFR_ONLIST (locked_on, new_frame, afr_selfheal_discover_cbk, lookup,
&loc, xdata);
+ afr_replies_wipe (replies, priv->child_count);
+
afr_replies_copy (replies, new_local->replies, priv->child_count);
out: