diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2011-01-21 06:35:15 -0500 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2011-03-10 05:48:04 -0500 |
commit | 0ddc5549f88dfc4a4c919693e9a86095e89e080b (patch) | |
tree | 95b89ce27e2e6d2e0989bd75becf19ca590c2c35 | |
parent | 20ceb2b22edaf51e59e76087efdc71a16a2858de (diff) |
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: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
-rw-r--r-- | drivers/block/drbd/drbd_main.c | 6 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 45 |
2 files changed, 31 insertions, 20 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index a9e9b496e73b..c3760f33d52c 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c | |||
@@ -1585,8 +1585,6 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os, | |||
1585 | 1585 | ||
1586 | if (drbd_send_state(mdev)) | 1586 | if (drbd_send_state(mdev)) |
1587 | dev_warn(DEV, "Notified peer that I'm now diskless.\n"); | 1587 | dev_warn(DEV, "Notified peer that I'm now diskless.\n"); |
1588 | else | ||
1589 | dev_err(DEV, "Sending state for being diskless failed\n"); | ||
1590 | /* corresponding get_ldev in __drbd_set_state | 1588 | /* corresponding get_ldev in __drbd_set_state |
1591 | * this may finaly trigger drbd_ldev_destroy. */ | 1589 | * this may finaly trigger drbd_ldev_destroy. */ |
1592 | put_ldev(mdev); | 1590 | put_ldev(mdev); |
@@ -1868,8 +1866,8 @@ int _drbd_send_cmd(struct drbd_conf *mdev, struct socket *sock, | |||
1868 | sent = drbd_send(mdev, sock, h, size, msg_flags); | 1866 | sent = drbd_send(mdev, sock, h, size, msg_flags); |
1869 | 1867 | ||
1870 | ok = (sent == size); | 1868 | ok = (sent == size); |
1871 | if (!ok) | 1869 | if (!ok && !signal_pending(current)) |
1872 | dev_err(DEV, "short sent %s size=%d sent=%d\n", | 1870 | dev_warn(DEV, "short sent %s size=%d sent=%d\n", |
1873 | cmdname(cmd), (int)size, sent); | 1871 | cmdname(cmd), (int)size, sent); |
1874 | return ok; | 1872 | return ok; |
1875 | } | 1873 | } |
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index e13134f83fae..a56b107e01eb 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c | |||
@@ -930,7 +930,8 @@ static int drbd_recv_header(struct drbd_conf *mdev, enum drbd_packets *cmd, unsi | |||
930 | 930 | ||
931 | r = drbd_recv(mdev, h, sizeof(*h)); | 931 | r = drbd_recv(mdev, h, sizeof(*h)); |
932 | if (unlikely(r != sizeof(*h))) { | 932 | if (unlikely(r != sizeof(*h))) { |
933 | dev_err(DEV, "short read expecting header on sock: r=%d\n", r); | 933 | if (!signal_pending(current)) |
934 | dev_warn(DEV, "short read expecting header on sock: r=%d\n", r); | ||
934 | return false; | 935 | return false; |
935 | } | 936 | } |
936 | 937 | ||
@@ -1229,8 +1230,10 @@ read_in_block(struct drbd_conf *mdev, u64 id, sector_t sector, int data_size) __ | |||
1229 | if (dgs) { | 1230 | if (dgs) { |
1230 | rr = drbd_recv(mdev, dig_in, dgs); | 1231 | rr = drbd_recv(mdev, dig_in, dgs); |
1231 | if (rr != dgs) { | 1232 | if (rr != dgs) { |
1232 | dev_warn(DEV, "short read receiving data digest: read %d expected %d\n", | 1233 | if (!signal_pending(current)) |
1233 | rr, dgs); | 1234 | dev_warn(DEV, |
1235 | "short read receiving data digest: read %d expected %d\n", | ||
1236 | rr, dgs); | ||
1234 | return NULL; | 1237 | return NULL; |
1235 | } | 1238 | } |
1236 | } | 1239 | } |
@@ -1270,8 +1273,9 @@ read_in_block(struct drbd_conf *mdev, u64 id, sector_t sector, int data_size) __ | |||
1270 | kunmap(page); | 1273 | kunmap(page); |
1271 | if (rr != len) { | 1274 | if (rr != len) { |
1272 | drbd_free_ee(mdev, e); | 1275 | drbd_free_ee(mdev, e); |
1273 | dev_warn(DEV, "short read receiving data: read %d expected %d\n", | 1276 | if (!signal_pending(current)) |
1274 | rr, len); | 1277 | dev_warn(DEV, "short read receiving data: read %d expected %d\n", |
1278 | rr, len); | ||
1275 | return NULL; | 1279 | return NULL; |
1276 | } | 1280 | } |
1277 | ds -= rr; | 1281 | ds -= rr; |
@@ -1311,8 +1315,10 @@ static int drbd_drain_block(struct drbd_conf *mdev, int data_size) | |||
1311 | rr = drbd_recv(mdev, data, min_t(int, data_size, PAGE_SIZE)); | 1315 | rr = drbd_recv(mdev, data, min_t(int, data_size, PAGE_SIZE)); |
1312 | if (rr != min_t(int, data_size, PAGE_SIZE)) { | 1316 | if (rr != min_t(int, data_size, PAGE_SIZE)) { |
1313 | rv = 0; | 1317 | rv = 0; |
1314 | dev_warn(DEV, "short read receiving data: read %d expected %d\n", | 1318 | if (!signal_pending(current)) |
1315 | rr, min_t(int, data_size, PAGE_SIZE)); | 1319 | dev_warn(DEV, |
1320 | "short read receiving data: read %d expected %d\n", | ||
1321 | rr, min_t(int, data_size, PAGE_SIZE)); | ||
1316 | break; | 1322 | break; |
1317 | } | 1323 | } |
1318 | data_size -= rr; | 1324 | data_size -= rr; |
@@ -1337,8 +1343,10 @@ static int recv_dless_read(struct drbd_conf *mdev, struct drbd_request *req, | |||
1337 | if (dgs) { | 1343 | if (dgs) { |
1338 | rr = drbd_recv(mdev, dig_in, dgs); | 1344 | rr = drbd_recv(mdev, dig_in, dgs); |
1339 | if (rr != dgs) { | 1345 | if (rr != dgs) { |
1340 | dev_warn(DEV, "short read receiving data reply digest: read %d expected %d\n", | 1346 | if (!signal_pending(current)) |
1341 | rr, dgs); | 1347 | dev_warn(DEV, |
1348 | "short read receiving data reply digest: read %d expected %d\n", | ||
1349 | rr, dgs); | ||
1342 | return 0; | 1350 | return 0; |
1343 | } | 1351 | } |
1344 | } | 1352 | } |
@@ -1359,9 +1367,10 @@ static int recv_dless_read(struct drbd_conf *mdev, struct drbd_request *req, | |||
1359 | expect); | 1367 | expect); |
1360 | kunmap(bvec->bv_page); | 1368 | kunmap(bvec->bv_page); |
1361 | if (rr != expect) { | 1369 | if (rr != expect) { |
1362 | dev_warn(DEV, "short read receiving data reply: " | 1370 | if (!signal_pending(current)) |
1363 | "read %d expected %d\n", | 1371 | dev_warn(DEV, "short read receiving data reply: " |
1364 | rr, expect); | 1372 | "read %d expected %d\n", |
1373 | rr, expect); | ||
1365 | return 0; | 1374 | return 0; |
1366 | } | 1375 | } |
1367 | data_size -= rr; | 1376 | data_size -= rr; |
@@ -3696,7 +3705,8 @@ static void drbdd(struct drbd_conf *mdev) | |||
3696 | if (shs) { | 3705 | if (shs) { |
3697 | rv = drbd_recv(mdev, &header->h80.payload, shs); | 3706 | rv = drbd_recv(mdev, &header->h80.payload, shs); |
3698 | if (unlikely(rv != shs)) { | 3707 | if (unlikely(rv != shs)) { |
3699 | dev_err(DEV, "short read while reading sub header: rv=%d\n", rv); | 3708 | if (!signal_pending(current)) |
3709 | dev_warn(DEV, "short read while reading sub header: rv=%d\n", rv); | ||
3700 | goto err_out; | 3710 | goto err_out; |
3701 | } | 3711 | } |
3702 | } | 3712 | } |
@@ -3953,7 +3963,8 @@ static int drbd_do_handshake(struct drbd_conf *mdev) | |||
3953 | rv = drbd_recv(mdev, &p->head.payload, expect); | 3963 | rv = drbd_recv(mdev, &p->head.payload, expect); |
3954 | 3964 | ||
3955 | if (rv != expect) { | 3965 | if (rv != expect) { |
3956 | dev_err(DEV, "short read receiving handshake packet: l=%u\n", rv); | 3966 | if (!signal_pending(current)) |
3967 | dev_warn(DEV, "short read receiving handshake packet: l=%u\n", rv); | ||
3957 | return 0; | 3968 | return 0; |
3958 | } | 3969 | } |
3959 | 3970 | ||
@@ -4055,7 +4066,8 @@ static int drbd_do_auth(struct drbd_conf *mdev) | |||
4055 | rv = drbd_recv(mdev, peers_ch, length); | 4066 | rv = drbd_recv(mdev, peers_ch, length); |
4056 | 4067 | ||
4057 | if (rv != length) { | 4068 | if (rv != length) { |
4058 | dev_err(DEV, "short read AuthChallenge: l=%u\n", rv); | 4069 | if (!signal_pending(current)) |
4070 | dev_warn(DEV, "short read AuthChallenge: l=%u\n", rv); | ||
4059 | rv = 0; | 4071 | rv = 0; |
4060 | goto fail; | 4072 | goto fail; |
4061 | } | 4073 | } |
@@ -4102,7 +4114,8 @@ static int drbd_do_auth(struct drbd_conf *mdev) | |||
4102 | rv = drbd_recv(mdev, response , resp_size); | 4114 | rv = drbd_recv(mdev, response , resp_size); |
4103 | 4115 | ||
4104 | if (rv != resp_size) { | 4116 | if (rv != resp_size) { |
4105 | dev_err(DEV, "short read receiving AuthResponse: l=%u\n", rv); | 4117 | if (!signal_pending(current)) |
4118 | dev_warn(DEV, "short read receiving AuthResponse: l=%u\n", rv); | ||
4106 | rv = 0; | 4119 | rv = 0; |
4107 | goto fail; | 4120 | goto fail; |
4108 | } | 4121 | } |