diff options
author | David Howells <dhowells@redhat.com> | 2017-03-16 16:27:44 +0000 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2017-03-16 16:27:44 +0000 |
commit | 6db3ac3c4bc552837d232ec794559a2fae2815a0 (patch) | |
tree | 3d6a01c735e66fd6e597eba738321b91c2160ef1 /fs/libfs.c | |
parent | bcd89270d93b7edebb5de5e5e7dca1a77a33496e (diff) |
afs: Handle better the server returning excess or short data
When an AFS server is given an FS.FetchData{,64} request to read data from
a file, it is permitted by the protocol to return more or less than was
requested. kafs currently relies on the latter behaviour in readpage{,s}
to handle a partial page at the end of the file (we just ask for a whole
page and clear space beyond the short read).
However, we don't handle all cases. Add:
(1) Handle excess data by discarding it rather than aborting. Note that
we use a common static buffer to discard into so that the decryption
algorithm advances the PCBC state.
(2) Handle a short read that affects more than just the last page.
Note that if a read comes up unexpectedly short of long, it's possible that
the server's copy of the file changed - in which case the data version
number will have been incremented and the callback will have been broken -
in which case all the pages currently attached to the inode will be zapped
anyway at some point.
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/libfs.c')
0 files changed, 0 insertions, 0 deletions