summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/dht-common.c
diff options
context:
space:
mode:
authorKinglong Mee <kinglongmee@gmail.com>2018-09-29 11:54:07 +0800
committerRaghavendra G <rgowdapp@redhat.com>2018-11-06 10:17:38 +0000
commit5f19d8231cedf72af554d6f5e9c2636b1586ec16 (patch)
tree47fef5d0f309dea1ef09eb637b9ae56742f14a14 /xlators/cluster/dht/src/dht-common.c
parent7be4f21f257f23d8e4f2fd57aefa8736cae4cdbf (diff)
md-cache: request cached xattrs at getxattr/fgetxattr
Change-Id: I8e3ad961164815683776850e3a5fd4f510003690 Updates: bz#1634220 Signed-off-by: Kinglong Mee <mijinlong@open-fs.com>
Diffstat (limited to 'xlators/cluster/dht/src/dht-common.c')
-rw-r--r--xlators/cluster/dht/src/dht-common.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c
index 6947d21a1ec..f64109303c5 100644
--- a/xlators/cluster/dht/src/dht-common.c
+++ b/xlators/cluster/dht/src/dht-common.c
@@ -4542,6 +4542,13 @@ dht_getxattr_cbk(call_frame_t *frame, void *cookie, xlator_t *this, int op_ret,
} else {
dht_aggregate_xattr(local->xattr, xattr);
}
+
+ if (!local->xdata) {
+ local->xdata = dict_ref(xdata);
+ } else if ((local->inode && IA_ISDIR(local->inode->ia_type)) ||
+ (local->fd && IA_ISDIR(local->fd->inode->ia_type))) {
+ dht_aggregate_xattr(local->xdata, xdata);
+ }
}
unlock:
UNLOCK(&frame->lock);
@@ -4556,7 +4563,7 @@ out:
}
DHT_STACK_UNWIND(getxattr, frame, local->op_ret, op_errno, local->xattr,
- NULL);
+ local->xdata);
}
return 0;
}