afs: Handle osi_NewVnode failures 01/13701/8
authorAndrew Deason <adeason@sinenomine.net>
Thu, 18 Jul 2019 21:21:10 +0000 (16:21 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 23 Oct 2020 16:43:48 +0000 (12:43 -0400)
commitea9e5e8519dc486cfb019447ee5d695de104079d
tree20def3e8f36a987235faa349448e7a19de2d98a7
parente1e5df918fee00d4d9152c31c24cc1e7f23b71a6
afs: Handle osi_NewVnode failures

Currently, code inside afs_vcache.c assumes that osi_NewVnode always
returns non-NULL, which means that osi_NewVnode must panic if it
cannot create a new vnode.

All of the callers of afs_GetVCache, afs_NewVCache, etc, already
handle getting a NULL return, though (after all, the given fid may not
exist or be inaccessible due to network errors, etc). So, just
propagate NULL returns from osi_NewVnode up to our callers, to avoid
panics in these situations.

Modify osi_NewVnode on many arches to return an error on allocation
failure, instead of panic'ing.

Change-Id: Ib578b1747590bdf65327d4674e0849811ed999eb
Reviewed-on: https://gerrit.openafs.org/13701
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Reviewed-by: Yadavendra Yadav <yadayada@in.ibm.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
src/afs/AIX/osi_vcache.c
src/afs/DARWIN/osi_vcache.c
src/afs/FBSD/osi_vcache.c
src/afs/IRIX/osi_vcache.c
src/afs/LINUX/osi_vcache.c
src/afs/NBSD/osi_vcache.c
src/afs/OBSD/osi_vcache.c
src/afs/SOLARIS/osi_vcache.c
src/afs/afs_vcache.c