From: Philipp Reisner <philipp.reisner@linbit.com>
To: johannes@johannesthoma.com
Cc: drbd-dev@lists.linbit.com
Subject: Re: [Drbd-dev] [PATCH] Added missing kref_debug_put()'s on failure path of drbd_create_device().
Date: Mon, 18 Jun 2018 11:26:34 +0200 [thread overview]
Message-ID: <3455189.oDu6CKLEq0@fat-tyre> (raw)
In-Reply-To: <20180530153727.2334-1-johannes@johannesthoma.com>
Hi Johannes,
the patch does not apply to the current master. Can you find out why, or
find out against which version/Git Hash this patch was created?
best regards,
Phil
Am Mittwoch, 30. Mai 2018, 17:37:27 CEST schrieb johannes@johannesthoma.com:
> From: Johannes Thoma <johannes@johannesthoma.com>
>
> On failing late in drbd_create_device() some kref_debug_put()'s
> were missing, which lead to false positives on kref_debug_destroy().
>
> This patch adds the missing calls.
>
> Signed-off-by: Johannes Thoma <johannes@johannesthoma.com>
> ---
> drbd/drbd_main.c | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/drbd/drbd_main.c b/drbd/drbd_main.c
> index 04ec052..ba60e3b 100644
> --- a/drbd/drbd_main.c
> +++ b/drbd/drbd_main.c
> @@ -3762,11 +3762,14 @@ out_remove_peer_device:
> kfree(peer_device);
> kref_debug_put(&connection->kref_debug, 3);
> kref_put(&connection->kref, drbd_destroy_connection);
> + kref_debug_put(&device->kref_debug, 1);
> }
> idr_remove(&resource->devices, vnr);
> + kref_debug_put(&device->kref_debug, 1);
>
> out_idr_remove_minor:
> idr_remove(&drbd_devices, minor);
> + kref_debug_put(&device->kref_debug, 1);
> out_no_minor_idr:
> if (locked)
> spin_unlock_irq(&resource->req_lock);
> @@ -3787,6 +3790,9 @@ out_no_disk:
> blk_cleanup_queue(q);
> out_no_q:
> kref_put(&resource->kref, drbd_destroy_resource);
> + kref_debug_put(&resource->kref_debug, 4);
> + /* kref debugging wants an extra put, see has_refs() */
> + kref_debug_put(&device->kref_debug, 4);
> kref_debug_destroy(&device->kref_debug);
> kfree(device);
> return err;
--
LINBIT | Keeping The Digital World Running
DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.
next prev parent reply other threads:[~2018-06-18 9:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-30 15:37 [Drbd-dev] [PATCH] Added missing kref_debug_put()'s on failure path of drbd_create_device() johannes
2018-06-18 9:26 ` Philipp Reisner [this message]
2018-06-18 9:44 ` Philipp Reisner
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=3455189.oDu6CKLEq0@fat-tyre \
--to=philipp.reisner@linbit.com \
--cc=drbd-dev@lists.linbit.com \
--cc=johannes@johannesthoma.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