Commit 4ec62b2b authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6:
  [SCSI] megaraid_sas: fix for 32bit apps
  [SCSI] fcoe: Only rmmod fcoe.ko if there are no active connections
  [SCSI] libfcoe: Send port LKA every FIP_VN_KA_PERIOD secs.
  [SCSI] libfc: Don't assume response request present.
  [SCSI] libfc: Fix e_d_tov ns -> ms scaling factor in PLOGI response.
  [SCSI] libfc: call ddp setup for only FCP reads to avoid accessing junk fsp pointer
  [SCSI] iscsi_tcp regression: remove bogus warn on in write path
parents 8386cda3 b3dc1a21
...@@ -2009,6 +2009,8 @@ static int fcoe_destroy(const char *buffer, struct kernel_param *kp) ...@@ -2009,6 +2009,8 @@ static int fcoe_destroy(const char *buffer, struct kernel_param *kp)
fcoe_interface_cleanup(fcoe); fcoe_interface_cleanup(fcoe);
rtnl_unlock(); rtnl_unlock();
fcoe_if_destroy(fcoe->ctlr.lp); fcoe_if_destroy(fcoe->ctlr.lp);
module_put(THIS_MODULE);
out_putdev: out_putdev:
dev_put(netdev); dev_put(netdev);
out_nodev: out_nodev:
...@@ -2059,6 +2061,11 @@ static int fcoe_create(const char *buffer, struct kernel_param *kp) ...@@ -2059,6 +2061,11 @@ static int fcoe_create(const char *buffer, struct kernel_param *kp)
} }
#endif #endif
if (!try_module_get(THIS_MODULE)) {
rc = -EINVAL;
goto out_nomod;
}
rtnl_lock(); rtnl_lock();
netdev = fcoe_if_to_netdev(buffer); netdev = fcoe_if_to_netdev(buffer);
if (!netdev) { if (!netdev) {
...@@ -2099,17 +2106,24 @@ static int fcoe_create(const char *buffer, struct kernel_param *kp) ...@@ -2099,17 +2106,24 @@ static int fcoe_create(const char *buffer, struct kernel_param *kp)
if (!fcoe_link_ok(lport)) if (!fcoe_link_ok(lport))
fcoe_ctlr_link_up(&fcoe->ctlr); fcoe_ctlr_link_up(&fcoe->ctlr);
rc = 0;
out_free:
/* /*
* Release from init in fcoe_interface_create(), on success lport * Release from init in fcoe_interface_create(), on success lport
* should be holding a reference taken in fcoe_if_create(). * should be holding a reference taken in fcoe_if_create().
*/ */
fcoe_interface_put(fcoe); fcoe_interface_put(fcoe);
dev_put(netdev);
rtnl_unlock();
mutex_unlock(&fcoe_config_mutex);
return 0;
out_free:
fcoe_interface_put(fcoe);
out_putdev: out_putdev:
dev_put(netdev); dev_put(netdev);
out_nodev: out_nodev:
rtnl_unlock(); rtnl_unlock();
module_put(THIS_MODULE);
out_nomod:
mutex_unlock(&fcoe_config_mutex); mutex_unlock(&fcoe_config_mutex);
return rc; return rc;
} }
......
...@@ -1187,7 +1187,7 @@ static void fcoe_ctlr_timeout(unsigned long arg) ...@@ -1187,7 +1187,7 @@ static void fcoe_ctlr_timeout(unsigned long arg)
next_timer = fip->ctlr_ka_time; next_timer = fip->ctlr_ka_time;
if (time_after_eq(jiffies, fip->port_ka_time)) { if (time_after_eq(jiffies, fip->port_ka_time)) {
fip->port_ka_time += jiffies + fip->port_ka_time = jiffies +
msecs_to_jiffies(FIP_VN_KA_PERIOD); msecs_to_jiffies(FIP_VN_KA_PERIOD);
fip->send_port_ka = 1; fip->send_port_ka = 1;
} }
......
...@@ -1890,7 +1890,7 @@ static struct fc_seq *fc_exch_seq_send(struct fc_lport *lport, ...@@ -1890,7 +1890,7 @@ static struct fc_seq *fc_exch_seq_send(struct fc_lport *lport,
fc_exch_setup_hdr(ep, fp, ep->f_ctl); fc_exch_setup_hdr(ep, fp, ep->f_ctl);
sp->cnt++; sp->cnt++;
if (ep->xid <= lport->lro_xid) if (ep->xid <= lport->lro_xid && fh->fh_r_ctl == FC_RCTL_DD_UNSOL_CMD)
fc_fcp_ddp_setup(fr_fsp(fp), ep->xid); fc_fcp_ddp_setup(fr_fsp(fp), ep->xid);
if (unlikely(lport->tt.frame_send(lport, fp))) if (unlikely(lport->tt.frame_send(lport, fp)))
......
...@@ -298,9 +298,6 @@ void fc_fcp_ddp_setup(struct fc_fcp_pkt *fsp, u16 xid) ...@@ -298,9 +298,6 @@ void fc_fcp_ddp_setup(struct fc_fcp_pkt *fsp, u16 xid)
{ {
struct fc_lport *lport; struct fc_lport *lport;
if (!fsp)
return;
lport = fsp->lp; lport = fsp->lp;
if ((fsp->req_flags & FC_SRB_READ) && if ((fsp->req_flags & FC_SRB_READ) &&
(lport->lro_enabled) && (lport->tt.ddp_setup)) { (lport->lro_enabled) && (lport->tt.ddp_setup)) {
......
...@@ -1800,6 +1800,7 @@ int fc_lport_bsg_request(struct fc_bsg_job *job) ...@@ -1800,6 +1800,7 @@ int fc_lport_bsg_request(struct fc_bsg_job *job)
u32 did; u32 did;
job->reply->reply_payload_rcv_len = 0; job->reply->reply_payload_rcv_len = 0;
if (rsp)
rsp->resid_len = job->reply_payload.payload_len; rsp->resid_len = job->reply_payload.payload_len;
mutex_lock(&lport->lp_mutex); mutex_lock(&lport->lp_mutex);
......
...@@ -623,7 +623,7 @@ static void fc_rport_plogi_resp(struct fc_seq *sp, struct fc_frame *fp, ...@@ -623,7 +623,7 @@ static void fc_rport_plogi_resp(struct fc_seq *sp, struct fc_frame *fp,
tov = ntohl(plp->fl_csp.sp_e_d_tov); tov = ntohl(plp->fl_csp.sp_e_d_tov);
if (ntohs(plp->fl_csp.sp_features) & FC_SP_FT_EDTR) if (ntohs(plp->fl_csp.sp_features) & FC_SP_FT_EDTR)
tov /= 1000; tov /= 1000000;
if (tov > rdata->e_d_tov) if (tov > rdata->e_d_tov)
rdata->e_d_tov = tov; rdata->e_d_tov = tov;
csp_seq = ntohs(plp->fl_csp.sp_tot_seq); csp_seq = ntohs(plp->fl_csp.sp_tot_seq);
......
...@@ -992,11 +992,9 @@ static struct iscsi_r2t_info *iscsi_tcp_get_curr_r2t(struct iscsi_task *task) ...@@ -992,11 +992,9 @@ static struct iscsi_r2t_info *iscsi_tcp_get_curr_r2t(struct iscsi_task *task)
if (r2t == NULL) { if (r2t == NULL) {
if (kfifo_out(&tcp_task->r2tqueue, if (kfifo_out(&tcp_task->r2tqueue,
(void *)&tcp_task->r2t, sizeof(void *)) != (void *)&tcp_task->r2t, sizeof(void *)) !=
sizeof(void *)) { sizeof(void *))
WARN_ONCE(1, "unexpected fifo state");
r2t = NULL; r2t = NULL;
} else
r2t = tcp_task->r2t; r2t = tcp_task->r2t;
} }
spin_unlock_bh(&session->lock); spin_unlock_bh(&session->lock);
......
...@@ -3781,6 +3781,7 @@ static int megasas_mgmt_compat_ioctl_fw(struct file *file, unsigned long arg) ...@@ -3781,6 +3781,7 @@ static int megasas_mgmt_compat_ioctl_fw(struct file *file, unsigned long arg)
compat_alloc_user_space(sizeof(struct megasas_iocpacket)); compat_alloc_user_space(sizeof(struct megasas_iocpacket));
int i; int i;
int error = 0; int error = 0;
compat_uptr_t ptr;
if (clear_user(ioc, sizeof(*ioc))) if (clear_user(ioc, sizeof(*ioc)))
return -EFAULT; return -EFAULT;
...@@ -3793,9 +3794,22 @@ static int megasas_mgmt_compat_ioctl_fw(struct file *file, unsigned long arg) ...@@ -3793,9 +3794,22 @@ static int megasas_mgmt_compat_ioctl_fw(struct file *file, unsigned long arg)
copy_in_user(&ioc->sge_count, &cioc->sge_count, sizeof(u32))) copy_in_user(&ioc->sge_count, &cioc->sge_count, sizeof(u32)))
return -EFAULT; return -EFAULT;
for (i = 0; i < MAX_IOCTL_SGE; i++) { /*
compat_uptr_t ptr; * The sense_ptr is used in megasas_mgmt_fw_ioctl only when
* sense_len is not null, so prepare the 64bit value under
* the same condition.
*/
if (ioc->sense_len) {
void __user **sense_ioc_ptr =
(void __user **)(ioc->frame.raw + ioc->sense_off);
compat_uptr_t *sense_cioc_ptr =
(compat_uptr_t *)(cioc->frame.raw + cioc->sense_off);
if (get_user(ptr, sense_cioc_ptr) ||
put_user(compat_ptr(ptr), sense_ioc_ptr))
return -EFAULT;
}
for (i = 0; i < MAX_IOCTL_SGE; i++) {
if (get_user(ptr, &cioc->sgl[i].iov_base) || if (get_user(ptr, &cioc->sgl[i].iov_base) ||
put_user(compat_ptr(ptr), &ioc->sgl[i].iov_base) || put_user(compat_ptr(ptr), &ioc->sgl[i].iov_base) ||
copy_in_user(&ioc->sgl[i].iov_len, copy_in_user(&ioc->sgl[i].iov_len,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment