summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src/mount3.c
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2016-01-12 12:04:59 +0530
committerDan Lambright <dlambrig@redhat.com>2016-01-13 17:35:12 -0800
commit14f925f5262ecabb2faf8142267c37103413e189 (patch)
treea39735f59539b3208718c3a61bcbc49a5cf83afc /xlators/nfs/server/src/mount3.c
parent3882408103973eac6983c2efdd5af8b1d51f272c (diff)
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 <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/13224 Reviewed-by: soumya k <skoduri@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Dan Lambright <dlambrig@redhat.com> Tested-by: Dan Lambright <dlambrig@redhat.com>
Diffstat (limited to 'xlators/nfs/server/src/mount3.c')
-rw-r--r--xlators/nfs/server/src/mount3.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/xlators/nfs/server/src/mount3.c b/xlators/nfs/server/src/mount3.c
index 2b9a75ee2cc..7b49d097d96 100644
--- a/xlators/nfs/server/src/mount3.c
+++ b/xlators/nfs/server/src/mount3.c
@@ -1057,8 +1057,9 @@ __mnt3_resolve_export_subdir_comp (mnt3_resolve_t *mres)
/* Wipe the contents of the previous component */
gf_uuid_copy (gfid, mres->resolveloc.inode->gfid);
nfs_loc_wipe (&mres->resolveloc);
- ret = nfs_entry_loc_fill (mres->exp->vol->itable, gfid, nextcomp,
- &mres->resolveloc, NFS_RESOLVE_CREATE);
+ ret = nfs_entry_loc_fill (mres->mstate->nfsx, mres->exp->vol->itable,
+ gfid, nextcomp, &mres->resolveloc,
+ NFS_RESOLVE_CREATE);
if ((ret < 0) && (ret != -2)) {
gf_msg (GF_MNT, GF_LOG_ERROR, EFAULT,
NFS_MSG_RESOLVE_INODE_FAIL, "Failed to resolve and "
@@ -1118,6 +1119,7 @@ mnt3_resolve_subdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
int authcode = 0;
char *authorized_host = NULL;
char *authorized_path = NULL;
+ inode_t *linked_inode = NULL;
mres = frame->local;
ms = mres->mstate;
@@ -1134,8 +1136,12 @@ mnt3_resolve_subdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this,
goto err;
}
- inode_link (mres->resolveloc.inode, mres->resolveloc.parent,
- mres->resolveloc.name, buf);
+ linked_inode = inode_link (mres->resolveloc.inode,
+ mres->resolveloc.parent,
+ mres->resolveloc.name, buf);
+
+ if (linked_inode)
+ nfs_fix_generation (this, linked_inode);
nfs3_fh_build_child_fh (&mres->parentfh, buf, &fh);
if (strlen (mres->remainingdir) <= 0) {
@@ -1366,8 +1372,9 @@ __mnt3_resolve_subdir (mnt3_resolve_t *mres)
goto err;
rootgfid[15] = 1;
- ret = nfs_entry_loc_fill (mres->exp->vol->itable, rootgfid, firstcomp,
- &mres->resolveloc, NFS_RESOLVE_CREATE);
+ ret = nfs_entry_loc_fill (mres->mstate->nfsx, mres->exp->vol->itable,
+ rootgfid, firstcomp, &mres->resolveloc,
+ NFS_RESOLVE_CREATE);
if ((ret < 0) && (ret != -2)) {
gf_msg (GF_MNT, GF_LOG_ERROR, EFAULT,
NFS_MSG_RESOLVE_INODE_FAIL, "Failed to resolve and "