From: iceberg Subject: [BUG] scsi_lib.c: sleeping function called from invalid context Date: Wed, 23 Sep 2009 13:12:23 +0000 Message-ID: <200909231312.23574.strakh@ispras.ru> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from smtp.ispras.ru ([83.149.198.201]:57959 "EHLO smtp.ispras.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751203AbZIWJ26 (ORCPT ); Wed, 23 Sep 2009 05:28:58 -0400 Content-Disposition: inline Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: James.Bottomley@hansenpartnership.com, eric@andante.org, linux-scsi@vger.kernel.org KERNEL_VERSION: 2.6.31 DESCRIBE: Driver scsi_lib.c might sleep in atomic context, because it calls scsi_device_put under spin_lock_irqsave. drivers/scsi/scsi_lib.c:356: spin_lock_irqsave(shost->host_lock, flags); scsi_device_put(sdev); Path to might_sleep macro from scsi_device_put: 1. scsi_device_put calls put_device at ./drivers/scsi/scsi.c:1111 2. put_device calls kobject_put at ./drivers/base/core.c:1038 3. kobject_put calls kref_put at ./lib/kobject.c 4. kref_put may call callback function kobject_release at ./lib/kref.c if refcount becomes zero, which might_sleep because it calls user event. Details: 4.1 kobject_cleanup calls kobject_uevent at ./lib/kobject.c:555 4.2 kobject_uevent calls kobject_uevent_env at ./lib/kobject_uevent.c:282 4.3 kobject_uevent_env calls call_usermodehelper_exec at include/linux/kmod.h:83 4.4 call_usermodehelper_exec calls wait_for_completion at ./kernel/kmod.c:481 4.5 wait_for_completion calls wait_for_common at ./kernel/sched.c:5710 4.5 wait_for_common calls might_sleep at ./kernels/sched.c:5692 Found by: Linux Driver Verification