aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2009-05-19 05:33:06 -0400
committerJens Axboe <jens.axboe@oracle.com>2009-05-19 05:36:08 -0400
commit4fc981ef9e7c0953d5c4896ce088b19c50cb018f (patch)
tree9efb7d762e51cb92dcee0e90ebdb76185aadebb4
parent5f49f63178360b07a095bd33b0d850d60edf7590 (diff)
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 <tj@kernel.org> Cc: Boaz Harrosh <bharrosh@panasas.com> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
-rw-r--r--fs/bio.c2
1 files changed, 1 insertions, 1 deletions
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)
1198 char *addr = page_address(bvec->bv_page); 1198 char *addr = page_address(bvec->bv_page);
1199 int len = bmd->iovecs[i].bv_len; 1199 int len = bmd->iovecs[i].bv_len;
1200 1200
1201 if (read && !err) 1201 if (read)
1202 memcpy(p, addr, len); 1202 memcpy(p, addr, len);
1203 1203
1204 __free_page(bvec->bv_page); 1204 __free_page(bvec->bv_page);