Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Aug 2012 15:53:27 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r239848 - stable/9/sys/fs/nfsclient
Message-ID:  <201208291553.q7TFrRlv071764@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);



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