diff --git a/block/blk-core.c b/block/blk-core.c index a2e58ee..211041d 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1232,6 +1232,16 @@ static int __make_request(struct request_queue *q, struct bio *bio) int el_ret, rw_flags, where = ELEVATOR_INSERT_SORT; struct request *req; + if (test_bit(QUEUE_FLAG_DEBUG_DUMP, &q->queue_flags)) { + printk("XXX __make_request() on dead queue %s:%p\n", + (bio->bi_bdev && bio->bi_bdev->bd_disk) ? + bio->bi_bdev->bd_disk->disk_name : "????", q); + printk("XXX bi_rw=0x%lx bi_sector=%llu sectors=%llu\n", + bio->bi_rw, (unsigned long long)bio->bi_sector, + (unsigned long long)bio_sectors(bio)); + dump_stack(); + } + /* * low level driver can indicate that it wants pages above a * certain limit bounced to low memory (ie for highmem, or even diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index e2f57e9..45bff2f 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -1321,6 +1321,14 @@ static unsigned int ata_scsi_start_stop_xlat(struct ata_queued_cmd *qc) tf->command = ATA_CMD_VERIFY; /* READ VERIFY */ } else { + struct scsi_device *sdev = qc->dev->sdev; + + if (sdev && sdev->request_queue) { + printk("XXX marking queue %p dead\n", sdev->request_queue); + queue_flag_set_unlocked(QUEUE_FLAG_DEBUG_DUMP, + sdev->request_queue); + } + /* Some odd clown BIOSen issue spindown on power off (ACPI S4 * or S5) causing some drives to spin up and down again. */ diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 2ad95fa..de5e0a1 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -401,6 +401,7 @@ struct request_queue #define QUEUE_FLAG_NOXMERGES 15 /* No extended merges */ #define QUEUE_FLAG_ADD_RANDOM 16 /* Contributes to random pool */ #define QUEUE_FLAG_SECDISCARD 17 /* supports SECDISCARD */ +#define QUEUE_FLAG_DEBUG_DUMP 20 #define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ (1 << QUEUE_FLAG_STACKABLE) | \