From 14f925f5262ecabb2faf8142267c37103413e189 Mon Sep 17 00:00:00 2001 From: Mohammed Rafi KC Date: Tue, 12 Jan 2016 12:04:59 +0530 Subject: nfs: send lookup if inode_ctx is not set During resolving of an entry or inode, if inode ctx was not set, we will send a lookup. This patch also make sure that inode_ctx will be created after every inode_link. Change-Id: I137a7e2510635ff4ea6d007b671961341f89c949 BUG: 1297311 Signed-off-by: Mohammed Rafi KC Reviewed-on: http://review.gluster.org/13224 Reviewed-by: soumya k Tested-by: NetBSD Build System Reviewed-by: Dan Lambright Tested-by: Dan Lambright --- xlators/nfs/server/src/nfs-common.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'xlators/nfs/server/src/nfs-common.c') diff --git a/xlators/nfs/server/src/nfs-common.c b/xlators/nfs/server/src/nfs-common.c index 359835f2cbd..51a2b7e36f7 100644 --- a/xlators/nfs/server/src/nfs-common.c +++ b/xlators/nfs/server/src/nfs-common.c @@ -326,8 +326,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; @@ -342,21 +342,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. */ -- cgit