From owner-svn-src-head@FreeBSD.ORG Tue Mar 22 19:49:27 2011 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A89F6106564A; Tue, 22 Mar 2011 19:49:27 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9C1D98FC12; Tue, 22 Mar 2011 19:49:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p2MJnR5Z069320; Tue, 22 Mar 2011 19:49:27 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p2MJnRJV069318; Tue, 22 Mar 2011 19:49:27 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201103221949.p2MJnRJV069318@svn.freebsd.org> From: Mikolaj Golub Date: Tue, 22 Mar 2011 19:49:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r219879 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 22 Mar 2011 19:49:27 -0000 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);