For a file in a directory with the CStatd bit cleared, we can get
an infinite fetchStatus loop.
In afs_create(), afs_getDCache() may return NULL due to an error.
If unchecked it will loop which may produce multiple fetchStatus()
calls to the fileserver.
Credit: Yadav Yadavendra for identifying and analysing this issue.
Change-Id: Iecd77d49a5f3e8bb629396c57246736b39aa935f
Reviewed-on: https://gerrit.openafs.org/12651
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
}
tdc = afs_GetDCache(adp, (afs_size_t) 0, treq, &offset, &len, 1);
+
+ /** Prevent multiple fetchStatus calls to fileserver when afs_GetDCache()
+ * returns NULL for an error condition
+ */
+ if (!tdc) {
+ code = EIO;
+ goto done;
+ }
+
ObtainWriteLock(&adp->lock, 135);
if (tdc)
ObtainSharedLock(&tdc->lock, 630);