From 730542a5d8c3d9be2202d3c26e9ff5c9404e3fe2 Mon Sep 17 00:00:00 2001 From: N Balachandran Date: Wed, 18 Jul 2018 22:09:19 +0530 Subject: 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 --- xlators/cluster/dht/src/dht-common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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; -- cgit