afs: Avoid afs_GetDCache panic on cache open error 46/13046/4
authorAndrew Deason <adeason@sinenomine.net>
Mon, 30 Apr 2018 22:33:14 +0000 (17:33 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 11 May 2018 13:56:36 +0000 (09:56 -0400)
commit22e64df8e043fa7bd78bff263866ee2bd6a6e13d
tree86d5132b8f2c75e994f38307c02610b5463d5888
parent3ec0414f769c37a19410fbd9aefb086cb5b69e55
afs: Avoid afs_GetDCache panic on cache open error

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.

Change-Id: If570ecc7f0fd0aab8340b568fc6cb2e2d316f35a
Reviewed-on: https://gerrit.openafs.org/13046
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: Benjamin Kaduk <kaduk@mit.edu>
src/afs/afs_dcache.c