887953
From 4a3e8888d7e866137287fced284b71ba152a17ad Mon Sep 17 00:00:00 2001
887953
From: Jiffin Tony Thottan <jthottan@redhat.com>
887953
Date: Thu, 29 Nov 2018 19:22:40 +0530
887953
Subject: [PATCH 469/493] nfs : set ctx for every inode looked up
887953
 nfs3_fh_resolve_inode_lookup_cbk()
887953
887953
The inode ctx for nfs xlator is set with help nfs_fix_generation.
887953
But currently gnfs is crashing because inode_ctx is becoming null
887953
nfs3_resolve_inode_hard() is used to perform a lookup on entire
887953
path and looks like function is missing to set the ctx for inode.
887953
This patch will set ctx for the inode which it looked on.
887953
887953
Upstream reference :
887953
>url: https://review.gluster.org/#/c/glusterfs/+/21749/
887953
>Change-Id: I464fa7f78df1bae990ebe97de8ccf6d5fb74fc9f
887953
>fixes: bz#1651439
887953
>Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
887953
887953
Change-Id: I464fa7f78df1bae990ebe97de8ccf6d5fb74fc9f
887953
BUG: 1633177
887953
Signed-off-by: Jiffin Tony Thottan <jthottan@redhat.com>
887953
Reviewed-on: https://code.engineering.redhat.com/gerrit/158676
887953
Tested-by: RHGS Build Bot <nigelb@redhat.com>
887953
Reviewed-by: Sunil Kumar Heggodu Gopala Acharya <sheggodu@redhat.com>
887953
---
887953
 xlators/nfs/server/src/nfs3-helpers.c | 6 ++++++
887953
 1 file changed, 6 insertions(+)
887953
887953
diff --git a/xlators/nfs/server/src/nfs3-helpers.c b/xlators/nfs/server/src/nfs3-helpers.c
887953
index 0b97709..9bc8aff 100644
887953
--- a/xlators/nfs/server/src/nfs3-helpers.c
887953
+++ b/xlators/nfs/server/src/nfs3-helpers.c
887953
@@ -3660,6 +3660,12 @@ nfs3_fh_resolve_entry_lookup_cbk (call_frame_t *frame, void *cookie,
887953
                 inode_lookup (linked_inode);
887953
                 inode_unref (cs->resolvedloc.inode);
887953
                 cs->resolvedloc.inode = linked_inode;
887953
+        } else {
887953
+        /* nfs3_fh_resolve_entry_hard() use to resolve entire path if needed.
887953
+         * So the ctx for inode obtained from here need to set properly,
887953
+         * otherwise it may result in a crash.
887953
+         */
887953
+                nfs_fix_generation(this, inode);
887953
         }
887953
 err:
887953
         nfs3_call_resume (cs);
887953
-- 
887953
1.8.3.1
887953