From 8e0e14b5e0f3afa89f4ba25379d21d61867d521b Mon Sep 17 00:00:00 2001 From: Joe Eykholt Date: Fri, 26 Nov 2010 21:40:59 +0000 Subject: [PATCH] My previous commit failed to include 2 critical patches, plus had the wrong version of 22-lport-notify. This corrects that. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2845 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- fcst/linux-patches/22-lport-notify | 14 ++++-- fcst/linux-patches/25-fip-union | 26 +++++++++++ fcst/linux-patches/26-exch-alloc2 | 71 ++++++++++++++++++++++++++++++ fcst/linux-patches/series-2.6.36 | 2 + 4 files changed, 110 insertions(+), 3 deletions(-) create mode 100644 fcst/linux-patches/25-fip-union create mode 100644 fcst/linux-patches/26-exch-alloc2 diff --git a/fcst/linux-patches/22-lport-notify b/fcst/linux-patches/22-lport-notify index 33b35f95c..bcf6fccb0 100644 --- a/fcst/linux-patches/22-lport-notify +++ b/fcst/linux-patches/22-lport-notify @@ -17,8 +17,8 @@ Signed-off-by: Joe Eykholt drivers/scsi/libfc/fc_libfc.c | 41 +++++++++++++++++++++++++++++++++++++++++ drivers/scsi/libfc/fc_libfc.h | 2 ++ drivers/scsi/libfc/fc_lport.c | 2 ++ - include/scsi/libfc.h | 13 ++++++++++++- - 4 files changed, 57 insertions(+), 1 deletions(-) + include/scsi/libfc.h | 14 +++++++++++++- + 4 files changed, 58 insertions(+), 1 deletions(-) --- @@ -119,7 +119,7 @@ index eec9d31..e2311f0 100644 return 0; } diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h -index 769d480..50a6e87 100644 +index 769d480..af8a6e8 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h @@ -765,6 +765,15 @@ struct fc_disc { @@ -157,3 +157,11 @@ index 769d480..50a6e87 100644 void *prov[FC_FC4_PROV_SIZE]; }; +@@ -1018,6 +1029,7 @@ struct fc_lport *libfc_vport_create(struct fc_vport *, int privsize); + struct fc_lport *fc_vport_id_lookup(struct fc_lport *, u32 port_id); + int fc_lport_bsg_request(struct fc_bsg_job *); + void fc_lport_set_local_id(struct fc_lport *, u32 port_id); ++void fc_lport_iterate(void (*func)(struct fc_lport *, void *), void *); + + /* + * REMOTE PORT LAYER diff --git a/fcst/linux-patches/25-fip-union b/fcst/linux-patches/25-fip-union new file mode 100644 index 000000000..4c827d589 --- /dev/null +++ b/fcst/linux-patches/25-fip-union @@ -0,0 +1,26 @@ +libfcoe: fix stack damage caused by using union instead of struct + +TBD. This was already submitted by someone else +but didn't make it into 2.6.36. + +Signed-off-by: Joe Eykholt + +--- + drivers/scsi/fcoe/libfcoe.c | 2 +- + 1 files changed, 1 insertions(+), 1 deletions(-) + + +--- +diff --git a/drivers/scsi/fcoe/libfcoe.c b/drivers/scsi/fcoe/libfcoe.c +index aa503d8..bc17c71 100644 +--- a/drivers/scsi/fcoe/libfcoe.c ++++ b/drivers/scsi/fcoe/libfcoe.c +@@ -2296,7 +2296,7 @@ static int fcoe_ctlr_vn_recv(struct fcoe_ctlr *fip, struct sk_buff *skb) + { + struct fip_header *fiph; + enum fip_vn2vn_subcode sub; +- union { ++ struct { + struct fc_rport_priv rdata; + struct fcoe_rport frport; + } buf; diff --git a/fcst/linux-patches/26-exch-alloc2 b/fcst/linux-patches/26-exch-alloc2 new file mode 100644 index 000000000..ca640da2a --- /dev/null +++ b/fcst/linux-patches/26-exch-alloc2 @@ -0,0 +1,71 @@ +libfc: export seq_release() for users of seq_assign() + +Target modules using lport->tt.seq_assign() get a hold on the +exchange but have no way of releasing it. Add that. + +Signed-off-by: Joe Eykholt + +--- + drivers/scsi/libfc/fc_exch.c | 14 ++++++++++++++ + include/scsi/libfc.h | 7 +++++++ + 2 files changed, 21 insertions(+), 0 deletions(-) + + +--- +diff --git a/drivers/scsi/libfc/fc_exch.c b/drivers/scsi/libfc/fc_exch.c +index 0000ddf..0deb901 100644 +--- a/drivers/scsi/libfc/fc_exch.c ++++ b/drivers/scsi/libfc/fc_exch.c +@@ -1252,6 +1252,8 @@ free: + * @fp: The request frame + * + * On success, the sequence pointer will be returned and also in fr_seq(@fp). ++ * A reference will be held on the exchange/sequence for the caller, which ++ * must call fc_seq_release(). + */ + static struct fc_seq *fc_seq_assign(struct fc_lport *lport, struct fc_frame *fp) + { +@@ -1269,6 +1271,15 @@ static struct fc_seq *fc_seq_assign(struct fc_lport *lport, struct fc_frame *fp) + } + + /** ++ * fc_seq_release() - Release the hold ++ * @sp: The sequence. ++ */ ++static void fc_seq_release(struct fc_seq *sp) ++{ ++ fc_exch_release(fc_seq_exch(sp)); ++} ++ ++/** + * fc_exch_recv_req() - Handler for an incoming request + * @lport: The local port that received the request + * @mp: The EM that the exchange is on +@@ -2337,6 +2348,9 @@ int fc_exch_init(struct fc_lport *lport) + if (!lport->tt.seq_assign) + lport->tt.seq_assign = fc_seq_assign; + ++ if (!lport->tt.seq_release) ++ lport->tt.seq_release = fc_seq_release; ++ + return 0; + } + EXPORT_SYMBOL(fc_exch_init); +diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h +index af8a6e8..875e3a8 100644 +--- a/include/scsi/libfc.h ++++ b/include/scsi/libfc.h +@@ -574,6 +574,13 @@ struct libfc_function_template { + void *arg); + + /* ++ * Release the reference on the sequence returned by seq_assign(). ++ * ++ * STATUS: OPTIONAL ++ */ ++ void (*seq_release)(struct fc_seq *); ++ ++ /* + * Reset an exchange manager, completing all sequences and exchanges. + * If s_id is non-zero, reset only exchanges originating from that FID. + * If d_id is non-zero, reset only exchanges sending to that FID. diff --git a/fcst/linux-patches/series-2.6.36 b/fcst/linux-patches/series-2.6.36 index 1db6f7715..b3fba47ce 100644 --- a/fcst/linux-patches/series-2.6.36 +++ b/fcst/linux-patches/series-2.6.36 @@ -4,3 +4,5 @@ 21-lport-hook 22-lport-notify 24-softirq +25-fip-union +26-exch-alloc2