All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: Michael Chan <mchan@broadcom.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
	"James.Bottomley@HansenPartnership.com"
	<James.Bottomley@HansenPartnership.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"open-iscsi@googlegroups.com" <open-iscsi@googlegroups.com>
Subject: Re: [PATCH] cnic: Fix ISCSI_KEVENT_IF_DOWN message handling.
Date: Wed, 29 Jul 2009 03:17:19 -0500	[thread overview]
Message-ID: <4A70058F.50403@cs.wisc.edu> (raw)
In-Reply-To: <C27F8246C663564A84BB7AB343977242178EE780E1@IRVEXCHCCR01.corp.ad.broadcom.com>

Michael Chan wrote:
> Mike Christie wrote:
> 
>> Michael Chan wrote:
>>> When a net device goes down or when the bnx2i driver is unloaded,
>>> the code was not generating the ISCSI_KEVENT_IF_DOWN message
>>> properly and this could cause the userspace driver to crash.
>>>
>>> This is fixed by sending the message properly in the shutdown path.
>>> cnic_uio_stop() is also added to send the message when bnx2i is
>>> unregistering.
>>>
>>> Signed-off-by: Michael Chan <mchan@broadcom.com>
>>> ---
>>>  drivers/net/cnic.c |   23 +++++++++++++++++++++--
>>>  1 files changed, 21 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
>>> index 4d1515f..4869d77 100644
>>> --- a/drivers/net/cnic.c
>>> +++ b/drivers/net/cnic.c
>>> @@ -227,7 +227,7 @@ static int cnic_send_nlmsg(struct
>> cnic_local *cp, u32 type,
>>>     }
>>>
>>>     rcu_read_lock();
>>> -   ulp_ops = rcu_dereference(cp->ulp_ops[CNIC_ULP_ISCSI]);
>>> +   ulp_ops = rcu_dereference(cnic_ulp_tbl[CNIC_ULP_ISCSI]);
>>>     if (ulp_ops)
>>>             ulp_ops->iscsi_nl_send_msg(cp->dev, msg_type, buf, len);
>>>     rcu_read_unlock();
>>> @@ -319,6 +319,20 @@ static int cnic_abort_prep(struct
>> cnic_sock *csk)
>>>     return 0;
>>>  }
>>>
>>> +static void cnic_uio_stop(void)
>>> +{
>>> +   struct cnic_dev *dev;
>>> +
>>> +   read_lock(&cnic_dev_lock);
>>> +   list_for_each_entry(dev, &cnic_dev_list, list) {
>>> +           struct cnic_local *cp = dev->cnic_priv;
>>> +
>>> +           if (cp->cnic_uinfo)
>>> +                   cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL);
>> I don't think you can call this with the cnic_dev_lock held.
>> They have
>> the same sleeping restrictions as a spin_lock right? If so,
>> the problem
>> is that iscsi_nl_send_ms calls iscsi_offload_mesg which uses GFP_NOIO
>> and can sleep.
>>
>>
> In that case, can I send in a patch to change iscsi_offload_mesg() to
> use GFP_ATOMIC?
> 

Yes, I guess so.

  reply	other threads:[~2009-07-29  8:17 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-23  3:01 [PATCH] cnic: Fix ISCSI_KEVENT_IF_DOWN message handling Michael Chan
2009-07-27 18:26 ` David Miller
2009-07-29  7:50 ` Mike Christie
2009-07-29  7:55   ` Michael Chan
2009-07-29  8:17     ` Mike Christie [this message]
     [not found]       ` <4A70058F.50403-hcNo3dDEHLuVc3sceRu5cw@public.gmane.org>
2009-07-29 18:49         ` [PATCH] iscsi: Use GFP_ATOMIC in iscsi_offload_mesg() Michael Chan
2009-07-30  1:40           ` Mike Christie
2009-07-30 18:04             ` David Miller
2009-07-29  8:42     ` [PATCH] cnic: Fix ISCSI_KEVENT_IF_DOWN message handling Anil Veerabhadrappa

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=4A70058F.50403@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=davem@davemloft.net \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mchan@broadcom.com \
    --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.