svn commit: r219879 - head/sbin/hastd

Mikolaj Golub trociny at FreeBSD.org
Tue Mar 22 19:49:27 UTC 2011


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);


More information about the svn-src-head mailing list