Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 5 May 2015 05:14:13 +0000 (UTC)
From:      Peter Wemm <peter@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r282448 - head/sys/compat/freebsd32
Message-ID:  <201505050514.t455EDtt040495@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: peter
Date: Tue May  5 05:14:12 2015
New Revision: 282448
URL: https://svnweb.freebsd.org/changeset/base/282448

Log:
  Fix an error in r281551, part of the getfsstat() / kern_getfsstat()
  rework.  The number of entries was supposed to be returned to the user,
  not used as a scratch variable.
  
  This broke RELENG_4 jails starting up on current systems.

Modified:
  head/sys/compat/freebsd32/freebsd32_misc.c

Modified: head/sys/compat/freebsd32/freebsd32_misc.c
==============================================================================
--- head/sys/compat/freebsd32/freebsd32_misc.c	Tue May  5 04:23:55 2015	(r282447)
+++ head/sys/compat/freebsd32/freebsd32_misc.c	Tue May  5 05:14:12 2015	(r282448)
@@ -248,7 +248,7 @@ freebsd4_freebsd32_getfsstat(struct thre
 {
 	struct statfs *buf, *sp;
 	struct statfs32 stat32;
-	size_t count, size;
+	size_t count, size, copycount;
 	int error;
 
 	count = uap->bufsize / sizeof(struct statfs32);
@@ -256,12 +256,13 @@ freebsd4_freebsd32_getfsstat(struct thre
 	error = kern_getfsstat(td, &buf, size, &count, UIO_SYSSPACE, uap->flags);
 	if (size > 0) {
 		sp = buf;
-		while (count > 0 && error == 0) {
+		copycount = count;
+		while (copycount > 0 && error == 0) {
 			copy_statfs(sp, &stat32);
 			error = copyout(&stat32, uap->buf, sizeof(stat32));
 			sp++;
 			uap->buf++;
-			count--;
+			copycount--;
 		}
 		free(buf, M_TEMP);
 	}



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