summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server
diff options
context:
space:
mode:
authorJiffin Tony Thottan <jthottan@redhat.com>2018-11-29 19:22:40 +0530
committerAmar Tumballi <amarts@redhat.com>2018-12-03 05:50:06 +0000
commit99c72652f81ca5ea212adbb5a555e12a4de94491 (patch)
treee469e49ea915edf9c1b72cdb3a95d8c1d279b435 /xlators/nfs/server
parent7c0cb6eebd37ced16bb3b4410404be12e8c892b5 (diff)
nfs : set ctx for every inode looked up nfs3_fh_resolve_inode_lookup_cbk()
The inode ctx for nfs xlator is set with help nfs_fix_generation. But currently gnfs is crashing because inode_ctx is becoming null nfs3_resolve_inode_hard() is used to perform a lookup on entire path and looks like function is missing to set the ctx for inode. This patch will set ctx for the inode which it looked on. Change-Id: I464fa7f78df1bae990ebe97de8ccf6d5fb74fc9f fixes: bz#1651439 Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
Diffstat (limited to 'xlators/nfs/server')
-rw-r--r--xlators/nfs/server/src/nfs3-helpers.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/xlators/nfs/server/src/nfs3-helpers.c b/xlators/nfs/server/src/nfs3-helpers.c
index 7fa278fdc24..5cd3bb8cb93 100644
--- a/xlators/nfs/server/src/nfs3-helpers.c
+++ b/xlators/nfs/server/src/nfs3-helpers.c
@@ -3556,6 +3556,12 @@ nfs3_fh_resolve_entry_lookup_cbk(call_frame_t *frame, void *cookie,
inode_lookup(linked_inode);
inode_unref(cs->resolvedloc.inode);
cs->resolvedloc.inode = linked_inode;
+ } else {
+ /* nfs3_fh_resolve_entry_hard() use to resolve entire path if needed.
+ * So the ctx for inode obtained from here need to set properly,
+ * otherwise it may result in a crash.
+ */
+ nfs_fix_generation(this, inode);
}
err:
nfs3_call_resume(cs);