summaryrefslogtreecommitdiffstats
path: root/sbin/hastd
diff options
context:
space:
mode:
authortrociny <trociny@FreeBSD.org>2013-12-10 20:05:07 +0000
committertrociny <trociny@FreeBSD.org>2013-12-10 20:05:07 +0000
commitf157138bd257c4482e29f29e8ca90c29aa92ad67 (patch)
tree209069820d72ef7c52d20627eeab4696c7b5bf89 /sbin/hastd
parentcf869ff0c7af4f5e118961594625bb7b7eb7d7c4 (diff)
downloadFreeBSD-src-f157138bd257c4482e29f29e8ca90c29aa92ad67.zip
FreeBSD-src-f157138bd257c4482e29f29e8ca90c29aa92ad67.tar.gz
In remote_send_thread, if sending a request fails don't take the
request back from the receive queue -- it might already be processed by remote_recv_thread, which lead to crashes like below: (primary) Unable to receive reply header: Connection reset by peer. (primary) Unable to send request (Connection reset by peer): WRITE(954662912, 131072). (primary) Disconnected from kopusha:7772. (primary) Increasing localcnt to 1. (primary) Assertion failed: (old > 0), function refcnt_release, file refcnt.h, line 62. Taking the request back was not necessary (it would properly be processed by the remote_recv_thread) and only complicated things. MFC after: 2 weeks
Diffstat (limited to 'sbin/hastd')
-rw-r--r--sbin/hastd/primary.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/sbin/hastd/primary.c b/sbin/hastd/primary.c
index 112611a..629b8a4 100644
--- a/sbin/hastd/primary.c
+++ b/sbin/hastd/primary.c
@@ -1656,18 +1656,9 @@ remote_send_thread(void *arg)
"Unable to send request (%s): ",
strerror(hio->hio_errors[ncomp]));
remote_close(res, ncomp);
- /*
- * Take request back from the receive queue and move
- * it immediately to the done queue.
- */
- mtx_lock(&hio_recv_list_lock[ncomp]);
- TAILQ_REMOVE(&hio_recv_list[ncomp], hio,
- hio_next[ncomp]);
- hio_recv_list_size[ncomp]--;
- mtx_unlock(&hio_recv_list_lock[ncomp]);
- goto done_queue;
+ } else {
+ rw_unlock(&hio_remote_lock[ncomp]);
}
- rw_unlock(&hio_remote_lock[ncomp]);
nv_free(nv);
if (wakeup)
cv_signal(&hio_recv_list_cond[ncomp]);
OpenPOWER on IntegriCloud