[Midnightbsd-cvs] src [7932] trunk/sys/fs/nfsclient/nfs_clbio.c: do not override an error from uiomove with non error results from bwrite

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Wed Sep 14 17:11:55 EDT 2016


Revision: 7932
          http://svnweb.midnightbsd.org/src/?rev=7932
Author:   laffer1
Date:     2016-09-14 17:11:54 -0400 (Wed, 14 Sep 2016)
Log Message:
-----------
do not override an error from uiomove with non error results from bwrite

Modified Paths:
--------------
    trunk/sys/fs/nfsclient/nfs_clbio.c

Modified: trunk/sys/fs/nfsclient/nfs_clbio.c
===================================================================
--- trunk/sys/fs/nfsclient/nfs_clbio.c	2016-09-14 21:11:09 UTC (rev 7931)
+++ trunk/sys/fs/nfsclient/nfs_clbio.c	2016-09-14 21:11:54 UTC (rev 7932)
@@ -873,7 +873,7 @@
 	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 @@
 		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);



More information about the Midnightbsd-cvs mailing list