[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <56fad7cf-1bf4-82a1-2acc-53a5fc7f9c70@oracle.com>
Date: Wed, 10 May 2023 12:48:27 -0700
From: michael.christie@...cle.com
To: Chris Leech <cleech@...hat.com>, Lee Duncan <lduncan@...e.com>,
linux-scsi@...r.kernel.org, open-iscsi@...glegroups.com,
netdev@...r.kernel.org
Subject: Re: [PATCH 04/11] iscsi: make all iSCSI netlink multicast namespace
aware
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.
Powered by blists - more mailing lists