diff options
author | David Howells <dhowells@redhat.com> | 2019-05-15 23:06:24 +0100 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2019-05-16 15:48:20 +0100 |
commit | 51eba99970797229b3ac8527193171adea5222ed (patch) | |
tree | 8e96476e28803280d8b6c4cedec662278777f92a /fs/afs/rotate.c | |
parent | d5c32c89b208e39a39cd8639aa21c012ce0daf4d (diff) | |
download | linux-51eba99970797229b3ac8527193171adea5222ed.tar.bz2 |
afs: Fix "kAFS: AFS vnode with undefined type 0"
Under some circumstances afs_select_fileserver() can return without setting
an error in fc->error. The problem is in the no_more_servers segment where
the accumulated errors from attempts to contact various servers are
integrated into an afs_error-type variable 'e'. The resultant error code
is, however, then abandoned.
Fix this by getting the error out of e.error and putting it in 'error' so
that the next part will store it into fc->error.
Not doing this causes a report like the following:
kAFS: AFS vnode with undefined type 0
kAFS: A=0 m=0 s=0 v=0
kAFS: vnode 20000025:1:1
because the code following the server selection loop then sees what it
thinks is a successful invocation because fc.error is 0. However, it can't
apply the status record because it's all zeros.
The report is followed on the first instance with a trace looking something
like:
dump_stack+0x67/0x8e
afs_inode_init_from_status.isra.2+0x21b/0x487
afs_fetch_status+0x119/0x1df
afs_iget+0x130/0x295
afs_get_tree+0x31d/0x595
vfs_get_tree+0x1f/0xe8
fc_mount+0xe/0x36
afs_d_automount+0x328/0x3c3
follow_managed+0x109/0x20a
lookup_fast+0x3bf/0x3f8
do_last+0xc3/0x6a4
path_openat+0x1af/0x236
do_filp_open+0x51/0xae
? _raw_spin_unlock+0x24/0x2d
? __alloc_fd+0x1a5/0x1b7
do_sys_open+0x13b/0x1e8
do_syscall_64+0x7d/0x1b3
entry_SYSCALL_64_after_hwframe+0x49/0xbe
Fixes: 4584ae96ae30 ("afs: Fix missing net error handling")
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/afs/rotate.c')
-rw-r--r-- | fs/afs/rotate.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/afs/rotate.c b/fs/afs/rotate.c index c3ae324781f8..838810da8d5c 100644 --- a/fs/afs/rotate.c +++ b/fs/afs/rotate.c @@ -459,6 +459,8 @@ no_more_servers: s->probe.abort_code); } + error = e.error; + failed_set_error: fc->error = error; failed: |