Hi Jens, Bart, Boris,

I have reviewed all blk-end-request patches again to confirm whether
there are any similar problems with the last week's ide-cd panic:
    http://lkml.org/lkml/2008/1/29/140

And I found a possible similar bug in ide-io change:
ide_end_drive_cmd() could be called for blk_pc_request() which could
have bios.  To complete such requests correctly, we need to pass
the actual size of the request.
Otherwise, __blk_end_request() returns 1 because the request still has
bios, and the system will BUG() unnecessarily.

The following patch fixes the bug and should be applied on top of
Linus' git.
Please review and apply.


Cc: Bartlomiej Zolnierkiewicz <[EMAIL PROTECTED]>
Cc: Borislav Petkov <[EMAIL PROTECTED]>
Signed-off-by: Kiyoshi Ueda <[EMAIL PROTECTED]>
Signed-off-by: Jun'ichi Nomura <[EMAIL PROTECTED]>
---
 drivers/ide/ide-io.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- a/drivers/ide/ide-io.c      2008-02-01 18:20:02.000000000 -0500
+++ b/drivers/ide/ide-io.c      2008-02-01 18:21:50.000000000 -0500
@@ -388,7 +388,8 @@ void ide_end_drive_cmd (ide_drive_t *dri
        spin_lock_irqsave(&ide_lock, flags);
        HWGROUP(drive)->rq = NULL;
        rq->errors = err;
-       if (__blk_end_request(rq, (rq->errors ? -EIO : 0), 0))
+       if (unlikely(__blk_end_request(rq, (rq->errors ? -EIO : 0),
+                                      blk_rq_bytes(rq))))
                BUG();
        spin_unlock_irqrestore(&ide_lock, flags);
 }

Thanks,
Kiyoshi Ueda
-
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to