From: Tejun Heo Date: Tue, 19 May 2009 09:33:06 +0000 (+0900) Subject: bio: always copy back data for copied kernel requests X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4fc981ef9e7c0953d5c4896ce088b19c50cb018f;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git bio: always copy back data for copied kernel requests When a read bio_copy_kern() request fails, the content of the bounce buffer is not copied back. However, as request failure doesn't necessarily mean complete failure, the buffer state can be useful. This behavior is also inconsistent with the user map counterpart and causes the subtle difference between bounced and unbounced IO causes confusion. This patch makes bio_copy_kern_endio() ignore @err and always copy back data on request completion. Signed-off-by: Tejun Heo Cc: Boaz Harrosh Cc: James Bottomley Signed-off-by: Jens Axboe --- diff --git a/fs/bio.c b/fs/bio.c index 7bbc98f0eda1..ee3bc67833d2 100644 --- a/fs/bio.c +++ b/fs/bio.c @@ -1198,7 +1198,7 @@ static void bio_copy_kern_endio(struct bio *bio, int err) char *addr = page_address(bvec->bv_page); int len = bmd->iovecs[i].bv_len; - if (read && !err) + if (read) memcpy(p, addr, len); __free_page(bvec->bv_page);