diff options
author | Yi Zou <yi.zou@intel.com> | 2011-01-28 19:03:15 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2011-02-12 11:56:53 -0500 |
commit | f56635a8695f6b4fccf546cb2d5cf246d1892a0f (patch) | |
tree | 9ed9c69c322e34e6c0bdbcd3e1d6e1b863d50d9f /drivers/scsi/libfc/fc_fcp.c | |
parent | 79775567e0439ca47eb9f501e52c4b713d44cf89 (diff) |
[SCSI] libfc: always initialize the FCoE DDP exchange id for fsp as FC_XID_UNKNOWN
The fsp's xfer_ddp is used as indication of the exchange id for the DDPed
I/O. We should always initialize it as FC_XID_UNKNOWN for a newly allocated
fsp, otherwise the fsp allocated in fc_fcp, i.e., not from queuecommand like
LUN RESET that is not doing DDP may still think DDP is setup for it since xid
0 is valid and goes on to call fc_fcp_ddp_done() in fc_fcp_resp() from
fc_tm_done(). So, set xfer_ddp as FC_XID_UNKNOWN in fc_fcp_pkt_alloc() now.
Also removes the setting of fsp->lp as it's already done when fsp is allocated.
Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: Robert Love <robert.w.love@intel.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/libfc/fc_fcp.c')
-rw-r--r-- | drivers/scsi/libfc/fc_fcp.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/scsi/libfc/fc_fcp.c b/drivers/scsi/libfc/fc_fcp.c index 5962d1a5a674..21a64d4e2edb 100644 --- a/drivers/scsi/libfc/fc_fcp.c +++ b/drivers/scsi/libfc/fc_fcp.c | |||
@@ -155,6 +155,7 @@ static struct fc_fcp_pkt *fc_fcp_pkt_alloc(struct fc_lport *lport, gfp_t gfp) | |||
155 | if (fsp) { | 155 | if (fsp) { |
156 | memset(fsp, 0, sizeof(*fsp)); | 156 | memset(fsp, 0, sizeof(*fsp)); |
157 | fsp->lp = lport; | 157 | fsp->lp = lport; |
158 | fsp->xfer_ddp = FC_XID_UNKNOWN; | ||
158 | atomic_set(&fsp->ref_cnt, 1); | 159 | atomic_set(&fsp->ref_cnt, 1); |
159 | init_timer(&fsp->timer); | 160 | init_timer(&fsp->timer); |
160 | INIT_LIST_HEAD(&fsp->list); | 161 | INIT_LIST_HEAD(&fsp->list); |
@@ -1842,9 +1843,7 @@ static int fc_queuecommand_lck(struct scsi_cmnd *sc_cmd, void (*done)(struct scs | |||
1842 | * build the libfc request pkt | 1843 | * build the libfc request pkt |
1843 | */ | 1844 | */ |
1844 | fsp->cmd = sc_cmd; /* save the cmd */ | 1845 | fsp->cmd = sc_cmd; /* save the cmd */ |
1845 | fsp->lp = lport; /* save the softc ptr */ | ||
1846 | fsp->rport = rport; /* set the remote port ptr */ | 1846 | fsp->rport = rport; /* set the remote port ptr */ |
1847 | fsp->xfer_ddp = FC_XID_UNKNOWN; | ||
1848 | sc_cmd->scsi_done = done; | 1847 | sc_cmd->scsi_done = done; |
1849 | 1848 | ||
1850 | /* | 1849 | /* |
@@ -2112,7 +2111,6 @@ int fc_eh_device_reset(struct scsi_cmnd *sc_cmd) | |||
2112 | * the sc passed in is not setup for execution like when sent | 2111 | * the sc passed in is not setup for execution like when sent |
2113 | * through the queuecommand callout. | 2112 | * through the queuecommand callout. |
2114 | */ | 2113 | */ |
2115 | fsp->lp = lport; /* save the softc ptr */ | ||
2116 | fsp->rport = rport; /* set the remote port ptr */ | 2114 | fsp->rport = rport; /* set the remote port ptr */ |
2117 | 2115 | ||
2118 | /* | 2116 | /* |