Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=48785bb9fa39415d7553e234946442579dfcf591
Commit:     48785bb9fa39415d7553e234946442579dfcf591
Parent:     9c9381f9425ab4d2f9f0458ae9525c18bc832f59
Author:     Jens Axboe <[EMAIL PROTECTED]>
AuthorDate: Tue Dec 19 11:07:59 2006 +0100
Committer:  Jens Axboe <[EMAIL PROTECTED]>
CommitDate: Tue Dec 19 11:07:59 2006 +0100

    [PATCH] __blk_rq_unmap_user() fails to return error
    
    If the bio is user copied, the copy back could return -EFAULT. Make
    sure we return any error seen during unmapping.
    
    Signed-off-by: Jens Axboe <[EMAIL PROTECTED]>
---
 block/ll_rw_blk.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/block/ll_rw_blk.c b/block/ll_rw_blk.c
index 5d472e4..a66ec30 100644
--- a/block/ll_rw_blk.c
+++ b/block/ll_rw_blk.c
@@ -2504,6 +2504,7 @@ EXPORT_SYMBOL(blk_rq_map_user_iov);
 int blk_rq_unmap_user(struct request *rq)
 {
        struct bio *bio, *mapped_bio;
+       int ret = 0, ret2;
 
        while ((bio = rq->bio)) {
                if (bio_flagged(bio, BIO_BOUNCED))
@@ -2511,11 +2512,15 @@ int blk_rq_unmap_user(struct request *rq)
                else
                        mapped_bio = bio;
 
-               __blk_rq_unmap_user(mapped_bio);
+               ret2 = __blk_rq_unmap_user(mapped_bio);
+               if (ret2 && !ret)
+                       ret = ret2;
+
                rq->bio = bio->bi_next;
                bio_put(bio);
        }
-       return 0;
+
+       return ret;
 }
 
 EXPORT_SYMBOL(blk_rq_unmap_user);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to