mbox series

[0/4] Call scsi_device_put() from non-atomic context

Message ID 20221031224728.2607760-1-bvanassche@acm.org
Headers show
Series Call scsi_device_put() from non-atomic context | expand

Message

Bart Van Assche Oct. 31, 2022, 10:47 p.m. UTC
Hi Martin,

As reported by Dan Carpenter, a recent change may cause scsi_device_put() to
sleep while a few callers remain that call scsi_device_put() from atomic
context. This patch series converts those callers. Please consider this patch
series for the 6.0 kernel.

Thanks,

Bart.

Bart Van Assche (4):
  scsi: alua: Move a scsi_device_put() call out of alua_check_vpd()
  scsi: alua: Move a scsi_device_put() call out of
    alua_rtpg_select_sdev()
  scsi: bfa: Convert bfad_reset_sdev_bflags() from a macro into a
    function
  scsi: bfa: Rework bfad_reset_sdev_bflags()

 drivers/scsi/bfa/bfad_bsg.c                | 29 ++++++++++
 drivers/scsi/bfa/bfad_im.h                 | 26 ---------
 drivers/scsi/device_handler/scsi_dh_alua.c | 61 ++++++++++++++--------
 3 files changed, 68 insertions(+), 48 deletions(-)

Comments

Hannes Reinecke Nov. 2, 2022, 2:27 p.m. UTC | #1
On 10/31/22 23:47, Bart Van Assche wrote:
> This patch fixes the following smatch warning:
> 
> drivers/scsi/device_handler/scsi_dh_alua.c:1013 alua_rtpg_queue() warn: sleeping in atomic context
> 
> alua_check_vpd() <- disables preempt
> -> alua_rtpg_queue()
>     -> scsi_device_put()
> 
> Cc: Hannes Reinecke <hare@suse.de>
> Cc: Dan Carpenter <dan.carpenter@oracle.com>
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
>   drivers/scsi/device_handler/scsi_dh_alua.c | 23 ++++++++++++++--------
>   1 file changed, 15 insertions(+), 8 deletions(-)
> 
Reviewed-by: Hannes Reinecke <hare@suse.de>

Cheers,

Hannes
Martin K. Petersen Nov. 8, 2022, 3:36 a.m. UTC | #2
Bart,

> As reported by Dan Carpenter, a recent change may cause
> scsi_device_put() to sleep while a few callers remain that call
> scsi_device_put() from atomic context. This patch series converts
> those callers. Please consider this patch series for the 6.0 kernel.

Applied to 6.2/scsi-staging, thanks!
Martin K. Petersen Nov. 17, 2022, 6:29 p.m. UTC | #3
On Mon, 31 Oct 2022 15:47:24 -0700, Bart Van Assche wrote:

> As reported by Dan Carpenter, a recent change may cause scsi_device_put() to
> sleep while a few callers remain that call scsi_device_put() from atomic
> context. This patch series converts those callers. Please consider this patch
> series for the 6.0 kernel.
> 
> Thanks,
> 
> [...]

Applied to 6.2/scsi-queue, thanks!

[1/4] scsi: alua: Move a scsi_device_put() call out of alua_check_vpd()
      https://git.kernel.org/mkp/scsi/c/0b25e17e9018
[2/4] scsi: alua: Move a scsi_device_put() call out of alua_rtpg_select_sdev()
      https://git.kernel.org/mkp/scsi/c/379e2554e3d1
[3/4] scsi: bfa: Convert bfad_reset_sdev_bflags() from a macro into a function
      https://git.kernel.org/mkp/scsi/c/2e5a6c3baccd
[4/4] scsi: bfa: Rework bfad_reset_sdev_bflags()
      https://git.kernel.org/mkp/scsi/c/2e79cf37b15b