On Tue, 17 Nov 2009 akpm@xxxxxxxxxxxxxxxxxxxx wrote: > From: Alexey Kuznetsov <kuznet@xxxxxxxxxxxxx> > > Asynchronous scan (scsi_add_lun()) sets state to SDEV_RUNNING, but the > device is not registered in sysfs. Before async scan it was OK, because > before releasing scan_mutex old code called either scsi_sysfs_add_sdev() > or scsi_destroy_sdev() and, therefore, completed the work or discarded it. > > With async scan the invariant is broken and scsi crashes in > __scsi_remove_device() when trying to unregister not registered devices. Alexey, have you seen the patches I posted? In particular this one, but also the following three messages: http://marc.info/?l=linux-scsi&m=125675695827770&w=2 It does what you want to accomplish and more. Alan Stern -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html