All of lore.kernel.org
 help / color / mirror / Atom feed
From: Talker Alex <alextalker@yandex.ru>
To: "linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Cc: "sagi@grimberg.me" <sagi@grimberg.me>
Subject: Re: [PATCH] nvmet: fix null-pointer when removing a referral
Date: Sat, 07 Dec 2019 13:21:55 +0300	[thread overview]
Message-ID: <34676161575714115@iva5-64778ce1ba26.qloud-c.yandex.net> (raw)
In-Reply-To: c797a78a-c9d4-266a-e0ec-bc0baf86e379@grimberg.me

>
> No need to mention irrelevant distro you tested.
>

I just wanted to make a point that older software(native distro kernel)
has no such problem but the MLNX OFED back-port does.
Also, mail list rules as I remember said to test patches before sending,
so I mentioned where precisely I tested it.

> The below section should not exist in the change-log, so you can place
> it under the "---" separator.

So, the correct version of message body would look like that?

>nvmet_referral_release() was called after item->ci_parent
>and item->ci_group were set to NULL by configfs internals.
>This caused oops on older kernels and possibly on the mainline too.
>
>Signed-off-by: Aleksandr Diadiushkin <alextalker@ya.ru>
>---
>
>Tested on CentOS 7.7 (kernel 3.10) and Ubuntu 18.04.3 (kernel 4.15)
>by means of MLNX OFED sources.
>
>This patch is mainly wanted in Mellanox OFED as in-tree nvmet.ko for
>mentioned kernel behaves proper as the bug was introduced about
>a year ago.
>
>I haven't found information about bug-reporting into the Mellanox OFED
>but after taking a look in the mainline I thought that it might need
>this patch too.
>
> drivers/nvme/target/configfs.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
>diff --git a/drivers/nvme/target/configfs.c b/drivers/nvme/target/configfs.c
>index 98613a45bd3b..00f30ab40e69 100644
>--- a/drivers/nvme/target/configfs.c
>+++ b/drivers/nvme/target/configfs.c
>@@ -970,17 +970,19 @@ static struct configfs_attribute *nvmet_referral_attrs[] = {
> 	NULL,
> };
> 
>-static void nvmet_referral_release(struct config_item *item)
>+static void nvmet_referral_release(struct config_group *group,
>+		struct config_item *item)
> {
>-	struct nvmet_port *parent = to_nvmet_port(item->ci_parent->ci_parent);
>+	struct nvmet_port *parent = to_nvmet_port(group->cg_item.ci_parent);
> 	struct nvmet_port *port = to_nvmet_port(item);
> 
> 	nvmet_referral_disable(parent, port);
> 	kfree(port);
>+
>+	config_item_put(item);
> }
> 
> static struct configfs_item_operations nvmet_referral_item_ops = {
>-	.release	= nvmet_referral_release,
> };
> 
> static const struct config_item_type nvmet_referral_type = {
>@@ -1006,6 +1008,7 @@ static struct config_group *nvmet_referral_make(
> 
> static struct configfs_group_operations nvmet_referral_group_ops = {
> 	.make_group		= nvmet_referral_make,
>+	.drop_item		= nvmet_referral_release,
> };
> 
> static const struct config_item_type nvmet_referrals_type = {
>-- 
>2.17.1

Also, am I correctly understood that now I just need to wait for this patch to be accepted?
Or there required some activity on my side to make it happen?
My main goal is to get nvmet module provided by Mellanox OFED fixed
but I'm do know nothing about its development process. I saw some people from
the company mentioned here, so this might be it.


_______________________________________________
linux-nvme mailing list
linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  reply	other threads:[~2019-12-07 10:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-06 20:39 [PATCH] nvmet: fix null-pointer when removing a referral Talker Alex
2019-12-06 22:31 ` Sagi Grimberg
2019-12-07 10:21   ` Talker Alex [this message]
2019-12-12  9:33 ` Christoph Hellwig
2019-12-12 10:36   ` Talker Alex
2019-12-12 10:40     ` Talker Alex
2019-12-12 10:43     ` Christoph Hellwig
2020-01-16 14:15       ` Talker Alex
2020-01-16 16:08         ` Keith Busch

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=34676161575714115@iva5-64778ce1ba26.qloud-c.yandex.net \
    --to=alextalker@yandex.ru \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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.