diff options
-rw-r--r-- | drivers/scsi/libfc/fc_fcp.c | 3 | ||||
-rw-r--r-- | include/scsi/fc_frame.h | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c index 40ed7442d9df..28bfe1c2c50a 100644 --- a/drivers/scsi/libfc/fc_fcp.c +++ b/drivers/scsi/libfc/fc_fcp.c | |||
@@ -574,7 +574,8 @@ static int fc_fcp_send_data(struct fc_fcp_pkt *fsp, struct fc_seq *seq, | |||
574 | tlen -= sg_bytes; | 574 | tlen -= sg_bytes; |
575 | remaining -= sg_bytes; | 575 | remaining -= sg_bytes; |
576 | 576 | ||
577 | if (tlen) | 577 | if ((skb_shinfo(fp_skb(fp))->nr_frags < FC_FRAME_SG_LEN) && |
578 | (tlen)) | ||
578 | continue; | 579 | continue; |
579 | 580 | ||
580 | /* | 581 | /* |
diff --git a/include/scsi/fc_frame.h b/include/scsi/fc_frame.h index c35d2383cc26..148126dcf9e9 100644 --- a/include/scsi/fc_frame.h +++ b/include/scsi/fc_frame.h | |||
@@ -37,6 +37,9 @@ | |||
37 | #define FC_FRAME_HEADROOM 32 /* headroom for VLAN + FCoE headers */ | 37 | #define FC_FRAME_HEADROOM 32 /* headroom for VLAN + FCoE headers */ |
38 | #define FC_FRAME_TAILROOM 8 /* trailer space for FCoE */ | 38 | #define FC_FRAME_TAILROOM 8 /* trailer space for FCoE */ |
39 | 39 | ||
40 | /* Max number of skb frags allowed, reserving one for fcoe_crc_eof page */ | ||
41 | #define FC_FRAME_SG_LEN (MAX_SKB_FRAGS - 1) | ||
42 | |||
40 | #define fp_skb(fp) (&((fp)->skb)) | 43 | #define fp_skb(fp) (&((fp)->skb)) |
41 | #define fr_hdr(fp) ((fp)->skb.data) | 44 | #define fr_hdr(fp) ((fp)->skb.data) |
42 | #define fr_len(fp) ((fp)->skb.len) | 45 | #define fr_len(fp) ((fp)->skb.len) |