From owner-svn-src-stable-9@FreeBSD.ORG Wed Aug 29 15:53:28 2012 Return-Path: Delivered-To: svn-src-stable-9@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EB8B106566C; Wed, 29 Aug 2012 15:53:28 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 295998FC12; Wed, 29 Aug 2012 15:53:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q7TFrS2T071766; Wed, 29 Aug 2012 15:53:28 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q7TFrRlv071764; Wed, 29 Aug 2012 15:53:27 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201208291553.q7TFrRlv071764@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 29 Aug 2012 15:53:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r239848 - stable/9/sys/fs/nfsclient X-BeenThere: svn-src-stable-9@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 9-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 Aug 2012 15:53:28 -0000 Author: kib Date: Wed Aug 29 15:53:27 2012 New Revision: 239848 URL: http://svn.freebsd.org/changeset/base/239848 Log: MFC r237987: Do not override an error from uiomove() with (non-)error result from bwrite(). Modified: stable/9/sys/fs/nfsclient/nfs_clbio.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clbio.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clbio.c Wed Aug 29 15:51:40 2012 (r239847) +++ stable/9/sys/fs/nfsclient/nfs_clbio.c Wed Aug 29 15:53:27 2012 (r239848) @@ -873,7 +873,7 @@ ncl_write(struct vop_write_args *ap) struct nfsmount *nmp = VFSTONFS(vp->v_mount); daddr_t lbn; int bcount; - int bp_cached, n, on, error = 0; + int bp_cached, n, on, error = 0, error1; size_t orig_resid, local_resid; off_t orig_size, tmp_off; @@ -1235,9 +1235,12 @@ again: if ((ioflag & IO_SYNC)) { if (ioflag & IO_INVAL) bp->b_flags |= B_NOCACHE; - error = bwrite(bp); - if (error) + error1 = bwrite(bp); + if (error1 != 0) { + if (error == 0) + error = error1; break; + } } else if ((n + on) == biosize) { bp->b_flags |= B_ASYNC; (void) ncl_writebp(bp, 0, NULL);