From: hch@infradead.org (Christoph Hellwig)
Subject: [PATCH v2 2/2] nvme_fc: add uevent for auto-connect
Date: Tue, 30 May 2017 01:39:43 -0700 [thread overview]
Message-ID: <20170530083943.GB18275@infradead.org> (raw)
In-Reply-To: <20170513190559.25484-3-jsmart2021@gmail.com>
> +nvme_fc_signal_discovery_scan(struct nvme_fc_lport *lport,
> + struct nvme_fc_rport *rport)
> +{
> + char hostaddr[80]; /* NVMEFC_HOST_TRADDR=...*/
> + char tgtaddr[80]; /* NVMEFC_TRADDR=...*/
> + char *envp[4] = { "FC_EVENT=nvmediscovery", hostaddr, tgtaddr, NULL };
> +
> + if (!(rport->remoteport.port_role & FC_PORT_ROLE_NVME_DISCOVERY))
> + return;
> +
> + snprintf(hostaddr, sizeof(hostaddr),
> + "NVMEFC_HOST_TRADDR=nn-0x%016llx:pn-0x%016llx",
> + lport->localport.node_name, lport->localport.port_name);
> + snprintf(tgtaddr, sizeof(tgtaddr),
> + "NVMEFC_TRADDR=nn-0x%016llx:pn-0x%016llx",
> + rport->remoteport.node_name, rport->remoteport.port_name);
> + kobject_uevent_env(&nvmefc_device->kobj, KOBJ_CHANGE, envp);
Please use kasprintf so that we have a dynamic allocation and don't
need to hardcode buffer sizes.
> + spin_lock_irqsave(&rport->lock, flags);
> + list_for_each_entry(ctrl, &rport->ctrl_list, ctrl_list) {
> + if (__nvme_fc_options_match(opts, ctrl)) {
> + found = true;
> + break;
> + }
> + }
> + spin_unlock_irqrestore(&rport->lock, flags);
> +
> + if (found) {
> + ret = -EALREADY;
> + goto out_fail;
> + }
Thus seems neither related to the intent of the patch, nor does it make
sense at all.
next prev parent reply other threads:[~2017-05-30 8:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-13 19:05 [PATCH v2 0/2] nvme_fc: add uevent to allow dynamic connects James Smart
2017-05-13 19:05 ` [PATCH v2 1/2] nvme_fc: create fc class and transport device James Smart
2017-05-30 8:36 ` Christoph Hellwig
2017-05-13 19:05 ` [PATCH v2 2/2] nvme_fc: add uevent for auto-connect James Smart
2017-05-30 8:39 ` Christoph Hellwig [this message]
2017-05-22 23:56 ` [PATCH v2 0/2] nvme_fc: add uevent to allow dynamic connects James Smart
2017-05-23 7:17 ` Christoph Hellwig
2017-05-23 16:02 ` James Smart
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=20170530083943.GB18275@infradead.org \
--to=hch@infradead.org \
/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