Re: 2.6.29 regression: ATA bus errors on resume

From: Tejun Heo
Date: Wed Jun 03 2009 - 00:28:25 EST


Hello,

Can you please do the followings?

1. Apply the attached patch, build & boot

2. Trigger the problem and record dmesg

3. On failed IO, the kernel will print the address of bi_endio. Run
"nm -n" on the vmlinux in the kernel build root and look up which
function it is and post the dmesg and function name.

Thanks.

--
tejun
diff --git a/block/blk-core.c b/block/blk-core.c
index c89883b..6c03f54 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -163,8 +163,13 @@ static void req_bio_endio(struct request *rq, struct bio *bio,
if (bio_integrity(bio))
bio_integrity_advance(bio, nbytes);

- if (bio->bi_size == 0)
+ if (bio->bi_size == 0) {
+ if (error)
+ printk("XXX %s: failing bio %p with %d\n",
+ rq->rq_disk ? rq->rq_disk->disk_name : "?",
+ bio, error);
bio_endio(bio, error);
+ }
} else {

/*
diff --git a/fs/bio.c b/fs/bio.c
index 9871164..c26364a 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -1391,13 +1391,24 @@ void bio_check_pages_dirty(struct bio *bio)
**/
void bio_endio(struct bio *bio, int error)
{
+ char name[BDEVNAME_SIZE] = "?";
+
+ if (bio->bi_bdev)
+ bdevname(bio->bi_bdev, name);
+
if (error)
clear_bit(BIO_UPTODATE, &bio->bi_flags);
- else if (!test_bit(BIO_UPTODATE, &bio->bi_flags))
+ else if (!test_bit(BIO_UPTODATE, &bio->bi_flags)) {
+ printk("XXX %s: !uptodate on bio %p\n", name, bio);
error = -EIO;
+ }

- if (bio->bi_end_io)
+ if (bio->bi_end_io) {
+ if (error)
+ printk("XXX %s: bio=%p error=%d bi_end_io=%p\n",
+ name, bio, error, bio->bi_end_io);
bio->bi_end_io(bio, error);
+ }
}

void bio_pair_release(struct bio_pair *bp)