summaryrefslogtreecommitdiffstats
path: root/xlators/nfs/server/src/nfs3-helpers.c
diff options
context:
space:
mode:
authorMohammed Rafi KC <rkavunga@redhat.com>2016-09-27 19:01:48 +0530
committerKaleb KEITHLEY <kkeithle@redhat.com>2016-11-10 14:19:08 -0800
commitba7a737b1260bbafe22097bea08814035c8b655d (patch)
tree8063aef9bc90a6a7469e660b0f0a1370813b1f73 /xlators/nfs/server/src/nfs3-helpers.c
parent7874ed245bcc80658547992205f8396f4dd3c76a (diff)
nfs: revalidate lookup converted to fresh lookup
when an inode ctx is missing for a linked inode the revalidate lookups are converted to fresh. This could result in sending ESTALE when the gfid are recreated We are not able to reproduce the issue with normal setup, most part of RCA was done with code reading. Possible scenario in which this bug can reproduce, Delete a file and recreate a new file with same name, at the same time from another client process try to list/or access the file. In this case the second client may throw an ESTALE error for such files Thanks to Soumya and Pranith for doing the complete RCA Change-Id: I73992a65844b09a169cefaaedc0dcfb129d66ea1 BUG: 1379720 Signed-off-by: Mohammed Rafi KC <rkavunga@redhat.com> Reviewed-on: http://review.gluster.org/15580 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.org> Smoke: Gluster Build System <jenkins@build.gluster.org> Reviewed-by: soumya k <skoduri@redhat.com> Reviewed-by: Kaleb KEITHLEY <kkeithle@redhat.com>
Diffstat (limited to 'xlators/nfs/server/src/nfs3-helpers.c')
-rw-r--r--xlators/nfs/server/src/nfs3-helpers.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/xlators/nfs/server/src/nfs3-helpers.c b/xlators/nfs/server/src/nfs3-helpers.c
index 5ed57bde0e2..0b977092fbb 100644
--- a/xlators/nfs/server/src/nfs3-helpers.c
+++ b/xlators/nfs/server/src/nfs3-helpers.c
@@ -3757,8 +3757,9 @@ out:
int
nfs3_fh_resolve_entry_hard (nfs3_call_state_t *cs)
{
- int ret = -EFAULT;
- nfs_user_t nfu = {0, };
+ int ret = -EFAULT;
+ nfs_user_t nfu = {0, };
+ gf_boolean_t freshlookup = _gf_false;
if (!cs)
return ret;
@@ -3771,7 +3772,7 @@ nfs3_fh_resolve_entry_hard (nfs3_call_state_t *cs)
ret = nfs_entry_loc_fill (cs->nfsx, cs->vol->itable, cs->resolvefh.gfid,
cs->resolventry, &cs->resolvedloc,
- NFS_RESOLVE_CREATE);
+ NFS_RESOLVE_CREATE, &freshlookup);
if (ret == -2) {
gf_msg_trace (GF_NFS3, 0, "Entry needs lookup: %s",
@@ -3782,8 +3783,8 @@ nfs3_fh_resolve_entry_hard (nfs3_call_state_t *cs)
* go ahead in the resume callback so that an EEXIST gets
* handled at posix without an extra fop at this point.
*/
- if (nfs3_lookup_op (cs) ||
- (nfs3_create_op (cs) && !nfs3_create_exclusive_op (cs))) {
+ if (freshlookup && (nfs3_lookup_op (cs) ||
+ (nfs3_create_op (cs) && !nfs3_create_exclusive_op (cs)))) {
cs->lookuptype = GF_NFS3_FRESH;
cs->resolve_ret = 0;
cs->hardresolved = 0;