When we need to populate a dcache entry, afs_GetDCache calls
afs_CFileOpen to get a handle for our file backing that dcache.
Currently, if we cannot open the file, we panic.
To handle this a little more gracefully, just return an error from
afs_GetDCache instead. The relevant userspace request will probably
fail with EIO, but this is better than possibly crashing the whole
system.
Reviewed-on: https://gerrit.openafs.org/13046
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit
22e64df8e043fa7bd78bff263866ee2bd6a6e13d)
Change-Id: Iddc7b0ebc56a64d792251f1f42c576603f2a86cf
Reviewed-on: https://gerrit.openafs.org/13072
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Reviewed-by: Michael Meffie <mmeffie@sinenomine.net>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
*/
DZap(tdc); /* pages in cache may be old */
file = afs_CFileOpen(&tdc->f.inode);
- osi_Assert(file);
+ if (!file) {
+ /* We can't access the file in the disk cache backing this dcache;
+ * bail out. */
+ ReleaseWriteLock(&tdc->lock);
+ afs_PutDCache(tdc);
+ tdc = NULL;
+ goto done;
+ }
afs_RemoveVCB(&avc->f.fid);
tdc->f.states |= DWriting;
tdc->dflags |= DFFetching;