Re: [PATCH 1/2] driver core: tell caller if the device/kboject is really released

From: Greg Kroah-Hartman
Date: Thu Sep 30 2021 - 01:51:45 EST


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@xxxxxxxxxx>
> ---
> 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