Skip to content

Commit c8912f2

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending
Pull target fixes from Nicholas Bellinger: "Two minor target fixes. There is really nothing exciting and/or controversial this time around. There's one fix from MDR for a RCU debug warning message within tcm_fc code (CC'ed to stable), and a small AC fix for qla_target.c based upon a recent Coverity static report. Also, there is one other outstanding virtio-scsi LUN scanning bugfix that has been uncovered with the in-flight tcm_vhost driver over the last days, and that needs to make it into 3.5 final too. This patch has been posted to linux-scsi again here: http://marc.info/?l=linux-scsi&m=134160609212542&w=2 and I've asked James to include it in his next PULL request." * git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: qla2xxx: print the right array elements in qlt_async_event tcm_fc: Resolve suspicious RCU usage warnings
2 parents af9b9a5 + 4f1d0f1 commit c8912f2

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

drivers/scsi/qla2xxx/qla_target.c

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3960,7 +3960,7 @@ void qlt_async_event(uint16_t code, struct scsi_qla_host *vha,
39603960
{
39613961
struct qla_hw_data *ha = vha->hw;
39623962
struct qla_tgt *tgt = ha->tgt.qla_tgt;
3963-
int reason_code;
3963+
int login_code;
39643964

39653965
ql_dbg(ql_dbg_tgt, vha, 0xe039,
39663966
"scsi(%ld): ha state %d init_done %d oper_mode %d topo %d\n",
@@ -4003,9 +4003,9 @@ void qlt_async_event(uint16_t code, struct scsi_qla_host *vha,
40034003
{
40044004
ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03b,
40054005
"qla_target(%d): Async LOOP_UP occured "
4006-
"(m[1]=%x, m[2]=%x, m[3]=%x, m[4]=%x)", vha->vp_idx,
4007-
le16_to_cpu(mailbox[1]), le16_to_cpu(mailbox[2]),
4008-
le16_to_cpu(mailbox[3]), le16_to_cpu(mailbox[4]));
4006+
"(m[0]=%x, m[1]=%x, m[2]=%x, m[3]=%x)", vha->vp_idx,
4007+
le16_to_cpu(mailbox[0]), le16_to_cpu(mailbox[1]),
4008+
le16_to_cpu(mailbox[2]), le16_to_cpu(mailbox[3]));
40094009
if (tgt->link_reinit_iocb_pending) {
40104010
qlt_send_notify_ack(vha, (void *)&tgt->link_reinit_iocb,
40114011
0, 0, 0, 0, 0, 0);
@@ -4020,33 +4020,34 @@ void qlt_async_event(uint16_t code, struct scsi_qla_host *vha,
40204020
case MBA_RSCN_UPDATE:
40214021
ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03c,
40224022
"qla_target(%d): Async event %#x occured "
4023-
"(m[1]=%x, m[2]=%x, m[3]=%x, m[4]=%x)", vha->vp_idx, code,
4024-
le16_to_cpu(mailbox[1]), le16_to_cpu(mailbox[2]),
4025-
le16_to_cpu(mailbox[3]), le16_to_cpu(mailbox[4]));
4023+
"(m[0]=%x, m[1]=%x, m[2]=%x, m[3]=%x)", vha->vp_idx, code,
4024+
le16_to_cpu(mailbox[0]), le16_to_cpu(mailbox[1]),
4025+
le16_to_cpu(mailbox[2]), le16_to_cpu(mailbox[3]));
40264026
break;
40274027

40284028
case MBA_PORT_UPDATE:
40294029
ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03d,
40304030
"qla_target(%d): Port update async event %#x "
4031-
"occured: updating the ports database (m[1]=%x, m[2]=%x, "
4032-
"m[3]=%x, m[4]=%x)", vha->vp_idx, code,
4033-
le16_to_cpu(mailbox[1]), le16_to_cpu(mailbox[2]),
4034-
le16_to_cpu(mailbox[3]), le16_to_cpu(mailbox[4]));
4035-
reason_code = le16_to_cpu(mailbox[2]);
4036-
if (reason_code == 0x4)
4031+
"occured: updating the ports database (m[0]=%x, m[1]=%x, "
4032+
"m[2]=%x, m[3]=%x)", vha->vp_idx, code,
4033+
le16_to_cpu(mailbox[0]), le16_to_cpu(mailbox[1]),
4034+
le16_to_cpu(mailbox[2]), le16_to_cpu(mailbox[3]));
4035+
4036+
login_code = le16_to_cpu(mailbox[2]);
4037+
if (login_code == 0x4)
40374038
ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03e,
40384039
"Async MB 2: Got PLOGI Complete\n");
4039-
else if (reason_code == 0x7)
4040+
else if (login_code == 0x7)
40404041
ql_dbg(ql_dbg_tgt_mgt, vha, 0xf03f,
40414042
"Async MB 2: Port Logged Out\n");
40424043
break;
40434044

40444045
default:
40454046
ql_dbg(ql_dbg_tgt_mgt, vha, 0xf040,
40464047
"qla_target(%d): Async event %#x occured: "
4047-
"ignore (m[1]=%x, m[2]=%x, m[3]=%x, m[4]=%x)", vha->vp_idx,
4048-
code, le16_to_cpu(mailbox[1]), le16_to_cpu(mailbox[2]),
4049-
le16_to_cpu(mailbox[3]), le16_to_cpu(mailbox[4]));
4048+
"ignore (m[0]=%x, m[1]=%x, m[2]=%x, m[3]=%x)", vha->vp_idx,
4049+
code, le16_to_cpu(mailbox[0]), le16_to_cpu(mailbox[1]),
4050+
le16_to_cpu(mailbox[2]), le16_to_cpu(mailbox[3]));
40504051
break;
40514052
}
40524053

drivers/target/tcm_fc/tfc_sess.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ static struct ft_tport *ft_tport_create(struct fc_lport *lport)
5858
struct ft_tport *tport;
5959
int i;
6060

61-
tport = rcu_dereference(lport->prov[FC_TYPE_FCP]);
61+
tport = rcu_dereference_protected(lport->prov[FC_TYPE_FCP],
62+
lockdep_is_held(&ft_lport_lock));
6263
if (tport && tport->tpg)
6364
return tport;
6465

0 commit comments

Comments
 (0)