public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Ming Lei <ming.lei@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org,
	"Martin K . Petersen" <martin.petersen@oracle.com>,
	Changhui Zhong <czhong@redhat.com>,
	Yi Zhang <yi.zhang@redhat.com>
Subject: Re: [PATCH 1/2] driver core: tell caller if the device/kboject is really released
Date: Thu, 30 Sep 2021 07:51:35 +0200	[thread overview]
Message-ID: <YVVQZ/yVpFJ7Abg5@kroah.com> (raw)
In-Reply-To: <20210930052028.934747-2-ming.lei@redhat.com>

On Thu, Sep 30, 2021 at 01:20:27PM +0800, Ming Lei wrote:
> Return if the device/kobject is really released to caller.
> 
> One use case is scsi_device_put() and the scsi device's release handler
> runs async work to clean up things. We have to piggyback the module_put()
> into the async work for avoiding to touch unmapped module page.
> 
> Signed-off-by: Ming Lei <ming.lei@redhat.com>
> ---
>  drivers/base/core.c     | 5 +++--
>  include/linux/device.h  | 2 +-
>  include/linux/kobject.h | 2 +-
>  lib/kobject.c           | 5 +++--
>  4 files changed, 8 insertions(+), 6 deletions(-)

I really don't like this as you should not ever care if you are
releasing the last reference on an object or not.

Why are you needing this?

And if you really do need this, you MUST document how this works in the
apis you are changing here, so I can't take this as is sorry.

greg k-h

  reply	other threads:[~2021-09-30  5:51 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-30  5:20 [PATCH 0/2] SCSI: fix race between releasing shost and unloading LLD module Ming Lei
2021-09-30  5:20 ` [PATCH 1/2] driver core: tell caller if the device/kboject is really released Ming Lei
2021-09-30  5:51   ` Greg Kroah-Hartman [this message]
2021-09-30  7:22     ` Ming Lei
2021-09-30  5:20 ` [PATCH 2/2] scsi: core: put LLD module refcnt after SCSI device is released Ming Lei
2021-09-30  5:57   ` Greg Kroah-Hartman

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=YVVQZ/yVpFJ7Abg5@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=czhong@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=ming.lei@redhat.com \
    --cc=yi.zhang@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox