diff options
Diffstat (limited to 'net/ceph/messenger.c')
-rw-r--r-- | net/ceph/messenger.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/net/ceph/messenger.c b/net/ceph/messenger.c index c3b9060d4844..18eb788bbb9d 100644 --- a/net/ceph/messenger.c +++ b/net/ceph/messenger.c | |||
@@ -2387,13 +2387,15 @@ static void con_work(struct work_struct *work) | |||
2387 | { | 2387 | { |
2388 | struct ceph_connection *con = container_of(work, struct ceph_connection, | 2388 | struct ceph_connection *con = container_of(work, struct ceph_connection, |
2389 | work.work); | 2389 | work.work); |
2390 | bool fault = false; | ||
2390 | int ret; | 2391 | int ret; |
2391 | 2392 | ||
2392 | mutex_lock(&con->mutex); | 2393 | mutex_lock(&con->mutex); |
2393 | restart: | 2394 | restart: |
2394 | if (con_sock_closed(con)) { | 2395 | if (con_sock_closed(con)) { |
2395 | dout("%s: con %p SOCK_CLOSED\n", __func__, con); | 2396 | dout("%s: con %p SOCK_CLOSED\n", __func__, con); |
2396 | goto fault; | 2397 | fault = true; |
2398 | goto done; | ||
2397 | } | 2399 | } |
2398 | if (con_backoff(con)) { | 2400 | if (con_backoff(con)) { |
2399 | dout("%s: con %p BACKOFF\n", __func__, con); | 2401 | dout("%s: con %p BACKOFF\n", __func__, con); |
@@ -2418,7 +2420,8 @@ restart: | |||
2418 | goto restart; | 2420 | goto restart; |
2419 | if (ret < 0) { | 2421 | if (ret < 0) { |
2420 | con->error_msg = "socket error on read"; | 2422 | con->error_msg = "socket error on read"; |
2421 | goto fault; | 2423 | fault = true; |
2424 | goto done; | ||
2422 | } | 2425 | } |
2423 | 2426 | ||
2424 | ret = try_write(con); | 2427 | ret = try_write(con); |
@@ -2426,20 +2429,17 @@ restart: | |||
2426 | goto restart; | 2429 | goto restart; |
2427 | if (ret < 0) { | 2430 | if (ret < 0) { |
2428 | con->error_msg = "socket error on write"; | 2431 | con->error_msg = "socket error on write"; |
2429 | goto fault; | 2432 | fault = true; |
2430 | } | 2433 | } |
2431 | |||
2432 | done: | 2434 | done: |
2435 | if (fault) | ||
2436 | con_fault(con); | ||
2433 | mutex_unlock(&con->mutex); | 2437 | mutex_unlock(&con->mutex); |
2434 | done_unlocked: | ||
2435 | con->ops->put(con); | ||
2436 | return; | ||
2437 | 2438 | ||
2438 | fault: | 2439 | if (fault) |
2439 | con_fault(con); | 2440 | con_fault_finish(con); |
2440 | mutex_unlock(&con->mutex); | 2441 | |
2441 | con_fault_finish(con); | 2442 | con->ops->put(con); |
2442 | goto done_unlocked; | ||
2443 | } | 2443 | } |
2444 | 2444 | ||
2445 | 2445 | ||