From cbba1c3f55a7f73791310085b5d9bc65008f0b9b Mon Sep 17 00:00:00 2001 From: Shehjar Tikoo Date: Wed, 29 Dec 2010 05:42:02 +0000 Subject: nfs3: Force root lookup before starting fh resolution Signed-off-by: Shehjar Tikoo Signed-off-by: Anand V. Avati BUG: 2200 (cp dies with "Invalid argument" after failover) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2200 --- xlators/nfs/server/src/nfs3.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'xlators/nfs/server/src/nfs3.c') diff --git a/xlators/nfs/server/src/nfs3.c b/xlators/nfs/server/src/nfs3.c index 46f7f7c5c..de32a2de0 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); \ -- cgit