From owner-svn-src-all@FreeBSD.ORG Tue May 5 05:14:13 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 810FBC76; Tue, 5 May 2015 05:14:13 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6EA6219B7; Tue, 5 May 2015 05:14:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t455EDvS040496; Tue, 5 May 2015 05:14:13 GMT (envelope-from peter@FreeBSD.org) Received: (from peter@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t455EDtt040495; Tue, 5 May 2015 05:14:13 GMT (envelope-from peter@FreeBSD.org) Message-Id: <201505050514.t455EDtt040495@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: peter set sender to peter@FreeBSD.org using -f From: Peter Wemm Date: Tue, 5 May 2015 05:14:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r282448 - head/sys/compat/freebsd32 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 May 2015 05:14:13 -0000 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); }