]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit770e63cd64a1f1c6f1da49a8e8b1c1c6daae47ed
tree7130c6dbecf5792a13fac49feba84c2f2cee3a4b
parent50989d23ca5db97a114835d8d2e6ff5fbc9855bb
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: 5c266ab011f3 ("afs: Rearrange status mapping")
Reported-by: Jeffrey Altman <jaltman@auristor.com>
Signed-off-by: David Howells <dhowells@redhat.com>
fs/afs/fsclient.c