diff options
| author | Kinglong Mee <kinglongmee@gmail.com> | 2018-09-29 11:54:07 +0800 | 
|---|---|---|
| committer | Raghavendra G <rgowdapp@redhat.com> | 2018-11-06 10:17:38 +0000 | 
| commit | 5f19d8231cedf72af554d6f5e9c2636b1586ec16 (patch) | |
| tree | 47fef5d0f309dea1ef09eb637b9ae56742f14a14 /xlators/cluster/dht/src | |
| parent | 7be4f21f257f23d8e4f2fd57aefa8736cae4cdbf (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')
| -rw-r--r-- | xlators/cluster/dht/src/dht-common.c | 9 | 
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;  }  | 
