Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[SCSI] iscsi class: fix gfp use in ping compl and host event

If a ping or host event were to occur when memory is low
we do not want to use GFP_KERNEL, because the paths
sending them cannot block for data to be written. These
paths might be needed to recover write paths. Use GFP_NOIO
instead.

Signed-off-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>

authored by

Mike Christie and committed by
James Bottomley
49d0e64b 76c8ae4b

+4 -4
+4 -4
drivers/scsi/scsi_transport_iscsi.c
··· 1486 1486 struct iscsi_uevent *ev; 1487 1487 int len = NLMSG_SPACE(sizeof(*ev) + data_size); 1488 1488 1489 - skb = alloc_skb(len, GFP_KERNEL); 1489 + skb = alloc_skb(len, GFP_NOIO); 1490 1490 if (!skb) { 1491 1491 printk(KERN_ERR "gracefully ignored host event (%d):%d OOM\n", 1492 1492 host_no, code); ··· 1504 1504 if (data_size) 1505 1505 memcpy((char *)ev + sizeof(*ev), data, data_size); 1506 1506 1507 - iscsi_multicast_skb(skb, ISCSI_NL_GRP_ISCSID, GFP_KERNEL); 1507 + iscsi_multicast_skb(skb, ISCSI_NL_GRP_ISCSID, GFP_NOIO); 1508 1508 } 1509 1509 EXPORT_SYMBOL_GPL(iscsi_post_host_event); 1510 1510 ··· 1517 1517 struct iscsi_uevent *ev; 1518 1518 int len = NLMSG_SPACE(sizeof(*ev) + data_size); 1519 1519 1520 - skb = alloc_skb(len, GFP_KERNEL); 1520 + skb = alloc_skb(len, GFP_NOIO); 1521 1521 if (!skb) { 1522 1522 printk(KERN_ERR "gracefully ignored ping comp: OOM\n"); 1523 1523 return; ··· 1533 1533 ev->r.ping_comp.data_size = data_size; 1534 1534 memcpy((char *)ev + sizeof(*ev), data, data_size); 1535 1535 1536 - iscsi_multicast_skb(skb, ISCSI_NL_GRP_ISCSID, GFP_KERNEL); 1536 + iscsi_multicast_skb(skb, ISCSI_NL_GRP_ISCSID, GFP_NOIO); 1537 1537 } 1538 1538 EXPORT_SYMBOL_GPL(iscsi_ping_comp_event); 1539 1539