clear_bit(STANDBY, &con->state); /* avoid connect_seq bump */
mutex_lock(&con->mutex);
reset_connection(con);
+ cancel_delayed_work(&con->work);
mutex_unlock(&con->mutex);
queue_con(con);
}
clear_bit(BUSY, &con->state); /* to avoid an improbable race */
mutex_lock(&con->mutex);
+ if (test_bit(CLOSED, &con->state))
+ goto out_unlock;
con_close_socket(con);
else if (con->delay < MAX_DELAY_INTERVAL)
con->delay *= 2;
- mutex_unlock(&con->mutex);
-
/* explicitly schedule work to try to reconnect again later. */
dout("fault queueing %p delay %lu\n", con, con->delay);
con->ops->get(con);
round_jiffies_relative(con->delay)) == 0)
con->ops->put(con);
+out_unlock:
+ mutex_unlock(&con->mutex);
out:
if (con->ops->fault)
con->ops->fault(con);