[pso] [tema3] Construirea unui bio pt CRC

Bogdan Tenea tenea.bogdan at gmail.com
Sun May 17 15:27:03 EEST 2009


Momentan imi pica toate testele de mirror deoarece nu am implementat crc.
Cand am adaugat si CRC (citirea sectoarelor ce contin CRCurile pentru BIOul
primit) imi crapa cu un kernel_panic de toate frumusetea. Modul de creere al
bioului pentru CRC arata in felul urmator:

    printk(LOG_LEVEL"Build CRC for %d sect: start sect %d, end sect %d, %d
pages, %d on last\n", bio_cur_sectors(bio), start_sector, end_sector,
num_pages, sectors_in_last_page);

    bio_crc->bi_bdev = dev;
    bio_crc->bi_sector = start_sector;
    init_completion(event);
    bio_crc->bi_private = event;
    bio_crc->bi_end_io = my_complete;
    bio_crc->bi_rw = DIRECTION_READ;
    bio_crc->bi_vcnt = num_pages;
    bio_crc->bi_idx = 0;

    for(i=0; i<num_pages-1; i++)
        bio_add_page(bio_crc, alloc_page(GFP_NOIO), PAGE_SIZE, 0);
    bio_add_page(bio_crc, alloc_page(GFP_NOIO), sectors_in_last_page *
MY_SECTOR_SIZE, 0);

Panicul l-am atasat mai jos:

   /home/bogdan# netcat -u -l -p 6000
> Build CRC for 8 sect: start sect 194560, end sect 194560, 1 pages, 1 on
> last
> Build CRC for 8 sect: start sect 194560, end sect 194560, 1 pages, 1 on
> last
> Build CRC for 8 sect: start sect 194560, end sect 194560, 1 pages, 1 on
> last
> Build CRC for 8 sect: start sect 194560, end sect 194560, 1 pages, 1 on
> last
> ------------[ cut here ]------------
> ------------[ cut here ]------------
> WARNING: at arch/x86/kernel/pci-nommu.c:62 nommu_map_sg+0x22/0xb0()
> WARNING: at arch/x86/kernel/pci-nommu.c:62 nommu_map_sg+0x22/0xb0()
> Modules linked in:Modules linked in: ssr ssr netconsole netconsole vmblock
> vmblock vmci vmci vmmemctl vmmemctl pcnet32 pcnet32 vmxnet vmxnet ide_cd_mod
> ide_cd_mod crc32 crc32 cdrom cdrom [last unloaded: ssr] [last unloaded: ssr]
>
> Pid: 58, comm: kblockd/0 Not tainted 2.6.28.4 #5
> Pid: 58, comm: kblockd/0 Not tainted 2.6.28.4 #5
> Call Trace:
> Call Trace:
>  [<c035d08b>] ? printk+0x18/0x1a
>  [<c035d08b>] ? printk+0x18/0x1a
>  [<c011eae4>] warn_on_slowpath+0x54/0x80
>  [<c011eae4>] warn_on_slowpath+0x54/0x80
>  [<c0108002>] nommu_map_sg+0x22/0xb0
>  [<c0108002>] nommu_map_sg+0x22/0xb0
>  [<c02b873a>] ide_build_sglist+0x4a/0x60
>  [<c02b873a>] ide_build_sglist+0x4a/0x60
>  [<c02b8a96>] ide_build_dmatable+0x36/0x1a0
>  [<c02b8a96>] ide_build_dmatable+0x36/0x1a0
>  [<c02b8c3c>] ide_dma_setup+0x3c/0x100
>  [<c02b8c3c>] ide_dma_setup+0x3c/0x100
>  [<c02b6963>] do_rw_taskfile+0x1b3/0x240
>  [<c02b6963>] do_rw_taskfile+0x1b3/0x240
>  [<c022df21>] ? elv_dispatch_sort+0xb1/0xd0
>  [<c022df21>] ? elv_dispatch_sort+0xb1/0xd0
>  [<c02b9d75>] ide_do_rw_disk+0x215/0x310
>  [<c02b9d75>] ide_do_rw_disk+0x215/0x310
>  [<c02b941a>] ide_gd_do_request+0xa/0x10
>  [<c02b941a>] ide_gd_do_request+0xa/0x10
>  [<c02b09ba>] ide_do_request+0x48a/0xa90
>  [<c011b4ff>] ? update_curr+0x14f/0x180
>  [<c02b11c9>] do_ide_request+0x19/0x20
>  [<c0230583>] __generic_unplug_device+0x23/0x30
>  [<c02b09ba>] ide_do_request+0x48a/0xa90
>  [<c011b4ff>] ? update_curr+0x14f/0x180
>  [<c0230801>] generic_unplug_device+0x21/0x30
>  [<c02b11c9>] do_ide_request+0x19/0x20
>  [<c0230583>] __generic_unplug_device+0x23/0x30
>  [<c0230801>] generic_unplug_device+0x21/0x30
>  [<c022e94e>] blk_unplug_work+0xe/0x10
>  [<c022e94e>] blk_unplug_work+0xe/0x10
>  [<c012ed8c>] run_workqueue+0xdc/0x1f0
>  [<c012ed8c>] run_workqueue+0xdc/0x1f0
>  [<c012ed2a>] ? run_workqueue+0x7a/0x1f0
>  [<c012ed2a>] ? run_workqueue+0x7a/0x1f0
>  [<c022e940>] ? blk_unplug_work+0x0/0x10
>  [<c022e940>] ? blk_unplug_work+0x0/0x10
>  [<c012f15f>] worker_thread+0x4f/0xa0
>  [<c012f15f>] worker_thread+0x4f/0xa0
>  [<c0132a50>] ? autoremove_wake_function+0x0/0x50
>  [<c0132a50>] ? autoremove_wake_function+0x0/0x50
>  [<c012f110>] ? worker_thread+0x0/0xa0
>  [<c012f110>] ? worker_thread+0x0/0xa0
>  [<c01327ea>] kthread+0x3a/0x70
>  [<c01327ea>] kthread+0x3a/0x70
>  [<c01327b0>] ? kthread+0x0/0x70
>  [<c01327b0>] ? kthread+0x0/0x70
>  [<c010415b>] kernel_thread_helper+0x7/0x1c
>  [<c010415b>] kernel_thread_helper+0x7/0x1c
> ---[ end trace 2693ec7ba8436b5d ]---
> ---[ end trace 2693ec7ba8436b5d ]---
> ------------[ cut here ]------------
> kernel BUG at arch/x86/kernel/pci-nommu.c:65!
> invalid opcode: 0000 [#1] PREEMPT DEBUG_PAGEALLOC
> ------------[ cut here ]------------
> last sysfs file: /sys/devices/virtual/block/ssr/removable
> Modules linked in: ssr netconsole vmblock vmci vmmemctl pcnet32 vmxnet
> ide_cd_mod crc32 cdrom [last unloaded: ssr]kernel BUG at
> arch/x86/kernel/pci-nommu.c:65!
>
>
> invalid opcode: 0000 [#1] PREEMPT DEBUG_PAGEALLOCPid: 58, comm: kblockd/0
> Tainted: G        W  (2.6.28.4 #5) VMware Virtual Platform
>
> EIP: 0060:[<c010807c>] EFLAGS: 00010046 CPU: 0
> EIP is at nommu_map_sg+0x9c/0xb0
> last sysfs file: /sys/devices/virtual/block/ssr/removable
> EAX: 00000000 EBX: c7208000 ECX: c7930000 EDX: 00000000
> Modules linked in:ESI: c792d848 EDI: 00000001 EBP: c7930db8 ESP: c7930da8
>  ssr DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068
>  netconsoleProcess kblockd/0 (pid: 58, ti=c7930000 task=c78a9780
> task.ti=c7930000)
>  vmblockStack:
>  c7930db8 c044c180 c57e8ba8 c7208000 c7930dd0 c02b873a 00000002 c7205000
> vmci
>  c57e8ba8 00000008 c7930e0c c02b8a96 c055d1c0 63422000 00000086 c7205534
>  c7205000 00000000 000001c5 00000000 c721a52c c71d5000 c7205000 c57e8ba8
>  vmmemctl pcnet32 vmxnet ide_cd_mod crc32Call Trace:
>  [<c02b873a>] ? ide_build_sglist+0x4a/0x60
>  [<c02b8a96>] ? ide_build_dmatable+0x36/0x1a0
>  [<c02b8c3c>] ? ide_dma_setup+0x3c/0x100
>  [<c02b6963>] ? do_rw_taskfile+0x1b3/0x240
>  [<c022df21>] ? elv_dispatch_sort+0xb1/0xd0
>  [<c02b9d75>] ? ide_do_rw_disk+0x215/0x310
>  [<c02b941a>] ? ide_gd_do_request+0xa/0x10
>  [<c02b09ba>] ? ide_do_request+0x48a/0xa90
>  [<c011b4ff>] ? update_curr+0x14f/0x180
>  [<c02b11c9>] ? do_ide_request+0x19/0x20
>  [<c0230583>] ? __generic_unplug_device+0x23/0x30
>  [<c0230801>] ? generic_unplug_device+0x21/0x30
>  cdrom [<c022e94e>] ? blk_unplug_work+0xe/0x10
>  [<c012ed8c>] ? run_workqueue+0xdc/0x1f0
>  [last unloaded: ssr] [<c012ed2a>] ? run_workqueue+0x7a/0x1f0
>  [<c022e940>] ? blk_unplug_work+0x0/0x10
>
>  [<c012f15f>] ? worker_thread+0x4f/0xa0
>
>  [<c0132a50>] ? autoremove_wake_function+0x0/0x50
>  [<c012f110>] ? worker_thread+0x0/0xa0
> Pid: 58, comm: kblockd/0 Tainted: G        W  (2.6.28.4 #5) VMware Virtual
> Platform
>  [<c01327ea>] ? kthread+0x3a/0x70
>  [<c01327b0>] ? kthread+0x0/0x70
> EIP: 0060:[<c010807c>] EFLAGS: 00010046 CPU: 0
>  [<c010415b>] ? kernel_thread_helper+0x7/0x1c
> Code: 00 EIP is at nommu_map_sg+0x9c/0xb0
> 00 01 d8 83 79 04 00 77 bd 39 01 73 b9 31 ff 83 c4 04 89 f8 5b 5e 5f 5d c3
> 90 8d 74 26 00 8b 52 08 85 d2 75 8b e9 77 ff ff ff <0f> 0b 66 90 eb fc 8d b4
> EAX: 00000000 EBX: c7208000 ECX: c7930000 EDX: 00000000
> ESI: c792d848 EDI: 00000001 EBP: c7930db8 ESP: c7930da8
>  DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068
> Process kblockd/0 (pid: 58, ti=c7930000 task=c78a9780 task.ti=c7930000)
> Stack:
>  c7930db8 c044c180 c57e8ba8 c7208000 c7930dd0 c02b873a 00000002 c720500026
>  c57e8ba8 00000008 c7930e0c c02b8a96 c055d1c0 63422000 00000086 c7205534
>  c7205000 00000000 000001c5 00000000 c721a52c00  c71d5000 c7205000 c57e8ba8
> Call Trace:
>  [<c02b873a>] ? ide_build_sglist+0x4a/0x60
>  [<c02b8a96>] ? ide_build_dmatable+0x36/0x1a0
>  [<c02b8c3c>] ? ide_dma_setup+0x3c/0x100
>  [<c02b6963>] ? do_rw_taskfile+0x1b3/0x240
>  [<c022df21>] ? elv_dispatch_sort+0xb1/0xd0
>  [<c02b9d75>] ? ide_do_rw_disk+0x215/0x310
>  [<c02b941a>] ? ide_gd_do_request+0xa/0x10
>  [<c02b09ba>] ? ide_do_request+0x48a/0xa90
>  [<c011b4ff>] ? update_curr+0x14f/0x180
>  [<c02b11c9>] ? do_ide_request+0x19/0x20
>  [<c0230583>] ? __generic_unplug_device+0x23/0x30
> 00  [<c0230801>] ? generic_unplug_device+0x21/0x30
>  [<c022e94e>] ? blk_unplug_work+0xe/0x10
>  [<c012ed8c>] ? run_workqueue+0xdc/0x1f0
>  [<c012ed2a>] ? run_workqueue+0x7a/0x1f0
>  [<c022e940>] ? blk_unplug_work+0x0/0x10
>  [<c012f15f>] ? worker_thread+0x4f/0xa0
>  [<c0132a50>] ? autoremove_wake_function+0x0/0x50
>  [<c012f110>] ? worker_thread+0x0/0xa0
>  [<c01327ea>] ? kthread+0x3a/0x70
>  [<c01327b0>] ? kthread+0x0/0x70
>  [<c010415b>] ? kernel_thread_helper+0x7/0x1c
> Code:  [<c0123905>] ? irq_exit+0x85/0x90
>  [<c010e0a9>] ? smp_apic_timer_interrupt+0x49/0x80
>  [<c0240a08>] ? trace_hardirqs_off_thunk+0xc/0x14
>  [<c0123905>] ? irq_exit+0x85/0x90
>  [<c0104041>] ? apic_timer_interrupt+0x2d/0x34
>  [<c010e0a9>] ? smp_apic_timer_interrupt+0x49/0x80
>  [<c035fcd4>] ? _spin_unlock_irq+0x24/0x60
>  [<c0240a08>] ? trace_hardirqs_off_thunk+0xc/0x14
>  [<c0104041>] ? apic_timer_interrupt+0x2d/0x34
>  [<c014d016>] ? acct_collect+0x126/0x170
>  [<c035fcd4>] ? _spin_unlock_irq+0x24/0x60
>  [<c014d016>] ? acct_collect+0x126/0x170
>  [<c0121f0b>] ? do_exit+0x62b/0x7e0
>  [<c0105775>] ? show_registers+0x85/0x250
>  [<c0121f0b>] ? do_exit+0x62b/0x7e0
>  [<c035d08b>] ? printk+0x18/0x1a
>  [<c0105775>] ? show_registers+0x85/0x250
>  [<c011ea0a>] ? print_oops_end_marker+0x2a/0x30
>  [<c035d08b>] ? printk+0x18/0x1a
>  [<c03611d5>] ? oops_end+0x95/0xa0
>  [<c011ea0a>] ? print_oops_end_marker+0x2a/0x30
>  [<c03611d5>] ? oops_end+0x95/0xa0
>  [<c0105994>] ? die+0x54/0x70
>  [<c013078d>] ? search_exception_tables+0x2d/0x40
>  [<c0105994>] ? die+0x54/0x70
>  [<c03608d1>] ? do_trap+0x91/0xd0
>  [<c013078d>] ? search_exception_tables+0x2d/0x40
>  [<c0104530>] ? do_invalid_op+0x0/0xb0
>

Nu-mi dau seama ce imi scapa :(
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cursuri.cs.pub.ro/pipermail/pso/attachments/20090517/fc8c52c2/attachment.htm>


More information about the pso mailing list