From: D Brashear Date: Tue, 14 Oct 2014 18:03:40 +0000 (-0400) Subject: libafs: avoid contaminating the return of lookup vnop X-Git-Tag: openafs-stable-1_8_0pre1~525 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=3b27be6692796bb5319dfa1ea0e01698bbf64aab 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 --- diff --git a/src/afs/VNOPS/afs_vnop_lookup.c b/src/afs/VNOPS/afs_vnop_lookup.c index 223b866..11713d1 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. */