Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Mar 2011 19:49:27 +0000 (UTC)
From:      Mikolaj Golub <trociny@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r219879 - head/sbin/hastd
Message-ID:  <201103221949.p2MJnRJV069318@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trociny
Date: Tue Mar 22 19:49:27 2011
New Revision: 219879
URL: http://svn.freebsd.org/changeset/base/219879

Log:
  For requests that are sent only to remote component use the
  error from remote.
  Approved by:	pjd (mentor)
  MFC after:	1 week

Modified:
  head/sbin/hastd/primary.c

Modified: head/sbin/hastd/primary.c
==============================================================================
--- head/sbin/hastd/primary.c	Tue Mar 22 17:44:07 2011	(r219878)
+++ head/sbin/hastd/primary.c	Tue Mar 22 19:49:27 2011	(r219879)
@@ -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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201103221949.p2MJnRJV069318>