diff options
-rw-r--r-- | xlators/nfs/server/src/nfs-common.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/xlators/nfs/server/src/nfs-common.c b/xlators/nfs/server/src/nfs-common.c index 5609b8efe7e..9f68f714649 100644 --- a/xlators/nfs/server/src/nfs-common.c +++ b/xlators/nfs/server/src/nfs-common.c @@ -324,6 +324,7 @@ nfs_entry_loc_fill (inode_table_t *itable, ino_t ino, uint64_t gen, char *entry, inode_t *entryinode = NULL; int ret = -3; char *resolvedpath = NULL; + int pret = -3; if ((!itable) || (!entry) || (!loc)) return ret; @@ -345,10 +346,17 @@ nfs_entry_loc_fill (inode_table_t *itable, ino_t ino, uint64_t gen, char *entry, * lookup. */ entryinode = inode_new (itable); - ret = nfs_parent_inode_loc_fill (parent, entryinode, - entry, loc); - if (ret < 0) - ret = -3; + /* Cannot change ret because that must + * continue to have -2. + */ + pret = nfs_parent_inode_loc_fill (parent, entryinode, + entry, loc); + /* Only if parent loc fill fails, should we notify error + * through ret, otherwise, we still need to force a + * lookup by returning -2. + */ + if (pret < 0) + ret = -3; } goto err; } |