public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: "Jan Höppner" <hoeppner@linux.ibm.com>
To: Miroslav Franc <mfranc@suse.cz>, linux-s390@vger.kernel.org
Cc: Stefan Haberland <sth@linux.ibm.com>
Subject: Re: [PATCH] s390/dasd: fix double module refcount decrement
Date: Thu, 11 Jan 2024 13:56:01 +0100	[thread overview]
Message-ID: <a69fb463-384b-4bf1-8cc7-0d442ec72b2c@linux.ibm.com> (raw)
In-Reply-To: <871qap9nyi.fsf@>

On 10/01/2024 17:01, Miroslav Franc wrote:
> Once the discipline is associated with the device, deleting the device
> takes care of decrementing the module's refcount.  Doing it manually on
> this error path causes refcount to artificially decrease on each error
> while it should just stay the same.
> 
> Fixes: c020d722b110 ("s390/dasd: fix panic during offline processing")
> Signed-off-by: Miroslav Franc <mfranc@suse.cz>
> ---
>  drivers/s390/block/dasd.c | 2 --
>  1 file changed, 2 deletions(-)
> 
> diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c
> index 833cfab7d877..739da1c2b71f 100644
> --- a/drivers/s390/block/dasd.c
> +++ b/drivers/s390/block/dasd.c
> @@ -3546,8 +3546,6 @@ int dasd_generic_set_online(struct ccw_device *cdev,
>  	if (rc) {
>  		pr_warn("%s Setting the DASD online with discipline %s failed with rc=%i\n",
>  			dev_name(&cdev->dev), discipline->name, rc);
> -		module_put(discipline->owner);
> -		module_put(base_discipline->owner);

Good catch. I think there is one more line above this part that should
also be removed:

if (!try_module_get(discipline->owner)) {
        module_put(base_discipline->owner); <---
        dasd_delete_device(device);
        return -EINVAL;
}

Can you add it to the patch? Thanks!

>  		dasd_delete_device(device);
>  		return rc;
>  	}
> 


  reply	other threads:[~2024-01-11 12:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-10 16:01 [PATCH] s390/dasd: fix double module refcount decrement Miroslav Franc
2024-01-11 12:56 ` Jan Höppner [this message]
2024-01-11 14:54   ` Miroslav Franc
2024-01-12 10:22     ` Jan Höppner

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=a69fb463-384b-4bf1-8cc7-0d442ec72b2c@linux.ibm.com \
    --to=hoeppner@linux.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=mfranc@suse.cz \
    --cc=sth@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox