summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src/nfs3.c
diff options
context:
space:
mode:
authorShehjar Tikoo <shehjart@gluster.com>2010-12-29 05:42:02 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-12-29 10:20:50 -0800
commitcbba1c3f55a7f73791310085b5d9bc65008f0b9b (patch)
treef1d09a4bf3524b1879e9918ceb2e58d2671036f1 /xlators/nfs/server/src/nfs3.c
parent165efc45ab5518033612a58c1ac51243eb6bcef8 (diff)
nfs3: Force root lookup before starting fh resolutionv3.1.2qa3
Signed-off-by: Shehjar Tikoo <shehjart@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2200 (cp dies with "Invalid argument" after failover) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2200
Diffstat (limited to 'xlators/nfs/server/src/nfs3.c')
-rw-r--r--xlators/nfs/server/src/nfs3.c38
1 files changed, 38 insertions, 0 deletions
diff --git a/xlators/nfs/server/src/nfs3.c b/xlators/nfs/server/src/nfs3.c
index 46f7f7c5ce2..de32a2de05e 100644
--- a/xlators/nfs/server/src/nfs3.c
+++ b/xlators/nfs/server/src/nfs3.c
@@ -174,6 +174,44 @@ out:
}
+int
+nfs3_is_root_looked_up (struct nfs3_state *nfs3, struct nfs3_fh *rootfh)
+{
+ struct nfs3_export *exp = NULL;
+ int ret = 0;
+
+ if ((!nfs3) || (!rootfh))
+ return 0;
+
+ exp = __nfs3_get_export_by_exportid (nfs3, rootfh->exportid);
+ if (!exp)
+ goto out;
+
+ ret = exp->rootlookedup;
+out:
+ return ret;
+}
+
+
+int
+nfs3_set_root_looked_up (struct nfs3_state *nfs3, struct nfs3_fh *rootfh)
+{
+ struct nfs3_export *exp = NULL;
+ int ret = 0;
+
+ if ((!nfs3) || (!rootfh))
+ return 0;
+
+ exp = __nfs3_get_export_by_exportid (nfs3, rootfh->exportid);
+ if (!exp)
+ goto out;
+
+ exp->rootlookedup = 1;
+out:
+ return ret;
+}
+
+
#define nfs3_map_fh_to_volume(nfs3state, handle, rqst, volume, status, label) \
do { \
volume = nfs3_fh_to_xlator ((nfs3state), handle); \