Commit 9aaa2b46 authored by Mike Christie's avatar Mike Christie Committed by James Bottomley

[SCSI] iscsi bugfixes: dont use GFP_KERNEL for sending errors

iscsi_tcp can send error events from soft irq context so we
cannot use GFP_KERNEL.
Signed-off-by: default avatarMike Christie <michaelc@cs.wisc.edu>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 63f75cc8
...@@ -634,13 +634,13 @@ mempool_zone_get_skb(struct mempool_zone *zone) ...@@ -634,13 +634,13 @@ mempool_zone_get_skb(struct mempool_zone *zone)
} }
static int static int
iscsi_broadcast_skb(struct mempool_zone *zone, struct sk_buff *skb) iscsi_broadcast_skb(struct mempool_zone *zone, struct sk_buff *skb, gfp_t gfp)
{ {
unsigned long flags; unsigned long flags;
int rc; int rc;
skb_get(skb); skb_get(skb);
rc = netlink_broadcast(nls, skb, 0, 1, GFP_KERNEL); rc = netlink_broadcast(nls, skb, 0, 1, gfp);
if (rc < 0) { if (rc < 0) {
mempool_free(skb, zone->pool); mempool_free(skb, zone->pool);
printk(KERN_ERR "iscsi: can not broadcast skb (%d)\n", rc); printk(KERN_ERR "iscsi: can not broadcast skb (%d)\n", rc);
...@@ -749,7 +749,7 @@ void iscsi_conn_error(struct iscsi_cls_conn *conn, enum iscsi_err error) ...@@ -749,7 +749,7 @@ void iscsi_conn_error(struct iscsi_cls_conn *conn, enum iscsi_err error)
ev->r.connerror.cid = conn->cid; ev->r.connerror.cid = conn->cid;
ev->r.connerror.sid = iscsi_conn_get_sid(conn); ev->r.connerror.sid = iscsi_conn_get_sid(conn);
iscsi_broadcast_skb(conn->z_error, skb); iscsi_broadcast_skb(conn->z_error, skb, GFP_ATOMIC);
dev_printk(KERN_INFO, &conn->dev, "iscsi: detected conn error (%d)\n", dev_printk(KERN_INFO, &conn->dev, "iscsi: detected conn error (%d)\n",
error); error);
...@@ -895,7 +895,7 @@ int iscsi_if_destroy_session_done(struct iscsi_cls_conn *conn) ...@@ -895,7 +895,7 @@ int iscsi_if_destroy_session_done(struct iscsi_cls_conn *conn)
* this will occur if the daemon is not up, so we just warn * this will occur if the daemon is not up, so we just warn
* the user and when the daemon is restarted it will handle it * the user and when the daemon is restarted it will handle it
*/ */
rc = iscsi_broadcast_skb(conn->z_pdu, skb); rc = iscsi_broadcast_skb(conn->z_pdu, skb, GFP_KERNEL);
if (rc < 0) if (rc < 0)
dev_printk(KERN_ERR, &conn->dev, "Cannot notify userspace of " dev_printk(KERN_ERR, &conn->dev, "Cannot notify userspace of "
"session destruction event. Check iscsi daemon\n"); "session destruction event. Check iscsi daemon\n");
...@@ -958,7 +958,7 @@ int iscsi_if_create_session_done(struct iscsi_cls_conn *conn) ...@@ -958,7 +958,7 @@ int iscsi_if_create_session_done(struct iscsi_cls_conn *conn)
* this will occur if the daemon is not up, so we just warn * this will occur if the daemon is not up, so we just warn
* the user and when the daemon is restarted it will handle it * the user and when the daemon is restarted it will handle it
*/ */
rc = iscsi_broadcast_skb(conn->z_pdu, skb); rc = iscsi_broadcast_skb(conn->z_pdu, skb, GFP_KERNEL);
if (rc < 0) if (rc < 0)
dev_printk(KERN_ERR, &conn->dev, "Cannot notify userspace of " dev_printk(KERN_ERR, &conn->dev, "Cannot notify userspace of "
"session creation event. Check iscsi daemon\n"); "session creation event. Check iscsi daemon\n");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment