diff options
Diffstat (limited to 'drivers/scsi/libfc/fc_fcp.c')
-rw-r--r-- | drivers/scsi/libfc/fc_fcp.c | 31 |
1 files changed, 1 insertions, 30 deletions
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c index e303e0d12c4b..59a4408b27b5 100644 --- a/drivers/scsi/libfc/fc_fcp.c +++ b/drivers/scsi/libfc/fc_fcp.c | |||
@@ -507,33 +507,6 @@ static int fc_fcp_send_data(struct fc_fcp_pkt *fsp, struct fc_seq *seq, | |||
507 | f_ctl = FC_FC_REL_OFF; | 507 | f_ctl = FC_FC_REL_OFF; |
508 | WARN_ON(!seq); | 508 | WARN_ON(!seq); |
509 | 509 | ||
510 | /* | ||
511 | * If a get_page()/put_page() will fail, don't use sg lists | ||
512 | * in the fc_frame structure. | ||
513 | * | ||
514 | * The put_page() may be long after the I/O has completed | ||
515 | * in the case of FCoE, since the network driver does it | ||
516 | * via free_skb(). See the test in free_pages_check(). | ||
517 | * | ||
518 | * Test this case with 'dd </dev/zero >/dev/st0 bs=64k'. | ||
519 | */ | ||
520 | if (using_sg) { | ||
521 | for (sg = scsi_sglist(sc); sg; sg = sg_next(sg)) { | ||
522 | if (page_count(sg_page(sg)) == 0 || | ||
523 | (sg_page(sg)->flags & (1 << PG_lru | | ||
524 | 1 << PG_private | | ||
525 | 1 << PG_locked | | ||
526 | 1 << PG_active | | ||
527 | 1 << PG_slab | | ||
528 | 1 << PG_swapcache | | ||
529 | 1 << PG_writeback | | ||
530 | 1 << PG_reserved | | ||
531 | 1 << PG_buddy))) { | ||
532 | using_sg = 0; | ||
533 | break; | ||
534 | } | ||
535 | } | ||
536 | } | ||
537 | sg = scsi_sglist(sc); | 510 | sg = scsi_sglist(sc); |
538 | 511 | ||
539 | while (remaining > 0 && sg) { | 512 | while (remaining > 0 && sg) { |
@@ -569,8 +542,6 @@ static int fc_fcp_send_data(struct fc_fcp_pkt *fsp, struct fc_seq *seq, | |||
569 | } | 542 | } |
570 | sg_bytes = min(tlen, sg->length - offset); | 543 | sg_bytes = min(tlen, sg->length - offset); |
571 | if (using_sg) { | 544 | if (using_sg) { |
572 | WARN_ON(skb_shinfo(fp_skb(fp))->nr_frags > | ||
573 | FC_FRAME_SG_LEN); | ||
574 | get_page(sg_page(sg)); | 545 | get_page(sg_page(sg)); |
575 | skb_fill_page_desc(fp_skb(fp), | 546 | skb_fill_page_desc(fp_skb(fp), |
576 | skb_shinfo(fp_skb(fp))->nr_frags, | 547 | skb_shinfo(fp_skb(fp))->nr_frags, |
@@ -1337,7 +1308,7 @@ static void fc_fcp_rec(struct fc_fcp_pkt *fsp) | |||
1337 | fc_fill_fc_hdr(fp, FC_RCTL_ELS_REQ, rport->port_id, | 1308 | fc_fill_fc_hdr(fp, FC_RCTL_ELS_REQ, rport->port_id, |
1338 | fc_host_port_id(rp->local_port->host), FC_TYPE_ELS, | 1309 | fc_host_port_id(rp->local_port->host), FC_TYPE_ELS, |
1339 | FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0); | 1310 | FC_FC_FIRST_SEQ | FC_FC_END_SEQ | FC_FC_SEQ_INIT, 0); |
1340 | if (lp->tt.elsct_send(lp, rport, fp, ELS_REC, fc_fcp_rec_resp, | 1311 | if (lp->tt.elsct_send(lp, rport->port_id, fp, ELS_REC, fc_fcp_rec_resp, |
1341 | fsp, jiffies_to_msecs(FC_SCSI_REC_TOV))) { | 1312 | fsp, jiffies_to_msecs(FC_SCSI_REC_TOV))) { |
1342 | fc_fcp_pkt_hold(fsp); /* hold while REC outstanding */ | 1313 | fc_fcp_pkt_hold(fsp); /* hold while REC outstanding */ |
1343 | return; | 1314 | return; |