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
This commit is contained in:
Joe Eykholt
2010-11-26 21:40:59 +00:00
parent bef485b20f
commit 8e0e14b5e0
4 changed files with 110 additions and 3 deletions
+11 -3
View File
@@ -17,8 +17,8 @@ Signed-off-by: Joe Eykholt <jeykholt@cisco.com>
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
+26
View File
@@ -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 <jeykholt@cisco.com>
---
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;
+71
View File
@@ -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 <jeykholt@cisco.com>
---
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.
+2
View File
@@ -4,3 +4,5 @@
21-lport-hook
22-lport-notify
24-softirq
25-fip-union
26-exch-alloc2