Commit 0ddc5549 authored by Lars Ellenberg's avatar Lars Ellenberg Committed by Philipp Reisner

drbd: silence some noisy log messages during disconnect

If we fail to send the information that we lost our disk,
we have no connection, and no disk: no access to data anymore.
That is either expected (deconfiguration), or there will be so much
noise in the logs that "Sending state failed" is not useful at all.
Drop it.

If the reason for a shorter than expected receive was a signal,
which we sent because we already decided to disconnect,
these additional log messages are confusing and useless.

This patch follows this pattern:
 - dev_warn(DEV, "short read expecting header on sock: r=%d\n", r);
 + if (!signal_pending(current))
 + 	dev_warn(DEV, "short read expecting header on sock: r=%d\n", r);

Also make them all dev_warn for consistency.
Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent 20ceb2b2
......@@ -1585,8 +1585,6 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
if (drbd_send_state(mdev))
dev_warn(DEV, "Notified peer that I'm now diskless.\n");
else
dev_err(DEV, "Sending state for being diskless failed\n");
/* corresponding get_ldev in __drbd_set_state
* this may finaly trigger drbd_ldev_destroy. */
put_ldev(mdev);
......@@ -1868,8 +1866,8 @@ int _drbd_send_cmd(struct drbd_conf *mdev, struct socket *sock,
sent = drbd_send(mdev, sock, h, size, msg_flags);
ok = (sent == size);
if (!ok)
dev_err(DEV, "short sent %s size=%d sent=%d\n",
if (!ok && !signal_pending(current))
dev_warn(DEV, "short sent %s size=%d sent=%d\n",
cmdname(cmd), (int)size, sent);
return ok;
}
......
......@@ -930,7 +930,8 @@ static int drbd_recv_header(struct drbd_conf *mdev, enum drbd_packets *cmd, unsi
r = drbd_recv(mdev, h, sizeof(*h));
if (unlikely(r != sizeof(*h))) {
dev_err(DEV, "short read expecting header on sock: r=%d\n", r);
if (!signal_pending(current))
dev_warn(DEV, "short read expecting header on sock: r=%d\n", r);
return false;
}
......@@ -1229,7 +1230,9 @@ read_in_block(struct drbd_conf *mdev, u64 id, sector_t sector, int data_size) __
if (dgs) {
rr = drbd_recv(mdev, dig_in, dgs);
if (rr != dgs) {
dev_warn(DEV, "short read receiving data digest: read %d expected %d\n",
if (!signal_pending(current))
dev_warn(DEV,
"short read receiving data digest: read %d expected %d\n",
rr, dgs);
return NULL;
}
......@@ -1270,6 +1273,7 @@ read_in_block(struct drbd_conf *mdev, u64 id, sector_t sector, int data_size) __
kunmap(page);
if (rr != len) {
drbd_free_ee(mdev, e);
if (!signal_pending(current))
dev_warn(DEV, "short read receiving data: read %d expected %d\n",
rr, len);
return NULL;
......@@ -1311,7 +1315,9 @@ static int drbd_drain_block(struct drbd_conf *mdev, int data_size)
rr = drbd_recv(mdev, data, min_t(int, data_size, PAGE_SIZE));
if (rr != min_t(int, data_size, PAGE_SIZE)) {
rv = 0;
dev_warn(DEV, "short read receiving data: read %d expected %d\n",
if (!signal_pending(current))
dev_warn(DEV,
"short read receiving data: read %d expected %d\n",
rr, min_t(int, data_size, PAGE_SIZE));
break;
}
......@@ -1337,7 +1343,9 @@ static int recv_dless_read(struct drbd_conf *mdev, struct drbd_request *req,
if (dgs) {
rr = drbd_recv(mdev, dig_in, dgs);
if (rr != dgs) {
dev_warn(DEV, "short read receiving data reply digest: read %d expected %d\n",
if (!signal_pending(current))
dev_warn(DEV,
"short read receiving data reply digest: read %d expected %d\n",
rr, dgs);
return 0;
}
......@@ -1359,6 +1367,7 @@ static int recv_dless_read(struct drbd_conf *mdev, struct drbd_request *req,
expect);
kunmap(bvec->bv_page);
if (rr != expect) {
if (!signal_pending(current))
dev_warn(DEV, "short read receiving data reply: "
"read %d expected %d\n",
rr, expect);
......@@ -3696,7 +3705,8 @@ static void drbdd(struct drbd_conf *mdev)
if (shs) {
rv = drbd_recv(mdev, &header->h80.payload, shs);
if (unlikely(rv != shs)) {
dev_err(DEV, "short read while reading sub header: rv=%d\n", rv);
if (!signal_pending(current))
dev_warn(DEV, "short read while reading sub header: rv=%d\n", rv);
goto err_out;
}
}
......@@ -3953,7 +3963,8 @@ static int drbd_do_handshake(struct drbd_conf *mdev)
rv = drbd_recv(mdev, &p->head.payload, expect);
if (rv != expect) {
dev_err(DEV, "short read receiving handshake packet: l=%u\n", rv);
if (!signal_pending(current))
dev_warn(DEV, "short read receiving handshake packet: l=%u\n", rv);
return 0;
}
......@@ -4055,7 +4066,8 @@ static int drbd_do_auth(struct drbd_conf *mdev)
rv = drbd_recv(mdev, peers_ch, length);
if (rv != length) {
dev_err(DEV, "short read AuthChallenge: l=%u\n", rv);
if (!signal_pending(current))
dev_warn(DEV, "short read AuthChallenge: l=%u\n", rv);
rv = 0;
goto fail;
}
......@@ -4102,7 +4114,8 @@ static int drbd_do_auth(struct drbd_conf *mdev)
rv = drbd_recv(mdev, response , resp_size);
if (rv != resp_size) {
dev_err(DEV, "short read receiving AuthResponse: l=%u\n", rv);
if (!signal_pending(current))
dev_warn(DEV, "short read receiving AuthResponse: l=%u\n", rv);
rv = 0;
goto fail;
}
......
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