stec-inc / EnhanceIO

EnhanceIO Open Source for Linux
Other
420 stars 177 forks source link

Kernel Panics During Create On MD Device #7

Closed mgmartin closed 11 years ago

mgmartin commented 11 years ago

I created an md raid 1 mirror using two external usb drives. Another usb flash device is being used as the cache device. Whenever I create the cache, the kernel panics. I testing on two separate machines ( different hardware ) with the same kernel, and the panic and stack traces were consistent.

Creating the cache on a usb disk directly works ok, so something is up when the md device gets involve.

Using latest git commit 94cb7dbd68a38c0f149dab6ad4e33bf5d9071f78 on linux 3.7.2 .

eio_cli create -d /dev/md/smallraid -s /dev/disk/by-id/usb-Corsair_Survivor_3.0_12331349000015410267-0:0 -c test
[  411.511504] ------------[ cut here ]------------
[  411.511699] kernel BUG at drivers/scsi/scsi_lib.c:1192!
[  411.511823] invalid opcode: 0000 [#1] SMP 
[  411.512061] Modules linked in: enhanceio_fifo enhanceio_lru enhanceio netconsole configfs fcoe libfcoe libfc scsi_transport_fc scsi_tgt rdma_ucm ib_uverbs rdma_cm ib_addr iw_cm ib_cm ib_sa ib_mad ib_core xt_LOG xt_nat iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack it87 hwmon_vid ip6table_filter ip6_tables iptable_filter ip_tables ebtable_nat ebtables x_tables bnep rfcomm parport_pc ppdev lp parport bluetooth rfkill crc16 cpufreq_userspace cpufreq_stats cpufreq_powersave cpufreq_conservative autofs4 binfmt_misc nfsd auth_rpcgss nfs_acl nfs lockd fscache sunrpc bridge stp llc loop firewire_sbp2 dm_crypt zfs(PO) zunicode(PO) zavl(PO) zcommon(PO) znvpair(PO) spl(O) zlib_deflate snd_hda_codec_hdmi coretemp kvm_intel kvm snd_hda_codec_realtek snd_usb_audio snd_usbmidi_lib snd_hda_intel snd_hda_codec snd_hwdep snd_pcm snd_page_alloc i7core_edac snd_seq_midi pcspkr edac_core snd_seq_midi_event snd_seq iTCO_wdt snd_rawmidi iTCO_vendor_support i2c_i801 snd_timer snd_seq_device snd serio_raw i2c_core acpi_cpufreq mperf microcode evdev soundcore mxm_wmi lpc_ich joydev processor mfd_core button wmi thermal_sys hid_generic ses enclosure hid_logitech_dj usbhid hid xfs dm_mod raid10 raid1 md_mod usb_storage firewire_ohci xhci_hcd firewire_core uhci_hcd ata_generic crc32c_intel crc_itu_t r8169 ehci_hcd mii sr_mod pata_jmicron cdrom sg usbcore sd_mod crc_t10dif usb_common
[  411.518497] CPU 3 
[  411.518545] Pid: 9108, comm: eio_cli Tainted: P           O 3.7.2+ #5 Gigabyte Technology Co., Ltd. EX58-UD5/EX58-UD5
[  411.518726] RIP: 0010:[<ffffffff8124cd6c>]  [<ffffffff8124cd6c>] scsi_setup_fs_cmnd+0x42/0x8a
[  411.518885] RSP: 0018:ffff8806126cd9f8  EFLAGS: 00010046
[  411.518965] RAX: 0000000000000000 RBX: ffff880617e1c800 RCX: 0000000000000002
[  411.519051] RDX: 0000000000040000 RSI: ffff8806171c7b20 RDI: ffff880617e1c800
[  411.519137] RBP: ffff8806171c7b20 R08: ffffffff8179d9c0 R09: ffff8806126cd9f0
[  411.519222] R10: 0000000000012a00 R11: ffff880617257400 R12: ffff880617e1c800
[  411.519307] R13: 0000000000040000 R14: ffff8806172e8000 R15: ffff880600fa90c0
[  411.519392] FS:  00007f6bbf783700(0000) GS:ffff88063fc60000(0000) knlGS:0000000000000000
[  411.519517] CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
[  411.519599] CR2: ffffffffff600400 CR3: 000000061801e000 CR4: 00000000000007e0
[  411.519701] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[  411.519802] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[  411.519905] Process eio_cli (pid: 9108, threadinfo ffff8806126cc000, task ffff880618ecea60)
[  411.520032] Stack:
[  411.520119]  0000000000000000 ffff8806171c7b20 0000000000000000 ffffffffa0068163
[  411.520402]  ffff880617257400 00000000efc94f94 ffff8806171c7b20 ffff880617390330
[  411.520665]  ffff8806171c7b20 ffff880617173c00 ffff880600000000 ffff880626b21038
[  411.520927] Call Trace:
[  411.521008]  [<ffffffffa0068163>] ? sd_prep_fn+0x3de/0xc5f [sd_mod]
[  411.521095]  [<ffffffff81176abb>] ? blk_peek_request+0xab/0x185
[  411.528249]  [<ffffffff8124d26c>] ? scsi_request_fn+0x49/0x4ee
[  411.528365]  [<ffffffff8104e3b2>] ? abort_exclusive_wait+0x79/0x79
[  411.528494]  [<ffffffff811736c6>] ? elv_rqhash_add.isra.13+0x26/0x4c
[  411.528604]  [<ffffffff81177147>] ? blk_queue_bio+0x281/0x2d2
[  411.528701]  [<ffffffff81175ad7>] ? generic_make_request+0x96/0xd5
[  411.528807]  [<ffffffffa021da81>] ? make_request+0x39c/0xa8d [raid1]
[  411.528902]  [<ffffffff810d3e6d>] ? kmem_cache_alloc+0x8a/0xae
[  411.529006]  [<ffffffffa020492c>] ? md_make_request+0xcc/0x1c1 [md_mod]
[  411.529099]  [<ffffffff81100849>] ? bio_alloc_bioset+0x78/0xe3
[  411.529201]  [<ffffffffa0204860>] ? new_dev_store+0x158/0x158 [md_mod]
[  411.529298]  [<ffffffffa040b692>] ? eio_issue_empty_barrier_flush+0x82/0xa1 [enhanceio]
[  411.529425]  [<ffffffffa040be93>] ? eio_ttc_activate+0x19b/0x1c7 [enhanceio]
[  411.529525]  [<ffffffffa0403591>] ? eio_cache_create+0x1292/0x1439 [enhanceio]
[  411.529653]  [<ffffffff810c3635>] ? insert_vmalloc_vmlist+0x15/0x4d
[  411.529752]  [<ffffffff810c4fd6>] ? __vmalloc_node_range+0x1b9/0x1e4
[  411.529852]  [<ffffffffa0403791>] ? eio_ioctl+0x30/0x1fd [enhanceio]
[  411.529950]  [<ffffffff81055462>] ? should_resched+0x5/0x23
[  411.530047]  [<ffffffffa04037c7>] ? eio_ioctl+0x66/0x1fd [enhanceio]
[  411.530148]  [<ffffffff810e8a32>] ? vfs_ioctl+0x1e/0x31
[  411.530242]  [<ffffffff810e9269>] ? do_vfs_ioctl+0x3ed/0x42f
[  411.530336]  [<ffffffff810e0111>] ? sys_newfstat+0x23/0x2b
[  411.530433]  [<ffffffff810e92f8>] ? sys_ioctl+0x4d/0x7d
[  411.530531]  [<ffffffff8135d569>] ? system_call_fastpath+0x16/0x1b
[  411.530627] Code: 00 00 48 85 c0 75 0c 66 83 bd e8 00 00 00 00 75 1c eb 18 48 8b 00 48 85 c0 74 ec eb 47 48 89 ee 48 89 df ff d0 85 c0 74 de eb 44 <0f> 0b 48 89 ee 48 89 df e8 bf f7 ff ff 48 85 c0 48 89 c2 74 1d 
[  411.533342] RIP  [<ffffffff8124cd6c>] scsi_setup_fs_cmnd+0x42/0x8a
[  411.533464]  RSP <ffff8806126cd9f8>
[  411.533539] ---[ end trace 1c19110551a620e2 ]---
sanoj-stec commented 11 years ago

Resolved by the commit 6084df15697f68ddd71a953f7531a1f2ab357b64

The issue was due to a zero sized read being issue in eio_issue_empty_barrier_flush Should have been marked as write instead