afs: Avoid panics on failed return from afs_CFileOpen 41/14241/8
authorCheyenne Wills <cwills@sinenomine.net>
Fri, 19 Jun 2020 14:01:14 +0000 (08:01 -0600)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 3 Jul 2020 15:50:42 +0000 (11:50 -0400)
commitd2d27f975df13c3833898611dacff940a5ba3e2a
tree664d6190c549679015b05f65d81b07014c77a7d8
parent7d85ce221d6ccc19cf76ce7680c74311e4ed2632
afs: Avoid panics on failed return from afs_CFileOpen

afs_CFileOpen is a macro that invokes the open "method" of the
afs_cacheOps structure, and for disk caches the osi_UFSOpen function is
used.

Currently osi_UFSOpen will panic if there is an error encountered while
opening a file.

Prepare to handle osi_UFSOpen function returning a NULL instead of
issuing a panic (future commit).

Update callers of afs_CFileOpen to test for an error and to return an
error instead of issuing a panic.

While this commit eliminates some panics, it does not address some of the
more complex cases associated with errors from afs_CFileOpen.

Change-Id: I2bdd525633dd44ebf8e26fcfd7059dfdfffb6142
Reviewed-on: https://gerrit.openafs.org/14241
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Mark Vitale <mvitale@sinenomine.net>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
src/afs/VNOPS/afs_vnop_symlink.c
src/afs/afs_buffer.c
src/afs/afs_dcache.c
src/afs/afs_disconnected.c
src/afs/afs_fetchstore.c
src/afs/afs_init.c
src/afs/afs_segments.c