From: Nickolai Zeldovich Date: Tue, 25 Dec 2001 18:04:52 +0000 (+0000) Subject: dcache-dont-erroneously-fail-to-fill-in-tsmall-20011225 X-Git-Tag: openafs-devel-1_3_0~105 X-Git-Url: https://git.michaelhowe.org/gitweb/?a=commitdiff_plain;h=96f340c532211577f5411aad2037ac728e6362e6;p=packages%2Fo%2Fopenafs.git dcache-dont-erroneously-fail-to-fill-in-tsmall-20011225 "The particular problem seems to be, when size is computed to be zero, tsmall is not filled in with valid data, and ProcessFS is called with a zeroed out OutStatus. This causes the file to magically turn into a directory (VDIR), among other things" "The second part of the patch doesn't fix any bug that I've ran into thus far, but seemed like a good idea while I was reading the code to find the former bug." --- diff --git a/src/afs/afs_dcache.c b/src/afs/afs_dcache.c index 12ccd88dd..b6177af12 100644 --- a/src/afs/afs_dcache.c +++ b/src/afs/afs_dcache.c @@ -2141,7 +2141,7 @@ RetryLookup: /* * Not a dynamic vnode: do the real fetch. */ - if (size) do { + do { /* * Locks held: * avc->lock(R) if setLocks && !slowPass @@ -2548,7 +2548,7 @@ done: /* Check if we need to perform any last-minute fixes with a write-lock */ if (!setLocks || doVcacheUpdate) { if (setNewCallback) avc->callback = newCallback; - if (tsmall) afs_ProcessFS(avc, &tsmall->OutStatus, areq); + if (tsmall && setVcacheStatus) afs_ProcessFS(avc, &tsmall->OutStatus, areq); if (setLocks) ReleaseWriteLock(&avc->lock); }