From: Joe Gorse Date: Wed, 10 May 2017 15:38:25 +0000 (-0400) Subject: afs: fix repeated BulkStatus calls for directories. X-Git-Tag: BP-openafs-stable-1_8_x~15 X-Git-Url: http://git.openafs.org/?p=openafs.git;a=commitdiff_plain;h=3c12ff9fbb2724b6e430f3eeeb2c2a1d2ae3f884 afs: fix repeated BulkStatus calls for directories. There is a filetype comparison check in afs_DoBulkStat just after BulkFetch RPC. This check will fail for directories even though bulkStatus was done for directories. This code is apparently necessary for Darwin, but it causes this problem otherwise. Thus it is removed from the rest of the builds using the AFS_DARWIN_ENV preprocessor variable. Credit: Yadav Yadavendra for identifying and analysing this issue. Change-Id: I9645f0e7a3327cb5f20cdf3ba2bf1cc5b1509bb5 Reviewed-on: https://gerrit.openafs.org/12610 Reviewed-by: Benjamin Kaduk Tested-by: BuildBot --- diff --git a/src/afs/VNOPS/afs_vnop_lookup.c b/src/afs/VNOPS/afs_vnop_lookup.c index c3c3963..08ad2af 100644 --- a/src/afs/VNOPS/afs_vnop_lookup.c +++ b/src/afs/VNOPS/afs_vnop_lookup.c @@ -696,7 +696,9 @@ afs_DoBulkStat(struct vcache *adp, long dirCookie, struct vrequest *areqp) long startTime; /* time we started the call, * for callback expiration base */ +#if defined(AFS_DARWIN_ENV) int ftype[4] = {VNON, VREG, VDIR, VLNK}; /* verify type is as expected */ +#endif afs_size_t statSeqNo = 0; /* Valued of file size to detect races */ int code; /* error code */ afs_int32 newIndex; /* new index in the dir */ @@ -1160,7 +1162,10 @@ afs_DoBulkStat(struct vcache *adp, long dirCookie, struct vrequest *areqp) */ if (!(tvcp->f.states & CBulkFetching) || (tvcp->f.m.Length != statSeqNo) - || (ftype[(&statsp[i])->FileType] != vType(tvcp))) { +#if defined(AFS_DARWIN_ENV) + || (ftype[(&statsp[i])->FileType] != vType(tvcp)) +#endif + ) { flagIndex++; ReleaseWriteLock(&tvcp->lock); afs_PutVCache(tvcp);