summaryrefslogtreecommitdiffstats
path: root/fs/afs/fsclient.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2017-03-16 17:27:44 +0100
committerDavid Howells <dhowells@redhat.com>2017-03-16 17:27:44 +0100
commite8e581a88c5f5fc7cf1f636d122b77fbcfc8c2f6 (patch)
treef3a0da55163b43bbbc888c5638bb99e5cde1c301 /fs/afs/fsclient.c
parentafs: Kill struct afs_read::pg_offset (diff)
downloadlinux-e8e581a88c5f5fc7cf1f636d122b77fbcfc8c2f6.tar.xz
linux-e8e581a88c5f5fc7cf1f636d122b77fbcfc8c2f6.zip
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.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/afs/fsclient.c b/fs/afs/fsclient.c
index bf8904a1a58f..6f917dd1238c 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;
}
}