summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src/nfs-common.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/nfs/server/src/nfs-common.c')
-rw-r--r--xlators/nfs/server/src/nfs-common.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/xlators/nfs/server/src/nfs-common.c b/xlators/nfs/server/src/nfs-common.c
index b6791566c2c..cfb0edd1294 100644
--- a/xlators/nfs/server/src/nfs-common.c
+++ b/xlators/nfs/server/src/nfs-common.c
@@ -331,8 +331,8 @@ err:
* On other errors, return -3. 0 on success.
*/
int
-nfs_entry_loc_fill (inode_table_t *itable, uuid_t pargfid, char *entry,
- loc_t *loc, int how)
+nfs_entry_loc_fill (xlator_t *this, inode_table_t *itable, uuid_t pargfid,
+ char *entry, loc_t *loc, int how)
{
inode_t *parent = NULL;
inode_t *entryinode = NULL;
@@ -347,21 +347,22 @@ nfs_entry_loc_fill (inode_table_t *itable, uuid_t pargfid, char *entry,
ret = -1;
/* Will need hard resolution now */
- if (!parent)
+ if (!parent || inode_ctx_get (parent, this, NULL))
goto err;
gf_uuid_copy (loc->pargfid, pargfid);
ret = -2;
entryinode = inode_grep (itable, parent, entry);
- if (!entryinode) {
+ if (!entryinode || inode_ctx_get (entryinode, this, NULL)) {
if (how == NFS_RESOLVE_CREATE) {
/* Even though we'll create the inode and the loc for
* a missing inode, we still need to return -2 so
* that the caller can use the filled loc to call
* lookup.
*/
- entryinode = inode_new (itable);
+ if (!entryinode)
+ entryinode = inode_new (itable);
/* Cannot change ret because that must
* continue to have -2.
*/