diff options
Diffstat (limited to 'net/rds/send.c')
-rw-r--r-- | net/rds/send.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/net/rds/send.c b/net/rds/send.c index 23718160d71e..0a64541020b0 100644 --- a/net/rds/send.c +++ b/net/rds/send.c | |||
@@ -593,8 +593,11 @@ static void rds_send_remove_from_sock(struct list_head *messages, int status) | |||
593 | sock_put(rds_rs_to_sk(rs)); | 593 | sock_put(rds_rs_to_sk(rs)); |
594 | } | 594 | } |
595 | rs = rm->m_rs; | 595 | rs = rm->m_rs; |
596 | sock_hold(rds_rs_to_sk(rs)); | 596 | if (rs) |
597 | sock_hold(rds_rs_to_sk(rs)); | ||
597 | } | 598 | } |
599 | if (!rs) | ||
600 | goto unlock_and_drop; | ||
598 | spin_lock(&rs->rs_lock); | 601 | spin_lock(&rs->rs_lock); |
599 | 602 | ||
600 | if (test_and_clear_bit(RDS_MSG_ON_SOCK, &rm->m_flags)) { | 603 | if (test_and_clear_bit(RDS_MSG_ON_SOCK, &rm->m_flags)) { |
@@ -638,9 +641,6 @@ unlock_and_drop: | |||
638 | * queue. This means that in the TCP case, the message may not have been | 641 | * queue. This means that in the TCP case, the message may not have been |
639 | * assigned the m_ack_seq yet - but that's fine as long as tcp_is_acked | 642 | * assigned the m_ack_seq yet - but that's fine as long as tcp_is_acked |
640 | * checks the RDS_MSG_HAS_ACK_SEQ bit. | 643 | * checks the RDS_MSG_HAS_ACK_SEQ bit. |
641 | * | ||
642 | * XXX It's not clear to me how this is safely serialized with socket | ||
643 | * destruction. Maybe it should bail if it sees SOCK_DEAD. | ||
644 | */ | 644 | */ |
645 | void rds_send_drop_acked(struct rds_connection *conn, u64 ack, | 645 | void rds_send_drop_acked(struct rds_connection *conn, u64 ack, |
646 | is_acked_func is_acked) | 646 | is_acked_func is_acked) |
@@ -711,6 +711,9 @@ void rds_send_drop_to(struct rds_sock *rs, struct sockaddr_in *dest) | |||
711 | */ | 711 | */ |
712 | if (!test_and_clear_bit(RDS_MSG_ON_CONN, &rm->m_flags)) { | 712 | if (!test_and_clear_bit(RDS_MSG_ON_CONN, &rm->m_flags)) { |
713 | spin_unlock_irqrestore(&conn->c_lock, flags); | 713 | spin_unlock_irqrestore(&conn->c_lock, flags); |
714 | spin_lock_irqsave(&rm->m_rs_lock, flags); | ||
715 | rm->m_rs = NULL; | ||
716 | spin_unlock_irqrestore(&rm->m_rs_lock, flags); | ||
714 | continue; | 717 | continue; |
715 | } | 718 | } |
716 | list_del_init(&rm->m_conn_item); | 719 | list_del_init(&rm->m_conn_item); |