summaryrefslogtreecommitdiffstats
path: root/sbin/hastd
diff options
context:
space:
mode:
authortrociny <trociny@FreeBSD.org>2011-03-22 19:49:27 +0000
committertrociny <trociny@FreeBSD.org>2011-03-22 19:49:27 +0000
commit03d954b2b35a542a0e110e0d94d347e6514505d4 (patch)
tree4b725d3c73c928a4373c3e33d72b1ab6e0d2b21a /sbin/hastd
parenteb401e64c176dc676c855607e4a01265f652284e (diff)
downloadFreeBSD-src-03d954b2b35a542a0e110e0d94d347e6514505d4.zip
FreeBSD-src-03d954b2b35a542a0e110e0d94d347e6514505d4.tar.gz
For requests that are sent only to remote component use the
error from remote. Approved by: pjd (mentor) MFC after: 1 week
Diffstat (limited to 'sbin/hastd')
-rw-r--r--sbin/hastd/primary.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sbin/hastd/primary.c b/sbin/hastd/primary.c
index 8f6ec46..b943077 100644
--- a/sbin/hastd/primary.c
+++ b/sbin/hastd/primary.c
@@ -1610,9 +1610,14 @@ ggate_send_thread(void *arg)
if (ii == ncomps) {
/*
* None of the requests were successful.
- * Use first error.
+ * Use the error from local component except the
+ * case when we did only remote request.
*/
- ggio->gctl_error = hio->hio_errors[0];
+ if (ggio->gctl_cmd == BIO_READ &&
+ res->hr_syncsrc == HAST_SYNCSRC_SECONDARY)
+ ggio->gctl_error = hio->hio_errors[1];
+ else
+ ggio->gctl_error = hio->hio_errors[0];
}
if (ggio->gctl_error == 0 && ggio->gctl_cmd == BIO_WRITE) {
mtx_lock(&res->hr_amp_lock);
OpenPOWER on IntegriCloud