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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user