The server has crashed in ":sg:sg_add+0x349" while scanning for the new SAN devices

Solution Verified - Updated -

Issue

The server has crashed while scanning with rescan-scsi-bus.sh for the newly attached SAN devices with the following call trace in the kernel log:

sg_add: class_device_create failed
Unable to handle kernel NULL pointer dereference at 00000000000000af RIP: 
 [<ffffffff882eac53>] :sg:sg_add+0x349/0x453
PGD 268105067 PUD 1d6f73067 PMD 0 
Oops: 0002 [1] SMP 
last sysfs file: /devices/pci0000:00/0000:00:07.0/0000:06:00.1/host2/rport-2:0-2/target2:0:2/2:0:2:6/rev
CPU 12 
Modules linked in: st mptctl mptbase autofs4 bonding ipv6 ...skip...
Pid: 26152, comm: rescan-scsi-bus Not tainted 2.6.18-308.el5 #1
RIP: 0010:[<ffffffff882eac53>]  [<ffffffff882eac53>] :sg:sg_add+0x349/0x453
RSP: 0018:ffff8100b4095b98  EFLAGS: 00010286
RAX: 0000000000000026 RBX: ffffffffffffffef RCX: ffffffff80323028
RDX: ffffffff80323028 RSI: ffffffffffffffff RDI: ffff8102b75209d8
RBP: 0000000000000200 R08: ffffffff80323028 R09: 0000000000000001
R10: 0000000000000000 R11: 000000000000027f R12: 0000000000000040
R13: ffff81027c5033c0 R14: ffff8102cccd1800 R15: ffff8102b7520800
FS:  00002b6ff7bebf50(0000) GS:ffff81030bf20740(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 00000000000000af CR3: 000000027e7e3000 CR4: 00000000000006a0
Process rescan-scsi-bus (pid: 26152, threadinfo ffff8100b4094000, task ffff81017e9937e0)
Stack:  ffff8102b7520b50 ffff810092064dc0 0000000039fccb70 ffff81030a1e1000
 ffff810044da38e8 ffffffff882f07c0 ffff8102b7520b50 ffffffff8809ca90
 0000000000000000 ffff8102b7520b60 ffffffff8809c9a0 ffffffff801cf774
Call Trace:
 [<ffffffff801cf774>] class_device_add+0x323/0x422
 [<ffffffff8807e664>] :scsi_mod:scsi_sysfs_add_sdev+0x67/0x21b
 [<ffffffff8807c9ff>] :scsi_mod:scsi_probe_and_add_lun+0x8b1/0x9c9
 [<ffffffff8807b037>] :scsi_mod:scsi_execute_req+0x79/0xcf
 [<ffffffff8807d3ff>] :scsi_mod:__scsi_scan_target+0x410/0x5c7
 [<ffffffff8004c929>] sscanf+0x49/0x51
 [<ffffffff8807d874>] :scsi_mod:scsi_scan_target+0x73/0x8a
 [<ffffffff880d7558>] :scsi_transport_fc:fc_user_scan+0xe3/0x135
 [<ffffffff8807e1c4>] :scsi_mod:store_scan+0x9b/0xc5
 [<ffffffff80112648>] sysfs_write_file+0xb9/0xe8
 [<ffffffff80016b5d>] vfs_write+0xce/0x174
 [<ffffffff80017426>] sys_write+0x45/0x6e
 [<ffffffff8005d28d>] tracesys+0xd5/0xe0

Environment

Red Hat Enterprise Linux 5
Red Hat Enterprise Linux 6 is not affected

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content