]> git.michaelhowe.org Git - packages/o/openafs.git/commit
LINUX: Return NULL for afs_linux_raw_open error
authorAndrew Deason <adeason@sinenomine.net>
Mon, 30 Apr 2018 22:30:56 +0000 (17:30 -0500)
committerBenjamin Kaduk <kaduk@mit.edu>
Sat, 2 Jun 2018 22:18:10 +0000 (18:18 -0400)
commita5eeee6d2ef87d95722950989a2d261efc72b959
tree6617713e37d94097636b74b0ace15ee286ea97e0
parent5b9da66861db10dcc1d896769b495738cc07b450
LINUX: Return NULL for afs_linux_raw_open error

Currently, afs_linux_raw_open (and by extension, LINUX's
implementation of osi_UFSOpen) panic when they are unable to open the
given cache file. To allow callers to handle the error more
gracefully, change afs_linux_raw_open and osi_UFSOpen to return NULL
on error, instead of panic'ing. Expand the language a little on the
message logged while we're here, since the system might keep running
after this situation now.

This commit also changes all callers that did not already handle
afs_linux_raw_open/osi_UFSOpen errors to assert on errors, so we still
panic for all situations where we encounter an error. More graceful
behavior will be added in future commits; this commit does not change
the behavior on its own.

An error on opening cache files can legitimately happen when there is
corruption in the filesystem backing the disk cache, but possibly the
easiest way to generate an error is if the filesystem has been
forcibly mounted readonly (which can happen at runtime due to
filesystem corruption or various hardware faults). The latter will
generate -EROFS (-30) errors, but of course other errors are probably
possible.

Reviewed-on: https://gerrit.openafs.org/13045
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
(cherry picked from commit f6af4a155d3636e8f812e40c7169dd8902ae64be)

Change-Id: I5f9a71a96cd9c875f4b024562dfa714f9cc27e2f
Reviewed-on: https://gerrit.openafs.org/13071
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>
src/afs/LINUX/osi_file.c
src/afs/LINUX/osi_vnodeops.c
src/afs/VNOPS/afs_vnop_symlink.c
src/afs/VNOPS/afs_vnop_write.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