Lines Matching full:connection
57 static int drbd_do_features(struct drbd_connection *connection);
58 static int drbd_do_auth(struct drbd_connection *connection);
60 static void conn_wait_active_ee_empty(struct drbd_connection *connection);
221 static void conn_reclaim_net_peer_reqs(struct drbd_connection *connection) in conn_reclaim_net_peer_reqs() argument
227 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_reclaim_net_peer_reqs()
271 nc = rcu_dereference(peer_device->connection->net_conf); in drbd_alloc_pages()
512 static int drbd_recv(struct drbd_connection *connection, void *buf, size_t size) in drbd_recv() argument
516 rv = drbd_recv_short(connection->data.socket, buf, size, 0); in drbd_recv()
520 drbd_info(connection, "sock was reset by peer\n"); in drbd_recv()
522 drbd_err(connection, "sock_recvmsg returned %d\n", rv); in drbd_recv()
524 if (test_bit(DISCONNECT_SENT, &connection->flags)) { in drbd_recv()
527 t = rcu_dereference(connection->net_conf)->ping_timeo * HZ/10; in drbd_recv()
530 t = wait_event_timeout(connection->ping_wait, connection->cstate < C_WF_REPORT_PARAMS, t); in drbd_recv()
535 drbd_info(connection, "sock was shut down by peer\n"); in drbd_recv()
539 conn_request_state(connection, NS(conn, C_BROKEN_PIPE), CS_HARD); in drbd_recv()
545 static int drbd_recv_all(struct drbd_connection *connection, void *buf, size_t size) in drbd_recv_all() argument
549 err = drbd_recv(connection, buf, size); in drbd_recv_all()
558 static int drbd_recv_all_warn(struct drbd_connection *connection, void *buf, size_t size) in drbd_recv_all_warn() argument
562 err = drbd_recv_all(connection, buf, size); in drbd_recv_all_warn()
564 drbd_warn(connection, "short read (expected size %d)\n", (int)size); in drbd_recv_all_warn()
587 static struct socket *drbd_try_connect(struct drbd_connection *connection) in drbd_try_connect() argument
599 nc = rcu_dereference(connection->net_conf); in drbd_try_connect()
609 my_addr_len = min_t(int, connection->my_addr_len, sizeof(src_in6)); in drbd_try_connect()
610 memcpy(&src_in6, &connection->my_addr, my_addr_len); in drbd_try_connect()
612 if (((struct sockaddr *)&connection->my_addr)->sa_family == AF_INET6) in drbd_try_connect()
617 peer_addr_len = min_t(int, connection->peer_addr_len, sizeof(src_in6)); in drbd_try_connect()
618 memcpy(&peer_in6, &connection->peer_addr, peer_addr_len); in drbd_try_connect()
666 drbd_err(connection, "%s failed, err = %d\n", what, err); in drbd_try_connect()
669 conn_request_state(connection, NS(conn, C_DISCONNECTING), CS_HARD); in drbd_try_connect()
676 struct drbd_connection *connection; member
694 static int prepare_listen_socket(struct drbd_connection *connection, struct accept_wait_data *ad) in prepare_listen_socket() argument
703 nc = rcu_dereference(connection->net_conf); in prepare_listen_socket()
712 my_addr_len = min_t(int, connection->my_addr_len, sizeof(struct sockaddr_in6)); in prepare_listen_socket()
713 memcpy(&my_addr, &connection->my_addr, my_addr_len); in prepare_listen_socket()
749 drbd_err(connection, "%s failed, err = %d\n", what, err); in prepare_listen_socket()
750 conn_request_state(connection, NS(conn, C_DISCONNECTING), CS_HARD); in prepare_listen_socket()
765 static struct socket *drbd_wait_for_connect(struct drbd_connection *connection, struct accept_wait_… in drbd_wait_for_connect() argument
772 nc = rcu_dereference(connection->net_conf); in drbd_wait_for_connect()
791 drbd_err(connection, "accept failed, err = %d\n", err); in drbd_wait_for_connect()
792 conn_request_state(connection, NS(conn, C_DISCONNECTING), CS_HARD); in drbd_wait_for_connect()
804 static int send_first_packet(struct drbd_connection *connection, struct drbd_socket *sock, in send_first_packet() argument
807 if (!conn_prepare_command(connection, sock)) in send_first_packet()
809 return conn_send_command(connection, sock, cmd, 0, NULL, 0); in send_first_packet()
812 static int receive_first_packet(struct drbd_connection *connection, struct socket *sock) in receive_first_packet() argument
814 unsigned int header_size = drbd_header_size(connection); in receive_first_packet()
820 nc = rcu_dereference(connection->net_conf); in receive_first_packet()
828 err = drbd_recv_short(sock, connection->data.rbuf, header_size, 0); in receive_first_packet()
834 err = decode_header(connection, connection->data.rbuf, &pi); in receive_first_packet()
841 * drbd_socket_okay() - Free the socket if its connection is not okay
863 static bool connection_established(struct drbd_connection *connection, in connection_established() argument
875 nc = rcu_dereference(connection->net_conf); in connection_established()
886 /* Gets called if a connection is established, or if a new minor gets created
887 in a connection */
896 device->state_mutex = peer_device->connection->agreed_pro_version < 100 ? in drbd_connected()
897 &peer_device->connection->cstate_mutex : in drbd_connected()
916 * 1 yes, we have a valid connection
922 static int conn_connect(struct drbd_connection *connection) in conn_connect() argument
931 .connection = connection, in conn_connect()
935 clear_bit(DISCONNECT_SENT, &connection->flags); in conn_connect()
936 if (conn_request_state(connection, NS(conn, C_WF_CONNECTION), CS_VERBOSE) < SS_SUCCESS) in conn_connect()
940 sock.sbuf = connection->data.sbuf; in conn_connect()
941 sock.rbuf = connection->data.rbuf; in conn_connect()
944 msock.sbuf = connection->meta.sbuf; in conn_connect()
945 msock.rbuf = connection->meta.rbuf; in conn_connect()
949 connection->agreed_pro_version = 80; in conn_connect()
951 if (prepare_listen_socket(connection, &ad)) in conn_connect()
957 s = drbd_try_connect(connection); in conn_connect()
961 send_first_packet(connection, &sock, P_INITIAL_DATA); in conn_connect()
963 clear_bit(RESOLVE_CONFLICTS, &connection->flags); in conn_connect()
965 send_first_packet(connection, &msock, P_INITIAL_META); in conn_connect()
967 drbd_err(connection, "Logic error in conn_connect()\n"); in conn_connect()
972 if (connection_established(connection, &sock.socket, &msock.socket)) in conn_connect()
976 s = drbd_wait_for_connect(connection, &ad); in conn_connect()
978 int fp = receive_first_packet(connection, s); in conn_connect()
984 drbd_warn(connection, "initial packet S crossed\n"); in conn_connect()
992 set_bit(RESOLVE_CONFLICTS, &connection->flags); in conn_connect()
994 drbd_warn(connection, "initial packet M crossed\n"); in conn_connect()
1002 drbd_warn(connection, "Error receiving initial packet\n"); in conn_connect()
1010 if (connection->cstate <= C_DISCONNECTING) in conn_connect()
1015 if (get_t_state(&connection->receiver) == EXITING) in conn_connect()
1019 ok = connection_established(connection, &sock.socket, &msock.socket); in conn_connect()
1035 * sock.socket->sk->sk_sndtimeo = connection->net_conf->timeout*HZ/10; in conn_connect()
1040 nc = rcu_dereference(connection->net_conf); in conn_connect()
1057 connection->data.socket = sock.socket; in conn_connect()
1058 connection->meta.socket = msock.socket; in conn_connect()
1059 connection->last_received = jiffies; in conn_connect()
1061 h = drbd_do_features(connection); in conn_connect()
1065 if (connection->cram_hmac_tfm) { in conn_connect()
1067 switch (drbd_do_auth(connection)) { in conn_connect()
1069 drbd_err(connection, "Authentication of peer failed\n"); in conn_connect()
1072 drbd_err(connection, "Authentication of peer failed, trying again.\n"); in conn_connect()
1077 connection->data.socket->sk->sk_sndtimeo = timeout; in conn_connect()
1078 connection->data.socket->sk->sk_rcvtimeo = MAX_SCHEDULE_TIMEOUT; in conn_connect()
1080 if (drbd_send_protocol(connection) == -EOPNOTSUPP) in conn_connect()
1090 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) in conn_connect()
1094 spin_lock_irq(&connection->resource->req_lock); in conn_connect()
1095 set_bit(STATE_SENT, &connection->flags); in conn_connect()
1096 spin_unlock_irq(&connection->resource->req_lock); in conn_connect()
1098 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) in conn_connect()
1102 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_connect()
1118 rv = conn_request_state(connection, NS(conn, C_WF_REPORT_PARAMS), CS_VERBOSE); in conn_connect()
1119 if (rv < SS_SUCCESS || connection->cstate != C_WF_REPORT_PARAMS) { in conn_connect()
1120 clear_bit(STATE_SENT, &connection->flags); in conn_connect()
1124 drbd_thread_start(&connection->ack_receiver); in conn_connect()
1127 connection->ack_sender = in conn_connect()
1128 alloc_ordered_workqueue("drbd_as_%s", WQ_MEM_RECLAIM, connection->resource->name); in conn_connect()
1129 if (!connection->ack_sender) { in conn_connect()
1130 drbd_err(connection, "Failed to create workqueue ack_sender\n"); in conn_connect()
1134 mutex_lock(&connection->resource->conf_update); in conn_connect()
1136 * connection attempt, the handshake of which is now well underway. in conn_connect()
1139 connection->net_conf->discard_my_data = 0; in conn_connect()
1140 mutex_unlock(&connection->resource->conf_update); in conn_connect()
1154 static int decode_header(struct drbd_connection *connection, void *header, struct packet_info *pi) in decode_header() argument
1156 unsigned int header_size = drbd_header_size(connection); in decode_header()
1162 drbd_err(connection, "Header padding is not zero\n"); in decode_header()
1181 drbd_err(connection, "Wrong magic value 0x%08x in protocol version %d\n", in decode_header()
1183 connection->agreed_pro_version); in decode_header()
1190 static void drbd_unplug_all_devices(struct drbd_connection *connection) in drbd_unplug_all_devices() argument
1192 if (current->plug == &connection->receiver_plug) { in drbd_unplug_all_devices()
1193 blk_finish_plug(&connection->receiver_plug); in drbd_unplug_all_devices()
1194 blk_start_plug(&connection->receiver_plug); in drbd_unplug_all_devices()
1198 static int drbd_recv_header(struct drbd_connection *connection, struct packet_info *pi) in drbd_recv_header() argument
1200 void *buffer = connection->data.rbuf; in drbd_recv_header()
1203 err = drbd_recv_all_warn(connection, buffer, drbd_header_size(connection)); in drbd_recv_header()
1207 err = decode_header(connection, buffer, pi); in drbd_recv_header()
1208 connection->last_received = jiffies; in drbd_recv_header()
1213 static int drbd_recv_header_maybe_unplug(struct drbd_connection *connection, struct packet_info *pi) in drbd_recv_header_maybe_unplug() argument
1215 void *buffer = connection->data.rbuf; in drbd_recv_header_maybe_unplug()
1216 unsigned int size = drbd_header_size(connection); in drbd_recv_header_maybe_unplug()
1219 err = drbd_recv_short(connection->data.socket, buffer, size, MSG_NOSIGNAL|MSG_DONTWAIT); in drbd_recv_header_maybe_unplug()
1226 tcp_sock_set_quickack(connection->data.socket->sk, 2); in drbd_recv_header_maybe_unplug()
1227 drbd_unplug_all_devices(connection); in drbd_recv_header_maybe_unplug()
1233 err = drbd_recv_all_warn(connection, buffer, size); in drbd_recv_header_maybe_unplug()
1238 err = decode_header(connection, connection->data.rbuf, pi); in drbd_recv_header_maybe_unplug()
1239 connection->last_received = jiffies; in drbd_recv_header_maybe_unplug()
1310 static void drbd_flush(struct drbd_connection *connection) in drbd_flush() argument
1312 if (connection->resource->write_ordering >= WO_BDEV_FLUSH) { in drbd_flush()
1322 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in drbd_flush()
1346 drbd_bump_write_ordering(connection->resource, NULL, WO_DRAIN_IO); in drbd_flush()
1357 static enum finish_epoch drbd_may_finish_epoch(struct drbd_connection *connection, in drbd_may_finish_epoch() argument
1365 spin_lock(&connection->epoch_lock); in drbd_may_finish_epoch()
1387 spin_unlock(&connection->epoch_lock); in drbd_may_finish_epoch()
1388 drbd_send_b_ack(epoch->connection, epoch->barrier_nr, epoch_size); in drbd_may_finish_epoch()
1389 spin_lock(&connection->epoch_lock); in drbd_may_finish_epoch()
1392 /* FIXME: dec unacked on connection, once we have in drbd_may_finish_epoch()
1393 * something to count pending connection packets in. */ in drbd_may_finish_epoch()
1395 dec_unacked(epoch->connection); in drbd_may_finish_epoch()
1398 if (connection->current_epoch != epoch) { in drbd_may_finish_epoch()
1402 connection->epochs--; in drbd_may_finish_epoch()
1422 spin_unlock(&connection->epoch_lock); in drbd_may_finish_epoch()
1444 * @connection: DRBD connection.
1660 conn_wait_active_ee_empty(peer_req->peer_device->connection); in drbd_submit_peer_request()
1752 static void conn_wait_active_ee_empty(struct drbd_connection *connection) in conn_wait_active_ee_empty() argument
1758 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_wait_active_ee_empty()
1770 static int receive_Barrier(struct drbd_connection *connection, struct packet_info *pi) in receive_Barrier() argument
1776 /* FIXME these are unacked on connection, in receive_Barrier()
1779 connection->current_epoch->barrier_nr = p->barrier; in receive_Barrier()
1780 connection->current_epoch->connection = connection; in receive_Barrier()
1781 rv = drbd_may_finish_epoch(connection, connection->current_epoch, EV_GOT_BARRIER_NR); in receive_Barrier()
1788 switch (connection->resource->write_ordering) { in receive_Barrier()
1799 drbd_warn(connection, "Allocation of an epoch failed, slowing down\n"); in receive_Barrier()
1804 conn_wait_active_ee_empty(connection); in receive_Barrier()
1805 drbd_flush(connection); in receive_Barrier()
1807 if (atomic_read(&connection->current_epoch->epoch_size)) { in receive_Barrier()
1815 drbd_err(connection, "Strangeness in connection->write_ordering %d\n", in receive_Barrier()
1816 connection->resource->write_ordering); in receive_Barrier()
1824 spin_lock(&connection->epoch_lock); in receive_Barrier()
1825 if (atomic_read(&connection->current_epoch->epoch_size)) { in receive_Barrier()
1826 list_add(&epoch->list, &connection->current_epoch->list); in receive_Barrier()
1827 connection->current_epoch = epoch; in receive_Barrier()
1828 connection->epochs++; in receive_Barrier()
1833 spin_unlock(&connection->epoch_lock); in receive_Barrier()
1868 void *dig_in = peer_device->connection->int_dig_in; in read_in_block()
1869 void *dig_vv = peer_device->connection->int_dig_vv; in read_in_block()
1876 if (!trim && peer_device->connection->peer_integrity_tfm) { in read_in_block()
1877 digest_size = crypto_shash_digestsize(peer_device->connection->peer_integrity_tfm); in read_in_block()
1882 err = drbd_recv_all_warn(peer_device->connection, dig_in, digest_size); in read_in_block()
1955 err = drbd_recv_all_warn(peer_device->connection, data, len); in read_in_block()
1969 drbd_csum_ee_size(peer_device->connection->peer_integrity_tfm, peer_req, dig_vv, data_size); in read_in_block()
1999 err = drbd_recv_all_warn(peer_device->connection, data, len); in drbd_drain_block()
2016 void *dig_in = peer_device->connection->int_dig_in; in recv_dless_read()
2017 void *dig_vv = peer_device->connection->int_dig_vv; in recv_dless_read()
2020 if (peer_device->connection->peer_integrity_tfm) { in recv_dless_read()
2021 digest_size = crypto_shash_digestsize(peer_device->connection->peer_integrity_tfm); in recv_dless_read()
2022 err = drbd_recv_all_warn(peer_device->connection, dig_in, digest_size); in recv_dless_read()
2038 err = drbd_recv_all_warn(peer_device->connection, mapped, expect); in recv_dless_read()
2046 drbd_csum_bio(peer_device->connection->peer_integrity_tfm, bio, dig_vv); in recv_dless_read()
2143 static int receive_DataReply(struct drbd_connection *connection, struct packet_info *pi) in receive_DataReply() argument
2152 peer_device = conn_peer_device(connection, pi->vnr); in receive_DataReply()
2178 static int receive_RSDataReply(struct drbd_connection *connection, struct packet_info *pi) in receive_RSDataReply() argument
2186 peer_device = conn_peer_device(connection, pi->vnr); in receive_RSDataReply()
2273 …drbd_may_finish_epoch(peer_device->connection, peer_req->epoch, EV_PUT + (cancel ? EV_CLEANUP : 0)… in e_end_block()
2300 struct drbd_connection *connection = peer_req->peer_device->connection; in e_send_retry_write() local
2302 return e_send_ack(w, connection->agreed_pro_version >= 100 ? in e_send_retry_write()
2326 if (test_bit(RESOLVE_CONFLICTS, &peer_device->connection->flags)) { in update_peer_seq()
2375 * Assume we have a 10 GBit connection, that is about 1<<30 byte per second,
2389 if (!test_bit(RESOLVE_CONFLICTS, &peer_device->connection->flags)) in wait_for_and_update_peer_seq()
2405 tp = rcu_dereference(peer_device->connection->net_conf)->two_primaries; in wait_for_and_update_peer_seq()
2415 timeout = rcu_dereference(peer_device->connection->net_conf)->ping_timeo*HZ/10; in wait_for_and_update_peer_seq()
2480 struct drbd_connection *connection = peer_req->peer_device->connection; in handle_write_conflicts() local
2481 bool resolve_conflicts = test_bit(RESOLVE_CONFLICTS, &connection->flags); in handle_write_conflicts()
2535 queue_work(connection->ack_sender, &peer_req->peer_device->send_acks_work); in handle_write_conflicts()
2564 _conn_request_state(connection, NS(conn, C_TIMEOUT), CS_HARD); in handle_write_conflicts()
2586 static int receive_Data(struct drbd_connection *connection, struct packet_info *pi) in receive_Data() argument
2599 peer_device = conn_peer_device(connection, pi->vnr); in receive_Data()
2609 atomic_inc(&connection->current_epoch->epoch_size); in receive_Data()
2642 if (0 == (connection->agreed_features & DRBD_FF_WZEROES)) in receive_Data()
2659 spin_lock(&connection->epoch_lock); in receive_Data()
2660 peer_req->epoch = connection->current_epoch; in receive_Data()
2663 spin_unlock(&connection->epoch_lock); in receive_Data()
2666 nc = rcu_dereference(peer_device->connection->net_conf); in receive_Data()
2668 if (peer_device->connection->agreed_pro_version < 100) { in receive_Data()
2750 drbd_may_finish_epoch(connection, peer_req->epoch, EV_PUT | EV_CLEANUP); in receive_Data()
2836 static int receive_DataRequest(struct drbd_connection *connection, struct packet_info *pi) in receive_DataRequest() argument
2848 peer_device = conn_peer_device(connection, pi->vnr); in receive_DataRequest()
2941 if (drbd_recv_all(peer_device->connection, di->digest, pi->size)) in receive_DataRequest()
2945 D_ASSERT(device, peer_device->connection->agreed_pro_version >= 89); in receive_DataRequest()
2964 peer_device->connection->agreed_pro_version >= 90) { in receive_DataRequest()
3017 update_receiver_timing_details(connection, drbd_rs_should_slow_down); in receive_DataRequest()
3021 update_receiver_timing_details(connection, drbd_rs_begin_io); in receive_DataRequest()
3029 update_receiver_timing_details(connection, drbd_submit_peer_request); in receive_DataRequest()
3042 /* no drbd_rs_complete_io(), we are dropping the connection anyways */ in receive_DataRequest()
3066 after_sb_0p = rcu_dereference(peer_device->connection->net_conf)->after_sb_0p; in drbd_asb_recover_0p()
3102 rv = test_bit(RESOLVE_CONFLICTS, &peer_device->connection->flags) in drbd_asb_recover_0p()
3119 rv = test_bit(RESOLVE_CONFLICTS, &peer_device->connection->flags) in drbd_asb_recover_0p()
3142 after_sb_1p = rcu_dereference(peer_device->connection->net_conf)->after_sb_1p; in drbd_asb_recover_1p()
3199 after_sb_2p = rcu_dereference(peer_device->connection->net_conf)->after_sb_2p; in drbd_asb_recover_2p()
3272 struct drbd_connection *const connection = peer_device ? peer_device->connection : NULL; in drbd_uuid_compare() local
3298 if (connection->agreed_pro_version < 91) in drbd_uuid_compare()
3321 if (connection->agreed_pro_version < 91) in drbd_uuid_compare()
3361 if (!(connection->agreed_features & DRBD_FF_WSAME)) { in drbd_uuid_compare()
3385 dc = test_bit(RESOLVE_CONFLICTS, &connection->flags); in drbd_uuid_compare()
3398 if (connection->agreed_pro_version < 96 ? in drbd_uuid_compare()
3405 if (connection->agreed_pro_version < 91) in drbd_uuid_compare()
3435 if (connection->agreed_pro_version < 96 ? in drbd_uuid_compare()
3442 if (connection->agreed_pro_version < 91) in drbd_uuid_compare()
3545 nc = rcu_dereference(peer_device->connection->net_conf); in drbd_sync_handshake()
3594 * We just refuse to attach -- well, we drop the "connection" in drbd_sync_handshake()
3596 drbd_alert(device, "Split-Brain detected but unresolved, dropping connection!\n"); in drbd_sync_handshake()
3621 if (tentative || test_bit(CONN_DRY_RUN, &peer_device->connection->flags)) { in drbd_sync_handshake()
3667 static int receive_protocol(struct drbd_connection *connection, struct packet_info *pi) in receive_protocol() argument
3685 if (connection->agreed_pro_version >= 87) { in receive_protocol()
3690 err = drbd_recv_all(connection, integrity_alg, pi->size); in receive_protocol()
3697 clear_bit(CONN_DRY_RUN, &connection->flags); in receive_protocol()
3700 set_bit(CONN_DRY_RUN, &connection->flags); in receive_protocol()
3703 nc = rcu_dereference(connection->net_conf); in receive_protocol()
3706 drbd_err(connection, "incompatible %s settings\n", "protocol"); in receive_protocol()
3711 drbd_err(connection, "incompatible %s settings\n", "after-sb-0pri"); in receive_protocol()
3716 drbd_err(connection, "incompatible %s settings\n", "after-sb-1pri"); in receive_protocol()
3721 drbd_err(connection, "incompatible %s settings\n", "after-sb-2pri"); in receive_protocol()
3726 drbd_err(connection, "incompatible %s settings\n", "discard-my-data"); in receive_protocol()
3731 drbd_err(connection, "incompatible %s settings\n", "allow-two-primaries"); in receive_protocol()
3736 drbd_err(connection, "incompatible %s settings\n", "data-integrity-alg"); in receive_protocol()
3758 drbd_err(connection, "peer data-integrity-alg %s not supported\n", in receive_protocol()
3767 drbd_err(connection, "Allocation of buffers for data integrity checking failed\n"); in receive_protocol()
3774 drbd_err(connection, "Allocation of new net_conf failed\n"); in receive_protocol()
3778 mutex_lock(&connection->data.mutex); in receive_protocol()
3779 mutex_lock(&connection->resource->conf_update); in receive_protocol()
3780 old_net_conf = connection->net_conf; in receive_protocol()
3789 rcu_assign_pointer(connection->net_conf, new_net_conf); in receive_protocol()
3790 mutex_unlock(&connection->resource->conf_update); in receive_protocol()
3791 mutex_unlock(&connection->data.mutex); in receive_protocol()
3793 crypto_free_shash(connection->peer_integrity_tfm); in receive_protocol()
3794 kfree(connection->int_dig_in); in receive_protocol()
3795 kfree(connection->int_dig_vv); in receive_protocol()
3796 connection->peer_integrity_tfm = peer_integrity_tfm; in receive_protocol()
3797 connection->int_dig_in = int_dig_in; in receive_protocol()
3798 connection->int_dig_vv = int_dig_vv; in receive_protocol()
3801 drbd_info(connection, "peer data-integrity-alg: %s\n", in receive_protocol()
3814 conn_request_state(connection, NS(conn, C_DISCONNECTING), CS_HARD); in receive_protocol()
3841 static int ignore_remaining_packet(struct drbd_connection *connection, struct packet_info *pi) in ignore_remaining_packet() argument
3843 void *buffer = connection->data.rbuf; in ignore_remaining_packet()
3848 s = drbd_recv(connection, buffer, s); in ignore_remaining_packet()
3864 * When a device is added to an existing connection, the node on which the
3872 static int config_unknown_volume(struct drbd_connection *connection, struct packet_info *pi) in config_unknown_volume() argument
3874 drbd_warn(connection, "%s packet received for volume %u, which is not configured locally\n", in config_unknown_volume()
3876 return ignore_remaining_packet(connection, pi); in config_unknown_volume()
3879 static int receive_SyncParam(struct drbd_connection *connection, struct packet_info *pi) in receive_SyncParam() argument
3889 const int apv = connection->agreed_pro_version; in receive_SyncParam()
3894 peer_device = conn_peer_device(connection, pi->vnr); in receive_SyncParam()
3896 return config_unknown_volume(connection, pi); in receive_SyncParam()
3928 err = drbd_recv_all(peer_device->connection, p, header_size); in receive_SyncParam()
3932 mutex_lock(&connection->resource->conf_update); in receive_SyncParam()
3933 old_net_conf = peer_device->connection->net_conf; in receive_SyncParam()
3938 mutex_unlock(&connection->resource->conf_update); in receive_SyncParam()
3959 err = drbd_recv_all(peer_device->connection, p->verify_alg, data_size); in receive_SyncParam()
4033 crypto_free_shash(peer_device->connection->verify_tfm); in receive_SyncParam()
4034 peer_device->connection->verify_tfm = verify_tfm; in receive_SyncParam()
4040 crypto_free_shash(peer_device->connection->csums_tfm); in receive_SyncParam()
4041 peer_device->connection->csums_tfm = csums_tfm; in receive_SyncParam()
4044 rcu_assign_pointer(connection->net_conf, new_net_conf); in receive_SyncParam()
4058 mutex_unlock(&connection->resource->conf_update); in receive_SyncParam()
4072 mutex_unlock(&connection->resource->conf_update); in receive_SyncParam()
4081 mutex_unlock(&connection->resource->conf_update); in receive_SyncParam()
4087 conn_request_state(peer_device->connection, NS(conn, C_DISCONNECTING), CS_HARD); in receive_SyncParam()
4104 static int receive_sizes(struct drbd_connection *connection, struct packet_info *pi) in receive_sizes() argument
4109 struct o_qlim *o = (connection->agreed_features & DRBD_FF_WSAME) ? p->qlim : NULL; in receive_sizes()
4116 peer_device = conn_peer_device(connection, pi->vnr); in receive_sizes()
4118 return config_unknown_volume(connection, pi); in receive_sizes()
4154 conn_request_state(peer_device->connection, NS(conn, C_DISCONNECTING), CS_HARD); in receive_sizes()
4169 mutex_lock(&connection->resource->conf_update); in receive_sizes()
4175 mutex_unlock(&connection->resource->conf_update); in receive_sizes()
4229 conn_request_state(peer_device->connection, NS(conn, C_DISCONNECTING), CS_HARD); in receive_sizes()
4277 static int receive_uuids(struct drbd_connection *connection, struct packet_info *pi) in receive_uuids() argument
4285 peer_device = conn_peer_device(connection, pi->vnr); in receive_uuids()
4287 return config_unknown_volume(connection, pi); in receive_uuids()
4308 conn_request_state(peer_device->connection, NS(conn, C_DISCONNECTING), CS_HARD); in receive_uuids()
4315 peer_device->connection->agreed_pro_version >= 90 && in receive_uuids()
4384 static int receive_req_state(struct drbd_connection *connection, struct packet_info *pi) in receive_req_state() argument
4392 peer_device = conn_peer_device(connection, pi->vnr); in receive_req_state()
4400 if (test_bit(RESOLVE_CONFLICTS, &peer_device->connection->flags) && in receive_req_state()
4417 static int receive_req_conn_state(struct drbd_connection *connection, struct packet_info *pi) in receive_req_conn_state() argument
4426 if (test_bit(RESOLVE_CONFLICTS, &connection->flags) && in receive_req_conn_state()
4427 mutex_is_locked(&connection->cstate_mutex)) { in receive_req_conn_state()
4428 conn_send_sr_reply(connection, SS_CONCURRENT_ST_CHG); in receive_req_conn_state()
4435 rv = conn_request_state(connection, mask, val, CS_VERBOSE | CS_LOCAL_ONLY | CS_IGN_OUTD_FAIL); in receive_req_conn_state()
4436 conn_send_sr_reply(connection, rv); in receive_req_conn_state()
4441 static int receive_state(struct drbd_connection *connection, struct packet_info *pi) in receive_state() argument
4451 peer_device = conn_peer_device(connection, pi->vnr); in receive_state()
4453 return config_unknown_volume(connection, pi); in receive_state()
4470 * already decided to close the connection again, in receive_state()
4538 * In this scenario, we already dropped the connection hard in receive_state()
4541 * Should we want to change this, that is: not drop the connection in in receive_state()
4551 /* if we established a new connection */ in receive_state()
4553 /* if we had an established connection in receive_state()
4580 if (test_and_clear_bit(CONN_DRY_RUN, &peer_device->connection->flags)) in receive_state()
4583 conn_request_state(peer_device->connection, NS(conn, C_DISCONNECTING), CS_HARD); in receive_state()
4605 tl_clear(peer_device->connection); in receive_state()
4608 conn_request_state(peer_device->connection, NS2(conn, C_PROTOCOL_ERROR, susp, 0), CS_HARD); in receive_state()
4616 conn_request_state(peer_device->connection, NS(conn, C_DISCONNECTING), CS_HARD); in receive_state()
4638 static int receive_sync_uuid(struct drbd_connection *connection, struct packet_info *pi) in receive_sync_uuid() argument
4644 peer_device = conn_peer_device(connection, pi->vnr); in receive_sync_uuid()
4684 drbd_header_size(peer_device->connection); in receive_bitmap_plain()
4696 err = drbd_recv_all(peer_device->connection, p, want); in receive_bitmap_plain()
4814 conn_request_state(peer_device->connection, NS(conn, C_PROTOCOL_ERROR), CS_HARD); in decode_bitmap_c()
4822 unsigned int header_size = drbd_header_size(first_peer_device(device)->connection); in INFO_bm_xfer_stats()
4862 static int receive_bitmap(struct drbd_connection *connection, struct packet_info *pi) in receive_bitmap() argument
4869 peer_device = conn_peer_device(connection, pi->vnr); in receive_bitmap()
4891 if (pi->size > DRBD_SOCKET_BUFFER_SIZE - drbd_header_size(connection)) { in receive_bitmap()
4901 err = drbd_recv_all(peer_device->connection, p, pi->size); in receive_bitmap()
4912 c.bytes[pi->cmd == P_BITMAP] += drbd_header_size(connection) + pi->size; in receive_bitmap()
4919 err = drbd_recv_header(peer_device->connection, pi); in receive_bitmap()
4950 static int receive_skip(struct drbd_connection *connection, struct packet_info *pi) in receive_skip() argument
4952 drbd_warn(connection, "skipping unknown optional packet type %d, l: %d!\n", in receive_skip()
4955 return ignore_remaining_packet(connection, pi); in receive_skip()
4958 static int receive_UnplugRemote(struct drbd_connection *connection, struct packet_info *pi) in receive_UnplugRemote() argument
4962 tcp_sock_set_quickack(connection->data.socket->sk, 2); in receive_UnplugRemote()
4966 static int receive_out_of_sync(struct drbd_connection *connection, struct packet_info *pi) in receive_out_of_sync() argument
4972 peer_device = conn_peer_device(connection, pi->vnr); in receive_out_of_sync()
4992 static int receive_rs_deallocated(struct drbd_connection *connection, struct packet_info *pi) in receive_rs_deallocated() argument
5000 peer_device = conn_peer_device(connection, pi->vnr); in receive_rs_deallocated()
5096 static void drbdd(struct drbd_connection *connection) in drbdd() argument
5102 while (get_t_state(&connection->receiver) == RUNNING) { in drbdd()
5105 drbd_thread_current_set_cpu(&connection->receiver); in drbdd()
5106 update_receiver_timing_details(connection, drbd_recv_header_maybe_unplug); in drbdd()
5107 if (drbd_recv_header_maybe_unplug(connection, &pi)) in drbdd()
5112 drbd_err(connection, "Unexpected data packet %s (0x%04x)", in drbdd()
5118 if (pi.cmd == P_SIZES && connection->agreed_features & DRBD_FF_WSAME) in drbdd()
5121 drbd_err(connection, "No payload expected %s l:%d\n", in drbdd()
5126 drbd_err(connection, "%s: unexpected packet size, expected:%d received:%d\n", in drbdd()
5132 update_receiver_timing_details(connection, drbd_recv_all_warn); in drbdd()
5133 err = drbd_recv_all_warn(connection, pi.data, shs); in drbdd()
5139 update_receiver_timing_details(connection, cmd->fn); in drbdd()
5140 err = cmd->fn(connection, &pi); in drbdd()
5142 drbd_err(connection, "error receiving %s, e: %d l: %d!\n", in drbdd()
5150 conn_request_state(connection, NS(conn, C_PROTOCOL_ERROR), CS_HARD); in drbdd()
5153 static void conn_disconnect(struct drbd_connection *connection) in conn_disconnect() argument
5159 if (connection->cstate == C_STANDALONE) in conn_disconnect()
5162 /* We are about to start the cleanup after connection loss. in conn_disconnect()
5167 conn_request_state(connection, NS(conn, C_NETWORK_FAILURE), CS_HARD); in conn_disconnect()
5170 drbd_thread_stop(&connection->ack_receiver); in conn_disconnect()
5171 if (connection->ack_sender) { in conn_disconnect()
5172 destroy_workqueue(connection->ack_sender); in conn_disconnect()
5173 connection->ack_sender = NULL; in conn_disconnect()
5175 drbd_free_sock(connection); in conn_disconnect()
5178 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in conn_disconnect()
5188 if (!list_empty(&connection->current_epoch->list)) in conn_disconnect()
5189 drbd_err(connection, "ASSERTION FAILED: connection->current_epoch->list not empty\n"); in conn_disconnect()
5191 atomic_set(&connection->current_epoch->epoch_size, 0); in conn_disconnect()
5192 connection->send.seen_any_write_yet = false; in conn_disconnect()
5194 drbd_info(connection, "Connection closed\n"); in conn_disconnect()
5196 if (conn_highest_role(connection) == R_PRIMARY && conn_highest_pdsk(connection) >= D_UNKNOWN) in conn_disconnect()
5197 conn_try_outdate_peer_async(connection); in conn_disconnect()
5199 spin_lock_irq(&connection->resource->req_lock); in conn_disconnect()
5200 oc = connection->cstate; in conn_disconnect()
5202 _conn_request_state(connection, NS(conn, C_UNCONNECTED), CS_VERBOSE); in conn_disconnect()
5204 spin_unlock_irq(&connection->resource->req_lock); in conn_disconnect()
5207 conn_request_state(connection, NS(conn, C_STANDALONE), CS_VERBOSE | CS_HARD); in conn_disconnect()
5244 drbd_flush_workqueue(&peer_device->connection->sender_work); in drbd_disconnected()
5251 drbd_flush_workqueue(&peer_device->connection->sender_work); in drbd_disconnected()
5261 tl_clear(peer_device->connection); in drbd_disconnected()
5305 static int drbd_send_features(struct drbd_connection *connection) in drbd_send_features() argument
5310 sock = &connection->data; in drbd_send_features()
5311 p = conn_prepare_command(connection, sock); in drbd_send_features()
5318 return conn_send_command(connection, sock, P_CONNECTION_FEATURES, sizeof(*p), NULL, 0); in drbd_send_features()
5323 * 1 yes, we have a valid connection
5328 static int drbd_do_features(struct drbd_connection *connection) in drbd_do_features() argument
5330 /* ASSERT current == connection->receiver ... */ in drbd_do_features()
5336 err = drbd_send_features(connection); in drbd_do_features()
5340 err = drbd_recv_header(connection, &pi); in drbd_do_features()
5345 drbd_err(connection, "expected ConnectionFeatures packet, received: %s (0x%04x)\n", in drbd_do_features()
5351 drbd_err(connection, "expected ConnectionFeatures length: %u, received: %u\n", in drbd_do_features()
5357 err = drbd_recv_all_warn(connection, p, expect); in drbd_do_features()
5370 connection->agreed_pro_version = min_t(int, PRO_VERSION_MAX, p->protocol_max); in drbd_do_features()
5371 connection->agreed_features = PRO_FEATURES & be32_to_cpu(p->feature_flags); in drbd_do_features()
5373 drbd_info(connection, "Handshake successful: " in drbd_do_features()
5374 "Agreed network protocol version %d\n", connection->agreed_pro_version); in drbd_do_features()
5376 drbd_info(connection, "Feature flags enabled on protocol level: 0x%x%s%s%s%s.\n", in drbd_do_features()
5377 connection->agreed_features, in drbd_do_features()
5378 connection->agreed_features & DRBD_FF_TRIM ? " TRIM" : "", in drbd_do_features()
5379 connection->agreed_features & DRBD_FF_THIN_RESYNC ? " THIN_RESYNC" : "", in drbd_do_features()
5380 connection->agreed_features & DRBD_FF_WSAME ? " WRITE_SAME" : "", in drbd_do_features()
5381 connection->agreed_features & DRBD_FF_WZEROES ? " WRITE_ZEROES" : in drbd_do_features()
5382 connection->agreed_features ? "" : " none"); in drbd_do_features()
5387 drbd_err(connection, "incompatible DRBD dialects: " in drbd_do_features()
5395 static int drbd_do_auth(struct drbd_connection *connection) in drbd_do_auth() argument
5397 drbd_err(connection, "This kernel was build without CONFIG_CRYPTO_HMAC.\n"); in drbd_do_auth()
5398 drbd_err(connection, "You need to disable 'cram-hmac-alg' in drbd.conf.\n"); in drbd_do_auth()
5410 static int drbd_do_auth(struct drbd_connection *connection) in drbd_do_auth() argument
5428 nc = rcu_dereference(connection->net_conf); in drbd_do_auth()
5434 crypto_shash_descsize(connection->cram_hmac_tfm), in drbd_do_auth()
5440 desc->tfm = connection->cram_hmac_tfm; in drbd_do_auth()
5442 rv = crypto_shash_setkey(connection->cram_hmac_tfm, (u8 *)secret, key_len); in drbd_do_auth()
5444 drbd_err(connection, "crypto_shash_setkey() failed with %d\n", rv); in drbd_do_auth()
5451 sock = &connection->data; in drbd_do_auth()
5452 if (!conn_prepare_command(connection, sock)) { in drbd_do_auth()
5456 rv = !conn_send_command(connection, sock, P_AUTH_CHALLENGE, 0, in drbd_do_auth()
5461 err = drbd_recv_header(connection, &pi); in drbd_do_auth()
5468 drbd_err(connection, "expected AuthChallenge packet, received: %s (0x%04x)\n", in drbd_do_auth()
5475 drbd_err(connection, "expected AuthChallenge payload too big.\n"); in drbd_do_auth()
5481 drbd_err(connection, "AuthChallenge payload too small.\n"); in drbd_do_auth()
5488 drbd_err(connection, "kmalloc of peers_ch failed\n"); in drbd_do_auth()
5493 err = drbd_recv_all_warn(connection, peers_ch, pi.size); in drbd_do_auth()
5500 drbd_err(connection, "Peer presented the same challenge!\n"); in drbd_do_auth()
5505 resp_size = crypto_shash_digestsize(connection->cram_hmac_tfm); in drbd_do_auth()
5508 drbd_err(connection, "kmalloc of response failed\n"); in drbd_do_auth()
5515 drbd_err(connection, "crypto_hash_digest() failed with %d\n", rv); in drbd_do_auth()
5520 if (!conn_prepare_command(connection, sock)) { in drbd_do_auth()
5524 rv = !conn_send_command(connection, sock, P_AUTH_RESPONSE, 0, in drbd_do_auth()
5529 err = drbd_recv_header(connection, &pi); in drbd_do_auth()
5536 drbd_err(connection, "expected AuthResponse packet, received: %s (0x%04x)\n", in drbd_do_auth()
5543 drbd_err(connection, "expected AuthResponse payload of wrong size\n"); in drbd_do_auth()
5548 err = drbd_recv_all_warn(connection, response , resp_size); in drbd_do_auth()
5556 drbd_err(connection, "kmalloc of right_response failed\n"); in drbd_do_auth()
5564 drbd_err(connection, "crypto_hash_digest() failed with %d\n", rv); in drbd_do_auth()
5572 drbd_info(connection, "Peer authenticated using %d bytes HMAC\n", in drbd_do_auth()
5592 struct drbd_connection *connection = thi->connection; in drbd_receiver() local
5595 drbd_info(connection, "receiver (re)started\n"); in drbd_receiver()
5598 h = conn_connect(connection); in drbd_receiver()
5600 conn_disconnect(connection); in drbd_receiver()
5604 drbd_warn(connection, "Discarding network configuration.\n"); in drbd_receiver()
5605 conn_request_state(connection, NS(conn, C_DISCONNECTING), CS_HARD); in drbd_receiver()
5610 blk_start_plug(&connection->receiver_plug); in drbd_receiver()
5611 drbdd(connection); in drbd_receiver()
5612 blk_finish_plug(&connection->receiver_plug); in drbd_receiver()
5615 conn_disconnect(connection); in drbd_receiver()
5617 drbd_info(connection, "receiver terminated\n"); in drbd_receiver()
5623 static int got_conn_RqSReply(struct drbd_connection *connection, struct packet_info *pi) in got_conn_RqSReply() argument
5629 set_bit(CONN_WD_ST_CHG_OKAY, &connection->flags); in got_conn_RqSReply()
5631 set_bit(CONN_WD_ST_CHG_FAIL, &connection->flags); in got_conn_RqSReply()
5632 drbd_err(connection, "Requested state change failed by peer: %s (%d)\n", in got_conn_RqSReply()
5635 wake_up(&connection->ping_wait); in got_conn_RqSReply()
5640 static int got_RqSReply(struct drbd_connection *connection, struct packet_info *pi) in got_RqSReply() argument
5647 peer_device = conn_peer_device(connection, pi->vnr); in got_RqSReply()
5652 if (test_bit(CONN_WD_ST_CHG_REQ, &connection->flags)) { in got_RqSReply()
5653 D_ASSERT(device, connection->agreed_pro_version < 100); in got_RqSReply()
5654 return got_conn_RqSReply(connection, pi); in got_RqSReply()
5669 static int got_Ping(struct drbd_connection *connection, struct packet_info *pi) in got_Ping() argument
5671 return drbd_send_ping_ack(connection); in got_Ping()
5675 static int got_PingAck(struct drbd_connection *connection, struct packet_info *pi) in got_PingAck() argument
5678 connection->meta.socket->sk->sk_rcvtimeo = connection->net_conf->ping_int*HZ; in got_PingAck()
5679 if (!test_and_set_bit(GOT_PING_ACK, &connection->flags)) in got_PingAck()
5680 wake_up(&connection->ping_wait); in got_PingAck()
5685 static int got_IsInSync(struct drbd_connection *connection, struct packet_info *pi) in got_IsInSync() argument
5693 peer_device = conn_peer_device(connection, pi->vnr); in got_IsInSync()
5698 D_ASSERT(device, peer_device->connection->agreed_pro_version >= 89); in got_IsInSync()
5737 static int got_BlockAck(struct drbd_connection *connection, struct packet_info *pi) in got_BlockAck() argument
5746 peer_device = conn_peer_device(connection, pi->vnr); in got_BlockAck()
5783 static int got_NegAck(struct drbd_connection *connection, struct packet_info *pi) in got_NegAck() argument
5792 peer_device = conn_peer_device(connection, pi->vnr); in got_NegAck()
5819 static int got_NegDReply(struct drbd_connection *connection, struct packet_info *pi) in got_NegDReply() argument
5826 peer_device = conn_peer_device(connection, pi->vnr); in got_NegDReply()
5841 static int got_NegRSDReply(struct drbd_connection *connection, struct packet_info *pi) in got_NegRSDReply() argument
5849 peer_device = conn_peer_device(connection, pi->vnr); in got_NegRSDReply()
5877 static int got_BarrierAck(struct drbd_connection *connection, struct packet_info *pi) in got_BarrierAck() argument
5883 tl_release(connection, p->barrier, be32_to_cpu(p->set_size)); in got_BarrierAck()
5886 idr_for_each_entry(&connection->peer_devices, peer_device, vnr) { in got_BarrierAck()
5901 static int got_OVResult(struct drbd_connection *connection, struct packet_info *pi) in got_OVResult() argument
5910 peer_device = conn_peer_device(connection, pi->vnr); in got_OVResult()
5942 drbd_queue_work(&peer_device->connection->sender_work, &dw->w); in got_OVResult()
5953 static int got_skip(struct drbd_connection *connection, struct packet_info *pi) in got_skip() argument
5960 int (*fn)(struct drbd_connection *connection, struct packet_info *);
5963 static void set_rcvtimeo(struct drbd_connection *connection, bool ping_timeout) in set_rcvtimeo() argument
5969 nc = rcu_dereference(connection->net_conf); in set_rcvtimeo()
5977 connection->meta.socket->sk->sk_rcvtimeo = t; in set_rcvtimeo()
5980 static void set_ping_timeout(struct drbd_connection *connection) in set_ping_timeout() argument
5982 set_rcvtimeo(connection, 1); in set_ping_timeout()
5985 static void set_idle_timeout(struct drbd_connection *connection) in set_idle_timeout() argument
5987 set_rcvtimeo(connection, 0); in set_idle_timeout()
6012 struct drbd_connection *connection = thi->connection; in drbd_ack_receiver() local
6017 void *buf = connection->meta.rbuf; in drbd_ack_receiver()
6019 unsigned int header_size = drbd_header_size(connection); in drbd_ack_receiver()
6028 conn_reclaim_net_peer_reqs(connection); in drbd_ack_receiver()
6030 if (test_and_clear_bit(SEND_PING, &connection->flags)) { in drbd_ack_receiver()
6031 if (drbd_send_ping(connection)) { in drbd_ack_receiver()
6032 drbd_err(connection, "drbd_send_ping has failed\n"); in drbd_ack_receiver()
6035 set_ping_timeout(connection); in drbd_ack_receiver()
6040 rv = drbd_recv_short(connection->meta.socket, buf, expect-received, 0); in drbd_ack_receiver()
6045 * -ECONNRESET other side closed the connection in drbd_ack_receiver()
6050 * rv == 0 : "connection shut down by peer" in drbd_ack_receiver()
6056 if (test_bit(DISCONNECT_SENT, &connection->flags)) { in drbd_ack_receiver()
6059 t = rcu_dereference(connection->net_conf)->ping_timeo * HZ/10; in drbd_ack_receiver()
6062 t = wait_event_timeout(connection->ping_wait, in drbd_ack_receiver()
6063 connection->cstate < C_WF_REPORT_PARAMS, in drbd_ack_receiver()
6068 drbd_err(connection, "meta connection shut down by peer.\n"); in drbd_ack_receiver()
6073 if (time_after(connection->last_received, pre_recv_jif)) in drbd_ack_receiver()
6076 drbd_err(connection, "PingAck did not arrive in time.\n"); in drbd_ack_receiver()
6079 set_bit(SEND_PING, &connection->flags); in drbd_ack_receiver()
6088 drbd_err(connection, "sock_recvmsg returned %d\n", rv); in drbd_ack_receiver()
6093 if (decode_header(connection, connection->meta.rbuf, &pi)) in drbd_ack_receiver()
6097 drbd_err(connection, "Unexpected meta packet %s (0x%04x)\n", in drbd_ack_receiver()
6103 drbd_err(connection, "Wrong packet size on meta (c: %d, l: %d)\n", in drbd_ack_receiver()
6111 err = cmd->fn(connection, &pi); in drbd_ack_receiver()
6113 drbd_err(connection, "%ps failed\n", cmd->fn); in drbd_ack_receiver()
6117 connection->last_received = jiffies; in drbd_ack_receiver()
6120 set_idle_timeout(connection); in drbd_ack_receiver()
6124 buf = connection->meta.rbuf; in drbd_ack_receiver()
6133 conn_request_state(connection, NS(conn, C_NETWORK_FAILURE), CS_HARD); in drbd_ack_receiver()
6134 conn_md_sync(connection); in drbd_ack_receiver()
6138 conn_request_state(connection, NS(conn, C_DISCONNECTING), CS_HARD); in drbd_ack_receiver()
6141 drbd_info(connection, "ack_receiver terminated\n"); in drbd_ack_receiver()
6150 struct drbd_connection *connection = peer_device->connection; in drbd_send_acks_wf() local
6156 nc = rcu_dereference(connection->net_conf); in drbd_send_acks_wf()
6161 tcp_sock_set_cork(connection->meta.socket->sk, true); in drbd_send_acks_wf()
6169 conn_request_state(connection, NS(conn, C_NETWORK_FAILURE), CS_HARD); in drbd_send_acks_wf()
6174 tcp_sock_set_cork(connection->meta.socket->sk, false); in drbd_send_acks_wf()