diff options
Diffstat (limited to 'xlators/performance/md-cache/src/md-cache.c')
-rw-r--r-- | xlators/performance/md-cache/src/md-cache.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/xlators/performance/md-cache/src/md-cache.c b/xlators/performance/md-cache/src/md-cache.c index 7588463b891..782d258f47c 100644 --- a/xlators/performance/md-cache/src/md-cache.c +++ b/xlators/performance/md-cache/src/md-cache.c @@ -486,6 +486,25 @@ updatefn(dict_t *dict, char *key, data_t *value, void *data) } } + /* posix xlator as part of listxattr will send both names + * and values of the xattrs in the dict. But as per man page + * listxattr is mainly supposed to send names of the all the + * xattrs. gfapi, as of now will put all the keys it obtained + * in the dict (sent by posix) into a buffer provided by the + * caller (thus the values of those xattrs are lost). If some + * xlator makes gfapi based calls (ex: snapview-server), then + * it has to unwind the calls by putting those names it got + * in the buffer again into the dict. But now it would not be + * having the values for those xattrs. So it might just put + * a 0 byte value ("") into the dict for each xattr and unwind + * the call. So the xlators which cache the xattrs (as of now + * md-cache caches the acl and selinux related xattrs), should + * not update their cache if the value of a xattr is a 0 byte + * data (i.e. ""). + */ + if (!strcmp (value->data, "")) + continue; + if (dict_set(u->dict, key, value) < 0) { u->ret = -1; return -1; |