User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9b5) Gecko/2008042803 Red Hat/3.0b5-0.beta5.6.el5 Firefox/3.0b5 Using the 2.6.18-92.el5PAE kernel (and ONLY with PAE kernel), at queuecommand, I am getting use_sg as 1 (scsi_cmnd->use_sg == 1) and the length of the first sg in the sg list is zero i.e. sg[0].length==0. This issue is seen with a scsi driver. If use_sg is non-zero, then, we are using an sg list and not a buffer,so, sg[0].length should also be non-zero. I do not see this issue with normal RHEL5 Update2 kernel i.e.uname 2.6.18-92.el5 Reproducible: Always Steps to Reproduce: 1.load any scsi based driver 2.go to /sys/class/scsi_host/host<n> and run "echo - - - > scan" Actual Results: The actual behaviour depends on how the driver is written. I put a couple of prints in scsi_prep_fn and scsi_init_io and I see that use_sg is set to 1 (one) and sg[0].length is being set to zero I am trying this PAE kernel on a 64 bit machine with 2 GB of RAM Expected Results: If use_sg is 1, then sg[0].length has to be non-zero [<f8c169fe>] se_build_io_request+0xcb/0x32b [beiscsi] [<f8c16d89>] se_queue+0xf7/0x1a3 [beiscsi] [<f88574f7>] scsi_done+0x0/0x16 [scsi_mod] [<f8857a76>] scsi_dispatch_cmd+0x208/0x281 [scsi_mod] [<f885c1fb>] scsi_request_fn+0x247/0x2f9 [scsi_mod] [<c04d767d>] __generic_unplug_device+0x1d/0x1f [<c04d76f3>] blk_execute_rq_nowait+0x74/0x84 [<c04d7779>] blk_execute_rq+0x76/0x97 [<c04d6e2a>] blk_end_sync_rq+0x0/0x1d [<c04df765>] cfq_set_request+0x0/0x31f [<c0474386>] bio_map_kern+0x8a/0xcf [<c04d5fa4>] blk_rq_bio_prep+0x61/0x7c [<f885bb93>] scsi_execute+0xad/0xbf [scsi_mod] [<f885bc29>] scsi_execute_req+0x84/0xa1 [scsi_mod] [<f885cddb>] scsi_probe_and_add_lun+0x1da/0x8c1 [scsi_mod] [<f885d9b3>] __scsi_scan_target+0xb1/0x58c [scsi_mod] [<c0423870>] wake_up_new_task+0x1be/0x1c6 [<c04254a0>] do_fork+0xd1/0x130 [<f8c1a0bf>] se_set_session_conf+0x1a0/0x1aa [beiscsi] [<c060794e>] mutex_lock+0xb/0x19 [<f885decd>] scsi_scan_channel+0x3f/0x6e [scsi_mod] [<f885df9c>] scsi_scan_host_selected+0xa0/0xd6 [scsi_mod] [<f885dfe1>] scsi_scan_host+0xf/0x12 [scsi_mod] [<f8c18254>] se_pci_dev_probe+0x2b5/0x343 [beiscsi] [<c054cd51>] __driver_attach+0x0/0x6b [<c04edbc0>] pci_device_probe+0x36/0x57 [<c054cca4>] driver_probe_device+0x42/0x92 [<c054cd95>] __driver_attach+0x44/0x6b [<c054c7a2>] bus_for_each_dev+0x37/0x59 [<c054cc0e>] driver_attach+0x11/0x13 [<c054cd51>] __driver_attach+0x0/0x6b [<c054c4aa>] bus_add_driver+0x64/0xfd [<c0438c80>] down_write+0x8/0x19 [<c04edce5>] __pci_register_driver+0x3e/0x58 [<c043e871>] sys_init_module+0x18b5/0x1a60 [<c046d019>] kmem_cache_destroy+0x0/0xf3 [<c0448f0d>] audit_syscall_entry+0x14b/0x17d [<c0404eff>] syscall_call+0x7/0xb ======================= use_sg=1<3>sg[0].len ==0 Vendor: Model: Rev: Type: Direct-Access ANSI SCSI revision: 00 use_sg=0 len=0 <3>use_sg=0 len=0 BUG: warning at include/asm/dma-mapping.h:47/dma_map_sg() (Tainted: G ) [<f8c169fe>] se_build_io_request+0xcb/0x32b [beiscsi] [<f8c16d89>] se_queue+0xf7/0x1a3 [beiscsi] [<f88574f7>] scsi_done+0x0/0x16 [scsi_mod] [<f8857a76>] scsi_dispatch_cmd+0x208/0x281 [scsi_mod] [<f885c1fb>] scsi_request_fn+0x247/0x2f9 [scsi_mod] [<c04d767d>] __generic_unplug_device+0x1d/0x1f [<c04d76f3>] blk_execute_rq_nowait+0x74/0x84 [<c04d7779>] blk_execute_rq+0x76/0x97 [<c04d6e2a>] blk_end_sync_rq+0x0/0x1d [<c04df765>] cfq_set_request+0x0/0x31f [<c0474386>] bio_map_kern+0x8a/0xcf [<c04d5fa4>] blk_rq_bio_prep+0x61/0x7c [<f885bb93>] scsi_execute+0xad/0xbf [scsi_mod] [<f885bc29>] scsi_execute_req+0x84/0xa1 [scsi_mod] [<c06ebe00>] prepare_namespace+0x97/0x118 [<f883e585>] sd_revalidate_disk+0x376/0xd4e [sd_mod] [<c06ebe00>] prepare_namespace+0x97/0x118 [<c06ebe00>] prepare_namespace+0x97/0x118 [<f8840214>] sd_probe+0x2c2/0x356 [sd_mod] [<c054ccf4>] __device_attach+0x0/0x5 [<c054cca4>] driver_probe_device+0x42/0x92 [<c054c6d1>] bus_for_each_drv+0x37/0x5e [<c054cd40>] device_attach+0x47/0x58 [<c054ccf4>] __device_attach+0x0/0x5 [<c054c433>] bus_attach_device+0x13/0x26 [<c054b9f4>] device_add+0x1e5/0x2bf [<f885e9af>] scsi_sysfs_add_sdev+0x2a/0x1d2 [scsi_mod] [<f885d3d8>] scsi_probe_and_add_lun+0x7d7/0x8c1 [scsi_mod] [<f885d9b3>] __scsi_scan_target+0xb1/0x58c [scsi_mod] [<c0423870>] wake_up_new_task+0x1be/0x1c6 [<c04254a0>] do_fork+0xd1/0x130 [<f8c1a0bf>] se_set_session_conf+0x1a0/0x1aa [beiscsi] [<c060794e>] mutex_lock+0xb/0x19 [<f885decd>] scsi_scan_channel+0x3f/0x6e [scsi_mod] [<f885df9c>] scsi_scan_host_selected+0xa0/0xd6 [scsi_mod] [<f885dfe1>] scsi_scan_host+0xf/0x12 [scsi_mod] [<f8c18254>] se_pci_dev_probe+0x2b5/0x343 [beiscsi] [<c054cd51>] __driver_attach+0x0/0x6b [<c04edbc0>] pci_device_probe+0x36/0x57 [<c054cca4>] driver_probe_device+0x42/0x92 [<c054cd95>] __driver_attach+0x44/0x6b [<c054c7a2>] bus_for_each_dev+0x37/0x59 [<c054cc0e>] driver_attach+0x11/0x13 [<c054cd51>] __driver_attach+0x0/0x6b [<c054c4aa>] bus_add_driver+0x64/0xfd [<c0438c80>] down_write+0x8/0x19 [<c04edce5>] __pci_register_driver+0x3e/0x58 [<c043e871>] sys_init_module+0x18b5/0x1a60 [<c046d019>] kmem_cache_destroy+0x0/0xf3 [<c0448f0d>] audit_syscall_entry+0x14b/0x17d [<c0404eff>] syscall_call+0x7/0xb ======================= use_sg=1<3>sg[0].len ==0
What is the length according to CDB when this occurs? What is the command anyway?
Found to be a build issue. Pl close this