diff options
author | Alex Elder <elder@inktank.com> | 2012-05-16 22:51:59 -0400 |
---|---|---|
committer | Alex Elder <elder@dreamhost.com> | 2012-05-17 09:18:12 -0400 |
commit | 5a0f8fdd8a0ebe320952a388331dc043d7e14ced (patch) | |
tree | 64218dc46ca530cdd363f58d7a20e9c8dad23375 /net/ceph | |
parent | e10c758e4031a801ea4d2f8fb39bf14c2658d74b (diff) |
ceph: messenger: check prepare_write_connect() result
prepare_write_connect() can return an error, but only one of its
callers checks for it. All the rest are in functions that already
return errors, so it should be fine to return the error if one
gets returned.
Signed-off-by: Alex Elder <elder@inktank.com>
Reviewed-by: Sage Weil <sage@inktank.com>
Diffstat (limited to 'net/ceph')
-rw-r--r-- | net/ceph/messenger.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index cf292939dd1e..8e76936a8c13 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c | |||
@@ -1409,7 +1409,9 @@ static int process_connect(struct ceph_connection *con) | |||
1409 | ceph_pr_addr(&con->peer_addr.in_addr)); | 1409 | ceph_pr_addr(&con->peer_addr.in_addr)); |
1410 | reset_connection(con); | 1410 | reset_connection(con); |
1411 | ceph_con_out_kvec_reset(con); | 1411 | ceph_con_out_kvec_reset(con); |
1412 | prepare_write_connect(con); | 1412 | ret = prepare_write_connect(con); |
1413 | if (ret < 0) | ||
1414 | return ret; | ||
1413 | prepare_read_connect(con); | 1415 | prepare_read_connect(con); |
1414 | 1416 | ||
1415 | /* Tell ceph about it. */ | 1417 | /* Tell ceph about it. */ |
@@ -1433,7 +1435,9 @@ static int process_connect(struct ceph_connection *con) | |||
1433 | le32_to_cpu(con->in_connect.connect_seq)); | 1435 | le32_to_cpu(con->in_connect.connect_seq)); |
1434 | con->connect_seq = le32_to_cpu(con->in_connect.connect_seq); | 1436 | con->connect_seq = le32_to_cpu(con->in_connect.connect_seq); |
1435 | ceph_con_out_kvec_reset(con); | 1437 | ceph_con_out_kvec_reset(con); |
1436 | prepare_write_connect(con); | 1438 | ret = prepare_write_connect(con); |
1439 | if (ret < 0) | ||
1440 | return ret; | ||
1437 | prepare_read_connect(con); | 1441 | prepare_read_connect(con); |
1438 | break; | 1442 | break; |
1439 | 1443 | ||
@@ -1448,7 +1452,9 @@ static int process_connect(struct ceph_connection *con) | |||
1448 | get_global_seq(con->msgr, | 1452 | get_global_seq(con->msgr, |
1449 | le32_to_cpu(con->in_connect.global_seq)); | 1453 | le32_to_cpu(con->in_connect.global_seq)); |
1450 | ceph_con_out_kvec_reset(con); | 1454 | ceph_con_out_kvec_reset(con); |
1451 | prepare_write_connect(con); | 1455 | ret = prepare_write_connect(con); |
1456 | if (ret < 0) | ||
1457 | return ret; | ||
1452 | prepare_read_connect(con); | 1458 | prepare_read_connect(con); |
1453 | break; | 1459 | break; |
1454 | 1460 | ||
@@ -1854,7 +1860,9 @@ more: | |||
1854 | if (con->sock == NULL) { | 1860 | if (con->sock == NULL) { |
1855 | ceph_con_out_kvec_reset(con); | 1861 | ceph_con_out_kvec_reset(con); |
1856 | prepare_write_banner(con); | 1862 | prepare_write_banner(con); |
1857 | prepare_write_connect(con); | 1863 | ret = prepare_write_connect(con); |
1864 | if (ret < 0) | ||
1865 | goto out; | ||
1858 | prepare_read_banner(con); | 1866 | prepare_read_banner(con); |
1859 | set_bit(CONNECTING, &con->state); | 1867 | set_bit(CONNECTING, &con->state); |
1860 | clear_bit(NEGOTIATING, &con->state); | 1868 | clear_bit(NEGOTIATING, &con->state); |