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 | e8e581a88c5f5fc7cf1f636d122b77fbcfc8c2f6 (patch) | |
tree | f3a0da55163b43bbbc888c5638bb99e5cde1c301 /fs/afs/fsclient.c | |
parent | 3448e6521755862446aed28e29abf12565d8844e (diff) | |
download | op-kernel-dev-e8e581a88c5f5fc7cf1f636d122b77fbcfc8c2f6.zip op-kernel-dev-e8e581a88c5f5fc7cf1f636d122b77fbcfc8c2f6.tar.gz |
afs: Handle a short write to an AFS page
Handle the situation where afs_write_begin() is told to expect that a
full-page write will be made, but this doesn't happen (EFAULT, CTRL-C,
etc.), and so afs_write_end() sees a partial write took place. Currently,
no attempt is to deal with the discrepency.
Fix this by loading the gap from the server.
Reported-by: Al Viro <viro@ZenIV.linux.org.uk>
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'fs/afs/fsclient.c')
-rw-r--r-- | fs/afs/fsclient.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/afs/fsclient.c b/fs/afs/fsclient.c index bf8904a..6f917dd 100644 --- a/fs/afs/fsclient.c +++ b/fs/afs/fsclient.c @@ -393,8 +393,10 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call) if (req->remain > 0) { call->offset = 0; req->index++; - if (req->index >= req->nr_pages) + if (req->index >= req->nr_pages) { + call->unmarshall = 4; goto begin_discard; + } goto begin_page; } } |