From 3b27be6692796bb5319dfa1ea0e01698bbf64aab Mon Sep 17 00:00:00 2001 From: D Brashear Date: Tue, 14 Oct 2014 14:03:40 -0400 Subject: [PATCH] libafs: avoid contaminating the return of lookup vnop when we resort to checking the inlinebulk errors to see if a retry is needed, do not overwrite the lookup return code; only decide if a retry is needed. problem case was where the first vnode returned EACCES and so all vnodes were assumed to have failed, when just one did. Change-Id: Ifd7361ce5af50a72817afa81d31d9cfbda906efd Reviewed-on: http://gerrit.openafs.org/11537 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot Reviewed-by: Jeffrey Altman --- src/afs/VNOPS/afs_vnop_lookup.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/afs/VNOPS/afs_vnop_lookup.c b/src/afs/VNOPS/afs_vnop_lookup.c index 223b866d2..11713d1aa 100644 --- a/src/afs/VNOPS/afs_vnop_lookup.c +++ b/src/afs/VNOPS/afs_vnop_lookup.c @@ -1012,11 +1012,6 @@ afs_DoBulkStat(struct vcache *adp, long dirCookie, struct vrequest *areqp) RXAFS_BulkStatus(rxconn, &fidParm, &statParm, &cbParm, &volSync); RX_AFS_GLOCK(); - } else if (!code) { - /* The InlineBulkStatus call itself succeeded, but we - * may have failed to stat the first entry. Use the error - * from the first entry for processing. */ - code = (&statsp[0])->errorCode; } } else { RX_AFS_GUNLOCK(); @@ -1032,8 +1027,13 @@ afs_DoBulkStat(struct vcache *adp, long dirCookie, struct vrequest *areqp) } } else code = -1; + /* make sure we give afs_Analyze a chance to retry, + * but if the RPC succeeded we may have entries to merge. + * if we wipe code with one entry's status we get bogus failures. + */ } while (afs_Analyze - (tcp, rxconn, code, &adp->f.fid, areqp, AFS_STATS_FS_RPCIDX_BULKSTATUS, + (tcp, rxconn, code ? code : (&statsp[0])->errorCode, + &adp->f.fid, areqp, AFS_STATS_FS_RPCIDX_BULKSTATUS, SHARED_LOCK, NULL)); /* now, if we didnt get the info, bail out. */ -- 2.39.5