a3470f
From c2b215a14a38d3587a5a3ea4efab384033019ed5 Mon Sep 17 00:00:00 2001
a3470f
From: N Balachandran <nbalacha@redhat.com>
a3470f
Date: Wed, 18 Jul 2018 22:09:19 +0530
a3470f
Subject: [PATCH 329/333] cluster/dht: Set loc->gfid before healing attr
a3470f
a3470f
AFR takes inodelks when setting attrs. The loc->gfid
a3470f
and loc->inode->gfid were both null when dht_dir_attr_heal
a3470f
was called during a fresh lookup of an existing directory.
a3470f
As the gfid is null, client_pre_inodelk asserts in the gfid
a3470f
check.
a3470f
We now set the loc->gfid before calling dht_dir_attr_heal.
a3470f
a3470f
upstream patch: https://review.gluster.org/#/c/20530/
a3470f
a3470f
> Change-Id: I457f5a73fd301d97a03ca032587e73d4803298ac
a3470f
> fixes: bz#1602866
a3470f
> Signed-off-by: N Balachandran <nbalacha@redhat.com>
a3470f
a3470f
Change-Id: Ie5e30d4ab3b824eaad333da22465d6672c75a2f6
a3470f
BUG: 1601331
a3470f
Signed-off-by: N Balachandran <nbalacha@redhat.com>
a3470f
Reviewed-on: https://code.engineering.redhat.com/gerrit/144386
a3470f
Reviewed-by: Mohit Agrawal <moagrawa@redhat.com>
a3470f
Tested-by: RHGS Build Bot <nigelb@redhat.com>
a3470f
---
a3470f
 xlators/cluster/dht/src/dht-common.c | 3 ++-
a3470f
 1 file changed, 2 insertions(+), 1 deletion(-)
a3470f
a3470f
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
a3470f
index 2207708..0984f8f 100644
a3470f
--- a/xlators/cluster/dht/src/dht-common.c
a3470f
+++ b/xlators/cluster/dht/src/dht-common.c
a3470f
@@ -1518,7 +1518,6 @@ unlock:
a3470f
                 if (local->need_attrheal) {
a3470f
                         local->need_attrheal = 0;
a3470f
                         if (!__is_root_gfid (inode->gfid)) {
a3470f
-                                gf_uuid_copy (local->gfid, local->mds_stbuf.ia_gfid);
a3470f
                                 local->stbuf.ia_gid = local->mds_stbuf.ia_gid;
a3470f
                                 local->stbuf.ia_uid = local->mds_stbuf.ia_uid;
a3470f
                                 local->stbuf.ia_prot = local->mds_stbuf.ia_prot;
a3470f
@@ -1532,6 +1531,8 @@ unlock:
a3470f
                                         goto skip_attr_heal;
a3470f
                                 }
a3470f
                                 copy_local->stbuf = local->stbuf;
a3470f
+                                gf_uuid_copy (copy_local->loc.gfid,
a3470f
+                                              local->stbuf.ia_gfid);
a3470f
                                 copy_local->mds_stbuf = local->mds_stbuf;
a3470f
                                 copy_local->mds_subvol = local->mds_subvol;
a3470f
                                 copy->local = copy_local;
a3470f
-- 
a3470f
1.8.3.1
a3470f