diff options
Diffstat (limited to 'drivers/block/drbd/drbd_receiver.c')
-rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 134 |
1 files changed, 67 insertions, 67 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 2ee9023b1808..1de5cac5a8dd 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c @@ -497,9 +497,9 @@ static int drbd_recv(struct drbd_connection *connection, void *buf, size_t size) if (rv < 0) { if (rv == -ECONNRESET) - conn_info(connection, "sock was reset by peer\n"); + drbd_info(connection, "sock was reset by peer\n"); else if (rv != -ERESTARTSYS) - conn_err(connection, "sock_recvmsg returned %d\n", rv); + drbd_err(connection, "sock_recvmsg returned %d\n", rv); } else if (rv == 0) { if (test_bit(DISCONNECT_SENT, &connection->flags)) { long t; @@ -512,7 +512,7 @@ static int drbd_recv(struct drbd_connection *connection, void *buf, size_t size) if (t) goto out; } - conn_info(connection, "sock was shut down by peer\n"); + drbd_info(connection, "sock was shut down by peer\n"); } if (rv != size) @@ -541,7 +541,7 @@ static int drbd_recv_all_warn(struct drbd_connection *connection, void *buf, siz err = drbd_recv_all(connection, buf, size); if (err && !signal_pending(current)) - conn_warn(connection, "short read (expected size %d)\n", (int)size); + drbd_warn(connection, "short read (expected size %d)\n", (int)size); return err; } @@ -643,7 +643,7 @@ out: disconnect_on_error = 0; break; default: - conn_err(connection, "%s failed, err = %d\n", what, err); + drbd_err(connection, "%s failed, err = %d\n", what, err); } if (disconnect_on_error) conn_request_state(connection, NS(conn, C_DISCONNECTING), CS_HARD); @@ -726,7 +726,7 @@ out: sock_release(s_listen); if (err < 0) { if (err != -EAGAIN && err != -EINTR && err != -ERESTARTSYS) { - conn_err(connection, "%s failed, err = %d\n", what, err); + drbd_err(connection, "%s failed, err = %d\n", what, err); conn_request_state(connection, NS(conn, C_DISCONNECTING), CS_HARD); } } @@ -768,7 +768,7 @@ static struct socket *drbd_wait_for_connect(struct drbd_connection *connection, err = kernel_accept(ad->s_listen, &s_estab, 0); if (err < 0) { if (err != -EAGAIN && err != -EINTR && err != -ERESTARTSYS) { - conn_err(connection, "accept failed, err = %d\n", err); + drbd_err(connection, "accept failed, err = %d\n", err); conn_request_state(connection, NS(conn, C_DISCONNECTING), CS_HARD); } } @@ -909,7 +909,7 @@ static int conn_connect(struct drbd_connection *connection) msock.socket = s; send_first_packet(connection, &msock, P_INITIAL_META); } else { - conn_err(connection, "Logic error in conn_connect()\n"); + drbd_err(connection, "Logic error in conn_connect()\n"); goto out_release_sockets; } } @@ -935,7 +935,7 @@ retry: switch (fp) { case P_INITIAL_DATA: if (sock.socket) { - conn_warn(connection, "initial packet S crossed\n"); + drbd_warn(connection, "initial packet S crossed\n"); sock_release(sock.socket); sock.socket = s; goto randomize; @@ -945,7 +945,7 @@ retry: case P_INITIAL_META: set_bit(RESOLVE_CONFLICTS, &connection->flags); if (msock.socket) { - conn_warn(connection, "initial packet M crossed\n"); + drbd_warn(connection, "initial packet M crossed\n"); sock_release(msock.socket); msock.socket = s; goto randomize; @@ -953,7 +953,7 @@ retry: msock.socket = s; break; default: - conn_warn(connection, "Error receiving initial packet\n"); + drbd_warn(connection, "Error receiving initial packet\n"); sock_release(s); randomize: if (prandom_u32() & 1) @@ -1021,10 +1021,10 @@ randomize: /* drbd_request_state(device, NS(conn, WFAuth)); */ switch (drbd_do_auth(connection)) { case -1: - conn_err(connection, "Authentication of peer failed\n"); + drbd_err(connection, "Authentication of peer failed\n"); return -1; case 0: - conn_err(connection, "Authentication of peer failed, trying again.\n"); + drbd_err(connection, "Authentication of peer failed, trying again.\n"); return 0; } } @@ -1100,7 +1100,7 @@ static int decode_header(struct drbd_connection *connection, void *header, struc *(__be32 *)header == cpu_to_be32(DRBD_MAGIC_100)) { struct p_header100 *h = header; if (h->pad != 0) { - conn_err(connection, "Header padding is not zero\n"); + drbd_err(connection, "Header padding is not zero\n"); return -EINVAL; } pi->vnr = be16_to_cpu(h->volume); @@ -1119,7 +1119,7 @@ static int decode_header(struct drbd_connection *connection, void *header, struc pi->size = be16_to_cpu(h->length); pi->vnr = 0; } else { - conn_err(connection, "Wrong magic value 0x%08x in protocol version %d\n", + drbd_err(connection, "Wrong magic value 0x%08x in protocol version %d\n", be32_to_cpu(*(__be32 *)header), connection->agreed_pro_version); return -EINVAL; @@ -1291,7 +1291,7 @@ void drbd_bump_write_ordering(struct drbd_connection *connection, enum write_ord rcu_read_unlock(); connection->write_ordering = wo; if (pwo != connection->write_ordering || wo == WO_bdev_flush) - conn_info(connection, "Method to ensure write ordering: %s\n", write_ordering_str[connection->write_ordering]); + drbd_info(connection, "Method to ensure write ordering: %s\n", write_ordering_str[connection->write_ordering]); } /** @@ -1451,7 +1451,7 @@ static int receive_Barrier(struct drbd_connection *connection, struct packet_inf if (epoch) break; else - conn_warn(connection, "Allocation of an epoch failed, slowing down\n"); + drbd_warn(connection, "Allocation of an epoch failed, slowing down\n"); /* Fall through */ case WO_bdev_flush: @@ -1467,7 +1467,7 @@ static int receive_Barrier(struct drbd_connection *connection, struct packet_inf return 0; default: - conn_err(connection, "Strangeness in connection->write_ordering %d\n", connection->write_ordering); + drbd_err(connection, "Strangeness in connection->write_ordering %d\n", connection->write_ordering); return -EIO; } @@ -3149,37 +3149,37 @@ static int receive_protocol(struct drbd_connection *connection, struct packet_in nc = rcu_dereference(connection->net_conf); if (p_proto != nc->wire_protocol) { - conn_err(connection, "incompatible %s settings\n", "protocol"); + drbd_err(connection, "incompatible %s settings\n", "protocol"); goto disconnect_rcu_unlock; } if (convert_after_sb(p_after_sb_0p) != nc->after_sb_0p) { - conn_err(connection, "incompatible %s settings\n", "after-sb-0pri"); + drbd_err(connection, "incompatible %s settings\n", "after-sb-0pri"); goto disconnect_rcu_unlock; } if (convert_after_sb(p_after_sb_1p) != nc->after_sb_1p) { - conn_err(connection, "incompatible %s settings\n", "after-sb-1pri"); + drbd_err(connection, "incompatible %s settings\n", "after-sb-1pri"); goto disconnect_rcu_unlock; } if (convert_after_sb(p_after_sb_2p) != nc->after_sb_2p) { - conn_err(connection, "incompatible %s settings\n", "after-sb-2pri"); + drbd_err(connection, "incompatible %s settings\n", "after-sb-2pri"); goto disconnect_rcu_unlock; } if (p_discard_my_data && nc->discard_my_data) { - conn_err(connection, "incompatible %s settings\n", "discard-my-data"); + drbd_err(connection, "incompatible %s settings\n", "discard-my-data"); goto disconnect_rcu_unlock; } if (p_two_primaries != nc->two_primaries) { - conn_err(connection, "incompatible %s settings\n", "allow-two-primaries"); + drbd_err(connection, "incompatible %s settings\n", "allow-two-primaries"); goto disconnect_rcu_unlock; } if (strcmp(integrity_alg, nc->integrity_alg)) { - conn_err(connection, "incompatible %s settings\n", "data-integrity-alg"); + drbd_err(connection, "incompatible %s settings\n", "data-integrity-alg"); goto disconnect_rcu_unlock; } @@ -3200,7 +3200,7 @@ static int receive_protocol(struct drbd_connection *connection, struct packet_in peer_integrity_tfm = crypto_alloc_hash(integrity_alg, 0, CRYPTO_ALG_ASYNC); if (!peer_integrity_tfm) { - conn_err(connection, "peer data-integrity-alg %s not supported\n", + drbd_err(connection, "peer data-integrity-alg %s not supported\n", integrity_alg); goto disconnect; } @@ -3209,14 +3209,14 @@ static int receive_protocol(struct drbd_connection *connection, struct packet_in int_dig_in = kmalloc(hash_size, GFP_KERNEL); int_dig_vv = kmalloc(hash_size, GFP_KERNEL); if (!(int_dig_in && int_dig_vv)) { - conn_err(connection, "Allocation of buffers for data integrity checking failed\n"); + drbd_err(connection, "Allocation of buffers for data integrity checking failed\n"); goto disconnect; } } new_net_conf = kmalloc(sizeof(struct net_conf), GFP_KERNEL); if (!new_net_conf) { - conn_err(connection, "Allocation of new net_conf failed\n"); + drbd_err(connection, "Allocation of new net_conf failed\n"); goto disconnect; } @@ -3243,7 +3243,7 @@ static int receive_protocol(struct drbd_connection *connection, struct packet_in connection->int_dig_vv = int_dig_vv; if (strcmp(old_net_conf->integrity_alg, integrity_alg)) - conn_info(connection, "peer data-integrity-alg: %s\n", + drbd_info(connection, "peer data-integrity-alg: %s\n", integrity_alg[0] ? integrity_alg : "(none)"); synchronize_rcu(); @@ -3316,7 +3316,7 @@ static int ignore_remaining_packet(struct drbd_connection *connection, struct pa */ static int config_unknown_volume(struct drbd_connection *connection, struct packet_info *pi) { - conn_warn(connection, "%s packet received for volume %u, which is not configured locally\n", + drbd_warn(connection, "%s packet received for volume %u, which is not configured locally\n", cmdname(pi->cmd), pi->vnr); return ignore_remaining_packet(connection, pi); } @@ -4311,7 +4311,7 @@ static int receive_bitmap(struct drbd_connection *connection, struct packet_info static int receive_skip(struct drbd_connection *connection, struct packet_info *pi) { - conn_warn(connection, "skipping unknown optional packet type %d, l: %d!\n", + drbd_warn(connection, "skipping unknown optional packet type %d, l: %d!\n", pi->cmd, pi->size); return ignore_remaining_packet(connection, pi); @@ -4398,14 +4398,14 @@ static void drbdd(struct drbd_connection *connection) cmd = &drbd_cmd_handler[pi.cmd]; if (unlikely(pi.cmd >= ARRAY_SIZE(drbd_cmd_handler) || !cmd->fn)) { - conn_err(connection, "Unexpected data packet %s (0x%04x)", + drbd_err(connection, "Unexpected data packet %s (0x%04x)", cmdname(pi.cmd), pi.cmd); goto err_out; } shs = cmd->pkt_size; if (pi.size > shs && !cmd->expect_payload) { - conn_err(connection, "No payload expected %s l:%d\n", + drbd_err(connection, "No payload expected %s l:%d\n", cmdname(pi.cmd), pi.size); goto err_out; } @@ -4419,7 +4419,7 @@ static void drbdd(struct drbd_connection *connection) err = cmd->fn(connection, &pi); if (err) { - conn_err(connection, "error receiving %s, e: %d l: %d!\n", + drbd_err(connection, "error receiving %s, e: %d l: %d!\n", cmdname(pi.cmd), err, pi.size); goto err_out; } @@ -4473,12 +4473,12 @@ static void conn_disconnect(struct drbd_connection *connection) rcu_read_unlock(); if (!list_empty(&connection->current_epoch->list)) - conn_err(connection, "ASSERTION FAILED: connection->current_epoch->list not empty\n"); + drbd_err(connection, "ASSERTION FAILED: connection->current_epoch->list not empty\n"); /* ok, no more ee's on the fly, it is safe to reset the epoch_size */ atomic_set(&connection->current_epoch->epoch_size, 0); connection->send.seen_any_write_yet = false; - conn_info(connection, "Connection closed\n"); + drbd_info(connection, "Connection closed\n"); if (conn_highest_role(connection) == R_PRIMARY && conn_highest_pdsk(connection) >= D_UNKNOWN) conn_try_outdate_peer_async(connection); @@ -4625,13 +4625,13 @@ static int drbd_do_features(struct drbd_connection *connection) return 0; if (pi.cmd != P_CONNECTION_FEATURES) { - conn_err(connection, "expected ConnectionFeatures packet, received: %s (0x%04x)\n", + drbd_err(connection, "expected ConnectionFeatures packet, received: %s (0x%04x)\n", cmdname(pi.cmd), pi.cmd); return -1; } if (pi.size != expect) { - conn_err(connection, "expected ConnectionFeatures length: %u, received: %u\n", + drbd_err(connection, "expected ConnectionFeatures length: %u, received: %u\n", expect, pi.size); return -1; } @@ -4652,13 +4652,13 @@ static int drbd_do_features(struct drbd_connection *connection) connection->agreed_pro_version = min_t(int, PRO_VERSION_MAX, p->protocol_max); - conn_info(connection, "Handshake successful: " + drbd_info(connection, "Handshake successful: " "Agreed network protocol version %d\n", connection->agreed_pro_version); return 1; incompat: - conn_err(connection, "incompatible DRBD dialects: " + drbd_err(connection, "incompatible DRBD dialects: " "I support %d-%d, peer supports %d-%d\n", PRO_VERSION_MIN, PRO_VERSION_MAX, p->protocol_min, p->protocol_max); @@ -4668,8 +4668,8 @@ static int drbd_do_features(struct drbd_connection *connection) #if !defined(CONFIG_CRYPTO_HMAC) && !defined(CONFIG_CRYPTO_HMAC_MODULE) static int drbd_do_auth(struct drbd_connection *connection) { - conn_err(connection, "This kernel was build without CONFIG_CRYPTO_HMAC.\n"); - conn_err(connection, "You need to disable 'cram-hmac-alg' in drbd.conf.\n"); + drbd_err(connection, "This kernel was build without CONFIG_CRYPTO_HMAC.\n"); + drbd_err(connection, "You need to disable 'cram-hmac-alg' in drbd.conf.\n"); return -1; } #else @@ -4710,7 +4710,7 @@ static int drbd_do_auth(struct drbd_connection *connection) rv = crypto_hash_setkey(connection->cram_hmac_tfm, (u8 *)secret, key_len); if (rv) { - conn_err(connection, "crypto_hash_setkey() failed with %d\n", rv); + drbd_err(connection, "crypto_hash_setkey() failed with %d\n", rv); rv = -1; goto fail; } @@ -4734,21 +4734,21 @@ static int drbd_do_auth(struct drbd_connection *connection) } if (pi.cmd != P_AUTH_CHALLENGE) { - conn_err(connection, "expected AuthChallenge packet, received: %s (0x%04x)\n", + drbd_err(connection, "expected AuthChallenge packet, received: %s (0x%04x)\n", cmdname(pi.cmd), pi.cmd); rv = 0; goto fail; } if (pi.size > CHALLENGE_LEN * 2) { - conn_err(connection, "expected AuthChallenge payload too big.\n"); + drbd_err(connection, "expected AuthChallenge payload too big.\n"); rv = -1; goto fail; } peers_ch = kmalloc(pi.size, GFP_NOIO); if (peers_ch == NULL) { - conn_err(connection, "kmalloc of peers_ch failed\n"); + drbd_err(connection, "kmalloc of peers_ch failed\n"); rv = -1; goto fail; } @@ -4762,7 +4762,7 @@ static int drbd_do_auth(struct drbd_connection *connection) resp_size = crypto_hash_digestsize(connection->cram_hmac_tfm); response = kmalloc(resp_size, GFP_NOIO); if (response == NULL) { - conn_err(connection, "kmalloc of response failed\n"); + drbd_err(connection, "kmalloc of response failed\n"); rv = -1; goto fail; } @@ -4772,7 +4772,7 @@ static int drbd_do_auth(struct drbd_connection *connection) rv = crypto_hash_digest(&desc, &sg, sg.length, response); if (rv) { - conn_err(connection, "crypto_hash_digest() failed with %d\n", rv); + drbd_err(connection, "crypto_hash_digest() failed with %d\n", rv); rv = -1; goto fail; } @@ -4793,14 +4793,14 @@ static int drbd_do_auth(struct drbd_connection *connection) } if (pi.cmd != P_AUTH_RESPONSE) { - conn_err(connection, "expected AuthResponse packet, received: %s (0x%04x)\n", + drbd_err(connection, "expected AuthResponse packet, received: %s (0x%04x)\n", cmdname(pi.cmd), pi.cmd); rv = 0; goto fail; } if (pi.size != resp_size) { - conn_err(connection, "expected AuthResponse payload of wrong size\n"); + drbd_err(connection, "expected AuthResponse payload of wrong size\n"); rv = 0; goto fail; } @@ -4813,7 +4813,7 @@ static int drbd_do_auth(struct drbd_connection *connection) right_response = kmalloc(resp_size, GFP_NOIO); if (right_response == NULL) { - conn_err(connection, "kmalloc of right_response failed\n"); + drbd_err(connection, "kmalloc of right_response failed\n"); rv = -1; goto fail; } @@ -4822,7 +4822,7 @@ static int drbd_do_auth(struct drbd_connection *connection) rv = crypto_hash_digest(&desc, &sg, sg.length, right_response); if (rv) { - conn_err(connection, "crypto_hash_digest() failed with %d\n", rv); + drbd_err(connection, "crypto_hash_digest() failed with %d\n", rv); rv = -1; goto fail; } @@ -4830,7 +4830,7 @@ static int drbd_do_auth(struct drbd_connection *connection) rv = !memcmp(response, right_response, resp_size); if (rv) - conn_info(connection, "Peer authenticated using %d bytes HMAC\n", + drbd_info(connection, "Peer authenticated using %d bytes HMAC\n", resp_size); else rv = -1; @@ -4849,7 +4849,7 @@ int drbdd_init(struct drbd_thread *thi) struct drbd_connection *connection = thi->connection; int h; - conn_info(connection, "receiver (re)started\n"); + drbd_info(connection, "receiver (re)started\n"); do { h = conn_connect(connection); @@ -4858,7 +4858,7 @@ int drbdd_init(struct drbd_thread *thi) schedule_timeout_interruptible(HZ); } if (h == -1) { - conn_warn(connection, "Discarding network configuration.\n"); + drbd_warn(connection, "Discarding network configuration.\n"); conn_request_state(connection, NS(conn, C_DISCONNECTING), CS_HARD); } } while (h == 0); @@ -4868,7 +4868,7 @@ int drbdd_init(struct drbd_thread *thi) conn_disconnect(connection); - conn_info(connection, "receiver terminated\n"); + drbd_info(connection, "receiver terminated\n"); return 0; } @@ -4883,7 +4883,7 @@ static int got_conn_RqSReply(struct drbd_connection *connection, struct packet_i set_bit(CONN_WD_ST_CHG_OKAY, &connection->flags); } else { set_bit(CONN_WD_ST_CHG_FAIL, &connection->flags); - conn_err(connection, "Requested state change failed by peer: %s (%d)\n", + drbd_err(connection, "Requested state change failed by peer: %s (%d)\n", drbd_set_st_err_str(retcode), retcode); } wake_up(&connection->ping_wait); @@ -5274,7 +5274,7 @@ int drbd_asender(struct drbd_thread *thi) rv = sched_setscheduler(current, SCHED_RR, ¶m); if (rv < 0) - conn_err(connection, "drbd_asender: ERROR set priority, ret=%d\n", rv); + drbd_err(connection, "drbd_asender: ERROR set priority, ret=%d\n", rv); while (get_t_state(thi) == RUNNING) { drbd_thread_current_set_cpu(thi); @@ -5288,7 +5288,7 @@ int drbd_asender(struct drbd_thread *thi) if (test_and_clear_bit(SEND_PING, &connection->flags)) { if (drbd_send_ping(connection)) { - conn_err(connection, "drbd_send_ping has failed\n"); + drbd_err(connection, "drbd_send_ping has failed\n"); goto reconnect; } connection->meta.socket->sk->sk_rcvtimeo = ping_timeo * HZ / 10; @@ -5300,7 +5300,7 @@ int drbd_asender(struct drbd_thread *thi) if (tcp_cork) drbd_tcp_cork(connection->meta.socket); if (connection_finish_peer_reqs(connection)) { - conn_err(connection, "connection_finish_peer_reqs() failed\n"); + drbd_err(connection, "connection_finish_peer_reqs() failed\n"); goto reconnect; } /* but unconditionally uncork unless disabled */ @@ -5342,7 +5342,7 @@ int drbd_asender(struct drbd_thread *thi) if (t) break; } - conn_err(connection, "meta connection shut down by peer.\n"); + drbd_err(connection, "meta connection shut down by peer.\n"); goto reconnect; } else if (rv == -EAGAIN) { /* If the data socket received something meanwhile, @@ -5351,7 +5351,7 @@ int drbd_asender(struct drbd_thread *thi) jiffies - connection->meta.socket->sk->sk_rcvtimeo)) continue; if (ping_timeout_active) { - conn_err(connection, "PingAck did not arrive in time.\n"); + drbd_err(connection, "PingAck did not arrive in time.\n"); goto reconnect; } set_bit(SEND_PING, &connection->flags); @@ -5359,7 +5359,7 @@ int drbd_asender(struct drbd_thread *thi) } else if (rv == -EINTR) { continue; } else { - conn_err(connection, "sock_recvmsg returned %d\n", rv); + drbd_err(connection, "sock_recvmsg returned %d\n", rv); goto reconnect; } @@ -5368,13 +5368,13 @@ int drbd_asender(struct drbd_thread *thi) goto reconnect; cmd = &asender_tbl[pi.cmd]; if (pi.cmd >= ARRAY_SIZE(asender_tbl) || !cmd->fn) { - conn_err(connection, "Unexpected meta packet %s (0x%04x)\n", + drbd_err(connection, "Unexpected meta packet %s (0x%04x)\n", cmdname(pi.cmd), pi.cmd); goto disconnect; } expect = header_size + cmd->pkt_size; if (pi.size != expect - header_size) { - conn_err(connection, "Wrong packet size on meta (c: %d, l: %d)\n", + drbd_err(connection, "Wrong packet size on meta (c: %d, l: %d)\n", pi.cmd, pi.size); goto reconnect; } @@ -5384,7 +5384,7 @@ int drbd_asender(struct drbd_thread *thi) err = cmd->fn(connection, &pi); if (err) { - conn_err(connection, "%pf failed\n", cmd->fn); + drbd_err(connection, "%pf failed\n", cmd->fn); goto reconnect; } @@ -5414,7 +5414,7 @@ disconnect: } clear_bit(SIGNAL_ASENDER, &connection->flags); - conn_info(connection, "asender terminated\n"); + drbd_info(connection, "asender terminated\n"); return 0; } |