diff options
Diffstat (limited to 'fs/afs/fsclient.c')
-rw-r--r-- | fs/afs/fsclient.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/fs/afs/fsclient.c b/fs/afs/fsclient.c index e54e6c2ad343..1e65fee36413 100644 --- a/fs/afs/fsclient.c +++ b/fs/afs/fsclient.c | |||
@@ -206,7 +206,7 @@ int afs_fs_fetch_file_status(struct afs_server *server, | |||
206 | struct afs_call *call; | 206 | struct afs_call *call; |
207 | __be32 *bp; | 207 | __be32 *bp; |
208 | 208 | ||
209 | _enter(",%x,{%x:%d},,", | 209 | _enter(",%x,{%x:%u},,", |
210 | key_serial(key), vnode->fid.vid, vnode->fid.vnode); | 210 | key_serial(key), vnode->fid.vid, vnode->fid.vnode); |
211 | 211 | ||
212 | call = afs_alloc_flat_call(&afs_RXFSFetchStatus, 16, (21 + 3 + 6) * 4); | 212 | call = afs_alloc_flat_call(&afs_RXFSFetchStatus, 16, (21 + 3 + 6) * 4); |
@@ -265,25 +265,20 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call, | |||
265 | call->offset = 0; | 265 | call->offset = 0; |
266 | call->unmarshall++; | 266 | call->unmarshall++; |
267 | 267 | ||
268 | if (call->count < PAGE_SIZE) { | ||
269 | page = call->reply3; | ||
270 | buffer = kmap_atomic(page, KM_USER0); | ||
271 | memset(buffer + PAGE_SIZE - call->count, 0, | ||
272 | call->count); | ||
273 | kunmap_atomic(buffer, KM_USER0); | ||
274 | } | ||
275 | |||
276 | /* extract the returned data */ | 268 | /* extract the returned data */ |
277 | case 2: | 269 | case 2: |
278 | _debug("extract data"); | 270 | _debug("extract data"); |
279 | page = call->reply3; | 271 | if (call->count > 0) { |
280 | buffer = kmap_atomic(page, KM_USER0); | 272 | page = call->reply3; |
281 | ret = afs_extract_data(call, skb, last, buffer, call->count); | 273 | buffer = kmap_atomic(page, KM_USER0); |
282 | kunmap_atomic(buffer, KM_USER0); | 274 | ret = afs_extract_data(call, skb, last, buffer, |
283 | switch (ret) { | 275 | call->count); |
284 | case 0: break; | 276 | kunmap_atomic(buffer, KM_USER0); |
285 | case -EAGAIN: return 0; | 277 | switch (ret) { |
286 | default: return ret; | 278 | case 0: break; |
279 | case -EAGAIN: return 0; | ||
280 | default: return ret; | ||
281 | } | ||
287 | } | 282 | } |
288 | 283 | ||
289 | call->offset = 0; | 284 | call->offset = 0; |
@@ -318,6 +313,14 @@ static int afs_deliver_fs_fetch_data(struct afs_call *call, | |||
318 | if (!last) | 313 | if (!last) |
319 | return 0; | 314 | return 0; |
320 | 315 | ||
316 | if (call->count < PAGE_SIZE) { | ||
317 | _debug("clear"); | ||
318 | page = call->reply3; | ||
319 | buffer = kmap_atomic(page, KM_USER0); | ||
320 | memset(buffer + call->count, 0, PAGE_SIZE - call->count); | ||
321 | kunmap_atomic(buffer, KM_USER0); | ||
322 | } | ||
323 | |||
321 | _leave(" = 0 [done]"); | 324 | _leave(" = 0 [done]"); |
322 | return 0; | 325 | return 0; |
323 | } | 326 | } |