All of lore.kernel.org
 help / color / mirror / Atom feed
From: Martin Wilck <mwilck@suse.com>
To: Bart Van Assche <bvanassche@acm.org>,
	"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, Steffen Maier <maier@linux.ibm.com>,
	Hannes Reinecke <hare@suse.de>,
	Sachin Sant <sachinp@linux.ibm.com>,
	Benjamin Block <bblock@linux.ibm.com>
Subject: Re: [PATCH] scsi: core: Fix the scsi_device_put() might_sleep annotation
Date: Wed, 25 Jan 2023 21:03:04 +0100	[thread overview]
Message-ID: <f28ab37a5cd36476f03b63d5214cf5fb475adfca.camel@suse.com> (raw)
In-Reply-To: <20230125194311.249553-1-bvanassche@acm.org>

On Wed, 2023-01-25 at 11:43 -0800, Bart Van Assche wrote:
> Although most calls of scsi_device_put() happen from non-atomic
> context,
> alua_rtpg_queue() calls this function from atomic context if
> alua_rtpg_queue() itself is called from atomic context.
> alua_rtpg_queue()
> is always called from contexts where the caller must hold at least
> one
> reference to the scsi device in question. This means that the
> reference
> taken by alua_rtpg_queue() itself can't be the last one, and thus can
> be
> dropped without entering the code path in which scsi_device_put()
> might
> actually sleep. Hence move the might_sleep() annotation from
> scsi_device_put() into scsi_device_dev_release().
> 
> [1]
> https://lore.kernel.org/linux-scsi/b49e37d5-edfb-4c56-3eeb-62c7d5855c00@linux.ibm.com/
> [2]
> https://lore.kernel.org/linux-scsi/55c35e64-a7d4-9072-46fd-e8eae6a90e96@linux.ibm.com/
> 
> Note: a significant part of the above description was written by
> Martin
> Wilck.
> 
> Fixes: f93ed747e2c7 ("scsi: core: Release SCSI devices
> synchronously")
> Cc: Martin Wilck <mwilck@suse.com>
> Cc: Steffen Maier <maier@linux.ibm.com>
> Cc: Hannes Reinecke <hare@suse.de>
> Cc: Sachin Sant <sachinp@linux.ibm.com>
> Cc: Benjamin Block <bblock@linux.ibm.com>
> Reported-by: Steffen Maier <maier@linux.ibm.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

Reviewed-by: Martin Wilck <mwilck@suse.com>


  reply	other threads:[~2023-01-25 20:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-25 19:43 [PATCH] scsi: core: Fix the scsi_device_put() might_sleep annotation Bart Van Assche
2023-01-25 20:03 ` Martin Wilck [this message]
2023-01-27  3:22 ` Martin K. Petersen
2023-01-30  7:58   ` Christoph Hellwig
2023-01-30 17:04     ` Martin Wilck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f28ab37a5cd36476f03b63d5214cf5fb475adfca.camel@suse.com \
    --to=mwilck@suse.com \
    --cc=bblock@linux.ibm.com \
    --cc=bvanassche@acm.org \
    --cc=hare@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=maier@linux.ibm.com \
    --cc=martin.petersen@oracle.com \
    --cc=sachinp@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.