On Wed, 2012-11-07 at 17:11 +0000, Prantis, Kelsey wrote: > Hi Nicholas, > > I decided to try to use the patch you provided since I have quite a few > devices and initiators, and it seemed like it'd be a pain to maintain > changing that setting on every initiator. I added that patch to the patch > you provided earlier this week for too long scsi ids on top of a > 3.6.3-1.fc17 kernel, and now our target server keeps oopsing after a few > minutes of i/o. I've included the oops output below. > Ok, so this is with a virtio-blk backend, yes..? For reference, please send along the: head /sys/block/$VIRTIO_BLK/queue/* output in order to see what hardware limits are reported to block. > [ 839.081918] BUG: unable to handle kernel NULL pointer dereference at > 0000000000000028 > [ 839.082411] IP: [<ffffffffa00bf721] iblock_bio_destructor+0x11/0x30 > [target_core_iblock] Strange, a NULL pointer in the final iblock_bio_destructor callback.. Just to double check, please confirm if huge pages is enabled/disabled on this machine..? > [ 839.082411] PGD 0 > [ 839.082411] Oops: 0000 [#1] SMP > [ 39.082411] Modules linked in: target_core_pscsit_core_file > target_core_iblo iscsi_target_mod target_core_mod > ip6t_REJECTf_conntrack_ipv6 nf_defrag_ipv6 xt_statef_conntrack > ip6table_filter ip6_tablestio_balloon virtio_net i2c_piix4 i2c_cor > microcode joydev virtio_blk > [ 839.082411] CPU 0 9.082411] Pid: 0, comm: swapper/0 Not taintd > 3.6.3-1.chromatestlab1.fc17.x86_64 #1 Red Hat KVM > [ 839.082411] RIP: 0010:[<ffffffffa00bf721>] [<ffffffffa001>] > iblock_bio_destructor+0x11/0x30 [target_core_iblock] > [ 839.082411] RSP: 0018:ffff88007fc03ce8 EFLAGS: 00010092[ 839.082411] > RAX: 0000000000000000 RBX: ffff880071da0 RCX: 0000000000000400 > [ 839.082411] RDX: 0000000000080000 RSI: 0000000000000000 RDI: > fff880071da6840 > [ 839.082411] RBP: ffff88007fc03ce8 R0: 0000000000000000 R09: > 0000000000000000 > [ 839.082411] R10: 0000000000000000 R11: 0000000000000000 R12: > ffff88006945f1a0 > [ 839.082411] R13: 0000000000000000 R14: 0000000000080000 R15: > 0000000000080000 > [ 839.082411] FS: 0000000000000000(0000) GSf88007fc00000(0000) > knlGS:0000000000000000 > [ 839.082411] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008 839.082411] > CR2: 0000000000000028 CR3: 0000000036ca00 CR4: 00000000000006f0 > [ 839.082411] DR0: 0000000000000000 DR1: 0000000000000000 DR2: > 0000000000000000 > [ 839.082411] DR3: 0000000000000000 DR6: 00000000ffff0ff0 R7: > 0000000000000400 > [ 839.082411] Process swaper/0 (pid: 0, threadinfo ffffffff81c00000, task > ffffffff8c13420) > [ 839.082411] Stack: > [ 839.082411] ffff88007fc03d08 ffffffffffff815442f4 ffff880071da6840 > [ 839.082411] ffff88007fc03d38 ffffffffa00bf640 ffff880079aa00 > ffff880071da6840 > [ 839.082411] 0000000000000 ffff880079752d78 ffff88007fc03d48 > ffffffff811c24cd[ 839.082411] Call Trace: > [ 839.082411] <IRQ> > [ 839.082411] [<ffffffff811c39a6>] bio_put+0x36/0x40 > [ 839.082411] [<ffffffff815442f4>] ? ip_rcv+0x214/0x320 > [ 839.082411] [<ffffffffa00bf640>] iblock_bio_d0 [target_core_iblock] > [ 839.082411] [<ffffffffc24cd>] bio_endio+0x1d/0x40 > [ 839.082411] [<ffffff812b7513>] req_bio_endio.isra.53+0xa3/0xe0 > [ 839.082411] [<ffffff812b7648>] blk_update_request+0xf8/0x480 > [ 839.082411] [<fffffff81371375>] ? detach_buf+0x95/0xb0 > [ 839.082411] [<ffffffff812b79f7>] blk_update_bidi_request+0x2xa0 > [ 839.082411] [<ffffffff812bad80>] __blk_end_bii_request+0x20/0x50 > [ 839.082411] [<ffffffff812ba] __blk_end_request_all+0x1f/0x30 > [ 839.082411] fffffa00000ba>] blk_done+0x5a/0x100 [virtio_blk] > [ 839.082411] [<ffffffff81371aac>] vring_interrupt+0c/0xa0 > [ 839.082411] [<ffffffff810e7774>] handle_irq_event_percpu+0x54/0x1f > [ 839.082411] [<ffffffff810e7951>] handle_irq_event+0x41/0x70 > [ 839.082411] [<ffffffff810ea16f>] ndle_edge_irq+0x6f/0x110 > [ 839.082411] [<fffffff101510f>] handle_irq+0xbf/0x150 > [ 839.082411] [<ffffffff81620eb2>] ? > __atomic_noifier_call_chain+0x12/0x20 > [ 839.082411] [<ffffffff8160ed6>] ? atomic_notifier_call_chain+0x16/0x20 > [ 839.082411] [<ffffffff81626a8a>] do_IRQ+x5a/0xe0 > [ 839.082411] [<ffffffff8161d36a>] common_interr+0x6a/0x6a > [ 839.082411] <EOI> > [ 839.082411] [<fffffff81041fd6>] ? native_safe_halt+0x6/0x10 > [ 839.082411] [<ffffff8101b85f>] default_idle+0x4f/0x1a0 > [ 839.082411] [<fffffff8101c58e>] cpu_idle+0xfe/0x120 > [ 839.082411] [<ffffffff8a8e>] rest_init+0x72/0x74 > [ 839.082411] [<ffffffff81cfbc2c>] strt_kernel+0x3b9/0x3c6 > [ 839.082411] [<ffffffff81cfb672>] epair_env_string+0x5e/0x5e > [ 839.082411] [<ffffffff81cfb35] x86_64_start_reservations+0x131/0x135 > [ 839.082411] [<ffffffff81cfb45a>] x86_64_strt_kernel+0x100/0x10f > [ 839.082411] Code: f8 c3 48 c7 c7 68 12 0c a0 31 c0 fc 37 55 e1 eb db > 0f 1f 80 00 00 55 48 89 e5 0f 1f 44 00 00 48 8b 7 58 48 8b 40 70 <48> 8b > 40 28 0 08 02 00 00 e8 af 3d 10 e1 5d c3 66 66 66 > [ 839.082411] RIP [<ffffffffa00bf721>] iblock_bio_destructor+0x11/0x30 > [target_core_iblock > [ 839.082411] RSP <ffff88007fc03ce8> > [ 839.082411] CR2: 0000000000000028 > [ 839.082411] ---[ end trace 0005c37b3cb2ef5 ]--- > [ 839.082411] Kernel panic - notsyncing: Fatal exception in interrupt > So I'll try to reproduce using some different combinations of fabric_max_sectors, but for the moment please apply the following debug patch to dump struct scatterlist + struct bio members and try to reproduce. Thanks! --nab diff --git a/drivers/target/target_core_iblock.c b/drivers/target/target_core_iblock.c index 9ba4954..d9197f3 100644 --- a/drivers/target/target_core_iblock.c +++ b/drivers/target/target_core_iblock.c @@ -559,8 +559,16 @@ static void iblock_complete_cmd(struct se_cmd *cmd) static void iblock_bio_destructor(struct bio *bio) { struct se_cmd *cmd = bio->bi_private; - struct iblock_dev *ib_dev = cmd->se_dev->dev_ptr; + struct iblock_dev *ib_dev; + + printk("IBLOCK: bio_destructor: bio: %p, bi_sector: %llu, bi_size: %u\n", + bio, bio->bi_sector, bio->bi_size); + + BUG_ON(!cmd); + BUG_ON(!cmd->se_dev); + BUG_ON(!cmd->se_dev->dev_ptr); + ib_dev = cmd->se_dev->dev_ptr; bio_free(bio, ib_dev->ibd_bio_set); } @@ -667,7 +675,11 @@ static int iblock_execute_rw(struct se_cmd *cmd) atomic_set(&ibr->pending, 2); bio_cnt = 1; + printk("IBLOCK: block_lba: %llu sgl_nents: %d\n", block_lba, sgl_nents); + for_each_sg(sgl, sg, sgl_nents, i) { + printk("IBLOCK: sg[%d]: %p addr: %p length: %u offset: %u\n", + i, sg, sg_page(sg), sg->length, sg->offset); /* * XXX: if the length the device accepts is shorter than the * length of the S/G list entry this will cause and @@ -675,7 +687,11 @@ static int iblock_execute_rw(struct se_cmd *cmd) */ while (bio_add_page(bio, sg_page(sg), sg->length, sg->offset) != sg->length) { + + printk("IBLOCK: bio_add_page(), bio %p bio_cnt: %u\n", + bio, bio_cnt); if (bio_cnt >= IBLOCK_MAX_BIO_PER_TASK) { + printk("IBLOCK: Calling iblock_submit_bios\n"); iblock_submit_bios(&list, rw); bio_cnt = 0; } @@ -687,7 +703,9 @@ static int iblock_execute_rw(struct se_cmd *cmd) atomic_inc(&ibr->pending); bio_list_add(&list, bio); bio_cnt++; - } + } + printk("IBLOCK: bio: %p bi_sector: %llu bi_size: %u\n", + bio, bio->bi_sector, bio->bi_size); /* Always in 512 byte units for Linux/Block */ block_lba += sg->length >> IBLOCK_LBA_SHIFT; -- To unsubscribe from this list: send the line "unsubscribe target-devel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html