summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorN Balachandran <nbalacha@redhat.com>2018-07-18 22:09:19 +0530
committerN Balachandran <nbalacha@redhat.com>2018-07-18 22:23:07 +0530
commit730542a5d8c3d9be2202d3c26e9ff5c9404e3fe2 (patch)
treeffc15af934d9752005c864a5f080f44c83552dca
parentec0d7d77de3e4bd485a4fa2e53c9137e25c71ce7 (diff)
cluster/dht: Set loc->gfid before healing attr
AFR takes inodelks when setting attrs. The loc->gfid and loc->inode->gfid were both null when dht_dir_attr_heal was called during a fresh lookup of an existing directory. As the gfid is null, client_pre_inodelk asserts in the gfid check. We now set the loc->gfid before calling dht_dir_attr_heal. Change-Id: I457f5a73fd301d97a03ca032587e73d4803298ac fixes: bz#1602866 Signed-off-by: N Balachandran <nbalacha@redhat.com>
-rw-r--r--xlators/cluster/dht/src/dht-common.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index d4530829625..45218d23482 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -1529,7 +1529,6 @@ unlock:
if (local->need_attrheal) {
local->need_attrheal = 0;
if (!__is_root_gfid (inode->gfid)) {
- gf_uuid_copy (local->gfid, local->mds_stbuf.ia_gfid);
local->stbuf.ia_gid = local->mds_stbuf.ia_gid;
local->stbuf.ia_uid = local->mds_stbuf.ia_uid;
local->stbuf.ia_prot = local->mds_stbuf.ia_prot;
@@ -1543,6 +1542,8 @@ unlock:
goto skip_attr_heal;
}
copy_local->stbuf = local->stbuf;
+ gf_uuid_copy (copy_local->loc.gfid,
+ local->stbuf.ia_gfid);
copy_local->mds_stbuf = local->mds_stbuf;
copy_local->mds_subvol = local->mds_subvol;
copy->local = copy_local;