Comment 9 for bug 1056746

Revision history for this message
Louis Bouchard (louis) wrote : Re: kernel panic on iscsi target disconnect

I must correct one affirmation I made earlier. The issue is also visible on latest Quantal kernel, so the table should read :

Kernel
3.2.0-31-virtual HANG
3.2.0-29-virtual OK
3.2.28-030228-generic HANG (this is the mainline kernel corresponding to 3.2.0-31-virtual I think)
3.5.0-17-generic HANG (Quantal latest)

Kernel bisection outlines the following commit as the first bad :

$ git bisect good [0/1917]
1675b80790e5e373535d87b5ffbfafe7e532b9b9 is the first bad commit
commit 1675b80790e5e373535d87b5ffbfafe7e532b9b9
Author: Dan Williams <email address hidden>
Date: Thu Jun 21 23:47:28 2012 -0700

    fix hot unplug vs async scan race

    BugLink: http://bugs.launchpad.net/bugs/1032640

    commit 3b661a92e869ebe2358de8f4b3230ad84f7fce51 upstream.

    The following crash results from cases where the end_device has been
    removed before scsi_sysfs_add_sdev has had a chance to run.

     BUG: unable to handle kernel NULL pointer dereference at 0000000000000098
     IP: [<ffffffff8115e100>] sysfs_create_dir+0x32/0xb6
     ...
     Call Trace:
      [<ffffffff8125e4a8>] kobject_add_internal+0x120/0x1e3
      [<ffffffff81075149>] ? trace_hardirqs_on+0xd/0xf
      [<ffffffff8125e641>] kobject_add_varg+0x41/0x50
      [<ffffffff8125e70b>] kobject_add+0x64/0x66
      [<ffffffff8131122b>] device_add+0x12d/0x63a
      [<ffffffff814b65ea>] ? _raw_spin_unlock_irqrestore+0x47/0x56
      [<ffffffff8107de15>] ? module_refcount+0x89/0xa0
      [<ffffffff8132f348>] scsi_sysfs_add_sdev+0x4e/0x28a
      [<ffffffff8132dcbb>] do_scan_async+0x9c/0x145

    ...teach scsi_sysfs_add_devices() to check for deleted devices() before
    trying to add them, and teach scsi_remove_target() how to remove targets
    that have not been added via device_add().

    Reported-by: Dariusz Majchrzak <email address hidden>
    Signed-off-by: Dan Williams <email address hidden>
    Signed-off-by: James Bottomley <email address hidden>
    Signed-off-by: Ben Hutchings <email address hidden>
    Signed-off-by: Herton Ronaldo Krzesinski <email address hidden>

:040000 040000 8d739d0b793a09849cc280e781cb3613391ed8f9 ff60255ac7ac2eced39510bec9caf066b431ce7a M drivers