Commit 1ec861eb authored by Andreas Gruenbacher's avatar Andreas Gruenbacher Committed by Philipp Reisner

drbd: Replace and remove the obsolete conn_() macros

With the polymorphic drbd_() macros, we no longer need the connection
specific variants.
Signed-off-by: default avatarAndreas Gruenbacher <agruen@linbit.com>
Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
parent 3b52beff
...@@ -147,16 +147,6 @@ void drbd_printk_with_wrong_object_type(void); ...@@ -147,16 +147,6 @@ void drbd_printk_with_wrong_object_type(void);
#define dynamic_drbd_dbg(device, fmt, args...) \ #define dynamic_drbd_dbg(device, fmt, args...) \
dynamic_dev_dbg(disk_to_dev(device->vdisk), fmt, ## args) dynamic_dev_dbg(disk_to_dev(device->vdisk), fmt, ## args)
#define conn_printk(LEVEL, TCONN, FMT, ARGS...) \
printk(LEVEL "d-con %s: " FMT, TCONN->resource->name , ## ARGS)
#define conn_alert(TCONN, FMT, ARGS...) conn_printk(KERN_ALERT, TCONN, FMT, ## ARGS)
#define conn_crit(TCONN, FMT, ARGS...) conn_printk(KERN_CRIT, TCONN, FMT, ## ARGS)
#define conn_err(TCONN, FMT, ARGS...) conn_printk(KERN_ERR, TCONN, FMT, ## ARGS)
#define conn_warn(TCONN, FMT, ARGS...) conn_printk(KERN_WARNING, TCONN, FMT, ## ARGS)
#define conn_notice(TCONN, FMT, ARGS...) conn_printk(KERN_NOTICE, TCONN, FMT, ## ARGS)
#define conn_info(TCONN, FMT, ARGS...) conn_printk(KERN_INFO, TCONN, FMT, ## ARGS)
#define conn_dbg(TCONN, FMT, ARGS...) conn_printk(KERN_DEBUG, TCONN, FMT, ## ARGS)
#define D_ASSERT(exp) if (!(exp)) \ #define D_ASSERT(exp) if (!(exp)) \
drbd_err(device, "ASSERT( " #exp " ) in %s:%d\n", __FILE__, __LINE__) drbd_err(device, "ASSERT( " #exp " ) in %s:%d\n", __FILE__, __LINE__)
......
...@@ -227,18 +227,18 @@ void tl_release(struct drbd_connection *connection, unsigned int barrier_nr, ...@@ -227,18 +227,18 @@ void tl_release(struct drbd_connection *connection, unsigned int barrier_nr,
/* first some paranoia code */ /* first some paranoia code */
if (req == NULL) { if (req == NULL) {
conn_err(connection, "BAD! BarrierAck #%u received, but no epoch in tl!?\n", drbd_err(connection, "BAD! BarrierAck #%u received, but no epoch in tl!?\n",
barrier_nr); barrier_nr);
goto bail; goto bail;
} }
if (expect_epoch != barrier_nr) { if (expect_epoch != barrier_nr) {
conn_err(connection, "BAD! BarrierAck #%u received, expected #%u!\n", drbd_err(connection, "BAD! BarrierAck #%u received, expected #%u!\n",
barrier_nr, expect_epoch); barrier_nr, expect_epoch);
goto bail; goto bail;
} }
if (expect_size != set_size) { if (expect_size != set_size) {
conn_err(connection, "BAD! BarrierAck #%u received with n_writes=%u, expected n_writes=%u!\n", drbd_err(connection, "BAD! BarrierAck #%u received with n_writes=%u, expected n_writes=%u!\n",
barrier_nr, set_size, expect_size); barrier_nr, set_size, expect_size);
goto bail; goto bail;
} }
...@@ -349,7 +349,7 @@ static int drbd_thread_setup(void *arg) ...@@ -349,7 +349,7 @@ static int drbd_thread_setup(void *arg)
*/ */
if (thi->t_state == RESTARTING) { if (thi->t_state == RESTARTING) {
conn_info(connection, "Restarting %s thread\n", thi->name); drbd_info(connection, "Restarting %s thread\n", thi->name);
thi->t_state = RUNNING; thi->t_state = RUNNING;
spin_unlock_irqrestore(&thi->t_lock, flags); spin_unlock_irqrestore(&thi->t_lock, flags);
goto restart; goto restart;
...@@ -361,7 +361,7 @@ static int drbd_thread_setup(void *arg) ...@@ -361,7 +361,7 @@ static int drbd_thread_setup(void *arg)
complete_all(&thi->stop); complete_all(&thi->stop);
spin_unlock_irqrestore(&thi->t_lock, flags); spin_unlock_irqrestore(&thi->t_lock, flags);
conn_info(connection, "Terminating %s\n", current->comm); drbd_info(connection, "Terminating %s\n", current->comm);
/* Release mod reference taken when thread was started */ /* Release mod reference taken when thread was started */
...@@ -393,12 +393,12 @@ int drbd_thread_start(struct drbd_thread *thi) ...@@ -393,12 +393,12 @@ int drbd_thread_start(struct drbd_thread *thi)
switch (thi->t_state) { switch (thi->t_state) {
case NONE: case NONE:
conn_info(connection, "Starting %s thread (from %s [%d])\n", drbd_info(connection, "Starting %s thread (from %s [%d])\n",
thi->name, current->comm, current->pid); thi->name, current->comm, current->pid);
/* Get ref on module for thread - this is released when thread exits */ /* Get ref on module for thread - this is released when thread exits */
if (!try_module_get(THIS_MODULE)) { if (!try_module_get(THIS_MODULE)) {
conn_err(connection, "Failed to get module reference in drbd_thread_start\n"); drbd_err(connection, "Failed to get module reference in drbd_thread_start\n");
spin_unlock_irqrestore(&thi->t_lock, flags); spin_unlock_irqrestore(&thi->t_lock, flags);
return false; return false;
} }
...@@ -415,7 +415,7 @@ int drbd_thread_start(struct drbd_thread *thi) ...@@ -415,7 +415,7 @@ int drbd_thread_start(struct drbd_thread *thi)
"drbd_%c_%s", thi->name[0], thi->connection->resource->name); "drbd_%c_%s", thi->name[0], thi->connection->resource->name);
if (IS_ERR(nt)) { if (IS_ERR(nt)) {
conn_err(connection, "Couldn't start thread\n"); drbd_err(connection, "Couldn't start thread\n");
kref_put(&connection->kref, drbd_destroy_connection); kref_put(&connection->kref, drbd_destroy_connection);
module_put(THIS_MODULE); module_put(THIS_MODULE);
...@@ -429,7 +429,7 @@ int drbd_thread_start(struct drbd_thread *thi) ...@@ -429,7 +429,7 @@ int drbd_thread_start(struct drbd_thread *thi)
break; break;
case EXITING: case EXITING:
thi->t_state = RESTARTING; thi->t_state = RESTARTING;
conn_info(connection, "Restarting %s thread (from %s [%d])\n", drbd_info(connection, "Restarting %s thread (from %s [%d])\n",
thi->name, current->comm, current->pid); thi->name, current->comm, current->pid);
/* fall through */ /* fall through */
case RUNNING: case RUNNING:
...@@ -786,7 +786,7 @@ int __drbd_send_protocol(struct drbd_connection *connection, enum drbd_packet cm ...@@ -786,7 +786,7 @@ int __drbd_send_protocol(struct drbd_connection *connection, enum drbd_packet cm
if (nc->tentative && connection->agreed_pro_version < 92) { if (nc->tentative && connection->agreed_pro_version < 92) {
rcu_read_unlock(); rcu_read_unlock();
mutex_unlock(&sock->mutex); mutex_unlock(&sock->mutex);
conn_err(connection, "--dry-run is not supported by peer"); drbd_err(connection, "--dry-run is not supported by peer");
return -EOPNOTSUPP; return -EOPNOTSUPP;
} }
...@@ -1435,7 +1435,7 @@ static int we_should_drop_the_connection(struct drbd_connection *connection, str ...@@ -1435,7 +1435,7 @@ static int we_should_drop_the_connection(struct drbd_connection *connection, str
drop_it = !--connection->ko_count; drop_it = !--connection->ko_count;
if (!drop_it) { if (!drop_it) {
conn_err(connection, "[%s/%d] sock_sendmsg time expired, ko = %u\n", drbd_err(connection, "[%s/%d] sock_sendmsg time expired, ko = %u\n",
current->comm, current->pid, connection->ko_count); current->comm, current->pid, connection->ko_count);
request_ping(connection); request_ping(connection);
} }
...@@ -1800,7 +1800,7 @@ int drbd_send(struct drbd_connection *connection, struct socket *sock, ...@@ -1800,7 +1800,7 @@ int drbd_send(struct drbd_connection *connection, struct socket *sock,
if (rv <= 0) { if (rv <= 0) {
if (rv != -EAGAIN) { if (rv != -EAGAIN) {
conn_err(connection, "%s_sendmsg returned %d\n", drbd_err(connection, "%s_sendmsg returned %d\n",
sock == connection->meta.socket ? "msock" : "sock", sock == connection->meta.socket ? "msock" : "sock",
rv); rv);
conn_request_state(connection, NS(conn, C_BROKEN_PIPE), CS_HARD); conn_request_state(connection, NS(conn, C_BROKEN_PIPE), CS_HARD);
...@@ -2507,7 +2507,7 @@ int set_resource_options(struct drbd_resource *resource, struct res_opts *res_op ...@@ -2507,7 +2507,7 @@ int set_resource_options(struct drbd_resource *resource, struct res_opts *res_op
err = bitmap_parse(res_opts->cpu_mask, 32, err = bitmap_parse(res_opts->cpu_mask, 32,
cpumask_bits(new_cpu_mask), nr_cpu_ids); cpumask_bits(new_cpu_mask), nr_cpu_ids);
if (err) { if (err) {
conn_warn(connection, "bitmap_parse() failed with %d\n", err); drbd_warn(resource, "bitmap_parse() failed with %d\n", err);
/* retcode = ERR_CPU_MASK_PARSE; */ /* retcode = ERR_CPU_MASK_PARSE; */
goto fail; goto fail;
} }
...@@ -2630,7 +2630,7 @@ void drbd_destroy_connection(struct kref *kref) ...@@ -2630,7 +2630,7 @@ void drbd_destroy_connection(struct kref *kref)
struct drbd_resource *resource = connection->resource; struct drbd_resource *resource = connection->resource;
if (atomic_read(&connection->current_epoch->epoch_size) != 0) if (atomic_read(&connection->current_epoch->epoch_size) != 0)
conn_err(connection, "epoch_size:%d\n", atomic_read(&connection->current_epoch->epoch_size)); drbd_err(connection, "epoch_size:%d\n", atomic_read(&connection->current_epoch->epoch_size));
kfree(connection->current_epoch); kfree(connection->current_epoch);
idr_destroy(&connection->peer_devices); idr_destroy(&connection->peer_devices);
......
...@@ -392,16 +392,16 @@ static int conn_khelper(struct drbd_connection *connection, char *cmd) ...@@ -392,16 +392,16 @@ static int conn_khelper(struct drbd_connection *connection, char *cmd)
setup_khelper_env(connection, envp); setup_khelper_env(connection, envp);
conn_md_sync(connection); conn_md_sync(connection);
conn_info(connection, "helper command: %s %s %s\n", usermode_helper, cmd, resource_name); drbd_info(connection, "helper command: %s %s %s\n", usermode_helper, cmd, resource_name);
/* TODO: conn_bcast_event() ?? */ /* TODO: conn_bcast_event() ?? */
ret = call_usermodehelper(usermode_helper, argv, envp, UMH_WAIT_PROC); ret = call_usermodehelper(usermode_helper, argv, envp, UMH_WAIT_PROC);
if (ret) if (ret)
conn_warn(connection, "helper command: %s %s %s exit code %u (0x%x)\n", drbd_warn(connection, "helper command: %s %s %s exit code %u (0x%x)\n",
usermode_helper, cmd, resource_name, usermode_helper, cmd, resource_name,
(ret >> 8) & 0xff, ret); (ret >> 8) & 0xff, ret);
else else
conn_info(connection, "helper command: %s %s %s exit code %u (0x%x)\n", drbd_info(connection, "helper command: %s %s %s exit code %u (0x%x)\n",
usermode_helper, cmd, resource_name, usermode_helper, cmd, resource_name,
(ret >> 8) & 0xff, ret); (ret >> 8) & 0xff, ret);
/* TODO: conn_bcast_event() ?? */ /* TODO: conn_bcast_event() ?? */
...@@ -443,7 +443,7 @@ bool conn_try_outdate_peer(struct drbd_connection *connection) ...@@ -443,7 +443,7 @@ bool conn_try_outdate_peer(struct drbd_connection *connection)
int r; int r;
if (connection->cstate >= C_WF_REPORT_PARAMS) { if (connection->cstate >= C_WF_REPORT_PARAMS) {
conn_err(connection, "Expected cstate < C_WF_REPORT_PARAMS\n"); drbd_err(connection, "Expected cstate < C_WF_REPORT_PARAMS\n");
return false; return false;
} }
...@@ -454,7 +454,7 @@ bool conn_try_outdate_peer(struct drbd_connection *connection) ...@@ -454,7 +454,7 @@ bool conn_try_outdate_peer(struct drbd_connection *connection)
fp = highest_fencing_policy(connection); fp = highest_fencing_policy(connection);
switch (fp) { switch (fp) {
case FP_NOT_AVAIL: case FP_NOT_AVAIL:
conn_warn(connection, "Not fencing peer, I'm not even Consistent myself.\n"); drbd_warn(connection, "Not fencing peer, I'm not even Consistent myself.\n");
goto out; goto out;
case FP_DONT_CARE: case FP_DONT_CARE:
return true; return true;
...@@ -488,24 +488,24 @@ bool conn_try_outdate_peer(struct drbd_connection *connection) ...@@ -488,24 +488,24 @@ bool conn_try_outdate_peer(struct drbd_connection *connection)
* This is useful when an unconnected R_SECONDARY is asked to * This is useful when an unconnected R_SECONDARY is asked to
* become R_PRIMARY, but finds the other peer being active. */ * become R_PRIMARY, but finds the other peer being active. */
ex_to_string = "peer is active"; ex_to_string = "peer is active";
conn_warn(connection, "Peer is primary, outdating myself.\n"); drbd_warn(connection, "Peer is primary, outdating myself.\n");
mask.disk = D_MASK; mask.disk = D_MASK;
val.disk = D_OUTDATED; val.disk = D_OUTDATED;
break; break;
case 7: case 7:
if (fp != FP_STONITH) if (fp != FP_STONITH)
conn_err(connection, "fence-peer() = 7 && fencing != Stonith !!!\n"); drbd_err(connection, "fence-peer() = 7 && fencing != Stonith !!!\n");
ex_to_string = "peer was stonithed"; ex_to_string = "peer was stonithed";
mask.pdsk = D_MASK; mask.pdsk = D_MASK;
val.pdsk = D_OUTDATED; val.pdsk = D_OUTDATED;
break; break;
default: default:
/* The script is broken ... */ /* The script is broken ... */
conn_err(connection, "fence-peer helper broken, returned %d\n", (r>>8)&0xff); drbd_err(connection, "fence-peer helper broken, returned %d\n", (r>>8)&0xff);
return false; /* Eventually leave IO frozen */ return false; /* Eventually leave IO frozen */
} }
conn_info(connection, "fence-peer helper returned %d (%s)\n", drbd_info(connection, "fence-peer helper returned %d (%s)\n",
(r>>8) & 0xff, ex_to_string); (r>>8) & 0xff, ex_to_string);
out: out:
...@@ -519,7 +519,7 @@ bool conn_try_outdate_peer(struct drbd_connection *connection) ...@@ -519,7 +519,7 @@ bool conn_try_outdate_peer(struct drbd_connection *connection)
if (connection->connect_cnt != connect_cnt) if (connection->connect_cnt != connect_cnt)
/* In case the connection was established and droped /* In case the connection was established and droped
while the fence-peer handler was running, ignore it */ while the fence-peer handler was running, ignore it */
conn_info(connection, "Ignoring fence-peer exit code\n"); drbd_info(connection, "Ignoring fence-peer exit code\n");
else else
_conn_request_state(connection, mask, val, CS_VERBOSE); _conn_request_state(connection, mask, val, CS_VERBOSE);
} }
...@@ -545,7 +545,7 @@ void conn_try_outdate_peer_async(struct drbd_connection *connection) ...@@ -545,7 +545,7 @@ void conn_try_outdate_peer_async(struct drbd_connection *connection)
kref_get(&connection->kref); kref_get(&connection->kref);
opa = kthread_run(_try_outdate_peer_async, connection, "drbd_async_h"); opa = kthread_run(_try_outdate_peer_async, connection, "drbd_async_h");
if (IS_ERR(opa)) { if (IS_ERR(opa)) {
conn_err(connection, "out of mem, failed to invoke fence-peer helper\n"); drbd_err(connection, "out of mem, failed to invoke fence-peer helper\n");
kref_put(&connection->kref, drbd_destroy_connection); kref_put(&connection->kref, drbd_destroy_connection);
} }
} }
...@@ -2335,7 +2335,7 @@ static enum drbd_state_rv conn_try_disconnect(struct drbd_connection *connection ...@@ -2335,7 +2335,7 @@ static enum drbd_state_rv conn_try_disconnect(struct drbd_connection *connection
rv2 = conn_request_state(connection, NS(conn, C_STANDALONE), rv2 = conn_request_state(connection, NS(conn, C_STANDALONE),
CS_VERBOSE | CS_HARD); CS_VERBOSE | CS_HARD);
if (rv2 < SS_SUCCESS) if (rv2 < SS_SUCCESS)
conn_err(connection, drbd_err(connection,
"unexpected rv2=%d in conn_try_disconnect()\n", "unexpected rv2=%d in conn_try_disconnect()\n",
rv2); rv2);
} }
......
...@@ -497,9 +497,9 @@ static int drbd_recv(struct drbd_connection *connection, void *buf, size_t size) ...@@ -497,9 +497,9 @@ static int drbd_recv(struct drbd_connection *connection, void *buf, size_t size)
if (rv < 0) { if (rv < 0) {
if (rv == -ECONNRESET) 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) 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) { } else if (rv == 0) {
if (test_bit(DISCONNECT_SENT, &connection->flags)) { if (test_bit(DISCONNECT_SENT, &connection->flags)) {
long t; long t;
...@@ -512,7 +512,7 @@ static int drbd_recv(struct drbd_connection *connection, void *buf, size_t size) ...@@ -512,7 +512,7 @@ static int drbd_recv(struct drbd_connection *connection, void *buf, size_t size)
if (t) if (t)
goto out; 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) if (rv != size)
...@@ -541,7 +541,7 @@ static int drbd_recv_all_warn(struct drbd_connection *connection, void *buf, siz ...@@ -541,7 +541,7 @@ static int drbd_recv_all_warn(struct drbd_connection *connection, void *buf, siz
err = drbd_recv_all(connection, buf, size); err = drbd_recv_all(connection, buf, size);
if (err && !signal_pending(current)) 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; return err;
} }
...@@ -643,7 +643,7 @@ static struct socket *drbd_try_connect(struct drbd_connection *connection) ...@@ -643,7 +643,7 @@ static struct socket *drbd_try_connect(struct drbd_connection *connection)
disconnect_on_error = 0; disconnect_on_error = 0;
break; break;
default: 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) if (disconnect_on_error)
conn_request_state(connection, NS(conn, C_DISCONNECTING), CS_HARD); conn_request_state(connection, NS(conn, C_DISCONNECTING), CS_HARD);
...@@ -726,7 +726,7 @@ static int prepare_listen_socket(struct drbd_connection *connection, struct acce ...@@ -726,7 +726,7 @@ static int prepare_listen_socket(struct drbd_connection *connection, struct acce
sock_release(s_listen); sock_release(s_listen);
if (err < 0) { if (err < 0) {
if (err != -EAGAIN && err != -EINTR && err != -ERESTARTSYS) { 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); 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, ...@@ -768,7 +768,7 @@ static struct socket *drbd_wait_for_connect(struct drbd_connection *connection,
err = kernel_accept(ad->s_listen, &s_estab, 0); err = kernel_accept(ad->s_listen, &s_estab, 0);
if (err < 0) { if (err < 0) {
if (err != -EAGAIN && err != -EINTR && err != -ERESTARTSYS) { 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); conn_request_state(connection, NS(conn, C_DISCONNECTING), CS_HARD);
} }
} }
...@@ -909,7 +909,7 @@ static int conn_connect(struct drbd_connection *connection) ...@@ -909,7 +909,7 @@ static int conn_connect(struct drbd_connection *connection)
msock.socket = s; msock.socket = s;
send_first_packet(connection, &msock, P_INITIAL_META); send_first_packet(connection, &msock, P_INITIAL_META);
} else { } else {
conn_err(connection, "Logic error in conn_connect()\n"); drbd_err(connection, "Logic error in conn_connect()\n");
goto out_release_sockets; goto out_release_sockets;
} }
} }
...@@ -935,7 +935,7 @@ static int conn_connect(struct drbd_connection *connection) ...@@ -935,7 +935,7 @@ static int conn_connect(struct drbd_connection *connection)
switch (fp) { switch (fp) {
case P_INITIAL_DATA: case P_INITIAL_DATA:
if (sock.socket) { if (sock.socket) {
conn_warn(connection, "initial packet S crossed\n"); drbd_warn(connection, "initial packet S crossed\n");
sock_release(sock.socket); sock_release(sock.socket);
sock.socket = s; sock.socket = s;
goto randomize; goto randomize;
...@@ -945,7 +945,7 @@ static int conn_connect(struct drbd_connection *connection) ...@@ -945,7 +945,7 @@ static int conn_connect(struct drbd_connection *connection)
case P_INITIAL_META: case P_INITIAL_META:
set_bit(RESOLVE_CONFLICTS, &connection->flags); set_bit(RESOLVE_CONFLICTS, &connection->flags);
if (msock.socket) { if (msock.socket) {
conn_warn(connection, "initial packet M crossed\n"); drbd_warn(connection, "initial packet M crossed\n");
sock_release(msock.socket); sock_release(msock.socket);
msock.socket = s; msock.socket = s;
goto randomize; goto randomize;
...@@ -953,7 +953,7 @@ static int conn_connect(struct drbd_connection *connection) ...@@ -953,7 +953,7 @@ static int conn_connect(struct drbd_connection *connection)
msock.socket = s; msock.socket = s;
break; break;
default: default:
conn_warn(connection, "Error receiving initial packet\n"); drbd_warn(connection, "Error receiving initial packet\n");
sock_release(s); sock_release(s);
randomize: randomize:
if (prandom_u32() & 1) if (prandom_u32() & 1)
...@@ -1021,10 +1021,10 @@ static int conn_connect(struct drbd_connection *connection) ...@@ -1021,10 +1021,10 @@ static int conn_connect(struct drbd_connection *connection)
/* drbd_request_state(device, NS(conn, WFAuth)); */ /* drbd_request_state(device, NS(conn, WFAuth)); */
switch (drbd_do_auth(connection)) { switch (drbd_do_auth(connection)) {
case -1: case -1:
conn_err(connection, "Authentication of peer failed\n"); drbd_err(connection, "Authentication of peer failed\n");
return -1; return -1;
case 0: case 0:
conn_err(connection, "Authentication of peer failed, trying again.\n"); drbd_err(connection, "Authentication of peer failed, trying again.\n");
return 0; return 0;
} }
} }
...@@ -1100,7 +1100,7 @@ static int decode_header(struct drbd_connection *connection, void *header, struc ...@@ -1100,7 +1100,7 @@ static int decode_header(struct drbd_connection *connection, void *header, struc
*(__be32 *)header == cpu_to_be32(DRBD_MAGIC_100)) { *(__be32 *)header == cpu_to_be32(DRBD_MAGIC_100)) {
struct p_header100 *h = header; struct p_header100 *h = header;
if (h->pad != 0) { if (h->pad != 0) {
conn_err(connection, "Header padding is not zero\n"); drbd_err(connection, "Header padding is not zero\n");
return -EINVAL; return -EINVAL;
} }
pi->vnr = be16_to_cpu(h->volume); pi->vnr = be16_to_cpu(h->volume);
...@@ -1119,7 +1119,7 @@ static int decode_header(struct drbd_connection *connection, void *header, struc ...@@ -1119,7 +1119,7 @@ static int decode_header(struct drbd_connection *connection, void *header, struc
pi->size = be16_to_cpu(h->length); pi->size = be16_to_cpu(h->length);
pi->vnr = 0; pi->vnr = 0;
} else { } 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), be32_to_cpu(*(__be32 *)header),
connection->agreed_pro_version); connection->agreed_pro_version);
return -EINVAL; return -EINVAL;
...@@ -1291,7 +1291,7 @@ void drbd_bump_write_ordering(struct drbd_connection *connection, enum write_ord ...@@ -1291,7 +1291,7 @@ void drbd_bump_write_ordering(struct drbd_connection *connection, enum write_ord
rcu_read_unlock(); rcu_read_unlock();
connection->write_ordering = wo; connection->write_ordering = wo;
if (pwo != connection->write_ordering || wo == WO_bdev_flush) 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 ...@@ -1451,7 +1451,7 @@ static int receive_Barrier(struct drbd_connection *connection, struct packet_inf
if (epoch) if (epoch)
break; break;
else 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 */ /* Fall through */
case WO_bdev_flush: case WO_bdev_flush:
...@@ -1467,7 +1467,7 @@ static int receive_Barrier(struct drbd_connection *connection, struct packet_inf ...@@ -1467,7 +1467,7 @@ static int receive_Barrier(struct drbd_connection *connection, struct packet_inf
return 0; return 0;
default: 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; return -EIO;
} }
...@@ -3149,37 +3149,37 @@ static int receive_protocol(struct drbd_connection *connection, struct packet_in ...@@ -3149,37 +3149,37 @@ static int receive_protocol(struct drbd_connection *connection, struct packet_in
nc = rcu_dereference(connection->net_conf); nc = rcu_dereference(connection->net_conf);
if (p_proto != nc->wire_protocol) { 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; goto disconnect_rcu_unlock;
} }
if (convert_after_sb(p_after_sb_0p) != nc->after_sb_0p) { 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; goto disconnect_rcu_unlock;
} }
if (convert_after_sb(p_after_sb_1p) != nc->after_sb_1p) { 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; goto disconnect_rcu_unlock;
} }
if (convert_after_sb(p_after_sb_2p) != nc->after_sb_2p) { 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; goto disconnect_rcu_unlock;
} }
if (p_discard_my_data && nc->discard_my_data) { 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; goto disconnect_rcu_unlock;
} }
if (p_two_primaries != nc->two_primaries) { 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; goto disconnect_rcu_unlock;
} }
if (strcmp(integrity_alg, nc->integrity_alg)) { 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; goto disconnect_rcu_unlock;
} }
...@@ -3200,7 +3200,7 @@ static int receive_protocol(struct drbd_connection *connection, struct packet_in ...@@ -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); peer_integrity_tfm = crypto_alloc_hash(integrity_alg, 0, CRYPTO_ALG_ASYNC);
if (!peer_integrity_tfm) { 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); integrity_alg);
goto disconnect; goto disconnect;
} }
...@@ -3209,14 +3209,14 @@ static int receive_protocol(struct drbd_connection *connection, struct packet_in ...@@ -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_in = kmalloc(hash_size, GFP_KERNEL);
int_dig_vv = kmalloc(hash_size, GFP_KERNEL); int_dig_vv = kmalloc(hash_size, GFP_KERNEL);
if (!(int_dig_in && int_dig_vv)) { 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; goto disconnect;
} }
} }
new_net_conf = kmalloc(sizeof(struct net_conf), GFP_KERNEL); new_net_conf = kmalloc(sizeof(struct net_conf), GFP_KERNEL);
if (!new_net_conf) { 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; goto disconnect;
} }
...@@ -3243,7 +3243,7 @@ static int receive_protocol(struct drbd_connection *connection, struct packet_in ...@@ -3243,7 +3243,7 @@ static int receive_protocol(struct drbd_connection *connection, struct packet_in
connection->int_dig_vv = int_dig_vv; connection->int_dig_vv = int_dig_vv;
if (strcmp(old_net_conf->integrity_alg, integrity_alg)) 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)"); integrity_alg[0] ? integrity_alg : "(none)");
synchronize_rcu(); synchronize_rcu();
...@@ -3316,7 +3316,7 @@ static int ignore_remaining_packet(struct drbd_connection *connection, struct pa ...@@ -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) 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); cmdname(pi->cmd), pi->vnr);
return ignore_remaining_packet(connection, pi); return ignore_remaining_packet(connection, pi);
} }
...@@ -4311,7 +4311,7 @@ static int receive_bitmap(struct drbd_connection *connection, struct packet_info ...@@ -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) 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); pi->cmd, pi->size);
return ignore_remaining_packet(connection, pi); return ignore_remaining_packet(connection, pi);
...@@ -4398,14 +4398,14 @@ static void drbdd(struct drbd_connection *connection) ...@@ -4398,14 +4398,14 @@ static void drbdd(struct drbd_connection *connection)
cmd = &drbd_cmd_handler[pi.cmd]; cmd = &drbd_cmd_handler[pi.cmd];
if (unlikely(pi.cmd >= ARRAY_SIZE(drbd_cmd_handler) || !cmd->fn)) { 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); cmdname(pi.cmd), pi.cmd);
goto err_out; goto err_out;
} }
shs = cmd->pkt_size; shs = cmd->pkt_size;
if (pi.size > shs && !cmd->expect_payload) { 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); cmdname(pi.cmd), pi.size);
goto err_out; goto err_out;
} }
...@@ -4419,7 +4419,7 @@ static void drbdd(struct drbd_connection *connection) ...@@ -4419,7 +4419,7 @@ static void drbdd(struct drbd_connection *connection)
err = cmd->fn(connection, &pi); err = cmd->fn(connection, &pi);
if (err) { 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); cmdname(pi.cmd), err, pi.size);
goto err_out; goto err_out;
} }
...@@ -4473,12 +4473,12 @@ static void conn_disconnect(struct drbd_connection *connection) ...@@ -4473,12 +4473,12 @@ static void conn_disconnect(struct drbd_connection *connection)
rcu_read_unlock(); rcu_read_unlock();
if (!list_empty(&connection->current_epoch->list)) 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 */ /* ok, no more ee's on the fly, it is safe to reset the epoch_size */
atomic_set(&connection->current_epoch->epoch_size, 0); atomic_set(&connection->current_epoch->epoch_size, 0);
connection->send.seen_any_write_yet = false; 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) if (conn_highest_role(connection) == R_PRIMARY && conn_highest_pdsk(connection) >= D_UNKNOWN)
conn_try_outdate_peer_async(connection); conn_try_outdate_peer_async(connection);
...@@ -4625,13 +4625,13 @@ static int drbd_do_features(struct drbd_connection *connection) ...@@ -4625,13 +4625,13 @@ static int drbd_do_features(struct drbd_connection *connection)
return 0; return 0;
if (pi.cmd != P_CONNECTION_FEATURES) { 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); cmdname(pi.cmd), pi.cmd);
return -1; return -1;
} }
if (pi.size != expect) { 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); expect, pi.size);
return -1; return -1;
} }
...@@ -4652,13 +4652,13 @@ static int drbd_do_features(struct drbd_connection *connection) ...@@ -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); 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); "Agreed network protocol version %d\n", connection->agreed_pro_version);
return 1; return 1;
incompat: incompat:
conn_err(connection, "incompatible DRBD dialects: " drbd_err(connection, "incompatible DRBD dialects: "
"I support %d-%d, peer supports %d-%d\n", "I support %d-%d, peer supports %d-%d\n",
PRO_VERSION_MIN, PRO_VERSION_MAX, PRO_VERSION_MIN, PRO_VERSION_MAX,
p->protocol_min, p->protocol_max); p->protocol_min, p->protocol_max);
...@@ -4668,8 +4668,8 @@ static int drbd_do_features(struct drbd_connection *connection) ...@@ -4668,8 +4668,8 @@ static int drbd_do_features(struct drbd_connection *connection)
#if !defined(CONFIG_CRYPTO_HMAC) && !defined(CONFIG_CRYPTO_HMAC_MODULE) #if !defined(CONFIG_CRYPTO_HMAC) && !defined(CONFIG_CRYPTO_HMAC_MODULE)
static int drbd_do_auth(struct drbd_connection *connection) static int drbd_do_auth(struct drbd_connection *connection)
{ {
conn_err(connection, "This kernel was build without CONFIG_CRYPTO_HMAC.\n"); drbd_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, "You need to disable 'cram-hmac-alg' in drbd.conf.\n");
return -1; return -1;
} }
#else #else
...@@ -4710,7 +4710,7 @@ static int drbd_do_auth(struct drbd_connection *connection) ...@@ -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); rv = crypto_hash_setkey(connection->cram_hmac_tfm, (u8 *)secret, key_len);
if (rv) { 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; rv = -1;
goto fail; goto fail;
} }
...@@ -4734,21 +4734,21 @@ static int drbd_do_auth(struct drbd_connection *connection) ...@@ -4734,21 +4734,21 @@ static int drbd_do_auth(struct drbd_connection *connection)
} }
if (pi.cmd != P_AUTH_CHALLENGE) { 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); cmdname(pi.cmd), pi.cmd);
rv = 0; rv = 0;
goto fail; goto fail;
} }
if (pi.size > CHALLENGE_LEN * 2) { 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; rv = -1;
goto fail; goto fail;
} }
peers_ch = kmalloc(pi.size, GFP_NOIO); peers_ch = kmalloc(pi.size, GFP_NOIO);
if (peers_ch == NULL) { if (peers_ch == NULL) {
conn_err(connection, "kmalloc of peers_ch failed\n"); drbd_err(connection, "kmalloc of peers_ch failed\n");
rv = -1; rv = -1;
goto fail; goto fail;
} }
...@@ -4762,7 +4762,7 @@ static int drbd_do_auth(struct drbd_connection *connection) ...@@ -4762,7 +4762,7 @@ static int drbd_do_auth(struct drbd_connection *connection)
resp_size = crypto_hash_digestsize(connection->cram_hmac_tfm); resp_size = crypto_hash_digestsize(connection->cram_hmac_tfm);
response = kmalloc(resp_size, GFP_NOIO); response = kmalloc(resp_size, GFP_NOIO);
if (response == NULL) { if (response == NULL) {
conn_err(connection, "kmalloc of response failed\n"); drbd_err(connection, "kmalloc of response failed\n");
rv = -1; rv = -1;
goto fail; goto fail;
} }
...@@ -4772,7 +4772,7 @@ static int drbd_do_auth(struct drbd_connection *connection) ...@@ -4772,7 +4772,7 @@ static int drbd_do_auth(struct drbd_connection *connection)
rv = crypto_hash_digest(&desc, &sg, sg.length, response); rv = crypto_hash_digest(&desc, &sg, sg.length, response);
if (rv) { 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; rv = -1;
goto fail; goto fail;
} }
...@@ -4793,14 +4793,14 @@ static int drbd_do_auth(struct drbd_connection *connection) ...@@ -4793,14 +4793,14 @@ static int drbd_do_auth(struct drbd_connection *connection)
} }
if (pi.cmd != P_AUTH_RESPONSE) { 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); cmdname(pi.cmd), pi.cmd);
rv = 0; rv = 0;
goto fail; goto fail;
} }
if (pi.size != resp_size) { 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; rv = 0;
goto fail; goto fail;
} }
...@@ -4813,7 +4813,7 @@ static int drbd_do_auth(struct drbd_connection *connection) ...@@ -4813,7 +4813,7 @@ static int drbd_do_auth(struct drbd_connection *connection)
right_response = kmalloc(resp_size, GFP_NOIO); right_response = kmalloc(resp_size, GFP_NOIO);
if (right_response == NULL) { if (right_response == NULL) {
conn_err(connection, "kmalloc of right_response failed\n"); drbd_err(connection, "kmalloc of right_response failed\n");
rv = -1; rv = -1;
goto fail; goto fail;
} }
...@@ -4822,7 +4822,7 @@ static int drbd_do_auth(struct drbd_connection *connection) ...@@ -4822,7 +4822,7 @@ static int drbd_do_auth(struct drbd_connection *connection)
rv = crypto_hash_digest(&desc, &sg, sg.length, right_response); rv = crypto_hash_digest(&desc, &sg, sg.length, right_response);
if (rv) { 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; rv = -1;
goto fail; goto fail;
} }
...@@ -4830,7 +4830,7 @@ static int drbd_do_auth(struct drbd_connection *connection) ...@@ -4830,7 +4830,7 @@ static int drbd_do_auth(struct drbd_connection *connection)
rv = !memcmp(response, right_response, resp_size); rv = !memcmp(response, right_response, resp_size);
if (rv) if (rv)
conn_info(connection, "Peer authenticated using %d bytes HMAC\n", drbd_info(connection, "Peer authenticated using %d bytes HMAC\n",
resp_size); resp_size);
else else
rv = -1; rv = -1;
...@@ -4849,7 +4849,7 @@ int drbdd_init(struct drbd_thread *thi) ...@@ -4849,7 +4849,7 @@ int drbdd_init(struct drbd_thread *thi)
struct drbd_connection *connection = thi->connection; struct drbd_connection *connection = thi->connection;
int h; int h;
conn_info(connection, "receiver (re)started\n"); drbd_info(connection, "receiver (re)started\n");
do { do {
h = conn_connect(connection); h = conn_connect(connection);
...@@ -4858,7 +4858,7 @@ int drbdd_init(struct drbd_thread *thi) ...@@ -4858,7 +4858,7 @@ int drbdd_init(struct drbd_thread *thi)
schedule_timeout_interruptible(HZ); schedule_timeout_interruptible(HZ);
} }
if (h == -1) { 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); conn_request_state(connection, NS(conn, C_DISCONNECTING), CS_HARD);
} }
} while (h == 0); } while (h == 0);
...@@ -4868,7 +4868,7 @@ int drbdd_init(struct drbd_thread *thi) ...@@ -4868,7 +4868,7 @@ int drbdd_init(struct drbd_thread *thi)
conn_disconnect(connection); conn_disconnect(connection);
conn_info(connection, "receiver terminated\n"); drbd_info(connection, "receiver terminated\n");
return 0; return 0;
} }
...@@ -4883,7 +4883,7 @@ static int got_conn_RqSReply(struct drbd_connection *connection, struct packet_i ...@@ -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); set_bit(CONN_WD_ST_CHG_OKAY, &connection->flags);
} else { } else {
set_bit(CONN_WD_ST_CHG_FAIL, &connection->flags); 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); drbd_set_st_err_str(retcode), retcode);
} }
wake_up(&connection->ping_wait); wake_up(&connection->ping_wait);
...@@ -5274,7 +5274,7 @@ int drbd_asender(struct drbd_thread *thi) ...@@ -5274,7 +5274,7 @@ int drbd_asender(struct drbd_thread *thi)
rv = sched_setscheduler(current, SCHED_RR, &param); rv = sched_setscheduler(current, SCHED_RR, &param);
if (rv < 0) 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) { while (get_t_state(thi) == RUNNING) {
drbd_thread_current_set_cpu(thi); drbd_thread_current_set_cpu(thi);
...@@ -5288,7 +5288,7 @@ int drbd_asender(struct drbd_thread *thi) ...@@ -5288,7 +5288,7 @@ int drbd_asender(struct drbd_thread *thi)
if (test_and_clear_bit(SEND_PING, &connection->flags)) { if (test_and_clear_bit(SEND_PING, &connection->flags)) {
if (drbd_send_ping(connection)) { 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; goto reconnect;
} }
connection->meta.socket->sk->sk_rcvtimeo = ping_timeo * HZ / 10; connection->meta.socket->sk->sk_rcvtimeo = ping_timeo * HZ / 10;
...@@ -5300,7 +5300,7 @@ int drbd_asender(struct drbd_thread *thi) ...@@ -5300,7 +5300,7 @@ int drbd_asender(struct drbd_thread *thi)
if (tcp_cork) if (tcp_cork)
drbd_tcp_cork(connection->meta.socket); drbd_tcp_cork(connection->meta.socket);
if (connection_finish_peer_reqs(connection)) { 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; goto reconnect;
} }
/* but unconditionally uncork unless disabled */ /* but unconditionally uncork unless disabled */
...@@ -5342,7 +5342,7 @@ int drbd_asender(struct drbd_thread *thi) ...@@ -5342,7 +5342,7 @@ int drbd_asender(struct drbd_thread *thi)
if (t) if (t)
break; break;
} }
conn_err(connection, "meta connection shut down by peer.\n"); drbd_err(connection, "meta connection shut down by peer.\n");
goto reconnect; goto reconnect;
} else if (rv == -EAGAIN) { } else if (rv == -EAGAIN) {
/* If the data socket received something meanwhile, /* If the data socket received something meanwhile,
...@@ -5351,7 +5351,7 @@ int drbd_asender(struct drbd_thread *thi) ...@@ -5351,7 +5351,7 @@ int drbd_asender(struct drbd_thread *thi)
jiffies - connection->meta.socket->sk->sk_rcvtimeo)) jiffies - connection->meta.socket->sk->sk_rcvtimeo))
continue; continue;
if (ping_timeout_active) { 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; goto reconnect;
} }
set_bit(SEND_PING, &connection->flags); set_bit(SEND_PING, &connection->flags);
...@@ -5359,7 +5359,7 @@ int drbd_asender(struct drbd_thread *thi) ...@@ -5359,7 +5359,7 @@ int drbd_asender(struct drbd_thread *thi)
} else if (rv == -EINTR) { } else if (rv == -EINTR) {
continue; continue;
} else { } else {
conn_err(connection, "sock_recvmsg returned %d\n", rv); drbd_err(connection, "sock_recvmsg returned %d\n", rv);
goto reconnect; goto reconnect;
} }
...@@ -5368,13 +5368,13 @@ int drbd_asender(struct drbd_thread *thi) ...@@ -5368,13 +5368,13 @@ int drbd_asender(struct drbd_thread *thi)
goto reconnect; goto reconnect;
cmd = &asender_tbl[pi.cmd]; cmd = &asender_tbl[pi.cmd];
if (pi.cmd >= ARRAY_SIZE(asender_tbl) || !cmd->fn) { 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); cmdname(pi.cmd), pi.cmd);
goto disconnect; goto disconnect;
} }
expect = header_size + cmd->pkt_size; expect = header_size + cmd->pkt_size;
if (pi.size != expect - header_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); pi.cmd, pi.size);
goto reconnect; goto reconnect;
} }
...@@ -5384,7 +5384,7 @@ int drbd_asender(struct drbd_thread *thi) ...@@ -5384,7 +5384,7 @@ int drbd_asender(struct drbd_thread *thi)
err = cmd->fn(connection, &pi); err = cmd->fn(connection, &pi);
if (err) { if (err) {
conn_err(connection, "%pf failed\n", cmd->fn); drbd_err(connection, "%pf failed\n", cmd->fn);
goto reconnect; goto reconnect;
} }
...@@ -5414,7 +5414,7 @@ int drbd_asender(struct drbd_thread *thi) ...@@ -5414,7 +5414,7 @@ int drbd_asender(struct drbd_thread *thi)
} }
clear_bit(SIGNAL_ASENDER, &connection->flags); clear_bit(SIGNAL_ASENDER, &connection->flags);
conn_info(connection, "asender terminated\n"); drbd_info(connection, "asender terminated\n");
return 0; return 0;
} }
...@@ -507,7 +507,7 @@ static void conn_pr_state_change(struct drbd_connection *connection, union drbd_ ...@@ -507,7 +507,7 @@ static void conn_pr_state_change(struct drbd_connection *connection, union drbd_
is_susp(ns)); is_susp(ns));
if (pbp != pb) if (pbp != pb)
conn_info(connection, "%s\n", pb); drbd_info(connection, "%s\n", pb);
} }
...@@ -1846,7 +1846,7 @@ _conn_request_state(struct drbd_connection *connection, union drbd_state mask, u ...@@ -1846,7 +1846,7 @@ _conn_request_state(struct drbd_connection *connection, union drbd_state mask, u
acscw->w.connection = connection; acscw->w.connection = connection;
drbd_queue_work(&connection->sender_work, &acscw->w); drbd_queue_work(&connection->sender_work, &acscw->w);
} else { } else {
conn_err(connection, "Could not kmalloc an acscw\n"); drbd_err(connection, "Could not kmalloc an acscw\n");
} }
abort: abort:
...@@ -1859,9 +1859,9 @@ _conn_request_state(struct drbd_connection *connection, union drbd_state mask, u ...@@ -1859,9 +1859,9 @@ _conn_request_state(struct drbd_connection *connection, union drbd_state mask, u
spin_lock_irq(&connection->req_lock); spin_lock_irq(&connection->req_lock);
} }
if (rv < SS_SUCCESS && flags & CS_VERBOSE) { if (rv < SS_SUCCESS && flags & CS_VERBOSE) {
conn_err(connection, "State change failed: %s\n", drbd_set_st_err_str(rv)); drbd_err(connection, "State change failed: %s\n", drbd_set_st_err_str(rv));
conn_err(connection, " mask = 0x%x val = 0x%x\n", mask.i, val.i); drbd_err(connection, " mask = 0x%x val = 0x%x\n", mask.i, val.i);
conn_err(connection, " old_conn:%s wanted_conn:%s\n", drbd_conn_str(oc), drbd_conn_str(val.conn)); drbd_err(connection, " old_conn:%s wanted_conn:%s\n", drbd_conn_str(oc), drbd_conn_str(val.conn));
} }
return rv; return rv;
} }
......
...@@ -1905,7 +1905,7 @@ int drbd_worker(struct drbd_thread *thi) ...@@ -1905,7 +1905,7 @@ int drbd_worker(struct drbd_thread *thi)
if (signal_pending(current)) { if (signal_pending(current)) {
flush_signals(current); flush_signals(current);
if (get_t_state(thi) == RUNNING) { if (get_t_state(thi) == RUNNING) {
conn_warn(connection, "Worker got an unexpected signal\n"); drbd_warn(connection, "Worker got an unexpected signal\n");
continue; continue;
} }
break; break;
......
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