OSDN Git Service

afs: Fix AFSFetchStatus decoder to provide OpenAFS compatibility
authorDavid Howells <dhowells@redhat.com>
Thu, 10 May 2018 20:51:47 +0000 (21:51 +0100)
committerDavid Howells <dhowells@redhat.com>
Mon, 14 May 2018 14:15:18 +0000 (15:15 +0100)
commit684b0f68cf1c1cf4a40834818653491c5cad4435
tree7130c6dbecf5792a13fac49feba84c2f2cee3a4b
parentec5a3b4b507efca903d848518dcf2ebf7b04b466
afs: Fix AFSFetchStatus decoder to provide OpenAFS compatibility

The OpenAFS server's RXAFS_InlineBulkStatus implementation has a bug
whereby if an error occurs on one of the vnodes being queried, then the
errorCode field is set correctly in the corresponding status, but the
interfaceVersion field is left unset.

Fix kAFS to deal with this by evaluating the AFSFetchStatus blob against
the following cases when called from FS.InlineBulkStatus delivery:

 (1) If InterfaceVersion == 0 then:

     (a) If errorCode != 0 then it indicates the abort code for the
         corresponding vnode.

     (b) If errorCode == 0 then the status record is invalid.

 (2) If InterfaceVersion == 1 then:

     (a) If errorCode != 0 then it indicates the abort code for the
         corresponding vnode.

     (b) If errorCode == 0 then the status record is valid and can be
       parsed.

 (3) If InterfaceVersion is anything else then the status record is
     invalid.

Fixes: dd9fbcb8e103 ("afs: Rearrange status mapping")
Reported-by: Jeffrey Altman <jaltman@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
fs/afs/fsclient.c