All of lore.kernel.org
 help / color / mirror / Atom feed
From: michael.christie@oracle.com
To: Chris Leech <cleech@redhat.com>, Lee Duncan <lduncan@suse.com>,
	linux-scsi@vger.kernel.org, open-iscsi@googlegroups.com,
	netdev@vger.kernel.org
Subject: Re: [PATCH 04/11] iscsi: make all iSCSI netlink multicast namespace aware
Date: Wed, 10 May 2023 12:48:27 -0700	[thread overview]
Message-ID: <56fad7cf-1bf4-82a1-2acc-53a5fc7f9c70@oracle.com> (raw)
In-Reply-To: <20230506232930.195451-5-cleech@redhat.com>

On 5/6/23 4:29 PM, Chris Leech wrote:
> @@ -2857,11 +2859,17 @@ void iscsi_post_host_event(uint32_t host_no, struct iscsi_transport *transport,
>  			   enum iscsi_host_event_code code, uint32_t data_size,
>  			   uint8_t *data)
>  {
> +	struct Scsi_Host *shost;
> +	struct net *net;
>  	struct nlmsghdr *nlh;
>  	struct sk_buff *skb;
>  	struct iscsi_uevent *ev;
>  	int len = nlmsg_total_size(sizeof(*ev) + data_size);
>  
> +	shost = scsi_host_lookup(host_no);
> +	if (!shost)
> +		return;
> +
>  	skb = alloc_skb(len, GFP_NOIO);
>  	if (!skb) {

Need scsi_host_put. Maybe just grab the net and do the put before the alloc_skb.


>  		printk(KERN_ERR "gracefully ignored host event (%d):%d OOM\n",
> @@ -2880,7 +2888,9 @@ void iscsi_post_host_event(uint32_t host_no, struct iscsi_transport *transport,
>  	if (data_size)
>  		memcpy((char *)ev + sizeof(*ev), data, data_size);
>  
> -	iscsi_multicast_skb(skb, ISCSI_NL_GRP_ISCSID, GFP_NOIO);
> +	net = iscsi_host_net(shost->shost_data);
> +	scsi_host_put(shost);
> +	iscsi_multicast_skb(net, skb, ISCSI_NL_GRP_ISCSID, GFP_NOIO);
>  }
>  EXPORT_SYMBOL_GPL(iscsi_post_host_event);
>  
> @@ -2888,11 +2898,17 @@ void iscsi_ping_comp_event(uint32_t host_no, struct iscsi_transport *transport,
>  			   uint32_t status, uint32_t pid, uint32_t data_size,
>  			   uint8_t *data)
>  {
> +	struct Scsi_Host *shost;
> +	struct net *net;
>  	struct nlmsghdr *nlh;
>  	struct sk_buff *skb;
>  	struct iscsi_uevent *ev;
>  	int len = nlmsg_total_size(sizeof(*ev) + data_size);
>  
> +	shost = scsi_host_lookup(host_no);
> +	if (!shost)
> +		return;
> +
>  	skb = alloc_skb(len, GFP_NOIO);
>  	if (!skb) {

Same as above.

  reply	other threads:[~2023-05-10 19:48 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-06 23:29 [PATCH v2 00/11] Make iscsid-kernel communications namespace-aware Chris Leech
2023-05-06 23:29 ` [PATCH 01/11] iscsi: create per-net iscsi netlink kernel sockets Chris Leech
2023-05-06 23:29 ` [PATCH 02/11] iscsi: associate endpoints with a host Chris Leech
2023-05-06 23:29 ` [PATCH 03/11] iscsi: sysfs filtering by network namespace Chris Leech
2023-05-10 19:50   ` michael.christie
2023-05-06 23:29 ` [PATCH 04/11] iscsi: make all iSCSI netlink multicast namespace aware Chris Leech
2023-05-10 19:48   ` michael.christie [this message]
2023-05-06 23:29 ` [PATCH 05/11] iscsi: check net namespace for all iscsi lookup Chris Leech
2023-05-12 22:30   ` Mike Christie
2023-05-06 23:29 ` [PATCH 06/11] iscsi: set netns for tcp and iser hosts Chris Leech
2023-05-07  1:29   ` kernel test robot
2023-05-07  2:01   ` kernel test robot
2023-05-10 19:40   ` michael.christie
2023-05-06 23:29 ` [PATCH 07/11] iscsi: convert flashnode devices from bus to class Chris Leech
2023-05-10 19:28   ` michael.christie
2023-05-06 23:29 ` [PATCH 08/11] iscsi: rename iscsi_bus_flash_* to iscsi_flash_* Chris Leech
2023-05-06 23:29 ` [PATCH 09/11] iscsi: filter flashnode sysfs by net namespace Chris Leech
2023-05-06 23:29 ` [PATCH 10/11] iscsi: make session and connection lists per-net Chris Leech
2023-05-10 19:25   ` michael.christie
2023-05-06 23:29 ` [PATCH 11/11] iscsi: force destroy sesions when a network namespace exits Chris Leech
2023-05-10 20:09   ` michael.christie
2023-05-10 20:14     ` michael.christie
2023-05-10 19:54 ` [PATCH v2 00/11] Make iscsid-kernel communications namespace-aware michael.christie

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=56fad7cf-1bf4-82a1-2acc-53a5fc7f9c70@oracle.com \
    --to=michael.christie@oracle.com \
    --cc=cleech@redhat.com \
    --cc=lduncan@suse.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=open-iscsi@googlegroups.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 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.