提交 59436914 编写于 作者: M Michael Chan 提交者: David S. Miller

cnic: Fix missing ISCSI_KEVENT_IF_DOWN message

The iSCSI netlink message needs to be sent before the ulp_ops is cleared
as it is sent through a function pointer in the ulp_ops.  This bug
causes iscsid to not get the message when the bnx2i driver is unloaded.
Signed-off-by: NMichael Chan <mchan@broadcom.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 437b8a26
...@@ -608,6 +608,10 @@ static int cnic_unregister_device(struct cnic_dev *dev, int ulp_type) ...@@ -608,6 +608,10 @@ static int cnic_unregister_device(struct cnic_dev *dev, int ulp_type)
pr_err("%s: Bad type %d\n", __func__, ulp_type); pr_err("%s: Bad type %d\n", __func__, ulp_type);
return -EINVAL; return -EINVAL;
} }
if (ulp_type == CNIC_ULP_ISCSI)
cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL);
mutex_lock(&cnic_lock); mutex_lock(&cnic_lock);
if (rcu_dereference(cp->ulp_ops[ulp_type])) { if (rcu_dereference(cp->ulp_ops[ulp_type])) {
RCU_INIT_POINTER(cp->ulp_ops[ulp_type], NULL); RCU_INIT_POINTER(cp->ulp_ops[ulp_type], NULL);
...@@ -620,9 +624,7 @@ static int cnic_unregister_device(struct cnic_dev *dev, int ulp_type) ...@@ -620,9 +624,7 @@ static int cnic_unregister_device(struct cnic_dev *dev, int ulp_type)
} }
mutex_unlock(&cnic_lock); mutex_unlock(&cnic_lock);
if (ulp_type == CNIC_ULP_ISCSI) if (ulp_type == CNIC_ULP_FCOE)
cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL);
else if (ulp_type == CNIC_ULP_FCOE)
dev->fcoe_cap = NULL; dev->fcoe_cap = NULL;
synchronize_rcu(); synchronize_rcu();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册