All of lore.kernel.org
 help / color / mirror / Atom feed
From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH 3/4] nvmet: Add controllers to configfs
Date: Mon, 4 Dec 2017 23:39:20 +0100	[thread overview]
Message-ID: <20171204223920.GC19672@lst.de> (raw)
In-Reply-To: <1510576183-17215-4-git-send-email-israelr@mellanox.com>

On Mon, Nov 13, 2017@12:29:42PM +0000, Israel Rukshin wrote:
> The commit show all the controllers and some info about them.
> This will allow the user to monitor the created controllers from target
> point of view.
> The "controllers" folder was added per subsystem under:
> /config/nvmet/subsystems/<SUBSYSTEM_NAME>/controllers/<CTRL_ID>/
> 
> <CTRL_ID> folder consists of:
>  - hostnqn: Host NQN

This makes sense.

>  - port_traddr: Port Transport Address
>  - port_trsvcid: Port Transport Service ID

These are port properties.  You probably want to create a symlink
to the port from the controller directory instead.

> +void nvmet_ctrl_configfs_del(struct nvmet_ctrl *ctrl)
> +{
> +	if (d_inode(ctrl->group.cg_item.ci_dentry))
> +		configfs_unregister_group(&ctrl->group);
> +}

Are we even guaranteed that the denty is still around?  What happens
if you do a drop of all caches after the manual removal and then
?xecute this path later?
> +	int res = 0;
> +	char name[CONFIGFS_ITEM_NAME_LEN];
> +
> +	sprintf(name, "%d", ctrl->cntlid);
> +	pr_debug("Adding controller %s to configfs\n", name);
> +
> +	config_group_init_type_name(&ctrl->group, name, &nvmet_ctrl_type);
> +

Hmm - we probably should either add varargs to config_group_init_type_name
or just open code it.  config_item_set_name takes varargs, so having
this static buffer is a little silly.  I'll take a look at the configfs
side.

  parent reply	other threads:[~2017-12-04 22:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-11-13 12:29 [PATCH v2 0/4] Add controllers to nvmet configfs Israel Rukshin
2017-11-13 12:29 ` [PATCH 1/4] nvmet: Fix error flow in nvmet_alloc_ctrl() Israel Rukshin
2017-12-04 22:33   ` Christoph Hellwig
2017-11-13 12:29 ` [PATCH 2/4] nvmet: Rearrange nvmet_ctrl_free() Israel Rukshin
2017-12-04 22:33   ` Christoph Hellwig
2017-11-13 12:29 ` [PATCH 3/4] nvmet: Add controllers to configfs Israel Rukshin
2017-11-13 20:18   ` Sagi Grimberg
2017-11-14 10:04     ` Israel Rukshin
2017-12-04 22:39   ` Christoph Hellwig [this message]
2017-11-13 12:29 ` [PATCH 4/4] nvmet: Add feature close connection from target side Israel Rukshin
2017-11-13 20:21   ` Sagi Grimberg
2017-11-14  9:10     ` Israel Rukshin
2017-11-16 15:49       ` Sagi Grimberg
2017-12-04 22:40         ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2017-10-10 11:40 [PATCH 0/4] Add controllers to nvmet configfs Israel Rukshin
2017-10-10 11:40 ` [PATCH 3/4] nvmet: Add controllers to configfs Israel Rukshin
2017-10-11 11:36   ` Sagi Grimberg
     [not found]   ` <d06594ae-225e-8065-bead-019c99f309ad@gmail.com>
2017-10-12 15:58     ` Max Gurtovoy
     [not found]   ` <834d07fa-5830-ea7a-11b1-f20ebf47831c@gmail.com>
2017-10-15 13:25     ` Max Gurtovoy

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=20171204223920.GC19672@lst.de \
    --to=hch@lst.de \
    /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.