diff options
| -rw-r--r-- | xlators/cluster/dht/src/dht-common.c | 14 | ||||
| -rw-r--r-- | xlators/cluster/dht/src/dht-common.h | 2 |
2 files changed, 10 insertions, 6 deletions
diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index d54d54c5fc4..2a076034997 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -6332,29 +6332,32 @@ dht_populate_inode_for_dentry (xlator_t *this, xlator_t *subvol, int ret = 0; loc_t loc = {0, }; + gf_uuid_copy (loc.gfid, orig_entry->d_stat.ia_gfid); + loc.inode = inode_ref (orig_entry->inode); + + if (is_revalidate (&loc)) { + goto out; + } + layout = dht_layout_new (this, 1); if (!layout) goto out; ret = dht_layout_merge (this, layout, subvol, 0, 0, orig_entry->dict); if (!ret) { - gf_uuid_copy (loc.gfid, orig_entry->d_stat.ia_gfid); - loc.inode = inode_ref (orig_entry->inode); - ret = dht_layout_normalize (this, &loc, layout); if (ret == 0) { dht_layout_set (this, orig_entry->inode, layout); entry->inode = inode_ref (orig_entry->inode); layout = NULL; } - - loc_wipe (&loc); } if (layout) dht_layout_unref (this, layout); out: + loc_wipe (&loc); return; } @@ -6502,6 +6505,7 @@ list: entry, orig_entry); } + } } else { if (orig_entry->inode) { diff --git a/xlators/cluster/dht/src/dht-common.h b/xlators/cluster/dht/src/dht-common.h index a4114adc1de..91ba3418643 100644 --- a/xlators/cluster/dht/src/dht-common.h +++ b/xlators/cluster/dht/src/dht-common.h @@ -751,7 +751,7 @@ typedef struct dht_fd_ctx { #define ENTRY_MISSING(op_ret, op_errno) (op_ret == -1 && op_errno == ENOENT) -#define is_revalidate(loc) (dht_inode_ctx_layout_get (loc->inode, this, NULL) == 0) +#define is_revalidate(loc) (dht_inode_ctx_layout_get ((loc)->inode, this, NULL) == 0) #define is_last_call(cnt) (cnt == 0) |
