From owner-svn-src-stable@FreeBSD.ORG Sun May 26 03:48:41 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A9EB7CAB; Sun, 26 May 2013 03:48:41 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9B9488BA; Sun, 26 May 2013 03:48:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4Q3mfxR037423; Sun, 26 May 2013 03:48:41 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4Q3mftJ037418; Sun, 26 May 2013 03:48:41 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201305260348.r4Q3mftJ037418@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sun, 26 May 2013 03:48:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250994 - in stable/9/contrib: gcc gcclibs/libcpp gcclibs/libcpp/include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 03:48:41 -0000 Author: pfg Date: Sun May 26 03:48:40 2013 New Revision: 250994 URL: http://svnweb.freebsd.org/changeset/base/250994 Log: MFC r250566: Add support for "d" floating-point suffix, as defined by draft N1312 of TR 24732. Emit pedantic warning if the feature is being used. Obtained from: OpenBSD Modified: stable/9/contrib/gcc/c-lex.c stable/9/contrib/gcclibs/libcpp/expr.c stable/9/contrib/gcclibs/libcpp/include/cpplib.h Directory Properties: stable/9/ (props changed) stable/9/contrib/gcc/ (props changed) stable/9/contrib/gcclibs/ (props changed) Modified: stable/9/contrib/gcc/c-lex.c ============================================================================== --- stable/9/contrib/gcc/c-lex.c Sun May 26 00:44:20 2013 (r250993) +++ stable/9/contrib/gcc/c-lex.c Sun May 26 03:48:40 2013 (r250994) @@ -640,6 +640,13 @@ interpret_float (const cpp_token *token, char *copy; size_t copylen; + /* Default (no suffix) is double. */ + if (flags & CPP_N_DEFAULT) + { + flags ^= CPP_N_DEFAULT; + flags |= CPP_N_MEDIUM; + } + /* Decode type based on width and properties. */ if (flags & CPP_N_DFLOAT) if ((flags & CPP_N_WIDTH) == CPP_N_LARGE) Modified: stable/9/contrib/gcclibs/libcpp/expr.c ============================================================================== --- stable/9/contrib/gcclibs/libcpp/expr.c Sun May 26 00:44:20 2013 (r250993) +++ stable/9/contrib/gcclibs/libcpp/expr.c Sun May 26 03:48:40 2013 (r250994) @@ -82,7 +82,7 @@ static void check_promotion (cpp_reader static unsigned int interpret_float_suffix (const uchar *s, size_t len) { - size_t f = 0, l = 0, i = 0, d = 0; + size_t f = 0, l = 0, i = 0, d = 0, d0 = 0; while (len--) switch (s[len]) @@ -101,7 +101,12 @@ interpret_float_suffix (const uchar *s, return 0; } - if (f + l > 1 || i > 1) + if (d == 1 && !f && !l) { + d = 0; + d0 = 1; + } + + if (f + d0 + l > 1 || i > 1) return 0; /* Allow dd, df, dl suffixes for decimal float constants. */ @@ -110,7 +115,8 @@ interpret_float_suffix (const uchar *s, return ((i ? CPP_N_IMAGINARY : 0) | (f ? CPP_N_SMALL : - l ? CPP_N_LARGE : CPP_N_MEDIUM) + d0 ? CPP_N_MEDIUM : + l ? CPP_N_LARGE : CPP_N_DEFAULT) | (d ? CPP_N_DFLOAT : 0)); } @@ -261,6 +267,13 @@ cpp_classify_number (cpp_reader *pfile, "traditional C rejects the \"%.*s\" suffix", (int) (limit - str), str); + /* A suffix for double is a GCC extension via decimal float support. + If the suffix also specifies an imaginary value we'll catch that + later. */ + if ((result == CPP_N_MEDIUM) && CPP_PEDANTIC (pfile)) + cpp_error (pfile, CPP_DL_PEDWARN, + "suffix for double constant is a GCC extension"); + /* Radix must be 10 for decimal floats. */ if ((result & CPP_N_DFLOAT) && radix != 10) { Modified: stable/9/contrib/gcclibs/libcpp/include/cpplib.h ============================================================================== --- stable/9/contrib/gcclibs/libcpp/include/cpplib.h Sun May 26 00:44:20 2013 (r250993) +++ stable/9/contrib/gcclibs/libcpp/include/cpplib.h Sun May 26 03:48:40 2013 (r250994) @@ -749,6 +749,7 @@ struct cpp_num #define CPP_N_UNSIGNED 0x1000 /* Properties. */ #define CPP_N_IMAGINARY 0x2000 #define CPP_N_DFLOAT 0x4000 +#define CPP_N_DEFAULT 0x8000 /* Classify a CPP_NUMBER token. The return value is a combination of the flags from the above sets. */ From owner-svn-src-stable@FreeBSD.ORG Sun May 26 12:36:57 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0D94A92C; Sun, 26 May 2013 12:36:57 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F393B6A0; Sun, 26 May 2013 12:36:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QCauEK009644; Sun, 26 May 2013 12:36:56 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QCaufA009642; Sun, 26 May 2013 12:36:56 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201305261236.r4QCaufA009642@svn.freebsd.org> From: Rick Macklem Date: Sun, 26 May 2013 12:36:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250996 - stable/9/sys/fs/nfsclient X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 12:36:57 -0000 Author: rmacklem Date: Sun May 26 12:36:56 2013 New Revision: 250996 URL: http://svnweb.freebsd.org/changeset/base/250996 Log: MFC: r250580 Add support for the eofflag to nfs_readdir() in the new NFS client so that it works under a unionfs mount. Modified: stable/9/sys/fs/nfsclient/nfs_clvnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clvnops.c Sun May 26 09:25:14 2013 (r250995) +++ stable/9/sys/fs/nfsclient/nfs_clvnops.c Sun May 26 12:36:56 2013 (r250996) @@ -2207,6 +2207,8 @@ nfs_readdir(struct vop_readdir_args *ap) int error = 0; struct vattr vattr; + if (ap->a_eofflag != NULL) + *ap->a_eofflag = 0; if (vp->v_type != VDIR) return(EPERM); @@ -2221,6 +2223,8 @@ nfs_readdir(struct vop_readdir_args *ap) !NFS_TIMESPEC_COMPARE(&np->n_mtime, &vattr.va_mtime)) { mtx_unlock(&np->n_mtx); NFSINCRGLOBAL(newnfsstats.direofcache_hits); + if (ap->a_eofflag != NULL) + *ap->a_eofflag = 1; return (0); } else mtx_unlock(&np->n_mtx); @@ -2233,8 +2237,11 @@ nfs_readdir(struct vop_readdir_args *ap) tresid = uio->uio_resid; error = ncl_bioread(vp, uio, 0, ap->a_cred); - if (!error && uio->uio_resid == tresid) + if (!error && uio->uio_resid == tresid) { NFSINCRGLOBAL(newnfsstats.direofcache_misses); + if (ap->a_eofflag != NULL) + *ap->a_eofflag = 1; + } return (error); } From owner-svn-src-stable@FreeBSD.ORG Sun May 26 14:35:36 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0AE18470; Sun, 26 May 2013 14:35:36 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F1779D05; Sun, 26 May 2013 14:35:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QEZZ8a048848; Sun, 26 May 2013 14:35:35 GMT (envelope-from jlh@svn.freebsd.org) Received: (from jlh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QEZZAp048847; Sun, 26 May 2013 14:35:35 GMT (envelope-from jlh@svn.freebsd.org) Message-Id: <201305261435.r4QEZZAp048847@svn.freebsd.org> From: Jeremie Le Hen Date: Sun, 26 May 2013 14:35:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250998 - stable/9/share/man/man5 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 14:35:36 -0000 Author: jlh Date: Sun May 26 14:35:35 2013 New Revision: 250998 URL: http://svnweb.freebsd.org/changeset/base/250998 Log: MFC r249591: Document jail__parameters option. The description explains why we should not configure "path", "host.hostname", "command", "ip4.addr" and ip6.addr" parameters with this, but rather use the historical rc.conf(5) options. Modified: stable/9/share/man/man5/rc.conf.5 Directory Properties: stable/9/share/man/man5/ (props changed) Modified: stable/9/share/man/man5/rc.conf.5 ============================================================================== --- stable/9/share/man/man5/rc.conf.5 Sun May 26 14:14:42 2013 (r250997) +++ stable/9/share/man/man5/rc.conf.5 Sun May 26 14:35:35 2013 (r250998) @@ -3943,6 +3943,42 @@ Set to the root directory used by jail Unset by default. Set to the fully qualified domain name (FQDN) assigned to jail .Va jname . +.It Va jail_ Ns Ao Ar jname Ac Ns Va _parameters +.Pq Vt str +Unset by default. +Set extra parameters for jail +.Va jname , +such as +.Dq Li allow.chflags +or +.Dq Li children.max . +See +.Xr jail 8 +for a list of available parameters. +Note that the following parameters are already defined by +.Pa rc.d/jail +script out of their corresponding +.Nm +variables: +.Bl -tag -width "host.hostname" -offset indent +.It Li path +set from +.Va jail_ Ns Ao Ar jname Ac Ns Va _rootdir +.It Li host.hostname +set from +.Va jail_ Ns Ao Ar jname Ac Ns Va _hostname +.It Li command +set from +.Va jail_ Ns Ao Ar jname Ac Ns Va _exec_start +.It Li ip4.addr +set if +.Va jail_ Ns Ao Ar jname Ac Ns Va _ip +contains IPv4 addresses +.It Li ip6.addr +set if +.Va jail_ Ns Ao Ar jname Ac Ns Va _ip6 +contains IPv6 addresses +.El .It Va jail_ Ns Ao Ar jname Ac Ns Va _ip .Pq Vt str Unset by default. From owner-svn-src-stable@FreeBSD.ORG Sun May 26 14:40:24 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 739496C8; Sun, 26 May 2013 14:40:24 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4CC3CD7F; Sun, 26 May 2013 14:40:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QEeNik051108; Sun, 26 May 2013 14:40:23 GMT (envelope-from jlh@svn.freebsd.org) Received: (from jlh@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QEeNK3051107; Sun, 26 May 2013 14:40:23 GMT (envelope-from jlh@svn.freebsd.org) Message-Id: <201305261440.r4QEeNK3051107@svn.freebsd.org> From: Jeremie Le Hen Date: Sun, 26 May 2013 14:40:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r250999 - stable/9/share/mk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 14:40:24 -0000 Author: jlh Date: Sun May 26 14:40:23 2013 New Revision: 250999 URL: http://svnweb.freebsd.org/changeset/base/250999 Log: MFC r250992: Rework the comment I initially wrote when SHLIB_LDSCRIPT was introduced. The build system is really intricate and I had a hard time to remind the whole picture even when reading my own words. This one will hopefully be better. Modified: stable/9/share/mk/bsd.lib.mk Directory Properties: stable/9/share/mk/ (props changed) Modified: stable/9/share/mk/bsd.lib.mk ============================================================================== --- stable/9/share/mk/bsd.lib.mk Sun May 26 14:35:35 2013 (r250998) +++ stable/9/share/mk/bsd.lib.mk Sun May 26 14:40:23 2013 (r250999) @@ -273,16 +273,21 @@ _libinstall: .if defined(SHLIB_LINK) # ${_SHLIBDIRPREFIX} and ${_LDSCRIPTROOT} are both needed when cross-building # and when building 32 bits library shims. ${_SHLIBDIRPREFIX} is the directory -# prefix where shared objects will be installed. ${_LDSCRIPTROOT} is the -# directory prefix that will be used in generated ld(1) scripts. They cannot -# be coalesced because of the way ld(1) handles the sysroot prefix (used in the -# cross-toolchain): -# - 64 bits libs are located under sysroot, so ${_LDSCRIPTROOT} must be empty. +# prefix where shared objects will be installed by the install target. +# +# ${_LDSCRIPTROOT} is the directory prefix that will be used when generating +# ld(1) scripts. The crosstools' ld is configured to lookup libraries in an +# alternative directory which is called "sysroot", so during buildworld binaries +# won't be linked against the running system libraries but against the ones of +# the current source tree. ${_LDSCRIPTROOT} behavior is twisted because of +# the location where we store them: +# - 64 bits libs are located under sysroot, so ${_LDSCRIPTROOT} must be empty +# because ld(1) will manage to find them from sysroot; # - 32 bits shims are not, so ${_LDSCRIPTROOT} is used to specify their full -# path. Note that ld(1) scripts are generated both during buildworld and -# installworld; in the later case ${_LDSCRIPTROOT} must be obviously empty. -# On the other hand, the use of ${_SHLIBDIRPREFIX} is more consistent since it -# does not involve the logic of a tool we do not own. +# path, outside of sysroot. +# Note that ld(1) scripts are generated both during buildworld and +# installworld; in the later case ${_LDSCRIPTROOT} must be obviously empty +# because on the target system, libraries are meant to be looked up from /. .if defined(SHLIB_LDSCRIPT) && !empty(SHLIB_LDSCRIPT) && exists(${.CURDIR}/${SHLIB_LDSCRIPT}) sed -e 's,@@SHLIB@@,${_LDSCRIPTROOT}${SHLIBDIR}/${SHLIB_NAME},g' \ -e 's,@@LIBDIR@@,${_LDSCRIPTROOT}${LIBDIR},g' \ From owner-svn-src-stable@FreeBSD.ORG Sun May 26 16:48:51 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A3D5759B; Sun, 26 May 2013 16:48:51 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7BE9024D; Sun, 26 May 2013 16:48:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QGmpEP092140; Sun, 26 May 2013 16:48:51 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QGmpV6092138; Sun, 26 May 2013 16:48:51 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201305261648.r4QGmpV6092138@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 26 May 2013 16:48:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251001 - stable/9/lib/libfetch X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 16:48:51 -0000 Author: des Date: Sun May 26 16:48:51 2013 New Revision: 251001 URL: http://svnweb.freebsd.org/changeset/base/251001 Log: MFH (r243149): fix indentation MFH (r249431): use CONNECT to proxy HTTPS over HTTP PR: bin/80176 Modified: stable/9/lib/libfetch/http.c Directory Properties: stable/9/lib/libfetch/ (props changed) Modified: stable/9/lib/libfetch/http.c ============================================================================== --- stable/9/lib/libfetch/http.c Sun May 26 14:54:06 2013 (r251000) +++ stable/9/lib/libfetch/http.c Sun May 26 16:48:51 2013 (r251001) @@ -1373,6 +1373,7 @@ http_authorize(conn_t *conn, const char static conn_t * http_connect(struct url *URL, struct url *purl, const char *flags) { + struct url *curl; conn_t *conn; int verbose; int af, val; @@ -1391,17 +1392,21 @@ http_connect(struct url *URL, struct url af = AF_INET6; #endif - if (purl && strcasecmp(URL->scheme, SCHEME_HTTPS) != 0) { - URL = purl; - } else if (strcasecmp(URL->scheme, SCHEME_FTP) == 0) { - /* can't talk http to an ftp server */ - /* XXX should set an error code */ - return (NULL); - } + curl = (purl != NULL) ? purl : URL; - if ((conn = fetch_connect(URL->host, URL->port, af, verbose)) == NULL) + if ((conn = fetch_connect(curl->host, curl->port, af, verbose)) == NULL) /* fetch_connect() has already set an error code */ return (NULL); + if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && purl) { + http_cmd(conn, "CONNECT %s:%d HTTP/1.1", + URL->host, URL->port); + http_cmd(conn, ""); + if (http_get_reply(conn) != HTTP_OK) { + fetch_close(conn); + return (NULL); + } + http_get_reply(conn); + } if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && fetch_ssl(conn, verbose) == -1) { fetch_close(conn); @@ -1752,11 +1757,11 @@ http_request(struct url *URL, const char /* get headers. http_next_header expects one line readahead */ if (fetch_getln(conn) == -1) { - fetch_syserr(); - goto ouch; + fetch_syserr(); + goto ouch; } do { - switch ((h = http_next_header(conn, &headerbuf, &p))) { + switch ((h = http_next_header(conn, &headerbuf, &p))) { case hdr_syserror: fetch_syserr(); goto ouch; @@ -1785,7 +1790,7 @@ http_request(struct url *URL, const char conn->err != HTTP_USE_PROXY) { n = 1; break; - } + } if (new) free(new); if (verbose) From owner-svn-src-stable@FreeBSD.ORG Sun May 26 17:00:16 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 29AE58B7; Sun, 26 May 2013 17:00:16 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0BFA2294; Sun, 26 May 2013 17:00:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QH0Fmh097147; Sun, 26 May 2013 17:00:15 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QH0F99097145; Sun, 26 May 2013 17:00:15 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201305261700.r4QH0F99097145@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Sun, 26 May 2013 17:00:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251002 - stable/8/lib/libfetch X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 17:00:16 -0000 Author: des Date: Sun May 26 17:00:15 2013 New Revision: 251002 URL: http://svnweb.freebsd.org/changeset/base/251002 Log: MFH (r230478): fix a couple of nits in r230307 (r231248) MFH (r243149): fix indentation MFH (r249431): use CONNECT to proxy HTTPS over HTTP PR: bin/80176 Modified: stable/8/lib/libfetch/common.c stable/8/lib/libfetch/http.c Directory Properties: stable/8/lib/libfetch/ (props changed) Modified: stable/8/lib/libfetch/common.c ============================================================================== --- stable/8/lib/libfetch/common.c Sun May 26 16:48:51 2013 (r251001) +++ stable/8/lib/libfetch/common.c Sun May 26 17:00:15 2013 (r251002) @@ -418,7 +418,6 @@ fetch_cache_data(conn_t *conn, char *src if (conn->cache.size < nbytes) { tmp = realloc(conn->cache.buf, nbytes); if (tmp == NULL) { - errno = ENOMEM; fetch_syserr(); return (-1); } @@ -481,7 +480,7 @@ fetch_read(conn_t *conn, char *buf, size conn->cache.len -= total; conn->cache.pos += total; len -= total; - buf+= total; + buf += total; } while (len > 0) { Modified: stable/8/lib/libfetch/http.c ============================================================================== --- stable/8/lib/libfetch/http.c Sun May 26 16:48:51 2013 (r251001) +++ stable/8/lib/libfetch/http.c Sun May 26 17:00:15 2013 (r251002) @@ -1373,6 +1373,7 @@ http_authorize(conn_t *conn, const char static conn_t * http_connect(struct url *URL, struct url *purl, const char *flags) { + struct url *curl; conn_t *conn; int verbose; int af, val; @@ -1391,17 +1392,21 @@ http_connect(struct url *URL, struct url af = AF_INET6; #endif - if (purl && strcasecmp(URL->scheme, SCHEME_HTTPS) != 0) { - URL = purl; - } else if (strcasecmp(URL->scheme, SCHEME_FTP) == 0) { - /* can't talk http to an ftp server */ - /* XXX should set an error code */ - return (NULL); - } + curl = (purl != NULL) ? purl : URL; - if ((conn = fetch_connect(URL->host, URL->port, af, verbose)) == NULL) + if ((conn = fetch_connect(curl->host, curl->port, af, verbose)) == NULL) /* fetch_connect() has already set an error code */ return (NULL); + if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && purl) { + http_cmd(conn, "CONNECT %s:%d HTTP/1.1", + URL->host, URL->port); + http_cmd(conn, ""); + if (http_get_reply(conn) != HTTP_OK) { + fetch_close(conn); + return (NULL); + } + http_get_reply(conn); + } if (strcasecmp(URL->scheme, SCHEME_HTTPS) == 0 && fetch_ssl(conn, verbose) == -1) { fetch_close(conn); @@ -1752,11 +1757,11 @@ http_request(struct url *URL, const char /* get headers. http_next_header expects one line readahead */ if (fetch_getln(conn) == -1) { - fetch_syserr(); - goto ouch; + fetch_syserr(); + goto ouch; } do { - switch ((h = http_next_header(conn, &headerbuf, &p))) { + switch ((h = http_next_header(conn, &headerbuf, &p))) { case hdr_syserror: fetch_syserr(); goto ouch; @@ -1785,7 +1790,7 @@ http_request(struct url *URL, const char conn->err != HTTP_USE_PROXY) { n = 1; break; - } + } if (new) free(new); if (verbose) From owner-svn-src-stable@FreeBSD.ORG Sun May 26 18:26:30 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 25BE3B2E; Sun, 26 May 2013 18:26:30 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 17F1C77A; Sun, 26 May 2013 18:26:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QIQTM7024838; Sun, 26 May 2013 18:26:29 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QIQTMg024837; Sun, 26 May 2013 18:26:29 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305261826.r4QIQTMg024837@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 26 May 2013 18:26:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251003 - stable/9/lib/libprocstat X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 18:26:30 -0000 Author: trociny Date: Sun May 26 18:26:29 2013 New Revision: 251003 URL: http://svnweb.freebsd.org/changeset/base/251003 Log: MFC r250147: procstat_getpathname: for kvm method, instead of returning the error that the method is not supported, return an empty string. This looks more handy for callers like procstat(1), which will not abort after the failed call and still output some useful information. Modified: stable/9/lib/libprocstat/libprocstat.c Directory Properties: stable/9/lib/libprocstat/ (props changed) Modified: stable/9/lib/libprocstat/libprocstat.c ============================================================================== --- stable/9/lib/libprocstat/libprocstat.c Sun May 26 17:00:15 2013 (r251002) +++ stable/9/lib/libprocstat/libprocstat.c Sun May 26 18:26:29 2013 (r251003) @@ -2120,8 +2120,10 @@ procstat_getpathname(struct procstat *pr { switch(procstat->type) { case PROCSTAT_KVM: - warnx("kvm method is not supported"); - return (-1); + /* XXX: Return empty string. */ + if (maxlen > 0) + pathname[0] = '\0'; + return (0); case PROCSTAT_SYSCTL: return (procstat_getpathname_sysctl(kp->ki_pid, pathname, maxlen)); From owner-svn-src-stable@FreeBSD.ORG Sun May 26 18:28:37 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 03B8FCAB; Sun, 26 May 2013 18:28:37 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E8911788; Sun, 26 May 2013 18:28:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QISa3k025218; Sun, 26 May 2013 18:28:36 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QISaAj025215; Sun, 26 May 2013 18:28:36 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305261828.r4QISaAj025215@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 26 May 2013 18:28:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251004 - in stable/9/sbin: hastctl hastd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 18:28:37 -0000 Author: trociny Date: Sun May 26 18:28:36 2013 New Revision: 251004 URL: http://svnweb.freebsd.org/changeset/base/251004 Log: r250503 Get rid of libl dependency. We needed it only to provide yywrap. But yywrap is not necessary when parsing a single hast.conf file. Suggested by: kib Reviewed by: pjd Modified: stable/9/sbin/hastctl/Makefile stable/9/sbin/hastd/Makefile stable/9/sbin/hastd/token.l Directory Properties: stable/9/sbin/hastctl/ (props changed) stable/9/sbin/hastd/ (props changed) Modified: stable/9/sbin/hastctl/Makefile ============================================================================== --- stable/9/sbin/hastctl/Makefile Sun May 26 18:26:29 2013 (r251003) +++ stable/9/sbin/hastctl/Makefile Sun May 26 18:28:36 2013 (r251004) @@ -31,8 +31,8 @@ CFLAGS+=-DINET6 CFLAGS+=-DYY_NO_UNPUT CFLAGS+=-DYY_NO_INPUT -DPADD= ${LIBL} ${LIBUTIL} -LDADD= -ll -lutil +DPADD= ${LIBUTIL} +LDADD= -lutil .if ${MK_OPENSSL} != "no" DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto Modified: stable/9/sbin/hastd/Makefile ============================================================================== --- stable/9/sbin/hastd/Makefile Sun May 26 18:26:29 2013 (r251003) +++ stable/9/sbin/hastd/Makefile Sun May 26 18:28:36 2013 (r251004) @@ -30,7 +30,7 @@ CFLAGS+=-DINET6 .endif DPADD= ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} ${LIBL} ${LIBPTHREAD} ${LIBUTIL} -LDADD= -lgeom -lbsdxml -lsbuf -ll -lpthread -lutil +LDADD= -lgeom -lbsdxml -lsbuf -lpthread -lutil .if ${MK_OPENSSL} != "no" DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto Modified: stable/9/sbin/hastd/token.l ============================================================================== --- stable/9/sbin/hastd/token.l Sun May 26 18:26:29 2013 (r251003) +++ stable/9/sbin/hastd/token.l Sun May 26 18:28:36 2013 (r251004) @@ -46,6 +46,7 @@ int lineno; %option noinput %option nounput +%option noyywrap %% control { DP; return CONTROL; } From owner-svn-src-stable@FreeBSD.ORG Sun May 26 18:30:07 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EC17CE22; Sun, 26 May 2013 18:30:07 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DE4C4791; Sun, 26 May 2013 18:30:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QIU7LY025574; Sun, 26 May 2013 18:30:07 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QIU7V5025567; Sun, 26 May 2013 18:30:07 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305261830.r4QIU7V5025567@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 26 May 2013 18:30:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251005 - in stable/8/sbin: hastctl hastd X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 18:30:08 -0000 Author: trociny Date: Sun May 26 18:30:07 2013 New Revision: 251005 URL: http://svnweb.freebsd.org/changeset/base/251005 Log: MFC r250503: Get rid of libl dependency. We needed it only to provide yywrap. But yywrap is not necessary when parsing a single hast.conf file. Suggested by: kib Reviewed by: pjd Modified: stable/8/sbin/hastctl/Makefile stable/8/sbin/hastd/Makefile stable/8/sbin/hastd/token.l Directory Properties: stable/8/sbin/hastctl/ (props changed) stable/8/sbin/hastd/ (props changed) Modified: stable/8/sbin/hastctl/Makefile ============================================================================== --- stable/8/sbin/hastctl/Makefile Sun May 26 18:28:36 2013 (r251004) +++ stable/8/sbin/hastctl/Makefile Sun May 26 18:30:07 2013 (r251005) @@ -29,8 +29,8 @@ CFLAGS+=-DINET6 # This is needed to have WARNS > 1. CFLAGS+=-DYY_NO_UNPUT -DPADD= ${LIBL} ${LIBUTIL} -LDADD= -ll -lutil +DPADD= ${LIBUTIL} +LDADD= -lutil .if ${MK_OPENSSL} != "no" DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto Modified: stable/8/sbin/hastd/Makefile ============================================================================== --- stable/8/sbin/hastd/Makefile Sun May 26 18:28:36 2013 (r251004) +++ stable/8/sbin/hastd/Makefile Sun May 26 18:30:07 2013 (r251005) @@ -29,7 +29,7 @@ CFLAGS+=-DINET6 .endif DPADD= ${LIBGEOM} ${LIBBSDXML} ${LIBSBUF} ${LIBL} ${LIBPTHREAD} ${LIBUTIL} -LDADD= -lgeom -lbsdxml -lsbuf -ll -lpthread -lutil +LDADD= -lgeom -lbsdxml -lsbuf -lpthread -lutil .if ${MK_OPENSSL} != "no" DPADD+= ${LIBCRYPTO} LDADD+= -lcrypto Modified: stable/8/sbin/hastd/token.l ============================================================================== --- stable/8/sbin/hastd/token.l Sun May 26 18:28:36 2013 (r251004) +++ stable/8/sbin/hastd/token.l Sun May 26 18:30:07 2013 (r251005) @@ -46,6 +46,7 @@ int lineno; %option noinput %option nounput +%option noyywrap %% control { DP; return CONTROL; } From owner-svn-src-stable@FreeBSD.ORG Sun May 26 18:35:53 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 71276125; Sun, 26 May 2013 18:35:53 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 631CA7D7; Sun, 26 May 2013 18:35:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QIZrmC028150; Sun, 26 May 2013 18:35:53 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QIZrN3028147; Sun, 26 May 2013 18:35:53 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305261835.r4QIZrN3028147@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 26 May 2013 18:35:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251006 - in stable/9/usr.sbin/bsnmpd/modules: . snmp_hast X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 18:35:53 -0000 Author: trociny Date: Sun May 26 18:35:52 2013 New Revision: 251006 URL: http://svnweb.freebsd.org/changeset/base/251006 Log: MFC r250379, r250503: HAST module for bsnmpd(1). Reviewed by: harti, pjd Added: stable/9/usr.sbin/bsnmpd/modules/snmp_hast/ - copied from r250379, head/usr.sbin/bsnmpd/modules/snmp_hast/ Modified: stable/9/usr.sbin/bsnmpd/modules/Makefile stable/9/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Directory Properties: stable/9/usr.sbin/bsnmpd/ (props changed) Modified: stable/9/usr.sbin/bsnmpd/modules/Makefile ============================================================================== --- stable/9/usr.sbin/bsnmpd/modules/Makefile Sun May 26 18:30:07 2013 (r251005) +++ stable/9/usr.sbin/bsnmpd/modules/Makefile Sun May 26 18:35:52 2013 (r251006) @@ -10,6 +10,7 @@ _snmp_atm= snmp_atm SUBDIR= ${_snmp_atm} \ snmp_bridge \ + snmp_hast \ snmp_hostres \ snmp_mibII \ snmp_pf \ Modified: stable/9/usr.sbin/bsnmpd/modules/snmp_hast/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Wed May 8 20:03:37 2013 (r250379) +++ stable/9/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Sun May 26 18:35:52 2013 (r251006) @@ -29,8 +29,8 @@ CFLAGS+=-DYY_NO_UNPUT CFLAGS+=-DYY_NO_INPUT CFLAGS+= -DSNMPTREE_TYPES -DPADD= ${LIBL} ${LIBUTIL} -LDADD= -ll -lutil +DPADD= ${LIBUTIL} +LDADD= -lutil XSYM= begemotHast DEFS= ${MOD}_tree.def From owner-svn-src-stable@FreeBSD.ORG Sun May 26 18:37:21 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1244E299; Sun, 26 May 2013 18:37:21 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 048787E0; Sun, 26 May 2013 18:37:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QIbKr3028446; Sun, 26 May 2013 18:37:20 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QIbKsQ028444; Sun, 26 May 2013 18:37:20 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305261837.r4QIbKsQ028444@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 26 May 2013 18:37:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251007 - in stable/8/usr.sbin/bsnmpd/modules: . snmp_hast X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 18:37:21 -0000 Author: trociny Date: Sun May 26 18:37:20 2013 New Revision: 251007 URL: http://svnweb.freebsd.org/changeset/base/251007 Log: MFC r250379, r250503: HAST module for bsnmpd(1). Reviewed by: harti, pjd Added: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/ - copied from r250379, head/usr.sbin/bsnmpd/modules/snmp_hast/ Modified: stable/8/usr.sbin/bsnmpd/modules/Makefile stable/8/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Directory Properties: stable/8/usr.sbin/bsnmpd/ (props changed) Modified: stable/8/usr.sbin/bsnmpd/modules/Makefile ============================================================================== --- stable/8/usr.sbin/bsnmpd/modules/Makefile Sun May 26 18:35:52 2013 (r251006) +++ stable/8/usr.sbin/bsnmpd/modules/Makefile Sun May 26 18:37:20 2013 (r251007) @@ -10,6 +10,7 @@ _snmp_atm= snmp_atm SUBDIR= ${_snmp_atm} \ snmp_bridge \ + snmp_hast \ snmp_hostres \ snmp_mibII \ snmp_pf Modified: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/Makefile ============================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Wed May 8 20:03:37 2013 (r250379) +++ stable/8/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Sun May 26 18:37:20 2013 (r251007) @@ -29,8 +29,8 @@ CFLAGS+=-DYY_NO_UNPUT CFLAGS+=-DYY_NO_INPUT CFLAGS+= -DSNMPTREE_TYPES -DPADD= ${LIBL} ${LIBUTIL} -LDADD= -ll -lutil +DPADD= ${LIBUTIL} +LDADD= -lutil XSYM= begemotHast DEFS= ${MOD}_tree.def From owner-svn-src-stable@FreeBSD.ORG Sun May 26 18:38:46 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A5212428; Sun, 26 May 2013 18:38:46 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 97C9A7EC; Sun, 26 May 2013 18:38:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QIckfq028701; Sun, 26 May 2013 18:38:46 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QIck4o028700; Sun, 26 May 2013 18:38:46 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305261838.r4QIck4o028700@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 26 May 2013 18:38:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251008 - stable/9/contrib/bsnmp X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 18:38:46 -0000 Author: trociny Date: Sun May 26 18:38:46 2013 New Revision: 251008 URL: http://svnweb.freebsd.org/changeset/base/251008 Log: MFC r250380: Register OID for HAST module. Modified: stable/9/contrib/bsnmp/oid-list Directory Properties: stable/9/contrib/bsnmp/ (props changed) Modified: stable/9/contrib/bsnmp/oid-list ============================================================================== --- stable/9/contrib/bsnmp/oid-list Sun May 26 18:37:20 2013 (r251007) +++ stable/9/contrib/bsnmp/oid-list Sun May 26 18:38:46 2013 (r251008) @@ -24,6 +24,7 @@ enterprises 204 pingData bsnmp-ping (Nate Nielsen ) 205 begemotBridge bridge module 210 begemotWlan WLAN module + 220 begemotHast HAST module 300 BEGEMOT-ACM DLR ACM project 303 BEGEMOT-WLINK DLR WLINK simulator From owner-svn-src-stable@FreeBSD.ORG Sun May 26 18:39:34 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 57FA6597; Sun, 26 May 2013 18:39:34 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4A3127F3; Sun, 26 May 2013 18:39:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QIdYHn028877; Sun, 26 May 2013 18:39:34 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QIdYX5028876; Sun, 26 May 2013 18:39:34 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305261839.r4QIdYX5028876@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 26 May 2013 18:39:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251009 - stable/8/contrib/bsnmp X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 18:39:34 -0000 Author: trociny Date: Sun May 26 18:39:33 2013 New Revision: 251009 URL: http://svnweb.freebsd.org/changeset/base/251009 Log: MFC r250380: Register OID for HAST module. Modified: stable/8/contrib/bsnmp/oid-list Directory Properties: stable/8/contrib/bsnmp/ (props changed) Modified: stable/8/contrib/bsnmp/oid-list ============================================================================== --- stable/8/contrib/bsnmp/oid-list Sun May 26 18:38:46 2013 (r251008) +++ stable/8/contrib/bsnmp/oid-list Sun May 26 18:39:33 2013 (r251009) @@ -17,6 +17,7 @@ enterprises 200 BEGEMOT-PF snmpd PF module (phillip@freebsd.org) 201 BEGEMOT-NTP snmpd NTP module 202 BEGEMOT-HOSTRES snmpd HOSTRES module private stuff + 220 begemotHast HAST module 300 BEGEMOT-ACM DLR ACM project If you need an OID and don't know where to stuck it in, I can assign you one - From owner-svn-src-stable@FreeBSD.ORG Sun May 26 18:54:05 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C4E79A18; Sun, 26 May 2013 18:54:05 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B64D4869; Sun, 26 May 2013 18:54:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QIs520034400; Sun, 26 May 2013 18:54:05 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QIs5Vs034398; Sun, 26 May 2013 18:54:05 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305261854.r4QIs5Vs034398@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 26 May 2013 18:54:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251010 - stable/9/usr.sbin/bsnmpd/modules/snmp_hast X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 18:54:05 -0000 Author: trociny Date: Sun May 26 18:54:05 2013 New Revision: 251010 URL: http://svnweb.freebsd.org/changeset/base/251010 Log: MFC r250405: Move snmp_hast manual to section 3, where all other manual pages for bsnmp modules are located. Section 3 (Library Functions) looks wrong for this manual page, which contains only module description, that is why initially it was located to section 8 (System Manager's Manual). On the other hand manual pages for all other bsnmpd modules are already located in the section 3, and having all pages in one section looks more consistent. Also, currently, similarly to manuals for other modules, snmp_hast manual contains LIBRARY section, which is not good style for section 8. Added: stable/9/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 - copied unchanged from r250405, head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 Deleted: stable/9/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.8 Modified: stable/9/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Directory Properties: stable/9/usr.sbin/bsnmpd/ (props changed) Modified: stable/9/usr.sbin/bsnmpd/modules/snmp_hast/Makefile ============================================================================== --- stable/9/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Sun May 26 18:39:33 2013 (r251009) +++ stable/9/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Sun May 26 18:54:05 2013 (r251010) @@ -13,7 +13,7 @@ SRCS+= parse.y pjdlog.c SRCS+= proto.c proto_common.c proto_uds.c SRCS+= token.l SRCS+= y.tab.h -MAN= snmp_hast.8 +MAN= snmp_hast.3 NO_WFORMAT= NO_WCAST_ALIGN= Copied: stable/9/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 (from r250405, head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 Sun May 26 18:54:05 2013 (r251010, copy of r250405, head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3) @@ -0,0 +1,69 @@ +.\"- +.\" Copyright (c) 2013 Mikolaj Golub +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 9, 2013 +.Dt SNMP_HAST 3 +.Os +.Sh NAME +.Nm snmp_hast +.Nd "HAST module for" +.Xr bsnmpd 1 +.Sh LIBRARY +.Pq begemotSnmpdModulePath."hast" = "/usr/lib/snmp_hast.so" +.Sh DESCRIPTION +The +.Nm snmp_hast +module implements a private BEGEMOT-HAST-MIB, which allows +management of HAST resources. +.Pp +The module uses +.Xr hastd 8 +control socket to communicate with the daemon. +.Va hastConfigFile +variable can be used to specify the location of +.Xr hast.conf 5 +file to find the address of the control connection. +.Sh FILES +.Bl -tag -width "XXXXXXXXX" +.It Pa /usr/share/snmp/defs/hast_tree.def +The description of the MIB tree implemented by +.Nm . +.It Pa /usr/share/snmp/mibs/BEGEMOT-HAST-MIB.txt +The private BEGEMOT-HAST-MIB that is implemented by this module. +.It Pa /etc/hast.conf +The default +.Xr hastd 8 +configuration file. +.El +.Sh SEE ALSO +.Xr bsnmpd 1 , +.Xr gensnmptree 1 , +.Xr hastctl 8 , +.Xr hastd 8 , +.Xr snmpmod 3 +.Sh AUTHORS +.An Mikolaj Golub Aq trociny@FreeBSD.org From owner-svn-src-stable@FreeBSD.ORG Sun May 26 18:54:51 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1F2E0C62; Sun, 26 May 2013 18:54:51 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0EC9D873; Sun, 26 May 2013 18:54:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4QIsoGx034610; Sun, 26 May 2013 18:54:50 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4QIso5o034608; Sun, 26 May 2013 18:54:50 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201305261854.r4QIso5o034608@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 26 May 2013 18:54:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251011 - stable/8/usr.sbin/bsnmpd/modules/snmp_hast X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 May 2013 18:54:51 -0000 Author: trociny Date: Sun May 26 18:54:50 2013 New Revision: 251011 URL: http://svnweb.freebsd.org/changeset/base/251011 Log: MFC r250405: Move snmp_hast manual to section 3, where all other manual pages for bsnmp modules are located. Section 3 (Library Functions) looks wrong for this manual page, which contains only module description, that is why initially it was located to section 8 (System Manager's Manual). On the other hand manual pages for all other bsnmpd modules are already located in the section 3, and having all pages in one section looks more consistent. Also, currently, similarly to manuals for other modules, snmp_hast manual contains LIBRARY section, which is not good style for section 8. Added: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 - copied unchanged from r250405, head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 Deleted: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.8 Modified: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Directory Properties: stable/8/usr.sbin/bsnmpd/ (props changed) Modified: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/Makefile ============================================================================== --- stable/8/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Sun May 26 18:54:05 2013 (r251010) +++ stable/8/usr.sbin/bsnmpd/modules/snmp_hast/Makefile Sun May 26 18:54:50 2013 (r251011) @@ -13,7 +13,7 @@ SRCS+= parse.y pjdlog.c SRCS+= proto.c proto_common.c proto_uds.c SRCS+= token.l SRCS+= y.tab.h -MAN= snmp_hast.8 +MAN= snmp_hast.3 NO_WFORMAT= NO_WCAST_ALIGN= Copied: stable/8/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 (from r250405, head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/8/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3 Sun May 26 18:54:50 2013 (r251011, copy of r250405, head/usr.sbin/bsnmpd/modules/snmp_hast/snmp_hast.3) @@ -0,0 +1,69 @@ +.\"- +.\" Copyright (c) 2013 Mikolaj Golub +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\" notice, this list of conditions and the following disclaimer. +.\" 2. Redistributions in binary form must reproduce the above copyright +.\" notice, this list of conditions and the following disclaimer in the +.\" documentation and/or other materials provided with the distribution. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND +.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE +.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +.\" SUCH DAMAGE. +.\" +.\" $FreeBSD$ +.\" +.Dd May 9, 2013 +.Dt SNMP_HAST 3 +.Os +.Sh NAME +.Nm snmp_hast +.Nd "HAST module for" +.Xr bsnmpd 1 +.Sh LIBRARY +.Pq begemotSnmpdModulePath."hast" = "/usr/lib/snmp_hast.so" +.Sh DESCRIPTION +The +.Nm snmp_hast +module implements a private BEGEMOT-HAST-MIB, which allows +management of HAST resources. +.Pp +The module uses +.Xr hastd 8 +control socket to communicate with the daemon. +.Va hastConfigFile +variable can be used to specify the location of +.Xr hast.conf 5 +file to find the address of the control connection. +.Sh FILES +.Bl -tag -width "XXXXXXXXX" +.It Pa /usr/share/snmp/defs/hast_tree.def +The description of the MIB tree implemented by +.Nm . +.It Pa /usr/share/snmp/mibs/BEGEMOT-HAST-MIB.txt +The private BEGEMOT-HAST-MIB that is implemented by this module. +.It Pa /etc/hast.conf +The default +.Xr hastd 8 +configuration file. +.El +.Sh SEE ALSO +.Xr bsnmpd 1 , +.Xr gensnmptree 1 , +.Xr hastctl 8 , +.Xr hastd 8 , +.Xr snmpmod 3 +.Sh AUTHORS +.An Mikolaj Golub Aq trociny@FreeBSD.org From owner-svn-src-stable@FreeBSD.ORG Mon May 27 03:09:27 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 95085D14; Mon, 27 May 2013 03:09:27 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 87335D85; Mon, 27 May 2013 03:09:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4R39R7i097802; Mon, 27 May 2013 03:09:27 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4R39RsQ097801; Mon, 27 May 2013 03:09:27 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201305270309.r4R39RsQ097801@svn.freebsd.org> From: Jamie Gritton Date: Mon, 27 May 2013 03:09:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251021 - stable/9/share/man/man8 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 03:09:27 -0000 Author: jamie Date: Mon May 27 03:09:26 2013 New Revision: 251021 URL: http://svnweb.freebsd.org/changeset/base/251021 Log: MFC r250968: Mention the "nojailvnet" keyword. Modified: stable/9/share/man/man8/rc.8 Directory Properties: stable/9/share/man/man8/ (props changed) Modified: stable/9/share/man/man8/rc.8 ============================================================================== --- stable/9/share/man/man8/rc.8 Mon May 27 00:26:29 2013 (r251020) +++ stable/9/share/man/man8/rc.8 Mon May 27 03:09:26 2013 (r251021) @@ -124,7 +124,9 @@ Load the configuration files. Determine if booting in a jail, and add .Dq Li nojail -to the list of KEYWORDS to skip in +(no jails allowed) or +.Dq Li nojailvnet +(only allow vnet-enabled jails) to the list of KEYWORDS to skip in .Xr rcorder 8 . .It Invoke From owner-svn-src-stable@FreeBSD.ORG Mon May 27 13:49:56 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D4FBD5B0; Mon, 27 May 2013 13:49:56 +0000 (UTC) (envelope-from marck@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C650D38F; Mon, 27 May 2013 13:49:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RDnuGu011349; Mon, 27 May 2013 13:49:56 GMT (envelope-from marck@svn.freebsd.org) Received: (from marck@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RDnuJD011346; Mon, 27 May 2013 13:49:56 GMT (envelope-from marck@svn.freebsd.org) Message-Id: <201305271349.r4RDnuJD011346@svn.freebsd.org> From: Dmitry Morozovsky Date: Mon, 27 May 2013 13:49:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251025 - in stable/9: . sbin/hastctl X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 13:49:56 -0000 Author: marck (doc committer) Date: Mon May 27 13:49:55 2013 New Revision: 251025 URL: http://svnweb.freebsd.org/changeset/base/251025 Log: Preparation for MFC revs r248291 and r249741: Add 'list' command, for now the exact equivalent of 'status', so users of the latter could change their scripts. This is direct commit to stable, and is temporary. Requested by: Pete French Approved by: trociny 2B cleaned after: 6 weeks Modified: stable/9/UPDATING stable/9/sbin/hastctl/hastctl.8 stable/9/sbin/hastctl/hastctl.c Modified: stable/9/UPDATING ============================================================================== --- stable/9/UPDATING Mon May 27 08:50:10 2013 (r251024) +++ stable/9/UPDATING Mon May 27 13:49:55 2013 (r251025) @@ -11,6 +11,13 @@ handbook: Items affecting the ports and packages system can be found in /usr/ports/UPDATING. Please read that file before running portupgrade. +20130524: + `list' command has been added to hastctl(8). For now, it is full + equivalent of `status' command. + WARNING: in the near future the output of hastctl's status command + will change to more terse format. If you use `hastctl status' + for parsing in your scripts, switch to `hastctl list'. + 20130430: The mergemaster command now uses the default MAKEOBJDIRPREFIX rather than creating it's own in the temporary directory in Modified: stable/9/sbin/hastctl/hastctl.8 ============================================================================== --- stable/9/sbin/hastctl/hastctl.8 Mon May 27 08:50:10 2013 (r251024) +++ stable/9/sbin/hastctl/hastctl.8 Mon May 27 13:49:55 2013 (r251025) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 10, 2011 +.Dd May 24, 2013 .Dt HASTCTL 8 .Os .Sh NAME @@ -49,6 +49,11 @@ .Aq init | primary | secondary .Ar all | name ... .Nm +.Cm list +.Op Fl d +.Op Fl c Ar config +.Op Ar all | name ... +.Nm .Cm status .Op Fl d .Op Fl c Ar config @@ -139,8 +144,19 @@ GEOM provider .Pa /dev/hast/ will not be created on secondary node. .El +.It Cm list .It Cm status -Present status of the configured resources. +Present verbose status of the configured resources. +For now, list and status commands are equivalent. +In the near future the output of +.Nm +status command will change to more terse format. +If you use ` +.Nm +status' for parsing in your scripts, switch to ` +.Nm +list'. + .It Cm dump Dump metadata stored on local component for the configured resources. .El Modified: stable/9/sbin/hastctl/hastctl.c ============================================================================== --- stable/9/sbin/hastctl/hastctl.c Mon May 27 08:50:10 2013 (r251024) +++ stable/9/sbin/hastctl/hastctl.c Mon May 27 13:49:55 2013 (r251025) @@ -70,7 +70,8 @@ enum { CMD_CREATE, CMD_ROLE, CMD_STATUS, - CMD_DUMP + CMD_DUMP, + CMD_LIST }; static __dead2 void @@ -85,6 +86,9 @@ usage(void) " %s role [-d] [-c config] all | name ...\n", getprogname()); fprintf(stderr, + " %s list [-d] [-c config] [all | name ...]\n", + getprogname()); + fprintf(stderr, " %s status [-d] [-c config] [all | name ...]\n", getprogname()); fprintf(stderr, @@ -381,6 +385,9 @@ main(int argc, char *argv[]) } else if (strcmp(argv[1], "role") == 0) { cmd = CMD_ROLE; optstr = "c:dh"; + } else if (strcmp(argv[1], "list") == 0) { + cmd = CMD_LIST; + optstr = "c:dh"; } else if (strcmp(argv[1], "status") == 0) { cmd = CMD_STATUS; optstr = "c:dh"; @@ -469,6 +476,7 @@ main(int argc, char *argv[]) for (ii = 0; ii < argc - 1; ii++) nv_add_string(nv, argv[ii + 1], "resource%d", ii); break; + case CMD_LIST: case CMD_STATUS: /* Obtain status of the given resources. */ nv = nv_alloc(); @@ -524,6 +532,7 @@ main(int argc, char *argv[]) case CMD_ROLE: error = control_set_role(nv, argv[0]); break; + case CMD_LIST: case CMD_STATUS: error = control_status(nv); break; From owner-svn-src-stable@FreeBSD.ORG Mon May 27 13:51:57 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EED2378D; Mon, 27 May 2013 13:51:57 +0000 (UTC) (envelope-from marck@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E0D3E3DC; Mon, 27 May 2013 13:51:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RDpvSg013329; Mon, 27 May 2013 13:51:57 GMT (envelope-from marck@svn.freebsd.org) Received: (from marck@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RDpvar013326; Mon, 27 May 2013 13:51:57 GMT (envelope-from marck@svn.freebsd.org) Message-Id: <201305271351.r4RDpvar013326@svn.freebsd.org> From: Dmitry Morozovsky Date: Mon, 27 May 2013 13:51:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251026 - in stable/8: . sbin/hastctl X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 13:51:58 -0000 Author: marck (doc committer) Date: Mon May 27 13:51:57 2013 New Revision: 251026 URL: http://svnweb.freebsd.org/changeset/base/251026 Log: Preparation for MFC revs r248291 and r249741: Add 'list' command, for now the exact equivalent of 'status', so users of the latter could change their scripts. This is direct commit to stable, and is temporary. Requested by: Pete French Approved by: trociny 2B cleaned after: 6 weeks Modified: stable/8/UPDATING stable/8/sbin/hastctl/hastctl.8 stable/8/sbin/hastctl/hastctl.c Modified: stable/8/UPDATING ============================================================================== --- stable/8/UPDATING Mon May 27 13:49:55 2013 (r251025) +++ stable/8/UPDATING Mon May 27 13:51:57 2013 (r251026) @@ -15,6 +15,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 8. debugging tools present in HEAD were left in place because sun4v support still needs work to become production ready. +20130524: + `list' command has been added to hastctl(8). For now, it is full + equivalent of `status' command. + WARNING: in the near future the output of hastctl's status command + will change to more terse format. If you use `hastctl status' + for parsing in your scripts, switch to `hastctl list'. + 20130429: Fix a bug that allows NFS clients to issue READDIR on files. Modified: stable/8/sbin/hastctl/hastctl.8 ============================================================================== --- stable/8/sbin/hastctl/hastctl.8 Mon May 27 13:49:55 2013 (r251025) +++ stable/8/sbin/hastctl/hastctl.8 Mon May 27 13:51:57 2013 (r251026) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 10, 2011 +.Dd May 24, 2013 .Dt HASTCTL 8 .Os .Sh NAME @@ -49,6 +49,11 @@ .Aq init | primary | secondary .Ar all | name ... .Nm +.Cm list +.Op Fl d +.Op Fl c Ar config +.Op Ar all | name ... +.Nm .Cm status .Op Fl d .Op Fl c Ar config @@ -139,8 +144,19 @@ GEOM provider .Pa /dev/hast/ will not be created on secondary node. .El +.It Cm list .It Cm status -Present status of the configured resources. +Present verbose status of the configured resources. +For now, list and status commands are equivalent. +In the near future the output of +.Nm +status command will change to more terse format. +If you use ` +.Nm +status' for parsing in your scripts, switch to ` +.Nm +list'. + .It Cm dump Dump metadata stored on local component for the configured resources. .El Modified: stable/8/sbin/hastctl/hastctl.c ============================================================================== --- stable/8/sbin/hastctl/hastctl.c Mon May 27 13:49:55 2013 (r251025) +++ stable/8/sbin/hastctl/hastctl.c Mon May 27 13:51:57 2013 (r251026) @@ -70,7 +70,8 @@ enum { CMD_CREATE, CMD_ROLE, CMD_STATUS, - CMD_DUMP + CMD_DUMP, + CMD_LIST }; static __dead2 void @@ -85,6 +86,9 @@ usage(void) " %s role [-d] [-c config] all | name ...\n", getprogname()); fprintf(stderr, + " %s list [-d] [-c config] [all | name ...]\n", + getprogname()); + fprintf(stderr, " %s status [-d] [-c config] [all | name ...]\n", getprogname()); fprintf(stderr, @@ -381,6 +385,9 @@ main(int argc, char *argv[]) } else if (strcmp(argv[1], "role") == 0) { cmd = CMD_ROLE; optstr = "c:dh"; + } else if (strcmp(argv[1], "list") == 0) { + cmd = CMD_LIST; + optstr = "c:dh"; } else if (strcmp(argv[1], "status") == 0) { cmd = CMD_STATUS; optstr = "c:dh"; @@ -469,6 +476,7 @@ main(int argc, char *argv[]) for (ii = 0; ii < argc - 1; ii++) nv_add_string(nv, argv[ii + 1], "resource%d", ii); break; + case CMD_LIST: case CMD_STATUS: /* Obtain status of the given resources. */ nv = nv_alloc(); @@ -524,6 +532,7 @@ main(int argc, char *argv[]) case CMD_ROLE: error = control_set_role(nv, argv[0]); break; + case CMD_LIST: case CMD_STATUS: error = control_status(nv); break; From owner-svn-src-stable@FreeBSD.ORG Mon May 27 22:18:05 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 782F8E85; Mon, 27 May 2013 22:18:05 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 68405C9; Mon, 27 May 2013 22:18:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RMI5pA081402; Mon, 27 May 2013 22:18:05 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RMI47A081398; Mon, 27 May 2013 22:18:04 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201305272218.r4RMI47A081398@svn.freebsd.org> From: Kirk McKusick Date: Mon, 27 May 2013 22:18:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251043 - stable/9/sbin/dumpfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 22:18:05 -0000 Author: mckusick Date: Mon May 27 22:18:04 2013 New Revision: 251043 URL: http://svnweb.freebsd.org/changeset/base/251043 Log: MFC of 250708: Clean up trailing whitespace. Submitted by: Andy Kosela MFC of 250710: When running the -m option to generate a newfs(8) command suitable for recreating the filesystem, check for and output the -i, -k, and -l options if appropriate. Note the remaining deficiencies of the -m option in the dumpfs(8) manual page. Specifically that newfs(8) options -E, -R, -S, and -T options are not handled and that -p is not useful so is omitted. Also document that newfs(8) options -n and -r are neither checked for nor output but should be. The -r flag is needed if the filesystem uses gjournal(8). PR: bin/163992 Reported by: Dieter Submitted by: Andy Kosela Modified: stable/9/sbin/dumpfs/dumpfs.8 stable/9/sbin/dumpfs/dumpfs.c Directory Properties: stable/9/sbin/dumpfs/ (props changed) Modified: stable/9/sbin/dumpfs/dumpfs.8 ============================================================================== --- stable/9/sbin/dumpfs/dumpfs.8 Mon May 27 21:37:19 2013 (r251042) +++ stable/9/sbin/dumpfs/dumpfs.8 Mon May 27 22:18:04 2013 (r251043) @@ -28,7 +28,7 @@ .\" @(#)dumpfs.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd Jul 14, 2011 +.Dd May 16, 2013 .Dt DUMPFS 8 .Os .Sh NAME @@ -76,6 +76,27 @@ is specified, a .Xr newfs 8 command is printed that can be used to generate a new file system with equivalent settings. +Please note that +.Xr newfs 8 +options +.Fl E , +.Fl R , +.Fl S , +and +.Fl T +are not handled and +.Fl p +is not useful in this case so is omitted. +.Xr Newfs 8 +options +.Fl n +and +.Fl r +are neither checked for nor output but should be. +The +.Fl r +flag is needed if the filesystem uses +.Xr gjournal 8 . .Sh SEE ALSO .Xr disktab 5 , .Xr fs 5 , Modified: stable/9/sbin/dumpfs/dumpfs.c ============================================================================== --- stable/9/sbin/dumpfs/dumpfs.c Mon May 27 21:37:19 2013 (r251042) +++ stable/9/sbin/dumpfs/dumpfs.c Mon May 27 22:18:04 2013 (r251043) @@ -197,15 +197,15 @@ dumpfs(const char *name) "maxbsize", afs.fs_maxbsize, afs.fs_maxbpg, afs.fs_maxcontig, afs.fs_contigsumsize); printf("nbfree\t%jd\tndir\t%jd\tnifree\t%jd\tnffree\t%jd\n", - (intmax_t)afs.fs_cstotal.cs_nbfree, + (intmax_t)afs.fs_cstotal.cs_nbfree, (intmax_t)afs.fs_cstotal.cs_ndir, - (intmax_t)afs.fs_cstotal.cs_nifree, + (intmax_t)afs.fs_cstotal.cs_nifree, (intmax_t)afs.fs_cstotal.cs_nffree); printf("bpg\t%d\tfpg\t%d\tipg\t%d\tunrefs\t%jd\n", afs.fs_fpg / afs.fs_frag, afs.fs_fpg, afs.fs_ipg, (intmax_t)afs.fs_unrefs); printf("nindir\t%d\tinopb\t%d\tmaxfilesize\t%ju\n", - afs.fs_nindir, afs.fs_inopb, + afs.fs_nindir, afs.fs_inopb, (uintmax_t)afs.fs_maxfilesize); printf("sbsize\t%d\tcgsize\t%d\tcsaddr\t%jd\tcssize\t%d\n", afs.fs_sbsize, afs.fs_cgsize, (intmax_t)afs.fs_csaddr, @@ -417,12 +417,15 @@ marshal(const char *name) printf("-f %d ", fs->fs_fsize); printf("-g %d ", fs->fs_avgfilesize); printf("-h %d ", fs->fs_avgfpdir); - /* -i is dumb */ + printf("-i %jd ", fragroundup(fs, lblktosize(fs, fragstoblks(fs, + fs->fs_fpg)) / fs->fs_ipg)); if (fs->fs_flags & FS_SUJ) printf("-j "); if (fs->fs_flags & FS_GJOURNAL) printf("-J "); - /* -k..l unimplemented */ + printf("-k %jd ", fs->fs_metaspace); + if (fs->fs_flags & FS_MULTILABEL) + printf("-l "); printf("-m %d ", fs->fs_minfree); /* -n unimplemented */ printf("-o "); From owner-svn-src-stable@FreeBSD.ORG Mon May 27 22:41:44 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AB90A5EC; Mon, 27 May 2013 22:41:44 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9CE39183; Mon, 27 May 2013 22:41:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4RMfiER090356; Mon, 27 May 2013 22:41:44 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4RMfiwV090353; Mon, 27 May 2013 22:41:44 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201305272241.r4RMfiwV090353@svn.freebsd.org> From: Kirk McKusick Date: Mon, 27 May 2013 22:41:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251045 - stable/8/sbin/dumpfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 May 2013 22:41:44 -0000 Author: mckusick Date: Mon May 27 22:41:43 2013 New Revision: 251045 URL: http://svnweb.freebsd.org/changeset/base/251045 Log: MFC of 250708: Clean up trailing whitespace. Submitted by: Andy Kosela MFC of 250710: (delete addition of -k which does not exist in 8-stable) When running the -m option to generate a newfs(8) command suitable for recreating the filesystem, check for and output the -i, -k, and -l options if appropriate. Note the remaining deficiencies of the -m option in the dumpfs(8) manual page. Specifically that newfs(8) options -E, -R, -S, and -T options are not handled and that -p is not useful so is omitted. Also document that newfs(8) options -n and -r are neither checked for nor output but should be. The -r flag is needed if the filesystem uses gjournal(8). PR: bin/163992 Reported by: Dieter Submitted by: Andy Kosela Modified: stable/8/sbin/dumpfs/dumpfs.8 stable/8/sbin/dumpfs/dumpfs.c Directory Properties: stable/8/sbin/dumpfs/ (props changed) Modified: stable/8/sbin/dumpfs/dumpfs.8 ============================================================================== --- stable/8/sbin/dumpfs/dumpfs.8 Mon May 27 22:19:01 2013 (r251044) +++ stable/8/sbin/dumpfs/dumpfs.8 Mon May 27 22:41:43 2013 (r251045) @@ -28,7 +28,7 @@ .\" @(#)dumpfs.8 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd Jul 14, 2011 +.Dd May 16, 2013 .Dt DUMPFS 8 .Os .Sh NAME @@ -76,6 +76,27 @@ is specified, a .Xr newfs 8 command is printed that can be used to generate a new file system with equivalent settings. +Please note that +.Xr newfs 8 +options +.Fl E , +.Fl R , +.Fl S , +and +.Fl T +are not handled and +.Fl p +is not useful in this case so is omitted. +.Xr Newfs 8 +options +.Fl n +and +.Fl r +are neither checked for nor output but should be. +The +.Fl r +flag is needed if the filesystem uses +.Xr gjournal 8 . .Sh SEE ALSO .Xr disktab 5 , .Xr fs 5 , Modified: stable/8/sbin/dumpfs/dumpfs.c ============================================================================== --- stable/8/sbin/dumpfs/dumpfs.c Mon May 27 22:19:01 2013 (r251044) +++ stable/8/sbin/dumpfs/dumpfs.c Mon May 27 22:41:43 2013 (r251045) @@ -197,15 +197,15 @@ dumpfs(const char *name) "maxbsize", afs.fs_maxbsize, afs.fs_maxbpg, afs.fs_maxcontig, afs.fs_contigsumsize); printf("nbfree\t%jd\tndir\t%jd\tnifree\t%jd\tnffree\t%jd\n", - (intmax_t)afs.fs_cstotal.cs_nbfree, + (intmax_t)afs.fs_cstotal.cs_nbfree, (intmax_t)afs.fs_cstotal.cs_ndir, - (intmax_t)afs.fs_cstotal.cs_nifree, + (intmax_t)afs.fs_cstotal.cs_nifree, (intmax_t)afs.fs_cstotal.cs_nffree); printf("bpg\t%d\tfpg\t%d\tipg\t%d\tunrefs\t%jd\n", afs.fs_fpg / afs.fs_frag, afs.fs_fpg, afs.fs_ipg, (intmax_t)afs.fs_unrefs); printf("nindir\t%d\tinopb\t%d\tmaxfilesize\t%ju\n", - afs.fs_nindir, afs.fs_inopb, + afs.fs_nindir, afs.fs_inopb, (uintmax_t)afs.fs_maxfilesize); printf("sbsize\t%d\tcgsize\t%d\tcsaddr\t%jd\tcssize\t%d\n", afs.fs_sbsize, afs.fs_cgsize, (intmax_t)afs.fs_csaddr, @@ -416,8 +416,13 @@ marshal(const char *name) printf("-f %d ", fs->fs_fsize); printf("-g %d ", fs->fs_avgfilesize); printf("-h %d ", fs->fs_avgfpdir); - /* -i is dumb */ - /* -j..l unimplemented */ + printf("-i %jd ", fragroundup(fs, lblktosize(fs, fragstoblks(fs, + fs->fs_fpg)) / fs->fs_ipg)); + /* -j..k unimplemented */ + if (fs->fs_flags & FS_GJOURNAL) + printf("-J "); + if (fs->fs_flags & FS_MULTILABEL) + printf("-l "); printf("-m %d ", fs->fs_minfree); /* -n unimplemented */ printf("-o "); From owner-svn-src-stable@FreeBSD.ORG Tue May 28 05:22:45 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id ACD11BA5; Tue, 28 May 2013 05:22:45 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9F76E8E0; Tue, 28 May 2013 05:22:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4S5MjYG023968; Tue, 28 May 2013 05:22:45 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4S5Mj09023967; Tue, 28 May 2013 05:22:45 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305280522.r4S5Mj09023967@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 28 May 2013 05:22:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251048 - stable/9/sys/vm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 05:22:45 -0000 Author: kib Date: Tue May 28 05:22:45 2013 New Revision: 251048 URL: http://svnweb.freebsd.org/changeset/base/251048 Log: MFC r250849: Add ddb command 'show pginfo'. Modified: stable/9/sys/vm/vm_page.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/vm_page.c ============================================================================== --- stable/9/sys/vm/vm_page.c Tue May 28 04:54:16 2013 (r251047) +++ stable/9/sys/vm/vm_page.c Tue May 28 05:22:45 2013 (r251048) @@ -2915,4 +2915,27 @@ DB_SHOW_COMMAND(pageq, vm_page_print_pag *vm_page_queues[PQ_ACTIVE].cnt, *vm_page_queues[PQ_INACTIVE].cnt); } + +DB_SHOW_COMMAND(pginfo, vm_page_print_pginfo) +{ + vm_page_t m; + boolean_t phys; + + if (!have_addr) { + db_printf("show pginfo addr\n"); + return; + } + + phys = strchr(modif, 'p') != NULL; + if (phys) + m = PHYS_TO_VM_PAGE(addr); + else + m = (vm_page_t)addr; + db_printf( + "page %p obj %p pidx 0x%jx phys 0x%jx q %d hold %d wire %d\n" + " af 0x%x of 0x%x f 0x%x act %d busy %d valid 0x%x dirty 0x%x\n", + m, m->object, (uintmax_t)m->pindex, (uintmax_t)m->phys_addr, + m->queue, m->hold_count, m->wire_count, m->aflags, m->oflags, + m->flags, m->act_count, m->busy, m->valid, m->dirty); +} #endif /* DDB */ From owner-svn-src-stable@FreeBSD.ORG Tue May 28 05:25:11 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 40EE8D28; Tue, 28 May 2013 05:25:11 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 338FE8F2; Tue, 28 May 2013 05:25:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4S5PB8t024448; Tue, 28 May 2013 05:25:11 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4S5PBl8024447; Tue, 28 May 2013 05:25:11 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305280525.r4S5PBl8024447@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 28 May 2013 05:25:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251049 - stable/9/sys/amd64/amd64 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 05:25:11 -0000 Author: kib Date: Tue May 28 05:25:10 2013 New Revision: 251049 URL: http://svnweb.freebsd.org/changeset/base/251049 Log: MFC r250850: Add amd64-specific ddb command 'show phys2dmap'. Modified: stable/9/sys/amd64/amd64/pmap.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/pmap.c ============================================================================== --- stable/9/sys/amd64/amd64/pmap.c Tue May 28 05:22:45 2013 (r251048) +++ stable/9/sys/amd64/amd64/pmap.c Tue May 28 05:25:10 2013 (r251049) @@ -5543,4 +5543,16 @@ DB_SHOW_COMMAND(pte, pmap_print_pte) pte = pmap_pde_to_pte(pde, va); db_printf(" pte %#016lx\n", *pte); } + +DB_SHOW_COMMAND(phys2dmap, pmap_phys2dmap) +{ + vm_paddr_t a; + + if (have_addr) { + a = (vm_paddr_t)addr; + db_printf("0x%jx\n", (uintmax_t)PHYS_TO_DMAP(a)); + } else { + db_printf("show phys2dmap addr\n"); + } +} #endif From owner-svn-src-stable@FreeBSD.ORG Tue May 28 05:36:19 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CCB8B256; Tue, 28 May 2013 05:36:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AF3C894E; Tue, 28 May 2013 05:36:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4S5aJv0027996; Tue, 28 May 2013 05:36:19 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4S5aIbR027992; Tue, 28 May 2013 05:36:18 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305280536.r4S5aIbR027992@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 28 May 2013 05:36:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251050 - in stable/9/sys/amd64: amd64 include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 05:36:19 -0000 Author: kib Date: Tue May 28 05:36:18 2013 New Revision: 251050 URL: http://svnweb.freebsd.org/changeset/base/251050 Log: MFC r250851: Fix the hardware watchpoints on SMP amd64. Modified: stable/9/sys/amd64/amd64/db_trace.c stable/9/sys/amd64/amd64/mp_machdep.c stable/9/sys/amd64/include/md_var.h stable/9/sys/amd64/include/pcpu.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/amd64/db_trace.c ============================================================================== --- stable/9/sys/amd64/amd64/db_trace.c Tue May 28 05:25:10 2013 (r251049) +++ stable/9/sys/amd64/amd64/db_trace.c Tue May 28 05:36:18 2013 (r251050) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -63,6 +64,8 @@ static db_varfcn_t db_frame; static db_varfcn_t db_rsp; static db_varfcn_t db_ss; +CTASSERT(sizeof(struct dbreg) == sizeof(((struct pcpu *)NULL)->pc_dbreg)); + /* * Machine register set. */ @@ -591,64 +594,82 @@ db_md_set_watchpoint(addr, size) db_expr_t addr; db_expr_t size; { - struct dbreg d; - int avail, i, wsize; + struct dbreg *d; + struct pcpu *pc; + int avail, c, cpu, i, wsize; - fill_dbregs(NULL, &d); + d = (struct dbreg *)PCPU_PTR(dbreg); + cpu = PCPU_GET(cpuid); + fill_dbregs(NULL, d); avail = 0; - for(i = 0; i < 4; i++) { - if (!DBREG_DR7_ENABLED(d.dr[7], i)) + for (i = 0; i < 4; i++) { + if (!DBREG_DR7_ENABLED(d->dr[7], i)) avail++; } if (avail * 8 < size) return (-1); - for (i = 0; i < 4 && (size > 0); i++) { - if (!DBREG_DR7_ENABLED(d.dr[7], i)) { + for (i = 0; i < 4 && size > 0; i++) { + if (!DBREG_DR7_ENABLED(d->dr[7], i)) { if (size >= 8 || (avail == 1 && size > 4)) wsize = 8; else if (size > 2) wsize = 4; else wsize = size; - amd64_set_watch(i, addr, wsize, - DBREG_DR7_WRONLY, &d); + amd64_set_watch(i, addr, wsize, DBREG_DR7_WRONLY, d); addr += wsize; size -= wsize; avail--; } } - set_dbregs(NULL, &d); + set_dbregs(NULL, d); + CPU_FOREACH(c) { + if (c == cpu) + continue; + pc = pcpu_find(c); + memcpy(pc->pc_dbreg, d, sizeof(*d)); + pc->pc_dbreg_cmd = PC_DBREG_CMD_LOAD; + } - return(0); + return (0); } - int db_md_clr_watchpoint(addr, size) db_expr_t addr; db_expr_t size; { - struct dbreg d; - int i; + struct dbreg *d; + struct pcpu *pc; + int i, c, cpu; - fill_dbregs(NULL, &d); + d = (struct dbreg *)PCPU_PTR(dbreg); + cpu = PCPU_GET(cpuid); + fill_dbregs(NULL, d); - for(i = 0; i < 4; i++) { - if (DBREG_DR7_ENABLED(d.dr[7], i)) { - if ((DBREG_DRX((&d), i) >= addr) && - (DBREG_DRX((&d), i) < addr+size)) - amd64_clr_watch(i, &d); + for (i = 0; i < 4; i++) { + if (DBREG_DR7_ENABLED(d->dr[7], i)) { + if (DBREG_DRX((d), i) >= addr && + DBREG_DRX((d), i) < addr + size) + amd64_clr_watch(i, d); } } - set_dbregs(NULL, &d); + set_dbregs(NULL, d); + CPU_FOREACH(c) { + if (c == cpu) + continue; + pc = pcpu_find(c); + memcpy(pc->pc_dbreg, d, sizeof(*d)); + pc->pc_dbreg_cmd = PC_DBREG_CMD_LOAD; + } - return(0); + return (0); } @@ -699,3 +720,17 @@ db_md_list_watchpoints() } db_printf("\n"); } + +void +amd64_db_resume_dbreg(void) +{ + struct dbreg *d; + + switch (PCPU_GET(dbreg_cmd)) { + case PC_DBREG_CMD_LOAD: + d = (struct dbreg *)PCPU_PTR(dbreg); + set_dbregs(NULL, d); + PCPU_SET(dbreg_cmd, PC_DBREG_CMD_NONE); + break; + } +} Modified: stable/9/sys/amd64/amd64/mp_machdep.c ============================================================================== --- stable/9/sys/amd64/amd64/mp_machdep.c Tue May 28 05:25:10 2013 (r251049) +++ stable/9/sys/amd64/amd64/mp_machdep.c Tue May 28 05:36:18 2013 (r251050) @@ -28,6 +28,7 @@ __FBSDID("$FreeBSD$"); #include "opt_cpu.h" +#include "opt_ddb.h" #include "opt_kstack_pages.h" #include "opt_sched.h" #include "opt_smp.h" @@ -1397,6 +1398,10 @@ cpustop_handler(void) CPU_CLR_ATOMIC(cpu, &started_cpus); CPU_CLR_ATOMIC(cpu, &stopped_cpus); +#ifdef DDB + amd64_db_resume_dbreg(); +#endif + if (cpu == 0 && cpustop_restartfunc != NULL) { cpustop_restartfunc(); cpustop_restartfunc = NULL; Modified: stable/9/sys/amd64/include/md_var.h ============================================================================== --- stable/9/sys/amd64/include/md_var.h Tue May 28 05:25:10 2013 (r251049) +++ stable/9/sys/amd64/include/md_var.h Tue May 28 05:36:18 2013 (r251050) @@ -117,5 +117,6 @@ void minidumpsys(struct dumperinfo *); struct savefpu *get_pcb_user_save_td(struct thread *td); struct savefpu *get_pcb_user_save_pcb(struct pcb *pcb); struct pcb *get_pcb_td(struct thread *td); +void amd64_db_resume_dbreg(void); #endif /* !_MACHINE_MD_VAR_H_ */ Modified: stable/9/sys/amd64/include/pcpu.h ============================================================================== --- stable/9/sys/amd64/include/pcpu.h Tue May 28 05:25:10 2013 (r251049) +++ stable/9/sys/amd64/include/pcpu.h Tue May 28 05:36:18 2013 (r251050) @@ -77,7 +77,12 @@ /* Pointer to the CPU TSS descriptor */ \ struct system_segment_descriptor *pc_tss; \ u_int pc_cmci_mask /* MCx banks for CMCI */ \ - PCPU_XEN_FIELDS + PCPU_XEN_FIELDS; \ + uint64_t pc_dbreg[16]; /* ddb debugging regs */ \ + int pc_dbreg_cmd; /* ddb debugging reg cmd */ \ + +#define PC_DBREG_CMD_NONE 0 +#define PC_DBREG_CMD_LOAD 1 #ifdef _KERNEL From owner-svn-src-stable@FreeBSD.ORG Tue May 28 05:51:02 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 293B3625; Tue, 28 May 2013 05:51:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AD33FA19; Tue, 28 May 2013 05:51:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4S5p16X033561; Tue, 28 May 2013 05:51:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4S5p1Uh033547; Tue, 28 May 2013 05:51:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305280551.r4S5p1Uh033547@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 28 May 2013 05:51:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251051 - in stable/9/sys: compat/freebsd32 kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 05:51:02 -0000 Author: kib Date: Tue May 28 05:51:00 2013 New Revision: 251051 URL: http://svnweb.freebsd.org/changeset/base/251051 Log: MFC r250853: Fix the wait6(2) on 32bit architectures and for the compat32, by using the right type for the argument in syscalls.master. Also fix the posix_fallocate(2) and posix_fadvise(2) compat32 syscalls on the architectures which require padding of the 64bit argument. Modified: stable/9/sys/compat/freebsd32/freebsd32_misc.c stable/9/sys/compat/freebsd32/syscalls.master stable/9/sys/kern/syscalls.master Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/compat/freebsd32/freebsd32_misc.c ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_misc.c Tue May 28 05:36:18 2013 (r251050) +++ stable/9/sys/compat/freebsd32/freebsd32_misc.c Tue May 28 05:51:00 2013 (r251051) @@ -192,8 +192,8 @@ freebsd32_wait6(struct thread *td, struc bzero(sip, sizeof(*sip)); } else sip = NULL; - error = kern_wait6(td, uap->idtype, uap->id, &status, uap->options, - wrup, sip); + error = kern_wait6(td, uap->idtype, PAIR32TO64(id_t, uap->id), + &status, uap->options, wrup, sip); if (error != 0) return (error); if (uap->status != NULL) Modified: stable/9/sys/compat/freebsd32/syscalls.master ============================================================================== --- stable/9/sys/compat/freebsd32/syscalls.master Tue May 28 05:36:18 2013 (r251050) +++ stable/9/sys/compat/freebsd32/syscalls.master Tue May 28 05:51:00 2013 (r251051) @@ -990,6 +990,22 @@ 529 AUE_NULL NOPROTO { int rctl_remove_rule(const void *inbufp, \ size_t inbuflen, void *outbufp, \ size_t outbuflen); } +#ifdef PAD64_REQUIRED +530 AUE_NULL STD { int freebsd32_posix_fallocate(int fd, \ + int pad, \ + uint32_t offset1, uint32_t offset2,\ + uint32_t len1, uint32_t len2); } +531 AUE_NULL STD { int freebsd32_posix_fadvise(int fd, \ + int pad, \ + uint32_t offset1, uint32_t offset2,\ + uint32_t len1, uint32_t len2, \ + int advice); } +532 AUE_WAIT6 STD { int freebsd32_wait6(int idtype, int pad, \ + uint32_t id1, uint32_t id2, \ + int *status, int options, \ + struct wrusage32 *wrusage, \ + siginfo_t *info); } +#else 530 AUE_NULL STD { int freebsd32_posix_fallocate(int fd,\ uint32_t offset1, uint32_t offset2,\ uint32_t len1, uint32_t len2); } @@ -997,8 +1013,9 @@ uint32_t offset1, uint32_t offset2,\ uint32_t len1, uint32_t len2, \ int advice); } -532 AUE_WAIT6 STD { int freebsd32_wait6(int idtype, int id, \ +532 AUE_WAIT6 STD { int freebsd32_wait6(int idtype, \ + uint32_t id1, uint32_t id2, \ int *status, int options, \ struct wrusage32 *wrusage, \ siginfo_t *info); } - +#endif Modified: stable/9/sys/kern/syscalls.master ============================================================================== --- stable/9/sys/kern/syscalls.master Tue May 28 05:36:18 2013 (r251050) +++ stable/9/sys/kern/syscalls.master Tue May 28 05:51:00 2013 (r251051) @@ -948,7 +948,7 @@ off_t offset, off_t len); } 531 AUE_NULL STD { int posix_fadvise(int fd, off_t offset, \ off_t len, int advice); } -532 AUE_WAIT6 STD { int wait6(int idtype, int id, \ +532 AUE_WAIT6 STD { int wait6(int idtype, id_t id, \ int *status, int options, \ struct __wrusage *wrusage, \ siginfo_t *info); } From owner-svn-src-stable@FreeBSD.ORG Tue May 28 05:52:05 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DF62A8BF; Tue, 28 May 2013 05:52:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C03D8A28; Tue, 28 May 2013 05:52:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4S5q5dG033855; Tue, 28 May 2013 05:52:05 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4S5q3pS033834; Tue, 28 May 2013 05:52:03 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305280552.r4S5q3pS033834@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 28 May 2013 05:52:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251052 - in stable/9/sys: compat/freebsd32 kern sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 05:52:06 -0000 Author: kib Date: Tue May 28 05:52:03 2013 New Revision: 251052 URL: http://svnweb.freebsd.org/changeset/base/251052 Log: Regenerate. Modified: stable/9/sys/compat/freebsd32/freebsd32_proto.h stable/9/sys/compat/freebsd32/freebsd32_syscall.h stable/9/sys/compat/freebsd32/freebsd32_syscalls.c stable/9/sys/compat/freebsd32/freebsd32_sysent.c stable/9/sys/compat/freebsd32/freebsd32_systrace_args.c stable/9/sys/kern/init_sysent.c stable/9/sys/kern/syscalls.c stable/9/sys/kern/systrace_args.c stable/9/sys/sys/syscall.h stable/9/sys/sys/syscall.mk stable/9/sys/sys/sysproto.h Modified: stable/9/sys/compat/freebsd32/freebsd32_proto.h ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_proto.h Tue May 28 05:51:00 2013 (r251051) +++ stable/9/sys/compat/freebsd32/freebsd32_proto.h Tue May 28 05:52:03 2013 (r251052) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 244172 2012-12-13 06:17:05Z kib + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 251051 2013-05-28 05:51:00Z kib */ #ifndef _FREEBSD32_SYSPROTO_H_ @@ -573,8 +573,10 @@ struct freebsd32_pselect_args { char ts_l_[PADL_(const struct timespec32 *)]; const struct timespec32 * ts; char ts_r_[PADR_(const struct timespec32 *)]; char sm_l_[PADL_(const sigset_t *)]; const sigset_t * sm; char sm_r_[PADR_(const sigset_t *)]; }; +#ifdef PAD64_REQUIRED struct freebsd32_posix_fallocate_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; char len1_l_[PADL_(uint32_t)]; uint32_t len1; char len1_r_[PADR_(uint32_t)]; @@ -582,6 +584,7 @@ struct freebsd32_posix_fallocate_args { }; struct freebsd32_posix_fadvise_args { char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; char len1_l_[PADL_(uint32_t)]; uint32_t len1; char len1_r_[PADR_(uint32_t)]; @@ -590,12 +593,40 @@ struct freebsd32_posix_fadvise_args { }; struct freebsd32_wait6_args { char idtype_l_[PADL_(int)]; int idtype; char idtype_r_[PADR_(int)]; - char id_l_[PADL_(int)]; int id; char id_r_[PADR_(int)]; + char pad_l_[PADL_(int)]; int pad; char pad_r_[PADR_(int)]; + char id1_l_[PADL_(uint32_t)]; uint32_t id1; char id1_r_[PADR_(uint32_t)]; + char id2_l_[PADL_(uint32_t)]; uint32_t id2; char id2_r_[PADR_(uint32_t)]; char status_l_[PADL_(int *)]; int * status; char status_r_[PADR_(int *)]; char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)]; char wrusage_l_[PADL_(struct wrusage32 *)]; struct wrusage32 * wrusage; char wrusage_r_[PADR_(struct wrusage32 *)]; char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char info_r_[PADR_(siginfo_t *)]; }; +#else +struct freebsd32_posix_fallocate_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; + char len1_l_[PADL_(uint32_t)]; uint32_t len1; char len1_r_[PADR_(uint32_t)]; + char len2_l_[PADL_(uint32_t)]; uint32_t len2; char len2_r_[PADR_(uint32_t)]; +}; +struct freebsd32_posix_fadvise_args { + char fd_l_[PADL_(int)]; int fd; char fd_r_[PADR_(int)]; + char offset1_l_[PADL_(uint32_t)]; uint32_t offset1; char offset1_r_[PADR_(uint32_t)]; + char offset2_l_[PADL_(uint32_t)]; uint32_t offset2; char offset2_r_[PADR_(uint32_t)]; + char len1_l_[PADL_(uint32_t)]; uint32_t len1; char len1_r_[PADR_(uint32_t)]; + char len2_l_[PADL_(uint32_t)]; uint32_t len2; char len2_r_[PADR_(uint32_t)]; + char advice_l_[PADL_(int)]; int advice; char advice_r_[PADR_(int)]; +}; +struct freebsd32_wait6_args { + char idtype_l_[PADL_(int)]; int idtype; char idtype_r_[PADR_(int)]; + char id1_l_[PADL_(uint32_t)]; uint32_t id1; char id1_r_[PADR_(uint32_t)]; + char id2_l_[PADL_(uint32_t)]; uint32_t id2; char id2_r_[PADR_(uint32_t)]; + char status_l_[PADL_(int *)]; int * status; char status_r_[PADR_(int *)]; + char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)]; + char wrusage_l_[PADL_(struct wrusage32 *)]; struct wrusage32 * wrusage; char wrusage_r_[PADR_(struct wrusage32 *)]; + char info_l_[PADL_(siginfo_t *)]; siginfo_t * info; char info_r_[PADR_(siginfo_t *)]; +}; +#endif #if !defined(PAD64_REQUIRED) && defined(__powerpc__) #define PAD64_REQUIRED #endif @@ -705,9 +736,15 @@ int freebsd32_semctl(struct thread *, st int freebsd32_msgctl(struct thread *, struct freebsd32_msgctl_args *); int freebsd32_shmctl(struct thread *, struct freebsd32_shmctl_args *); int freebsd32_pselect(struct thread *, struct freebsd32_pselect_args *); +#ifdef PAD64_REQUIRED +int freebsd32_posix_fallocate(struct thread *, struct freebsd32_posix_fallocate_args *); +int freebsd32_posix_fadvise(struct thread *, struct freebsd32_posix_fadvise_args *); +int freebsd32_wait6(struct thread *, struct freebsd32_wait6_args *); +#else int freebsd32_posix_fallocate(struct thread *, struct freebsd32_posix_fallocate_args *); int freebsd32_posix_fadvise(struct thread *, struct freebsd32_posix_fadvise_args *); int freebsd32_wait6(struct thread *, struct freebsd32_wait6_args *); +#endif #ifdef COMPAT_43 @@ -776,6 +813,9 @@ struct ofreebsd32_getdirentries_args { #ifdef PAD64_REQUIRED #else #endif +#ifdef PAD64_REQUIRED +#else +#endif int ofreebsd32_lseek(struct thread *, struct ofreebsd32_lseek_args *); int ofreebsd32_stat(struct thread *, struct ofreebsd32_stat_args *); int ofreebsd32_lstat(struct thread *, struct ofreebsd32_lstat_args *); @@ -841,6 +881,9 @@ struct freebsd4_freebsd32_sigreturn_args #ifdef PAD64_REQUIRED #else #endif +#ifdef PAD64_REQUIRED +#else +#endif int freebsd4_freebsd32_getfsstat(struct thread *, struct freebsd4_freebsd32_getfsstat_args *); int freebsd4_freebsd32_statfs(struct thread *, struct freebsd4_freebsd32_statfs_args *); int freebsd4_freebsd32_fstatfs(struct thread *, struct freebsd4_freebsd32_fstatfs_args *); @@ -908,6 +951,9 @@ struct freebsd6_freebsd32_ftruncate_args #ifdef PAD64_REQUIRED #else #endif +#ifdef PAD64_REQUIRED +#else +#endif int freebsd6_freebsd32_pread(struct thread *, struct freebsd6_freebsd32_pread_args *); int freebsd6_freebsd32_pwrite(struct thread *, struct freebsd6_freebsd32_pwrite_args *); int freebsd6_freebsd32_mmap(struct thread *, struct freebsd6_freebsd32_mmap_args *); @@ -945,6 +991,9 @@ struct freebsd7_freebsd32_shmctl_args { #ifdef PAD64_REQUIRED #else #endif +#ifdef PAD64_REQUIRED +#else +#endif int freebsd7_freebsd32_semctl(struct thread *, struct freebsd7_freebsd32_semctl_args *); int freebsd7_freebsd32_msgctl(struct thread *, struct freebsd7_freebsd32_msgctl_args *); int freebsd7_freebsd32_shmctl(struct thread *, struct freebsd7_freebsd32_shmctl_args *); @@ -1085,6 +1134,9 @@ int freebsd7_freebsd32_shmctl(struct thr #define FREEBSD32_SYS_AUE_freebsd32_posix_fallocate AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_posix_fadvise AUE_NULL #define FREEBSD32_SYS_AUE_freebsd32_wait6 AUE_WAIT6 +#define FREEBSD32_SYS_AUE_freebsd32_posix_fallocate AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_posix_fadvise AUE_NULL +#define FREEBSD32_SYS_AUE_freebsd32_wait6 AUE_WAIT6 #undef PAD_ #undef PADL_ Modified: stable/9/sys/compat/freebsd32/freebsd32_syscall.h ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_syscall.h Tue May 28 05:51:00 2013 (r251051) +++ stable/9/sys/compat/freebsd32/freebsd32_syscall.h Tue May 28 05:52:03 2013 (r251052) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 244172 2012-12-13 06:17:05Z kib + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 251051 2013-05-28 05:51:00Z kib */ #define FREEBSD32_SYS_syscall 0 @@ -426,4 +426,7 @@ #define FREEBSD32_SYS_freebsd32_posix_fallocate 530 #define FREEBSD32_SYS_freebsd32_posix_fadvise 531 #define FREEBSD32_SYS_freebsd32_wait6 532 +#define FREEBSD32_SYS_freebsd32_posix_fallocate 530 +#define FREEBSD32_SYS_freebsd32_posix_fadvise 531 +#define FREEBSD32_SYS_freebsd32_wait6 532 #define FREEBSD32_SYS_MAXSYSCALL 533 Modified: stable/9/sys/compat/freebsd32/freebsd32_syscalls.c ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_syscalls.c Tue May 28 05:51:00 2013 (r251051) +++ stable/9/sys/compat/freebsd32/freebsd32_syscalls.c Tue May 28 05:52:03 2013 (r251052) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 244172 2012-12-13 06:17:05Z kib + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 251051 2013-05-28 05:51:00Z kib */ const char *freebsd32_syscallnames[] = { @@ -553,7 +553,13 @@ const char *freebsd32_syscallnames[] = { "rctl_get_limits", /* 527 = rctl_get_limits */ "rctl_add_rule", /* 528 = rctl_add_rule */ "rctl_remove_rule", /* 529 = rctl_remove_rule */ +#ifdef PAD64_REQUIRED + "freebsd32_posix_fallocate", /* 530 = freebsd32_posix_fallocate */ + "freebsd32_posix_fadvise", /* 531 = freebsd32_posix_fadvise */ + "freebsd32_wait6", /* 532 = freebsd32_wait6 */ +#else "freebsd32_posix_fallocate", /* 530 = freebsd32_posix_fallocate */ "freebsd32_posix_fadvise", /* 531 = freebsd32_posix_fadvise */ "freebsd32_wait6", /* 532 = freebsd32_wait6 */ +#endif }; Modified: stable/9/sys/compat/freebsd32/freebsd32_sysent.c ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_sysent.c Tue May 28 05:51:00 2013 (r251051) +++ stable/9/sys/compat/freebsd32/freebsd32_sysent.c Tue May 28 05:52:03 2013 (r251052) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 244172 2012-12-13 06:17:05Z kib + * created from FreeBSD: stable/9/sys/compat/freebsd32/syscalls.master 251051 2013-05-28 05:51:00Z kib */ #include "opt_compat.h" @@ -590,7 +590,13 @@ struct sysent freebsd32_sysent[] = { { AS(rctl_get_limits_args), (sy_call_t *)sys_rctl_get_limits, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 527 = rctl_get_limits */ { AS(rctl_add_rule_args), (sy_call_t *)sys_rctl_add_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 528 = rctl_add_rule */ { AS(rctl_remove_rule_args), (sy_call_t *)sys_rctl_remove_rule, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 529 = rctl_remove_rule */ +#ifdef PAD64_REQUIRED + { AS(freebsd32_posix_fallocate_args), (sy_call_t *)freebsd32_posix_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 530 = freebsd32_posix_fallocate */ + { AS(freebsd32_posix_fadvise_args), (sy_call_t *)freebsd32_posix_fadvise, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 531 = freebsd32_posix_fadvise */ + { AS(freebsd32_wait6_args), (sy_call_t *)freebsd32_wait6, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC }, /* 532 = freebsd32_wait6 */ +#else { AS(freebsd32_posix_fallocate_args), (sy_call_t *)freebsd32_posix_fallocate, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 530 = freebsd32_posix_fallocate */ { AS(freebsd32_posix_fadvise_args), (sy_call_t *)freebsd32_posix_fadvise, AUE_NULL, NULL, 0, 0, 0, SY_THR_STATIC }, /* 531 = freebsd32_posix_fadvise */ { AS(freebsd32_wait6_args), (sy_call_t *)freebsd32_wait6, AUE_WAIT6, NULL, 0, 0, 0, SY_THR_STATIC }, /* 532 = freebsd32_wait6 */ +#endif }; Modified: stable/9/sys/compat/freebsd32/freebsd32_systrace_args.c ============================================================================== --- stable/9/sys/compat/freebsd32/freebsd32_systrace_args.c Tue May 28 05:51:00 2013 (r251051) +++ stable/9/sys/compat/freebsd32/freebsd32_systrace_args.c Tue May 28 05:52:03 2013 (r251052) @@ -3023,6 +3023,47 @@ systrace_args(int sysnum, void *params, *n_args = 4; break; } +#ifdef PAD64_REQUIRED + /* freebsd32_posix_fallocate */ + case 530: { + struct freebsd32_posix_fallocate_args *p = params; + iarg[0] = p->fd; /* int */ + iarg[1] = p->pad; /* int */ + uarg[2] = p->offset1; /* uint32_t */ + uarg[3] = p->offset2; /* uint32_t */ + uarg[4] = p->len1; /* uint32_t */ + uarg[5] = p->len2; /* uint32_t */ + *n_args = 6; + break; + } + /* freebsd32_posix_fadvise */ + case 531: { + struct freebsd32_posix_fadvise_args *p = params; + iarg[0] = p->fd; /* int */ + iarg[1] = p->pad; /* int */ + uarg[2] = p->offset1; /* uint32_t */ + uarg[3] = p->offset2; /* uint32_t */ + uarg[4] = p->len1; /* uint32_t */ + uarg[5] = p->len2; /* uint32_t */ + iarg[6] = p->advice; /* int */ + *n_args = 7; + break; + } + /* freebsd32_wait6 */ + case 532: { + struct freebsd32_wait6_args *p = params; + iarg[0] = p->idtype; /* int */ + iarg[1] = p->pad; /* int */ + uarg[2] = p->id1; /* uint32_t */ + uarg[3] = p->id2; /* uint32_t */ + uarg[4] = (intptr_t) p->status; /* int * */ + iarg[5] = p->options; /* int */ + uarg[6] = (intptr_t) p->wrusage; /* struct wrusage32 * */ + uarg[7] = (intptr_t) p->info; /* siginfo_t * */ + *n_args = 8; + break; + } +#else /* freebsd32_posix_fallocate */ case 530: { struct freebsd32_posix_fallocate_args *p = params; @@ -3050,14 +3091,16 @@ systrace_args(int sysnum, void *params, case 532: { struct freebsd32_wait6_args *p = params; iarg[0] = p->idtype; /* int */ - iarg[1] = p->id; /* int */ - uarg[2] = (intptr_t) p->status; /* int * */ - iarg[3] = p->options; /* int */ - uarg[4] = (intptr_t) p->wrusage; /* struct wrusage32 * */ - uarg[5] = (intptr_t) p->info; /* siginfo_t * */ - *n_args = 6; + uarg[1] = p->id1; /* uint32_t */ + uarg[2] = p->id2; /* uint32_t */ + uarg[3] = (intptr_t) p->status; /* int * */ + iarg[4] = p->options; /* int */ + uarg[5] = (intptr_t) p->wrusage; /* struct wrusage32 * */ + uarg[6] = (intptr_t) p->info; /* siginfo_t * */ + *n_args = 7; break; } +#endif default: *n_args = 0; break; @@ -8095,6 +8138,7 @@ systrace_setargdesc(int sysnum, int ndx, break; }; break; +#ifdef PAD64_REQUIRED /* freebsd32_posix_fallocate */ case 530: switch(ndx) { @@ -8102,7 +8146,7 @@ systrace_setargdesc(int sysnum, int ndx, p = "int"; break; case 1: - p = "uint32_t"; + p = "int"; break; case 2: p = "uint32_t"; @@ -8113,6 +8157,9 @@ systrace_setargdesc(int sysnum, int ndx, case 4: p = "uint32_t"; break; + case 5: + p = "uint32_t"; + break; default: break; }; @@ -8124,7 +8171,7 @@ systrace_setargdesc(int sysnum, int ndx, p = "int"; break; case 1: - p = "uint32_t"; + p = "int"; break; case 2: p = "uint32_t"; @@ -8136,6 +8183,9 @@ systrace_setargdesc(int sysnum, int ndx, p = "uint32_t"; break; case 5: + p = "uint32_t"; + break; + case 6: p = "int"; break; default: @@ -8152,21 +8202,104 @@ systrace_setargdesc(int sysnum, int ndx, p = "int"; break; case 2: + p = "uint32_t"; + break; + case 3: + p = "uint32_t"; + break; + case 4: p = "int *"; break; + case 5: + p = "int"; + break; + case 6: + p = "struct wrusage32 *"; + break; + case 7: + p = "siginfo_t *"; + break; + default: + break; + }; + break; +#else + /* freebsd32_posix_fallocate */ + case 530: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "uint32_t"; + break; + case 2: + p = "uint32_t"; + break; case 3: + p = "uint32_t"; + break; + case 4: + p = "uint32_t"; + break; + default: + break; + }; + break; + /* freebsd32_posix_fadvise */ + case 531: + switch(ndx) { + case 0: p = "int"; break; + case 1: + p = "uint32_t"; + break; + case 2: + p = "uint32_t"; + break; + case 3: + p = "uint32_t"; + break; case 4: - p = "struct wrusage32 *"; + p = "uint32_t"; break; case 5: + p = "int"; + break; + default: + break; + }; + break; + /* freebsd32_wait6 */ + case 532: + switch(ndx) { + case 0: + p = "int"; + break; + case 1: + p = "uint32_t"; + break; + case 2: + p = "uint32_t"; + break; + case 3: + p = "int *"; + break; + case 4: + p = "int"; + break; + case 5: + p = "struct wrusage32 *"; + break; + case 6: p = "siginfo_t *"; break; default: break; }; break; +#endif default: break; }; Modified: stable/9/sys/kern/init_sysent.c ============================================================================== --- stable/9/sys/kern/init_sysent.c Tue May 28 05:51:00 2013 (r251051) +++ stable/9/sys/kern/init_sysent.c Tue May 28 05:52:03 2013 (r251052) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/kern/syscalls.master 244172 2012-12-13 06:17:05Z kib + * created from FreeBSD: stable/9/sys/kern/syscalls.master 251051 2013-05-28 05:51:00Z kib */ #include "opt_compat.h" Modified: stable/9/sys/kern/syscalls.c ============================================================================== --- stable/9/sys/kern/syscalls.c Tue May 28 05:51:00 2013 (r251051) +++ stable/9/sys/kern/syscalls.c Tue May 28 05:52:03 2013 (r251052) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/kern/syscalls.master 244172 2012-12-13 06:17:05Z kib + * created from FreeBSD: stable/9/sys/kern/syscalls.master 251051 2013-05-28 05:51:00Z kib */ const char *syscallnames[] = { Modified: stable/9/sys/kern/systrace_args.c ============================================================================== --- stable/9/sys/kern/systrace_args.c Tue May 28 05:51:00 2013 (r251051) +++ stable/9/sys/kern/systrace_args.c Tue May 28 05:52:03 2013 (r251052) @@ -3248,7 +3248,7 @@ systrace_args(int sysnum, void *params, case 532: { struct wait6_args *p = params; iarg[0] = p->idtype; /* int */ - iarg[1] = p->id; /* int */ + iarg[1] = p->id; /* id_t */ uarg[2] = (intptr_t) p->status; /* int * */ iarg[3] = p->options; /* int */ uarg[4] = (intptr_t) p->wrusage; /* struct __wrusage * */ @@ -8651,7 +8651,7 @@ systrace_setargdesc(int sysnum, int ndx, p = "int"; break; case 1: - p = "int"; + p = "id_t"; break; case 2: p = "int *"; Modified: stable/9/sys/sys/syscall.h ============================================================================== --- stable/9/sys/sys/syscall.h Tue May 28 05:51:00 2013 (r251051) +++ stable/9/sys/sys/syscall.h Tue May 28 05:52:03 2013 (r251052) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/kern/syscalls.master 244172 2012-12-13 06:17:05Z kib + * created from FreeBSD: stable/9/sys/kern/syscalls.master 251051 2013-05-28 05:51:00Z kib */ #define SYS_syscall 0 Modified: stable/9/sys/sys/syscall.mk ============================================================================== --- stable/9/sys/sys/syscall.mk Tue May 28 05:51:00 2013 (r251051) +++ stable/9/sys/sys/syscall.mk Tue May 28 05:52:03 2013 (r251052) @@ -1,7 +1,7 @@ # FreeBSD system call names. # DO NOT EDIT-- this file is automatically generated. # $FreeBSD$ -# created from FreeBSD: stable/9/sys/kern/syscalls.master 244172 2012-12-13 06:17:05Z kib +# created from FreeBSD: stable/9/sys/kern/syscalls.master 251051 2013-05-28 05:51:00Z kib MIASM = \ syscall.o \ exit.o \ Modified: stable/9/sys/sys/sysproto.h ============================================================================== --- stable/9/sys/sys/sysproto.h Tue May 28 05:51:00 2013 (r251051) +++ stable/9/sys/sys/sysproto.h Tue May 28 05:52:03 2013 (r251052) @@ -3,7 +3,7 @@ * * DO NOT EDIT-- this file is automatically generated. * $FreeBSD$ - * created from FreeBSD: stable/9/sys/kern/syscalls.master 244172 2012-12-13 06:17:05Z kib + * created from FreeBSD: stable/9/sys/kern/syscalls.master 251051 2013-05-28 05:51:00Z kib */ #ifndef _SYS_SYSPROTO_H_ @@ -1741,7 +1741,7 @@ struct posix_fadvise_args { }; struct wait6_args { char idtype_l_[PADL_(int)]; int idtype; char idtype_r_[PADR_(int)]; - char id_l_[PADL_(int)]; int id; char id_r_[PADR_(int)]; + char id_l_[PADL_(id_t)]; id_t id; char id_r_[PADR_(id_t)]; char status_l_[PADL_(int *)]; int * status; char status_r_[PADR_(int *)]; char options_l_[PADL_(int)]; int options; char options_r_[PADR_(int)]; char wrusage_l_[PADL_(struct __wrusage *)]; struct __wrusage * wrusage; char wrusage_r_[PADR_(struct __wrusage *)]; From owner-svn-src-stable@FreeBSD.ORG Tue May 28 18:13:09 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 52B06B5C; Tue, 28 May 2013 18:13:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2ABB7CD5; Tue, 28 May 2013 18:13:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SID9LE084216; Tue, 28 May 2013 18:13:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SID9eR084215; Tue, 28 May 2013 18:13:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305281813.r4SID9eR084215@svn.freebsd.org> From: John Baldwin Date: Tue, 28 May 2013 18:13:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251063 - stable/9/sys/dev/cpufreq X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 18:13:09 -0000 Author: jhb Date: Tue May 28 18:13:08 2013 New Revision: 251063 URL: http://svnweb.freebsd.org/changeset/base/251063 Log: MFC 247332: Add a quirk to disable this driver for certain older laptops with an ICH2 southbridge and an Intel 82815_MC host bridge where the host bridge's revision is less than 5 Modified: stable/9/sys/dev/cpufreq/ichss.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/cpufreq/ichss.c ============================================================================== --- stable/9/sys/dev/cpufreq/ichss.c Tue May 28 15:04:58 2013 (r251062) +++ stable/9/sys/dev/cpufreq/ichss.c Tue May 28 18:13:08 2013 (r251063) @@ -67,7 +67,7 @@ struct ichss_softc { #define PCI_DEV_82801BA 0x244c /* ICH2M */ #define PCI_DEV_82801CA 0x248c /* ICH3M */ #define PCI_DEV_82801DB 0x24cc /* ICH4M */ -#define PCI_DEV_82815BA 0x1130 /* Unsupported/buggy part */ +#define PCI_DEV_82815_MC 0x1130 /* Unsupported/buggy part */ /* PCI config registers for finding PMBASE and enabling SpeedStep. */ #define ICHSS_PMBASE_OFFSET 0x40 @@ -155,9 +155,6 @@ ichss_identify(driver_t *driver, device_ * E.g. see Section 6.1 "PCI Devices and Functions" and table 6.1 of * Intel(r) 82801BA I/O Controller Hub 2 (ICH2) and Intel(r) 82801BAM * I/O Controller Hub 2 Mobile (ICH2-M). - * - * TODO: add a quirk to disable if we see the 82815_MC along - * with the 82801BA and revision < 5. */ ich_device = pci_find_bsf(0, 0x1f, 0); if (ich_device == NULL || @@ -167,6 +164,22 @@ ichss_identify(driver_t *driver, device_ pci_get_device(ich_device) != PCI_DEV_82801DB)) return; + /* + * Certain systems with ICH2 and an Intel 82815_MC host bridge + * where the host bridge's revision is < 5 lockup if SpeedStep + * is used. + */ + if (pci_get_device(ich_device) == PCI_DEV_82801BA) { + device_t hostb; + + hostb = pci_find_bsf(0, 0, 0); + if (hostb != NULL && + pci_get_vendor(hostb) == PCI_VENDOR_INTEL && + pci_get_device(hostb) == PCI_DEV_82815_MC && + pci_get_revid(hostb) < 5) + return; + } + /* Find the PMBASE register from our PCI config header. */ pmbase = pci_read_config(ich_device, ICHSS_PMBASE_OFFSET, sizeof(pmbase)); From owner-svn-src-stable@FreeBSD.ORG Tue May 28 18:43:58 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C2FE2736; Tue, 28 May 2013 18:43:58 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9A5A8E68; Tue, 28 May 2013 18:43:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SIhwa0094514; Tue, 28 May 2013 18:43:58 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SIhwr8094512; Tue, 28 May 2013 18:43:58 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305281843.r4SIhwr8094512@svn.freebsd.org> From: John Baldwin Date: Tue, 28 May 2013 18:43:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251064 - stable/8/sys/dev/cpufreq X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 18:43:58 -0000 Author: jhb Date: Tue May 28 18:43:58 2013 New Revision: 251064 URL: http://svnweb.freebsd.org/changeset/base/251064 Log: MFC 247332: Add a quirk to disable this driver for certain older laptops with an ICH2 southbridge and an Intel 82815_MC host bridge where the host bridge's revision is less than 5 Modified: stable/8/sys/dev/cpufreq/ichss.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/cpufreq/ (props changed) Modified: stable/8/sys/dev/cpufreq/ichss.c ============================================================================== --- stable/8/sys/dev/cpufreq/ichss.c Tue May 28 18:13:08 2013 (r251063) +++ stable/8/sys/dev/cpufreq/ichss.c Tue May 28 18:43:58 2013 (r251064) @@ -67,7 +67,7 @@ struct ichss_softc { #define PCI_DEV_82801BA 0x244c /* ICH2M */ #define PCI_DEV_82801CA 0x248c /* ICH3M */ #define PCI_DEV_82801DB 0x24cc /* ICH4M */ -#define PCI_DEV_82815BA 0x1130 /* Unsupported/buggy part */ +#define PCI_DEV_82815_MC 0x1130 /* Unsupported/buggy part */ /* PCI config registers for finding PMBASE and enabling SpeedStep. */ #define ICHSS_PMBASE_OFFSET 0x40 @@ -155,9 +155,6 @@ ichss_identify(driver_t *driver, device_ * E.g. see Section 6.1 "PCI Devices and Functions" and table 6.1 of * Intel(r) 82801BA I/O Controller Hub 2 (ICH2) and Intel(r) 82801BAM * I/O Controller Hub 2 Mobile (ICH2-M). - * - * TODO: add a quirk to disable if we see the 82815_MC along - * with the 82801BA and revision < 5. */ ich_device = pci_find_bsf(0, 0x1f, 0); if (ich_device == NULL || @@ -167,6 +164,22 @@ ichss_identify(driver_t *driver, device_ pci_get_device(ich_device) != PCI_DEV_82801DB)) return; + /* + * Certain systems with ICH2 and an Intel 82815_MC host bridge + * where the host bridge's revision is < 5 lockup if SpeedStep + * is used. + */ + if (pci_get_device(ich_device) == PCI_DEV_82801BA) { + device_t hostb; + + hostb = pci_find_bsf(0, 0, 0); + if (hostb != NULL && + pci_get_vendor(hostb) == PCI_VENDOR_INTEL && + pci_get_device(hostb) == PCI_DEV_82815_MC && + pci_get_revid(hostb) < 5) + return; + } + /* Find the PMBASE register from our PCI config header. */ pmbase = pci_read_config(ich_device, ICHSS_PMBASE_OFFSET, sizeof(pmbase)); From owner-svn-src-stable@FreeBSD.ORG Tue May 28 20:53:26 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C8AE2CB9; Tue, 28 May 2013 20:53:26 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BA42F6E0; Tue, 28 May 2013 20:53:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SKrQ1o040094; Tue, 28 May 2013 20:53:26 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SKrQCx040093; Tue, 28 May 2013 20:53:26 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201305282053.r4SKrQCx040093@svn.freebsd.org> From: Marius Strobl Date: Tue, 28 May 2013 20:53:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251068 - stable/9/sys/dev/bge X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 20:53:26 -0000 Author: marius Date: Tue May 28 20:53:26 2013 New Revision: 251068 URL: http://svnweb.freebsd.org/changeset/base/251068 Log: MFC: r245926, r245931 - Improve some comments. - Make bge_lookup_{rev,vendor}() static. - Factor out chip identification rather than duplicating the code. - Sanitize bge_probe() a bit (don't hardcode buffer sizes, allow bge_lookup_vendor() to return NULL so the excessive panic() can be removed there, etc.) and return BUS_PROBE_DEFAULT rather than hardcoding 0. - According to the Linux tg3 driver, BCM57791 and BCM57795 aren't capable of Gigabit Ethernet. - Check the return value of taskqueue_start_threads(). - Mention NetLink controllers in the fallback description, too. Modified: stable/9/sys/dev/bge/if_bge.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/bge/if_bge.c ============================================================================== --- stable/9/sys/dev/bge/if_bge.c Tue May 28 20:37:48 2013 (r251067) +++ stable/9/sys/dev/bge/if_bge.c Tue May 28 20:53:26 2013 (r251068) @@ -35,10 +35,10 @@ __FBSDID("$FreeBSD$"); /* - * Broadcom BCM570x family gigabit ethernet driver for FreeBSD. + * Broadcom BCM57xx(x)/BCM590x NetXtreme and NetLink family Ethernet driver * * The Broadcom BCM5700 is based on technology originally developed by - * Alteon Networks as part of the Tigon I and Tigon II gigabit ethernet + * Alteon Networks as part of the Tigon I and Tigon II Gigabit Ethernet * MAC chips. The BCM5700, sometimes referred to as the Tigon III, has * two on-board MIPS R4000 CPUs and can have as much as 16MB of external * SSRAM. The BCM5700 supports TCP, UDP and IP checksum offload, jumbo @@ -367,8 +367,9 @@ static const struct bge_revision bge_maj #define BGE_IS_5717_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_5717_PLUS) #define BGE_IS_57765_PLUS(sc) ((sc)->bge_flags & BGE_FLAG_57765_PLUS) -const struct bge_revision * bge_lookup_rev(uint32_t); -const struct bge_vendor * bge_lookup_vendor(uint16_t); +static uint32_t bge_chipid(device_t); +static const struct bge_vendor * bge_lookup_vendor(uint16_t); +static const struct bge_revision * bge_lookup_rev(uint32_t); typedef int (*bge_eaddr_fcn_t)(struct bge_softc *, uint8_t[]); @@ -1916,7 +1917,7 @@ bge_chipinit(struct bge_softc *sc) PCI_CLRBIT(sc->bge_dev, BGE_PCI_CMD, PCIM_CMD_INTxDIS | PCIM_CMD_MWIEN, 4); - /* Set the timer prescaler (always 66Mhz) */ + /* Set the timer prescaler (always 66 MHz). */ CSR_WRITE_4(sc, BGE_MISC_CFG, BGE_32BITTIME_66MHZ); /* XXX: The Linux tg3 driver does this at the start of brgphy_reset. */ @@ -2586,7 +2587,7 @@ bge_blockinit(struct bge_softc *sc) return (0); } -const struct bge_revision * +static const struct bge_revision * bge_lookup_rev(uint32_t chipid) { const struct bge_revision *br; @@ -2604,7 +2605,7 @@ bge_lookup_rev(uint32_t chipid) return (NULL); } -const struct bge_vendor * +static const struct bge_vendor * bge_lookup_vendor(uint16_t vid) { const struct bge_vendor *v; @@ -2613,10 +2614,47 @@ bge_lookup_vendor(uint16_t vid) if (v->v_id == vid) return (v); - panic("%s: unknown vendor %d", __func__, vid); return (NULL); } +static uint32_t +bge_chipid(device_t dev) +{ + uint32_t id; + + id = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >> + BGE_PCIMISCCTL_ASICREV_SHIFT; + if (BGE_ASICREV(id) == BGE_ASICREV_USE_PRODID_REG) { + /* + * Find the ASCI revision. Different chips use different + * registers. + */ + switch (pci_get_device(dev)) { + case BCOM_DEVICEID_BCM5717: + case BCOM_DEVICEID_BCM5718: + case BCOM_DEVICEID_BCM5719: + case BCOM_DEVICEID_BCM5720: + id = pci_read_config(dev, + BGE_PCI_GEN2_PRODID_ASICREV, 4); + break; + case BCOM_DEVICEID_BCM57761: + case BCOM_DEVICEID_BCM57762: + case BCOM_DEVICEID_BCM57765: + case BCOM_DEVICEID_BCM57766: + case BCOM_DEVICEID_BCM57781: + case BCOM_DEVICEID_BCM57785: + case BCOM_DEVICEID_BCM57791: + case BCOM_DEVICEID_BCM57795: + id = pci_read_config(dev, + BGE_PCI_GEN15_PRODID_ASICREV, 4); + break; + default: + id = pci_read_config(dev, BGE_PCI_PRODID_ASICREV, 4); + } + } + return (id); +} + /* * Probe for a Broadcom chip. Check the PCI vendor and device IDs * against our list and return its name if we find a match. @@ -2634,61 +2672,34 @@ bge_probe(device_t dev) char model[64]; const struct bge_revision *br; const char *pname; - struct bge_softc *sc = device_get_softc(dev); + struct bge_softc *sc; const struct bge_type *t = bge_devs; const struct bge_vendor *v; uint32_t id; uint16_t did, vid; + sc = device_get_softc(dev); sc->bge_dev = dev; vid = pci_get_vendor(dev); did = pci_get_device(dev); while(t->bge_vid != 0) { if ((vid == t->bge_vid) && (did == t->bge_did)) { - id = pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >> - BGE_PCIMISCCTL_ASICREV_SHIFT; - if (BGE_ASICREV(id) == BGE_ASICREV_USE_PRODID_REG) { - /* - * Find the ASCI revision. Different chips - * use different registers. - */ - switch (pci_get_device(dev)) { - case BCOM_DEVICEID_BCM5717: - case BCOM_DEVICEID_BCM5718: - case BCOM_DEVICEID_BCM5719: - case BCOM_DEVICEID_BCM5720: - id = pci_read_config(dev, - BGE_PCI_GEN2_PRODID_ASICREV, 4); - break; - case BCOM_DEVICEID_BCM57761: - case BCOM_DEVICEID_BCM57762: - case BCOM_DEVICEID_BCM57765: - case BCOM_DEVICEID_BCM57766: - case BCOM_DEVICEID_BCM57781: - case BCOM_DEVICEID_BCM57785: - case BCOM_DEVICEID_BCM57791: - case BCOM_DEVICEID_BCM57795: - id = pci_read_config(dev, - BGE_PCI_GEN15_PRODID_ASICREV, 4); - break; - default: - id = pci_read_config(dev, - BGE_PCI_PRODID_ASICREV, 4); - } - } + id = bge_chipid(dev); br = bge_lookup_rev(id); - v = bge_lookup_vendor(vid); if (bge_has_eaddr(sc) && pci_get_vpd_ident(dev, &pname) == 0) - snprintf(model, 64, "%s", pname); - else - snprintf(model, 64, "%s %s", v->v_name, + snprintf(model, sizeof(model), "%s", pname); + else { + v = bge_lookup_vendor(vid); + snprintf(model, sizeof(model), "%s %s", + v != NULL ? v->v_name : "Unknown", br != NULL ? br->br_name : - "NetXtreme Ethernet Controller"); - snprintf(buf, 96, "%s, %sASIC rev. %#08x", model, - br != NULL ? "" : "unknown ", id); + "NetXtreme/NetLink Ethernet Controller"); + } + snprintf(buf, sizeof(buf), "%s, %sASIC rev. %#08x", + model, br != NULL ? "" : "unknown ", id); device_set_desc_copy(dev, buf); - return (0); + return (BUS_PROBE_DEFAULT); } t++; } @@ -3272,38 +3283,7 @@ bge_attach(device_t dev) /* Save various chip information. */ sc->bge_func_addr = pci_get_function(dev); - sc->bge_chipid = - pci_read_config(dev, BGE_PCI_MISC_CTL, 4) >> - BGE_PCIMISCCTL_ASICREV_SHIFT; - if (BGE_ASICREV(sc->bge_chipid) == BGE_ASICREV_USE_PRODID_REG) { - /* - * Find the ASCI revision. Different chips use different - * registers. - */ - switch (pci_get_device(dev)) { - case BCOM_DEVICEID_BCM5717: - case BCOM_DEVICEID_BCM5718: - case BCOM_DEVICEID_BCM5719: - case BCOM_DEVICEID_BCM5720: - sc->bge_chipid = pci_read_config(dev, - BGE_PCI_GEN2_PRODID_ASICREV, 4); - break; - case BCOM_DEVICEID_BCM57761: - case BCOM_DEVICEID_BCM57762: - case BCOM_DEVICEID_BCM57765: - case BCOM_DEVICEID_BCM57766: - case BCOM_DEVICEID_BCM57781: - case BCOM_DEVICEID_BCM57785: - case BCOM_DEVICEID_BCM57791: - case BCOM_DEVICEID_BCM57795: - sc->bge_chipid = pci_read_config(dev, - BGE_PCI_GEN15_PRODID_ASICREV, 4); - break; - default: - sc->bge_chipid = pci_read_config(dev, - BGE_PCI_PRODID_ASICREV, 4); - } - } + sc->bge_chipid = bge_chipid(dev); sc->bge_asicrev = BGE_ASICREV(sc->bge_chipid); sc->bge_chiprev = BGE_CHIPREV(sc->bge_chipid); @@ -3493,6 +3473,8 @@ bge_attach(device_t dev) pci_get_device(dev) == BCOM_DEVICEID_BCM5753F || pci_get_device(dev) == BCOM_DEVICEID_BCM5787F)) || pci_get_device(dev) == BCOM_DEVICEID_BCM57790 || + pci_get_device(dev) == BCOM_DEVICEID_BCM57791 || + pci_get_device(dev) == BCOM_DEVICEID_BCM57795 || sc->bge_asicrev == BGE_ASICREV_BCM5906) { /* These chips are 10/100 only. */ capmask &= ~BMSR_EXTSTAT; @@ -3504,8 +3486,8 @@ bge_attach(device_t dev) * TSO. But the firmware is not available to FreeBSD and Linux * claims that the TSO performed by the firmware is slower than * hardware based TSO. Moreover the firmware based TSO has one - * known bug which can't handle TSO if ethernet header + IP/TCP - * header is greater than 80 bytes. The workaround for the TSO + * known bug which can't handle TSO if Ethernet header + IP/TCP + * header is greater than 80 bytes. A workaround for the TSO * bug exist but it seems it's too expensive than not using * TSO at all. Some hardwares also have the TSO bug so limit * the TSO to the controllers that are not affected TSO issues @@ -3878,8 +3860,13 @@ again: error = ENOMEM; goto fail; } - taskqueue_start_threads(&sc->bge_tq, 1, PI_NET, "%s taskq", - device_get_nameunit(sc->bge_dev)); + error = taskqueue_start_threads(&sc->bge_tq, 1, PI_NET, + "%s taskq", device_get_nameunit(sc->bge_dev)); + if (error != 0) { + device_printf(dev, "could not start threads.\n"); + ether_ifdetach(ifp); + goto fail; + } error = bus_setup_intr(dev, sc->bge_irq, INTR_TYPE_NET | INTR_MPSAFE, bge_msi_intr, NULL, sc, &sc->bge_intrhand); From owner-svn-src-stable@FreeBSD.ORG Tue May 28 20:58:58 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B10313C3; Tue, 28 May 2013 20:58:58 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 84A8A912; Tue, 28 May 2013 20:58:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SKwwM5041255; Tue, 28 May 2013 20:58:58 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SKwvn0041245; Tue, 28 May 2013 20:58:57 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201305282058.r4SKwvn0041245@svn.freebsd.org> From: Marius Strobl Date: Tue, 28 May 2013 20:58:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251070 - stable/9/sys/dev/aac X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 20:58:58 -0000 Author: marius Date: Tue May 28 20:58:57 2013 New Revision: 251070 URL: http://svnweb.freebsd.org/changeset/base/251070 Log: MFC: r247570, r247591 - Make tables, device ID strings etc const. This includes #ifdef'ing 0 aac_command_status_table, which is actually unused since r111532. While at it, make aac_if a pointer to the now const interface tables instead of copying them over to the softc (this alone already reduces the size of aac.ko on amd64 by ~1 KiB). - Remove redundant softc members. - Use DEVMETHOD_END. - Use NULL instead of 0 for pointers. - Remove redundant bzero(9)'ing of the softc. - Use pci_enable_busmaster(9) instead of duplicating it. - Remove redundant checking for PCIM_CMD_MEMEN (resource allocation will just fail). - Canonicalize the error messages in case of resource allocation failures. - Add support for using MSI instead of INTx, controllable via the tunable hw.aac.enable_msi (defaulting to on). Modified: stable/9/sys/dev/aac/aac.c stable/9/sys/dev/aac/aac_cam.c stable/9/sys/dev/aac/aac_disk.c stable/9/sys/dev/aac/aac_pci.c stable/9/sys/dev/aac/aac_tables.h stable/9/sys/dev/aac/aacvar.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/aac/aac.c ============================================================================== --- stable/9/sys/dev/aac/aac.c Tue May 28 20:57:40 2013 (r251069) +++ stable/9/sys/dev/aac/aac.c Tue May 28 20:58:57 2013 (r251070) @@ -117,7 +117,7 @@ static void aac_sa_set_mailbox(struct aa static int aac_sa_get_mailbox(struct aac_softc *sc, int mb); static void aac_sa_set_interrupts(struct aac_softc *sc, int enable); -struct aac_interface aac_sa_interface = { +const struct aac_interface aac_sa_interface = { aac_sa_get_fwstatus, aac_sa_qnotify, aac_sa_get_istatus, @@ -142,7 +142,7 @@ static int aac_rx_send_command(struct aa static int aac_rx_get_outb_queue(struct aac_softc *sc); static void aac_rx_set_outb_queue(struct aac_softc *sc, int index); -struct aac_interface aac_rx_interface = { +const struct aac_interface aac_rx_interface = { aac_rx_get_fwstatus, aac_rx_qnotify, aac_rx_get_istatus, @@ -169,7 +169,7 @@ static int aac_rkt_send_command(struct a static int aac_rkt_get_outb_queue(struct aac_softc *sc); static void aac_rkt_set_outb_queue(struct aac_softc *sc, int index); -struct aac_interface aac_rkt_interface = { +const struct aac_interface aac_rkt_interface = { aac_rkt_get_fwstatus, aac_rkt_qnotify, aac_rkt_get_istatus, @@ -183,8 +183,8 @@ struct aac_interface aac_rkt_interface = }; /* Debugging and Diagnostics */ -static void aac_describe_controller(struct aac_softc *sc); -static char *aac_describe_code(struct aac_code_lookup *table, +static void aac_describe_controller(struct aac_softc *sc); +static const char *aac_describe_code(const struct aac_code_lookup *table, u_int32_t code); /* Management Interface */ @@ -222,7 +222,7 @@ static struct cdevsw aac_cdevsw = { static MALLOC_DEFINE(M_AACBUF, "aacbuf", "Buffers for the AAC driver"); /* sysctl node */ -static SYSCTL_NODE(_hw, OID_AUTO, aac, CTLFLAG_RD, 0, "AAC driver parameters"); +SYSCTL_NODE(_hw, OID_AUTO, aac, CTLFLAG_RD, 0, "AAC driver parameters"); /* * Device Interface @@ -634,8 +634,8 @@ aac_free(struct aac_softc *sc) if (sc->aac_intr) bus_teardown_intr(sc->aac_dev, sc->aac_irq, sc->aac_intr); if (sc->aac_irq != NULL) - bus_release_resource(sc->aac_dev, SYS_RES_IRQ, sc->aac_irq_rid, - sc->aac_irq); + bus_release_resource(sc->aac_dev, SYS_RES_IRQ, + rman_get_rid(sc->aac_irq), sc->aac_irq); /* destroy data-transfer DMA tag */ if (sc->aac_buffer_dmat) @@ -648,10 +648,10 @@ aac_free(struct aac_softc *sc) /* release the register window mapping */ if (sc->aac_regs_res0 != NULL) bus_release_resource(sc->aac_dev, SYS_RES_MEMORY, - sc->aac_regs_rid0, sc->aac_regs_res0); + rman_get_rid(sc->aac_regs_res0), sc->aac_regs_res0); if (sc->aac_hwif == AAC_HWIF_NARK && sc->aac_regs_res1 != NULL) bus_release_resource(sc->aac_dev, SYS_RES_MEMORY, - sc->aac_regs_rid1, sc->aac_regs_res1); + rman_get_rid(sc->aac_regs_res1), sc->aac_regs_res1); } /* @@ -1333,9 +1333,6 @@ aac_bio_complete(struct aac_command *cm) } else { bp->bio_error = EIO; bp->bio_flags |= BIO_ERROR; - /* pass an error string out to the disk layer */ - bp->bio_driver1 = aac_describe_code(aac_command_status_table, - status); } aac_biodone(bp); } @@ -1687,7 +1684,7 @@ static int aac_check_firmware(struct aac_softc *sc) { u_int32_t code, major, minor, options = 0, atu_size = 0; - int status; + int rid, status; time_t then; fwprintf(sc, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); @@ -1765,7 +1762,7 @@ aac_check_firmware(struct aac_softc *sc) sc->flags |= AAC_FLAGS_SG_64BIT; } if ((options & AAC_SUPPORTED_NEW_COMM) - && sc->aac_if.aif_send_command) + && sc->aac_if->aif_send_command) sc->flags |= AAC_FLAGS_NEW_COMM; if (options & AAC_SUPPORTED_64BIT_ARRAYSIZE) sc->flags |= AAC_FLAGS_ARRAY_64BIT; @@ -1776,17 +1773,15 @@ aac_check_firmware(struct aac_softc *sc) /* Remap mem. resource, if required */ if ((sc->flags & AAC_FLAGS_NEW_COMM) && - atu_size > rman_get_size(sc->aac_regs_res1)) { - bus_release_resource( - sc->aac_dev, SYS_RES_MEMORY, - sc->aac_regs_rid1, sc->aac_regs_res1); - sc->aac_regs_res1 = bus_alloc_resource( - sc->aac_dev, SYS_RES_MEMORY, &sc->aac_regs_rid1, - 0ul, ~0ul, atu_size, RF_ACTIVE); + atu_size > rman_get_size(sc->aac_regs_res1)) { + rid = rman_get_rid(sc->aac_regs_res1); + bus_release_resource(sc->aac_dev, SYS_RES_MEMORY, rid, + sc->aac_regs_res1); + sc->aac_regs_res1 = bus_alloc_resource(sc->aac_dev, + SYS_RES_MEMORY, &rid, 0ul, ~0ul, atu_size, RF_ACTIVE); if (sc->aac_regs_res1 == NULL) { sc->aac_regs_res1 = bus_alloc_resource_any( - sc->aac_dev, SYS_RES_MEMORY, - &sc->aac_regs_rid1, RF_ACTIVE); + sc->aac_dev, SYS_RES_MEMORY, &rid, RF_ACTIVE); if (sc->aac_regs_res1 == NULL) { device_printf(sc->aac_dev, "couldn't allocate register window\n"); @@ -1799,7 +1794,6 @@ aac_check_firmware(struct aac_softc *sc) if (sc->aac_hwif == AAC_HWIF_NARK) { sc->aac_regs_res0 = sc->aac_regs_res1; - sc->aac_regs_rid0 = sc->aac_regs_rid1; sc->aac_btag0 = sc->aac_btag1; sc->aac_bhandle0 = sc->aac_bhandle1; } @@ -2003,14 +1997,7 @@ out: static int aac_setup_intr(struct aac_softc *sc) { - sc->aac_irq_rid = 0; - if ((sc->aac_irq = bus_alloc_resource_any(sc->aac_dev, SYS_RES_IRQ, - &sc->aac_irq_rid, - RF_SHAREABLE | - RF_ACTIVE)) == NULL) { - device_printf(sc->aac_dev, "can't allocate interrupt\n"); - return (EINVAL); - } + if (sc->flags & AAC_FLAGS_NEW_COMM) { if (bus_setup_intr(sc->aac_dev, sc->aac_irq, INTR_MPSAFE|INTR_TYPE_BIO, NULL, @@ -2119,7 +2106,7 @@ aac_sync_fib(struct aac_softc *sc, u_int * Note that the queue implementation here is a little funky; neither the PI or * CI will ever be zero. This behaviour is a controller feature. */ -static struct { +static const struct { int size; int notify; } aac_qinfo[] = { @@ -2786,8 +2773,8 @@ aac_describe_controller(struct aac_softc * Look up a text description of a numeric error code and return a pointer to * same. */ -static char * -aac_describe_code(struct aac_code_lookup *table, u_int32_t code) +static const char * +aac_describe_code(const struct aac_code_lookup *table, u_int32_t code) { int i; Modified: stable/9/sys/dev/aac/aac_cam.c ============================================================================== --- stable/9/sys/dev/aac/aac_cam.c Tue May 28 20:57:40 2013 (r251069) +++ stable/9/sys/dev/aac/aac_cam.c Tue May 28 20:58:57 2013 (r251070) @@ -92,7 +92,7 @@ static device_method_t aac_pass_methods[ DEVMETHOD(device_probe, aac_cam_probe), DEVMETHOD(device_attach, aac_cam_attach), DEVMETHOD(device_detach, aac_cam_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t aac_pass_driver = { @@ -101,7 +101,7 @@ static driver_t aac_pass_driver = { sizeof(struct aac_cam) }; -DRIVER_MODULE(aacp, aac, aac_pass_driver, aac_pass_devclass, 0, 0); +DRIVER_MODULE(aacp, aac, aac_pass_driver, aac_pass_devclass, NULL, NULL); MODULE_DEPEND(aacp, cam, 1, 1, 1); static MALLOC_DEFINE(M_AACCAM, "aaccam", "AAC CAM info"); @@ -683,4 +683,3 @@ aac_cam_term_io(struct cam_sim *sim, uni { return (CAM_UA_TERMIO); } - Modified: stable/9/sys/dev/aac/aac_disk.c ============================================================================== --- stable/9/sys/dev/aac/aac_disk.c Tue May 28 20:57:40 2013 (r251069) +++ stable/9/sys/dev/aac/aac_disk.c Tue May 28 20:58:57 2013 (r251070) @@ -73,7 +73,7 @@ static device_method_t aac_disk_methods[ DEVMETHOD(device_probe, aac_disk_probe), DEVMETHOD(device_attach, aac_disk_attach), DEVMETHOD(device_detach, aac_disk_detach), - { 0, 0 } + DEVMETHOD_END }; static driver_t aac_disk_driver = { @@ -82,7 +82,7 @@ static driver_t aac_disk_driver = { sizeof(struct aac_disk) }; -DRIVER_MODULE(aacd, aac, aac_disk_driver, aac_disk_devclass, 0, 0); +DRIVER_MODULE(aacd, aac, aac_disk_driver, aac_disk_devclass, NULL, NULL); /* * Handle open from generic layer. Modified: stable/9/sys/dev/aac/aac_pci.c ============================================================================== --- stable/9/sys/dev/aac/aac_pci.c Tue May 28 20:57:40 2013 (r251069) +++ stable/9/sys/dev/aac/aac_pci.c Tue May 28 20:58:57 2013 (r251070) @@ -60,6 +60,11 @@ __FBSDID("$FreeBSD$"); static int aac_pci_probe(device_t dev); static int aac_pci_attach(device_t dev); +static int aac_enable_msi = 1; +TUNABLE_INT("hw.aac.enable_msi", &aac_enable_msi); +SYSCTL_INT(_hw_aac, OID_AUTO, enable_msi, CTLFLAG_RDTUN, &aac_enable_msi, 0, + "Enable MSI interrupts"); + static device_method_t aac_methods[] = { /* Device interface */ DEVMETHOD(device_probe, aac_pci_probe), @@ -79,11 +84,10 @@ static driver_t aac_pci_driver = { static devclass_t aac_devclass; -DRIVER_MODULE(aac, pci, aac_pci_driver, aac_devclass, 0, 0); +DRIVER_MODULE(aac, pci, aac_pci_driver, aac_devclass, NULL, NULL); MODULE_DEPEND(aac, pci, 1, 1, 1); - -struct aac_ident +static const struct aac_ident { u_int16_t vendor; u_int16_t device; @@ -91,7 +95,7 @@ struct aac_ident u_int16_t subdevice; int hwif; int quirks; - char *desc; + const char *desc; } aac_identifiers[] = { {0x1028, 0x0001, 0x1028, 0x0001, AAC_HWIF_I960RX, 0, "Dell PERC 2/Si"}, @@ -139,7 +143,6 @@ struct aac_ident "Adaptec SCSI RAID 2230S"}, {0x9005, 0x0286, 0x9005, 0x028d, AAC_HWIF_RKT, 0, "Adaptec SCSI RAID 2130S"}, - {0x9005, 0x0285, 0x9005, 0x0287, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB | AAC_FLAGS_256FIBS, "Adaptec SCSI RAID 2200S"}, {0x9005, 0x0285, 0x17aa, 0x0286, AAC_HWIF_I960RX, AAC_FLAGS_NO4GB | @@ -276,7 +279,8 @@ struct aac_ident "AOC-USAS-S8iR-LP"}, {0, 0, 0, 0, 0, 0, 0} }; -struct aac_ident + +static const struct aac_ident aac_family_identifiers[] = { {0x9005, 0x0285, 0, 0, AAC_HWIF_I960RX, 0, "Adaptec RAID Controller"}, @@ -285,10 +289,10 @@ aac_family_identifiers[] = { {0, 0, 0, 0, 0, 0, 0} }; -static struct aac_ident * +static const struct aac_ident * aac_find_ident(device_t dev) { - struct aac_ident *m; + const struct aac_ident *m; u_int16_t vendid, devid, sub_vendid, sub_devid; vendid = pci_get_vendor(dev); @@ -317,7 +321,7 @@ aac_find_ident(device_t dev) static int aac_pci_probe(device_t dev) { - struct aac_ident *id; + const struct aac_ident *id; fwprintf(NULL, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); @@ -335,9 +339,8 @@ static int aac_pci_attach(device_t dev) { struct aac_softc *sc; - struct aac_ident *id; - int error; - u_int32_t command; + const struct aac_ident *id; + int count, error, reg, rid; fwprintf(NULL, HBA_FLAGS_DBG_FUNCTION_ENTRY_B, ""); @@ -345,7 +348,6 @@ aac_pci_attach(device_t dev) * Initialise softc. */ sc = device_get_softc(dev); - bzero(sc, sizeof(*sc)); sc->aac_dev = dev; /* assume failure is 'not configured' */ @@ -354,55 +356,66 @@ aac_pci_attach(device_t dev) /* * Verify that the adapter is correctly set up in PCI space. */ - command = pci_read_config(sc->aac_dev, PCIR_COMMAND, 2); - command |= PCIM_CMD_BUSMASTEREN; - pci_write_config(dev, PCIR_COMMAND, command, 2); - command = pci_read_config(sc->aac_dev, PCIR_COMMAND, 2); - if (!(command & PCIM_CMD_BUSMASTEREN)) { - device_printf(sc->aac_dev, "can't enable bus-master feature\n"); - goto out; - } - if ((command & PCIM_CMD_MEMEN) == 0) { - device_printf(sc->aac_dev, "memory window not available\n"); + pci_enable_busmaster(dev); + if (!(pci_read_config(dev, PCIR_COMMAND, 2) & PCIM_CMD_BUSMASTEREN)) { + device_printf(dev, "can't enable bus-master feature\n"); goto out; } /* - * Allocate the PCI register window. + * Allocate the PCI register window(s). */ - sc->aac_regs_rid0 = PCIR_BAR(0); - if ((sc->aac_regs_res0 = bus_alloc_resource_any(sc->aac_dev, - SYS_RES_MEMORY, &sc->aac_regs_rid0, RF_ACTIVE)) == NULL) { - device_printf(sc->aac_dev, - "couldn't allocate register window 0\n"); + rid = PCIR_BAR(0); + if ((sc->aac_regs_res0 = bus_alloc_resource_any(dev, + SYS_RES_MEMORY, &rid, RF_ACTIVE)) == NULL) { + device_printf(dev, "can't allocate register window 0\n"); goto out; } sc->aac_btag0 = rman_get_bustag(sc->aac_regs_res0); sc->aac_bhandle0 = rman_get_bushandle(sc->aac_regs_res0); if (sc->aac_hwif == AAC_HWIF_NARK) { - sc->aac_regs_rid1 = PCIR_BAR(1); - if ((sc->aac_regs_res1 = bus_alloc_resource_any(sc->aac_dev, - SYS_RES_MEMORY, &sc->aac_regs_rid1, RF_ACTIVE)) == NULL) { - device_printf(sc->aac_dev, - "couldn't allocate register window 1\n"); + rid = PCIR_BAR(1); + if ((sc->aac_regs_res1 = bus_alloc_resource_any(dev, + SYS_RES_MEMORY, &rid, RF_ACTIVE)) == NULL) { + device_printf(dev, + "can't allocate register window 1\n"); goto out; } sc->aac_btag1 = rman_get_bustag(sc->aac_regs_res1); sc->aac_bhandle1 = rman_get_bushandle(sc->aac_regs_res1); } else { sc->aac_regs_res1 = sc->aac_regs_res0; - sc->aac_regs_rid1 = sc->aac_regs_rid0; sc->aac_btag1 = sc->aac_btag0; sc->aac_bhandle1 = sc->aac_bhandle0; } /* + * Allocate the interrupt. + */ + rid = 0; + count = 0; + if (aac_enable_msi != 0 && pci_find_cap(dev, PCIY_MSI, ®) == 0) { + count = pci_msi_count(dev); + if (count > 1) + count = 1; + else + count = 0; + if (count == 1 && pci_alloc_msi(dev, &count) == 0) + rid = 1; + } + if ((sc->aac_irq = bus_alloc_resource_any(sc->aac_dev, SYS_RES_IRQ, + &rid, RF_ACTIVE | (count != 0 ? 0 : RF_SHAREABLE))) == NULL) { + device_printf(dev, "can't allocate interrupt\n"); + goto out; + } + + /* * Allocate the parent bus DMA tag appropriate for our PCI interface. * * Note that some of these controllers are 64-bit capable. */ - if (bus_dma_tag_create(bus_get_dma_tag(sc->aac_dev), /* parent */ + if (bus_dma_tag_create(bus_get_dma_tag(dev), /* parent */ PAGE_SIZE, 0, /* algnmnt, boundary */ BUS_SPACE_MAXADDR, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ @@ -413,7 +426,7 @@ aac_pci_attach(device_t dev) 0, /* flags */ NULL, NULL, /* No locking needed */ &sc->aac_parent_dmat)) { - device_printf(sc->aac_dev, "can't allocate parent DMA tag\n"); + device_printf(dev, "can't allocate parent DMA tag\n"); goto out; } @@ -427,19 +440,19 @@ aac_pci_attach(device_t dev) case AAC_HWIF_I960RX: case AAC_HWIF_NARK: fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for i960Rx/NARK"); - sc->aac_if = aac_rx_interface; + sc->aac_if = &aac_rx_interface; break; case AAC_HWIF_STRONGARM: fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for StrongARM"); - sc->aac_if = aac_sa_interface; + sc->aac_if = &aac_sa_interface; break; case AAC_HWIF_RKT: fwprintf(sc, HBA_FLAGS_DBG_INIT_B, "set hardware up for Rocket/MIPS"); - sc->aac_if = aac_rkt_interface; + sc->aac_if = &aac_rkt_interface; break; default: sc->aac_hwif = AAC_HWIF_UNKNOWN; - device_printf(sc->aac_dev, "unknown hardware type\n"); + device_printf(dev, "unknown hardware type\n"); error = ENXIO; goto out; } @@ -472,7 +485,7 @@ static device_method_t aacch_methods[] = DEVMETHOD(device_probe, aacch_probe), DEVMETHOD(device_attach, aacch_attach), DEVMETHOD(device_detach, aacch_detach), - { 0, 0 } + DEVMETHOD_END }; struct aacch_softc { @@ -486,7 +499,7 @@ static driver_t aacch_driver = { }; static devclass_t aacch_devclass; -DRIVER_MODULE(aacch, pci, aacch_driver, aacch_devclass, 0, 0); +DRIVER_MODULE(aacch, pci, aacch_driver, aacch_devclass, NULL, NULL); static int aacch_probe(device_t dev) Modified: stable/9/sys/dev/aac/aac_tables.h ============================================================================== --- stable/9/sys/dev/aac/aac_tables.h Tue May 28 20:57:40 2013 (r251069) +++ stable/9/sys/dev/aac/aac_tables.h Tue May 28 20:58:57 2013 (r251070) @@ -27,13 +27,14 @@ * $FreeBSD$ */ +#if 0 /* * Status codes for block read/write commands, etc. * * XXX many of these would not normally be returned, as they are * relevant only to FSA operations. */ -static struct aac_code_lookup aac_command_status_table[] = { +static const struct aac_code_lookup aac_command_status_table[] = { {"OK", ST_OK}, {"operation not permitted", ST_PERM}, {"not found", ST_NOENT}, @@ -75,8 +76,9 @@ static struct aac_code_lookup aac_comman }; #define AAC_COMMAND_STATUS(x) aac_describe_code(aac_command_status_table, x) +#endif -static struct aac_code_lookup aac_cpu_variant[] = { +static const struct aac_code_lookup aac_cpu_variant[] = { {"i960JX", CPUI960_JX}, {"i960CX", CPUI960_CX}, {"i960HX", CPUI960_HX}, @@ -93,7 +95,7 @@ static struct aac_code_lookup aac_cpu_va {"Unknown processor", 0} }; -static struct aac_code_lookup aac_battery_platform[] = { +static const struct aac_code_lookup aac_battery_platform[] = { {"required battery present", PLATFORM_BAT_REQ_PRESENT}, {"REQUIRED BATTERY NOT PRESENT", PLATFORM_BAT_REQ_NOTPRESENT}, {"optional battery present", PLATFORM_BAT_OPT_PRESENT}, @@ -103,7 +105,7 @@ static struct aac_code_lookup aac_batter {"unknown battery platform", 0} }; -static struct aac_code_lookup aac_container_types[] = { +static const struct aac_code_lookup aac_container_types[] = { {"Volume", CT_VOLUME}, {"RAID 1 (Mirror)", CT_MIRROR}, {"RAID 0 (Stripe)", CT_STRIPE}, @@ -126,4 +128,3 @@ static struct aac_code_lookup aac_contai {NULL, 0}, {"unknown", 0} }; - Modified: stable/9/sys/dev/aac/aacvar.h ============================================================================== --- stable/9/sys/dev/aac/aacvar.h Tue May 28 20:57:40 2013 (r251069) +++ stable/9/sys/dev/aac/aacvar.h Tue May 28 20:58:57 2013 (r251070) @@ -33,10 +33,13 @@ #include #include #include -#include #include +#include +#include #include +SYSCTL_DECL(_hw_aac); + #define AAC_TYPE_DEVO 1 #define AAC_TYPE_ALPHA 2 #define AAC_TYPE_BETA 3 @@ -242,28 +245,28 @@ struct aac_interface int (*aif_get_outb_queue)(struct aac_softc *sc); void (*aif_set_outb_queue)(struct aac_softc *sc, int index); }; -extern struct aac_interface aac_rx_interface; -extern struct aac_interface aac_sa_interface; -extern struct aac_interface aac_fa_interface; -extern struct aac_interface aac_rkt_interface; - -#define AAC_GET_FWSTATUS(sc) ((sc)->aac_if.aif_get_fwstatus((sc))) -#define AAC_QNOTIFY(sc, qbit) ((sc)->aac_if.aif_qnotify((sc), (qbit))) -#define AAC_GET_ISTATUS(sc) ((sc)->aac_if.aif_get_istatus((sc))) -#define AAC_CLEAR_ISTATUS(sc, mask) ((sc)->aac_if.aif_clr_istatus((sc), \ +extern const struct aac_interface aac_rx_interface; +extern const struct aac_interface aac_sa_interface; +extern const struct aac_interface aac_fa_interface; +extern const struct aac_interface aac_rkt_interface; + +#define AAC_GET_FWSTATUS(sc) ((sc)->aac_if->aif_get_fwstatus((sc))) +#define AAC_QNOTIFY(sc, qbit) ((sc)->aac_if->aif_qnotify((sc), (qbit))) +#define AAC_GET_ISTATUS(sc) ((sc)->aac_if->aif_get_istatus((sc))) +#define AAC_CLEAR_ISTATUS(sc, mask) ((sc)->aac_if->aif_clr_istatus((sc), \ (mask))) #define AAC_SET_MAILBOX(sc, command, arg0, arg1, arg2, arg3) \ - ((sc)->aac_if.aif_set_mailbox((sc), (command), (arg0), (arg1), (arg2), \ + ((sc)->aac_if->aif_set_mailbox((sc), (command), (arg0), (arg1), (arg2), \ (arg3))) -#define AAC_GET_MAILBOX(sc, mb) ((sc)->aac_if.aif_get_mailbox((sc), \ +#define AAC_GET_MAILBOX(sc, mb) ((sc)->aac_if->aif_get_mailbox((sc), \ (mb))) -#define AAC_MASK_INTERRUPTS(sc) ((sc)->aac_if.aif_set_interrupts((sc), \ +#define AAC_MASK_INTERRUPTS(sc) ((sc)->aac_if->aif_set_interrupts((sc), \ 0)) -#define AAC_UNMASK_INTERRUPTS(sc) ((sc)->aac_if.aif_set_interrupts((sc), \ +#define AAC_UNMASK_INTERRUPTS(sc) ((sc)->aac_if->aif_set_interrupts((sc), \ 1)) -#define AAC_SEND_COMMAND(sc, cm) ((sc)->aac_if.aif_send_command((sc), (cm))) -#define AAC_GET_OUTB_QUEUE(sc) ((sc)->aac_if.aif_get_outb_queue((sc))) -#define AAC_SET_OUTB_QUEUE(sc, idx) ((sc)->aac_if.aif_set_outb_queue((sc), (idx))) +#define AAC_SEND_COMMAND(sc, cm) ((sc)->aac_if->aif_send_command((sc), (cm))) +#define AAC_GET_OUTB_QUEUE(sc) ((sc)->aac_if->aif_get_outb_queue((sc))) +#define AAC_SET_OUTB_QUEUE(sc, idx) ((sc)->aac_if->aif_set_outb_queue((sc), (idx))) #define AAC_MEM0_SETREG4(sc, reg, val) bus_space_write_4(sc->aac_btag0, \ sc->aac_bhandle0, reg, val) @@ -307,14 +310,12 @@ struct aac_softc /* bus connections */ device_t aac_dev; struct resource *aac_regs_res0, *aac_regs_res1; /* reg. if. window */ - int aac_regs_rid0, aac_regs_rid1; /* resource ID */ bus_space_handle_t aac_bhandle0, aac_bhandle1; /* bus space handle */ bus_space_tag_t aac_btag0, aac_btag1; /* bus space tag */ bus_dma_tag_t aac_parent_dmat; /* parent DMA tag */ bus_dma_tag_t aac_buffer_dmat; /* data buffer/command * DMA tag */ struct resource *aac_irq; /* interrupt */ - int aac_irq_rid; void *aac_intr; /* interrupt handle */ eventhandler_tag eh; @@ -339,7 +340,7 @@ struct aac_softc * DMA map */ struct aac_common *aac_common; u_int32_t aac_common_busaddr; - struct aac_interface aac_if; + const struct aac_interface *aac_if; /* command/fib resources */ bus_dma_tag_t aac_fib_dmat; /* DMA tag for allocing FIBs */ @@ -499,7 +500,7 @@ extern void aac_print_aif(struct aac_sof #endif struct aac_code_lookup { - char *string; + const char *string; u_int32_t code; }; @@ -581,7 +582,6 @@ aac_remove_ ## name (struct aac_command cm->cm_flags &= ~AAC_ON_ ## index; \ AACQ_REMOVE(cm->cm_sc, index); \ } \ -struct hack AACQ_COMMAND_QUEUE(free, AACQ_FREE); AACQ_COMMAND_QUEUE(ready, AACQ_READY); @@ -644,4 +644,3 @@ aac_release_sync_fib(struct aac_softc *s mtx_assert(&sc->aac_io_lock, MA_OWNED); } - From owner-svn-src-stable@FreeBSD.ORG Tue May 28 23:33:05 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7A7F4846; Tue, 28 May 2013 23:33:05 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5CEA32A8; Tue, 28 May 2013 23:33:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SNX5CB096037; Tue, 28 May 2013 23:33:05 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SNX4aT096026; Tue, 28 May 2013 23:33:04 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201305282333.r4SNX4aT096026@svn.freebsd.org> From: Marius Strobl Date: Tue, 28 May 2013 23:33:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251081 - in stable/9/sys: cam cam/ata dev/ata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 23:33:05 -0000 Author: marius Date: Tue May 28 23:33:03 2013 New Revision: 251081 URL: http://svnweb.freebsd.org/changeset/base/251081 Log: MFC: r249199 Unbreak ATA_NO_48BIT_DMA with ATA_CAM by treating 48-bit DMA as an optional property with PATA transport. Reviewed by: mav Modified: stable/9/sys/cam/ata/ata_all.h stable/9/sys/cam/ata/ata_da.c stable/9/sys/cam/ata/ata_xpt.c stable/9/sys/cam/cam_ccb.h stable/9/sys/dev/ata/ata-all.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/cam/ata/ata_all.h ============================================================================== --- stable/9/sys/cam/ata/ata_all.h Tue May 28 23:23:56 2013 (r251080) +++ stable/9/sys/cam/ata/ata_all.h Tue May 28 23:33:03 2013 (r251081) @@ -35,8 +35,9 @@ struct ccb_ataio; struct cam_periph; union ccb; -#define SID_AEN 0x04 /* Abuse inq_flags bit to track enabled AEN. */ -#define SID_DMA 0x10 /* Abuse inq_flags bit to track enabled DMA. */ +#define SID_DMA48 0x01 /* Abuse inq_flags bit to track enabled DMA48. */ +#define SID_AEN 0x04 /* Abuse inq_flags bit to track enabled AEN. */ +#define SID_DMA 0x10 /* Abuse inq_flags bit to track enabled DMA. */ struct ata_cmd { u_int8_t flags; /* ATA command flags */ Modified: stable/9/sys/cam/ata/ata_da.c ============================================================================== --- stable/9/sys/cam/ata/ata_da.c Tue May 28 23:23:56 2013 (r251080) +++ stable/9/sys/cam/ata/ata_da.c Tue May 28 23:33:03 2013 (r251081) @@ -75,18 +75,19 @@ typedef enum { } ada_state; typedef enum { - ADA_FLAG_PACK_INVALID = 0x001, - ADA_FLAG_CAN_48BIT = 0x002, - ADA_FLAG_CAN_FLUSHCACHE = 0x004, - ADA_FLAG_CAN_NCQ = 0x008, - ADA_FLAG_CAN_DMA = 0x010, - ADA_FLAG_NEED_OTAG = 0x020, - ADA_FLAG_WENT_IDLE = 0x040, - ADA_FLAG_CAN_TRIM = 0x080, - ADA_FLAG_OPEN = 0x100, - ADA_FLAG_SCTX_INIT = 0x200, - ADA_FLAG_CAN_CFA = 0x400, - ADA_FLAG_CAN_POWERMGT = 0x800 + ADA_FLAG_PACK_INVALID = 0x0001, + ADA_FLAG_CAN_48BIT = 0x0002, + ADA_FLAG_CAN_FLUSHCACHE = 0x0004, + ADA_FLAG_CAN_NCQ = 0x0008, + ADA_FLAG_CAN_DMA = 0x0010, + ADA_FLAG_NEED_OTAG = 0x0020, + ADA_FLAG_WENT_IDLE = 0x0040, + ADA_FLAG_CAN_TRIM = 0x0080, + ADA_FLAG_OPEN = 0x0100, + ADA_FLAG_SCTX_INIT = 0x0200, + ADA_FLAG_CAN_CFA = 0x0400, + ADA_FLAG_CAN_POWERMGT = 0x0800, + ADA_FLAG_CAN_DMA48 = 0x1000 } ada_flags; typedef enum { @@ -907,6 +908,15 @@ adaasync(void *callback_arg, u_int32_t c softc->flags |= ADA_FLAG_CAN_DMA; else softc->flags &= ~ADA_FLAG_CAN_DMA; + if (cgd.ident_data.support.command2 & ATA_SUPPORT_ADDRESS48) { + softc->flags |= ADA_FLAG_CAN_48BIT; + if (cgd.inq_flags & SID_DMA48) + softc->flags |= ADA_FLAG_CAN_DMA48; + else + softc->flags &= ~ADA_FLAG_CAN_DMA48; + } else + softc->flags &= ~(ADA_FLAG_CAN_48BIT | + ADA_FLAG_CAN_DMA48); if ((cgd.ident_data.satacapabilities & ATA_SUPPORT_NCQ) && (cgd.inq_flags & SID_DMA) && (cgd.inq_flags & SID_CmdQue)) softc->flags |= ADA_FLAG_CAN_NCQ; @@ -1071,8 +1081,11 @@ adaregister(struct cam_periph *periph, v if ((cgd->ident_data.capabilities1 & ATA_SUPPORT_DMA) && (cgd->inq_flags & SID_DMA)) softc->flags |= ADA_FLAG_CAN_DMA; - if (cgd->ident_data.support.command2 & ATA_SUPPORT_ADDRESS48) + if (cgd->ident_data.support.command2 & ATA_SUPPORT_ADDRESS48) { softc->flags |= ADA_FLAG_CAN_48BIT; + if (cgd->inq_flags & SID_DMA48) + softc->flags |= ADA_FLAG_CAN_DMA48; + } if (cgd->ident_data.support.command2 & ATA_SUPPORT_FLUSHCACHE) softc->flags |= ADA_FLAG_CAN_FLUSHCACHE; if (cgd->ident_data.support.command1 & ATA_SUPPORT_POWERMGT) @@ -1462,7 +1475,7 @@ adastart(struct cam_periph *periph, unio } else if ((softc->flags & ADA_FLAG_CAN_48BIT) && (lba + count >= ATA_MAX_28BIT_LBA || count > 256)) { - if (softc->flags & ADA_FLAG_CAN_DMA) { + if (softc->flags & ADA_FLAG_CAN_DMA48) { if (bp->bio_cmd == BIO_READ) { ata_48bit_cmd(ataio, ATA_READ_DMA48, 0, lba, count); Modified: stable/9/sys/cam/ata/ata_xpt.c ============================================================================== --- stable/9/sys/cam/ata/ata_xpt.c Tue May 28 23:23:56 2013 (r251080) +++ stable/9/sys/cam/ata/ata_xpt.c Tue May 28 23:33:03 2013 (r251081) @@ -965,19 +965,22 @@ noerror: xpt_schedule(periph, priority); return; case PROBE_SETMODE: - if (path->device->transport != XPORT_SATA) - goto notsata; /* Set supported bits. */ bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; xpt_action((union ccb *)&cts); - if (cts.xport_specific.sata.valid & CTS_SATA_VALID_CAPS) + if (path->device->transport == XPORT_SATA && + cts.xport_specific.sata.valid & CTS_SATA_VALID_CAPS) caps = cts.xport_specific.sata.caps & CTS_SATA_CAPS_H; + else if (path->device->transport == XPORT_ATA && + cts.xport_specific.ata.valid & CTS_ATA_VALID_CAPS) + caps = cts.xport_specific.ata.caps & CTS_ATA_CAPS_H; else caps = 0; - if (ident_buf->satacapabilities != 0xffff) { + if (path->device->transport == XPORT_SATA && + ident_buf->satacapabilities != 0xffff) { if (ident_buf->satacapabilities & ATA_SUPPORT_IFPWRMNGTRCV) caps |= CTS_SATA_CAPS_D_PMREQ; if (ident_buf->satacapabilities & ATA_SUPPORT_HAPST) @@ -989,19 +992,42 @@ noerror: cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; cts.type = CTS_TYPE_USER_SETTINGS; xpt_action((union ccb *)&cts); - if (cts.xport_specific.sata.valid & CTS_SATA_VALID_CAPS) + if (path->device->transport == XPORT_SATA && + cts.xport_specific.sata.valid & CTS_SATA_VALID_CAPS) caps &= cts.xport_specific.sata.caps; + else if (path->device->transport == XPORT_ATA && + cts.xport_specific.ata.valid & CTS_ATA_VALID_CAPS) + caps &= cts.xport_specific.ata.caps; else caps = 0; + /* + * Remember what transport thinks about 48-bit DMA. If + * capability information is not provided or transport is + * SATA, we take support for granted. + */ + if (!(path->device->inq_flags & SID_DMA) || + (path->device->transport == XPORT_ATA && + (cts.xport_specific.ata.valid & CTS_ATA_VALID_CAPS) && + !(caps & CTS_ATA_CAPS_H_DMA48))) + path->device->inq_flags &= ~SID_DMA48; + else + path->device->inq_flags |= SID_DMA48; /* Store result to SIM. */ bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_SET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; - cts.xport_specific.sata.caps = caps; - cts.xport_specific.sata.valid = CTS_SATA_VALID_CAPS; + if (path->device->transport == XPORT_SATA) { + cts.xport_specific.sata.caps = caps; + cts.xport_specific.sata.valid = CTS_SATA_VALID_CAPS; + } else { + cts.xport_specific.ata.caps = caps; + cts.xport_specific.ata.valid = CTS_ATA_VALID_CAPS; + } xpt_action((union ccb *)&cts); softc->caps = caps; + if (path->device->transport != XPORT_SATA) + goto notsata; if ((ident_buf->satasupport & ATA_SUPPORT_IFPWRMNGT) && (!(softc->caps & CTS_SATA_CAPS_H_PMREQ)) != (!(ident_buf->sataenabled & ATA_SUPPORT_IFPWRMNGT))) { @@ -1154,6 +1180,11 @@ notsata: caps &= cts.xport_specific.sata.caps; else caps = 0; + /* Remember what transport thinks about AEN. */ + if (caps & CTS_SATA_CAPS_H_AN) + path->device->inq_flags |= SID_AEN; + else + path->device->inq_flags &= ~SID_AEN; /* Store result to SIM. */ bzero(&cts, sizeof(cts)); xpt_setup_ccb(&cts.ccb_h, path, CAM_PRIORITY_NONE); @@ -1163,11 +1194,6 @@ notsata: cts.xport_specific.sata.valid = CTS_SATA_VALID_CAPS; xpt_action((union ccb *)&cts); softc->caps = caps; - /* Remember what transport thinks about AEN. */ - if (softc->caps & CTS_SATA_CAPS_H_AN) - path->device->inq_flags |= SID_AEN; - else - path->device->inq_flags &= ~SID_AEN; xpt_async(AC_GETDEV_CHANGED, path, NULL); if (periph->path->device->flags & CAM_DEV_UNCONFIGURED) { path->device->flags &= ~CAM_DEV_UNCONFIGURED; @@ -2077,4 +2103,3 @@ ata_announce_periph(struct cam_periph *p } printf("\n"); } - Modified: stable/9/sys/cam/cam_ccb.h ============================================================================== --- stable/9/sys/cam/cam_ccb.h Tue May 28 23:23:56 2013 (r251080) +++ stable/9/sys/cam/cam_ccb.h Tue May 28 23:33:03 2013 (r251081) @@ -892,9 +892,14 @@ struct ccb_trans_settings_pata { #define CTS_ATA_VALID_MODE 0x01 #define CTS_ATA_VALID_BYTECOUNT 0x02 #define CTS_ATA_VALID_ATAPI 0x20 +#define CTS_ATA_VALID_CAPS 0x40 int mode; /* Mode */ u_int bytecount; /* Length of PIO transaction */ u_int atapi; /* Length of ATAPI CDB */ + u_int caps; /* Device and host SATA caps. */ +#define CTS_ATA_CAPS_H 0x0000ffff +#define CTS_ATA_CAPS_H_DMA48 0x00000001 /* 48-bit DMA */ +#define CTS_ATA_CAPS_D 0xffff0000 }; struct ccb_trans_settings_sata { Modified: stable/9/sys/dev/ata/ata-all.c ============================================================================== --- stable/9/sys/dev/ata/ata-all.c Tue May 28 23:23:56 2013 (r251080) +++ stable/9/sys/dev/ata/ata-all.c Tue May 28 23:33:03 2013 (r251081) @@ -201,10 +201,15 @@ ata_attach(device_t dev) ch->user[i].bytecount = MAXPHYS; ch->user[i].caps = 0; ch->curr[i] = ch->user[i]; - if (ch->pm_level > 0) - ch->user[i].caps |= CTS_SATA_CAPS_H_PMREQ; - if (ch->pm_level > 1) - ch->user[i].caps |= CTS_SATA_CAPS_D_PMREQ; + if (ch->flags & ATA_SATA) { + if (ch->pm_level > 0) + ch->user[i].caps |= CTS_SATA_CAPS_H_PMREQ; + if (ch->pm_level > 1) + ch->user[i].caps |= CTS_SATA_CAPS_D_PMREQ; + } else { + if (!(ch->flags & ATA_NO_48BIT_DMA)) + ch->user[i].caps |= CTS_ATA_CAPS_H_DMA48; + } } callout_init(&ch->poll_callout, 1); #endif @@ -1797,6 +1802,8 @@ ataaction(struct cam_sim *sim, union ccb d->bytecount = cts->xport_specific.ata.bytecount; if (cts->xport_specific.ata.valid & CTS_ATA_VALID_ATAPI) d->atapi = cts->xport_specific.ata.atapi; + if (cts->xport_specific.ata.valid & CTS_ATA_VALID_CAPS) + d->caps = cts->xport_specific.ata.caps; } ccb->ccb_h.status = CAM_REQ_CMP; break; @@ -1837,14 +1844,12 @@ ataaction(struct cam_sim *sim, union ccb } cts->xport_specific.sata.caps &= ch->user[ccb->ccb_h.target_id].caps; - cts->xport_specific.sata.valid |= - CTS_SATA_VALID_CAPS; } else { cts->xport_specific.sata.revision = d->revision; cts->xport_specific.sata.valid |= CTS_SATA_VALID_REVISION; cts->xport_specific.sata.caps = d->caps; - cts->xport_specific.sata.valid |= CTS_SATA_VALID_CAPS; } + cts->xport_specific.sata.valid |= CTS_SATA_VALID_CAPS; cts->xport_specific.sata.atapi = d->atapi; cts->xport_specific.sata.valid |= CTS_SATA_VALID_ATAPI; } else { @@ -1855,6 +1860,17 @@ ataaction(struct cam_sim *sim, union ccb cts->xport_specific.ata.valid |= CTS_ATA_VALID_MODE; cts->xport_specific.ata.bytecount = d->bytecount; cts->xport_specific.ata.valid |= CTS_ATA_VALID_BYTECOUNT; + if (cts->type == CTS_TYPE_CURRENT_SETTINGS) { + cts->xport_specific.ata.caps = + d->caps & CTS_ATA_CAPS_D; + if (!(ch->flags & ATA_NO_48BIT_DMA)) + cts->xport_specific.ata.caps |= + CTS_ATA_CAPS_H_DMA48; + cts->xport_specific.ata.caps &= + ch->user[ccb->ccb_h.target_id].caps; + } else + cts->xport_specific.ata.caps = d->caps; + cts->xport_specific.ata.valid |= CTS_ATA_VALID_CAPS; cts->xport_specific.ata.atapi = d->atapi; cts->xport_specific.ata.valid |= CTS_ATA_VALID_ATAPI; } From owner-svn-src-stable@FreeBSD.ORG Tue May 28 23:43:12 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4859ED85; Tue, 28 May 2013 23:43:12 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2095934E; Tue, 28 May 2013 23:43:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4SNhC9Q099541; Tue, 28 May 2013 23:43:12 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4SNhCXp099540; Tue, 28 May 2013 23:43:12 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201305282343.r4SNhCXp099540@svn.freebsd.org> From: Marius Strobl Date: Tue, 28 May 2013 23:43:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251083 - stable/9/usr.sbin/rarpd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2013 23:43:12 -0000 Author: marius Date: Tue May 28 23:43:11 2013 New Revision: 251083 URL: http://svnweb.freebsd.org/changeset/base/251083 Log: MFC: r249234 Add some missing newlines and static declarations. Modified: stable/9/usr.sbin/rarpd/rarpd.c Directory Properties: stable/9/usr.sbin/rarpd/ (props changed) Modified: stable/9/usr.sbin/rarpd/rarpd.c ============================================================================== --- stable/9/usr.sbin/rarpd/rarpd.c Tue May 28 23:38:06 2013 (r251082) +++ stable/9/usr.sbin/rarpd/rarpd.c Tue May 28 23:43:11 2013 (r251083) @@ -90,13 +90,13 @@ struct if_info { * The list of all interfaces that are being listened to. rarp_loop() * "selects" on the descriptors in this list. */ -struct if_info *iflist; +static struct if_info *iflist; -int verbose; /* verbose messages */ -const char *tftp_dir = TFTP_DIR; /* tftp directory */ +static int verbose; /* verbose messages */ +static const char *tftp_dir = TFTP_DIR; /* tftp directory */ -int dflag; /* messages to stdout/stderr, not syslog(3) */ -int sflag; /* ignore /tftpboot */ +static int dflag; /* messages to stdout/stderr, not syslog(3) */ +static int sflag; /* ignore /tftpboot */ static u_char zero[6]; @@ -309,6 +309,7 @@ init_one(struct ifaddrs *ifa, char *targ break; } } + /* * Initialize all "candidate" interfaces that are in the system * configuration list. A "candidate" is up, not loopback and not @@ -370,6 +371,7 @@ init(char *target) static void usage(void) { + (void)fprintf(stderr, "%s\n%s\n", "usage: rarpd -a [-dfsv] [-t directory] [-P pidfile]", " rarpd [-dfsv] [-t directory] [-P pidfile] interface"); @@ -631,6 +633,7 @@ rarp_bootable_err: static in_addr_t choose_ipaddr(in_addr_t **alist, in_addr_t net, in_addr_t netmask) { + for (; *alist; ++alist) if ((**alist & netmask) == net) return **alist; @@ -693,17 +696,19 @@ rarp_process(struct if_info *ii, u_char * host (i.e. the guy running rarpd), won't try to ARP for the hardware * address of the guy being booted (he cannot answer the ARP). */ -struct sockaddr_inarp sin_inarp = { +static struct sockaddr_inarp sin_inarp = { sizeof(struct sockaddr_inarp), AF_INET, 0, {0}, {0}, 0, 0 }; -struct sockaddr_dl sin_dl = { + +static struct sockaddr_dl sin_dl = { sizeof(struct sockaddr_dl), AF_LINK, 0, IFT_ETHER, 0, 6, 0, "" }; -struct { + +static struct { struct rt_msghdr rthdr; char rtspace[512]; } rtmsg; @@ -885,6 +890,7 @@ rarp_reply(struct if_info *ii, struct et static in_addr_t ipaddrtonetmask(in_addr_t addr) { + addr = ntohl(addr); if (IN_CLASSA(addr)) return htonl(IN_CLASSA_NET); From owner-svn-src-stable@FreeBSD.ORG Wed May 29 00:18:12 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D43AABDA; Wed, 29 May 2013 00:18:12 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C6190785; Wed, 29 May 2013 00:18:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T0ICu2011426; Wed, 29 May 2013 00:18:12 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T0ICAu011425; Wed, 29 May 2013 00:18:12 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201305290018.r4T0ICAu011425@svn.freebsd.org> From: Bryan Drewery Date: Wed, 29 May 2013 00:18:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251087 - stable/9/crypto/openssh X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 00:18:12 -0000 Author: bdrewery (ports committer) Date: Wed May 29 00:18:12 2013 New Revision: 251087 URL: http://svnweb.freebsd.org/changeset/base/251087 Log: MFH r250595: The HPN patch added a new BUG bit for SSH_BUG_LARGEWINDOW and the update to 6.1 added SSH_BUG_DYNAMIC_RPORT with the same value. Fix the HPN SSH_BUG_LARGEWINDOW bit so it is unique. Modified: stable/9/crypto/openssh/compat.h Directory Properties: stable/9/crypto/openssh/ (props changed) Modified: stable/9/crypto/openssh/compat.h ============================================================================== --- stable/9/crypto/openssh/compat.h Tue May 28 23:52:01 2013 (r251086) +++ stable/9/crypto/openssh/compat.h Wed May 29 00:18:12 2013 (r251087) @@ -60,7 +60,7 @@ #define SSH_BUG_RFWD_ADDR 0x02000000 #define SSH_NEW_OPENSSH 0x04000000 #define SSH_BUG_DYNAMIC_RPORT 0x08000000 -#define SSH_BUG_LARGEWINDOW 0x08000000 +#define SSH_BUG_LARGEWINDOW 0x10000000 void enable_compat13(void); void enable_compat20(void); From owner-svn-src-stable@FreeBSD.ORG Wed May 29 04:09:33 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 11D12927; Wed, 29 May 2013 04:09:33 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 03C00220; Wed, 29 May 2013 04:09:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T49Wk9093759; Wed, 29 May 2013 04:09:32 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T49Wpa093758; Wed, 29 May 2013 04:09:32 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201305290409.r4T49Wpa093758@svn.freebsd.org> From: Alexander Motin Date: Wed, 29 May 2013 04:09:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251092 - stable/9/sys/dev/mps X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 04:09:33 -0000 Author: mav Date: Wed May 29 04:09:32 2013 New Revision: 251092 URL: http://svnweb.freebsd.org/changeset/base/251092 Log: MFC r250900: Fix NULL-dereference kernel panic in case of mps_attach() failure. Modified: stable/9/sys/dev/mps/mps_user.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/mps/mps_user.c ============================================================================== --- stable/9/sys/dev/mps/mps_user.c Wed May 29 01:54:10 2013 (r251091) +++ stable/9/sys/dev/mps/mps_user.c Wed May 29 04:09:32 2013 (r251092) @@ -208,8 +208,8 @@ mps_detach_user(struct mps_softc *sc) { /* XXX: do a purge of pending requests? */ - destroy_dev(sc->mps_cdev); - + if (sc->mps_cdev != NULL) + destroy_dev(sc->mps_cdev); } static int From owner-svn-src-stable@FreeBSD.ORG Wed May 29 04:10:57 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9C99AAAE; Wed, 29 May 2013 04:10:57 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8D9BA232; Wed, 29 May 2013 04:10:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T4Avh3095749; Wed, 29 May 2013 04:10:57 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T4Avqs095748; Wed, 29 May 2013 04:10:57 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201305290410.r4T4Avqs095748@svn.freebsd.org> From: Alexander Motin Date: Wed, 29 May 2013 04:10:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251093 - stable/8/sys/dev/mps X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 04:10:57 -0000 Author: mav Date: Wed May 29 04:10:57 2013 New Revision: 251093 URL: http://svnweb.freebsd.org/changeset/base/251093 Log: MFC r250900: Fix NULL-dereference kernel panic in case of mps_attach() failure. Modified: stable/8/sys/dev/mps/mps_user.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/mps/ (props changed) Modified: stable/8/sys/dev/mps/mps_user.c ============================================================================== --- stable/8/sys/dev/mps/mps_user.c Wed May 29 04:09:32 2013 (r251092) +++ stable/8/sys/dev/mps/mps_user.c Wed May 29 04:10:57 2013 (r251093) @@ -208,8 +208,8 @@ mps_detach_user(struct mps_softc *sc) { /* XXX: do a purge of pending requests? */ - destroy_dev(sc->mps_cdev); - + if (sc->mps_cdev != NULL) + destroy_dev(sc->mps_cdev); } static int From owner-svn-src-stable@FreeBSD.ORG Wed May 29 04:12:53 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E4C77C51; Wed, 29 May 2013 04:12:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D700C248; Wed, 29 May 2013 04:12:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T4CrwN096187; Wed, 29 May 2013 04:12:53 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T4CrUS096186; Wed, 29 May 2013 04:12:53 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201305290412.r4T4CrUS096186@svn.freebsd.org> From: Alexander Motin Date: Wed, 29 May 2013 04:12:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251094 - stable/9/sys/geom/raid X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 04:12:54 -0000 Author: mav Date: Wed May 29 04:12:53 2013 New Revision: 251094 URL: http://svnweb.freebsd.org/changeset/base/251094 Log: MFC r250819: Fix vdc->Secondary_Element_Count metadata field access from 16 to 8 bit. In some cases it could cause kernel panic during failed drive replacement. Modified: stable/9/sys/geom/raid/md_ddf.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/geom/raid/md_ddf.c ============================================================================== --- stable/9/sys/geom/raid/md_ddf.c Wed May 29 04:10:57 2013 (r251093) +++ stable/9/sys/geom/raid/md_ddf.c Wed May 29 04:12:53 2013 (r251094) @@ -515,7 +515,7 @@ ddf_meta_find_disk(struct ddf_vol_meta * int i, bvd, pos; i = 0; - for (bvd = 0; bvd < GET16(vmeta, vdc->Secondary_Element_Count); bvd++) { + for (bvd = 0; bvd < GET8(vmeta, vdc->Secondary_Element_Count); bvd++) { if (vmeta->bvdc[bvd] == NULL) { i += GET16(vmeta, vdc->Primary_Element_Count); // XXX continue; From owner-svn-src-stable@FreeBSD.ORG Wed May 29 04:14:41 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DDC47DFF; Wed, 29 May 2013 04:14:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D069925D; Wed, 29 May 2013 04:14:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T4EfQt096554; Wed, 29 May 2013 04:14:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T4Efh4096553; Wed, 29 May 2013 04:14:41 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201305290414.r4T4Efh4096553@svn.freebsd.org> From: Alexander Motin Date: Wed, 29 May 2013 04:14:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251095 - stable/8/sys/geom/raid X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 04:14:41 -0000 Author: mav Date: Wed May 29 04:14:41 2013 New Revision: 251095 URL: http://svnweb.freebsd.org/changeset/base/251095 Log: MFC r250819: Fix vdc->Secondary_Element_Count metadata field access from 16 to 8 bit. In some cases it could cause kernel panic during failed drive replacement. Modified: stable/8/sys/geom/raid/md_ddf.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/geom/ (props changed) Modified: stable/8/sys/geom/raid/md_ddf.c ============================================================================== --- stable/8/sys/geom/raid/md_ddf.c Wed May 29 04:12:53 2013 (r251094) +++ stable/8/sys/geom/raid/md_ddf.c Wed May 29 04:14:41 2013 (r251095) @@ -515,7 +515,7 @@ ddf_meta_find_disk(struct ddf_vol_meta * int i, bvd, pos; i = 0; - for (bvd = 0; bvd < GET16(vmeta, vdc->Secondary_Element_Count); bvd++) { + for (bvd = 0; bvd < GET8(vmeta, vdc->Secondary_Element_Count); bvd++) { if (vmeta->bvdc[bvd] == NULL) { i += GET16(vmeta, vdc->Primary_Element_Count); // XXX continue; From owner-svn-src-stable@FreeBSD.ORG Wed May 29 04:17:06 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 62D4869; Wed, 29 May 2013 04:17:06 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 43994288; Wed, 29 May 2013 04:17:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T4H6f9097073; Wed, 29 May 2013 04:17:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T4H6Lw097072; Wed, 29 May 2013 04:17:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201305290417.r4T4H6Lw097072@svn.freebsd.org> From: Alexander Motin Date: Wed, 29 May 2013 04:17:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251096 - stable/9/sys/cam/ata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 04:17:06 -0000 Author: mav Date: Wed May 29 04:17:05 2013 New Revision: 251096 URL: http://svnweb.freebsd.org/changeset/base/251096 Log: MFC r250508: Disable sending Early R_OK on SiI3726/SiI3826 port multipliers. With "cached read" HDD testing and multiple ports busy on a SATA host controller, 3726/3826 PMP will very rarely drop a deferred R_OK that was intended for the host. Symptom will be all 5 drives under test will timeout, get reset, and recover. Modified: stable/9/sys/cam/ata/ata_pmp.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ata/ata_pmp.c ============================================================================== --- stable/9/sys/cam/ata/ata_pmp.c Wed May 29 04:14:41 2013 (r251095) +++ stable/9/sys/cam/ata/ata_pmp.c Wed May 29 04:17:05 2013 (r251096) @@ -64,6 +64,9 @@ __FBSDID("$FreeBSD$"); typedef enum { PMP_STATE_NORMAL, PMP_STATE_PORTS, + PMP_STATE_PM_QUIRKS_1, + PMP_STATE_PM_QUIRKS_2, + PMP_STATE_PM_QUIRKS_3, PMP_STATE_PRECONFIG, PMP_STATE_RESET, PMP_STATE_CONNECT, @@ -319,7 +322,11 @@ pmpasync(void *callback_arg, u_int32_t c if (code == AC_SENT_BDR || code == AC_BUS_RESET) softc->found = 0; /* We have to reset everything. */ if (softc->state == PMP_STATE_NORMAL) { - softc->state = PMP_STATE_PRECONFIG; + if (softc->pm_pid == 0x37261095 || + softc->pm_pid == 0x38261095) + softc->state = PMP_STATE_PM_QUIRKS_1; + else + softc->state = PMP_STATE_PRECONFIG; cam_periph_acquire(periph); xpt_schedule(periph, CAM_PRIORITY_DEV); } else @@ -429,7 +436,10 @@ pmpstart(struct cam_periph *periph, unio if (softc->restart) { softc->restart = 0; - softc->state = min(softc->state, PMP_STATE_PRECONFIG); + if (softc->pm_pid == 0x37261095 || softc->pm_pid == 0x38261095) + softc->state = min(softc->state, PMP_STATE_PM_QUIRKS_1); + else + softc->state = min(softc->state, PMP_STATE_PRECONFIG); } /* Fetch user wanted device speed. */ if (softc->state == PMP_STATE_RESET || @@ -459,6 +469,32 @@ pmpstart(struct cam_periph *periph, unio pmp_default_timeout * 1000); ata_pm_read_cmd(ataio, 2, 15); break; + + case PMP_STATE_PM_QUIRKS_1: + case PMP_STATE_PM_QUIRKS_3: + cam_fill_ataio(ataio, + pmp_retry_count, + pmpdone, + /*flags*/CAM_DIR_NONE, + 0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + pmp_default_timeout * 1000); + ata_pm_read_cmd(ataio, 129, 15); + break; + + case PMP_STATE_PM_QUIRKS_2: + cam_fill_ataio(ataio, + pmp_retry_count, + pmpdone, + /*flags*/CAM_DIR_NONE, + 0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + pmp_default_timeout * 1000); + ata_pm_write_cmd(ataio, 129, 15, softc->caps & ~0x1); + break; + case PMP_STATE_PRECONFIG: /* Get/update host SATA capabilities. */ bzero(&cts, sizeof(cts)); @@ -468,6 +504,8 @@ pmpstart(struct cam_periph *periph, unio xpt_action((union ccb *)&cts); if (cts.xport_specific.sata.valid & CTS_SATA_VALID_CAPS) softc->caps = cts.xport_specific.sata.caps; + else + softc->caps = 0; cam_fill_ataio(ataio, pmp_retry_count, pmpdone, @@ -577,7 +615,10 @@ pmpdone(struct cam_periph *periph, union if (softc->restart) { softc->restart = 0; xpt_release_ccb(done_ccb); - softc->state = min(softc->state, PMP_STATE_PRECONFIG); + if (softc->pm_pid == 0x37261095 || softc->pm_pid == 0x38261095) + softc->state = min(softc->state, PMP_STATE_PM_QUIRKS_1); + else + softc->state = min(softc->state, PMP_STATE_PRECONFIG); xpt_schedule(periph, priority); return; } @@ -620,10 +661,48 @@ pmpdone(struct cam_periph *periph, union printf("%s%d: %d fan-out ports\n", periph->periph_name, periph->unit_number, softc->pm_ports); + if (softc->pm_pid == 0x37261095 || softc->pm_pid == 0x38261095) + softc->state = PMP_STATE_PM_QUIRKS_1; + else + softc->state = PMP_STATE_PRECONFIG; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + + case PMP_STATE_PM_QUIRKS_1: + softc->caps = (ataio->res.lba_high << 24) + + (ataio->res.lba_mid << 16) + + (ataio->res.lba_low << 8) + + ataio->res.sector_count; + if (softc->caps & 0x1) + softc->state = PMP_STATE_PM_QUIRKS_2; + else + softc->state = PMP_STATE_PRECONFIG; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + + case PMP_STATE_PM_QUIRKS_2: + if (bootverbose) + softc->state = PMP_STATE_PM_QUIRKS_3; + else + softc->state = PMP_STATE_PRECONFIG; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + + case PMP_STATE_PM_QUIRKS_3: + res = (ataio->res.lba_high << 24) + + (ataio->res.lba_mid << 16) + + (ataio->res.lba_low << 8) + + ataio->res.sector_count; + printf("%s%d: Disabling SiI3x26 R_OK in GSCR_POLL: %x->%x\n", + periph->periph_name, periph->unit_number, softc->caps, res); softc->state = PMP_STATE_PRECONFIG; xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); return; + case PMP_STATE_PRECONFIG: softc->pm_step = 0; softc->state = PMP_STATE_RESET; From owner-svn-src-stable@FreeBSD.ORG Wed May 29 04:18:03 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1632120D; Wed, 29 May 2013 04:18:03 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ED647292; Wed, 29 May 2013 04:18:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4T4I2p6097293; Wed, 29 May 2013 04:18:02 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4T4I28Y097292; Wed, 29 May 2013 04:18:02 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201305290418.r4T4I28Y097292@svn.freebsd.org> From: Alexander Motin Date: Wed, 29 May 2013 04:18:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251097 - stable/8/sys/cam/ata X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 04:18:03 -0000 Author: mav Date: Wed May 29 04:18:02 2013 New Revision: 251097 URL: http://svnweb.freebsd.org/changeset/base/251097 Log: MFC r250508: Disable sending Early R_OK on SiI3726/SiI3826 port multipliers. With "cached read" HDD testing and multiple ports busy on a SATA host controller, 3726/3826 PMP will very rarely drop a deferred R_OK that was intended for the host. Symptom will be all 5 drives under test will timeout, get reset, and recover. Modified: stable/8/sys/cam/ata/ata_pmp.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cam/ (props changed) Modified: stable/8/sys/cam/ata/ata_pmp.c ============================================================================== --- stable/8/sys/cam/ata/ata_pmp.c Wed May 29 04:17:05 2013 (r251096) +++ stable/8/sys/cam/ata/ata_pmp.c Wed May 29 04:18:02 2013 (r251097) @@ -64,6 +64,9 @@ __FBSDID("$FreeBSD$"); typedef enum { PMP_STATE_NORMAL, PMP_STATE_PORTS, + PMP_STATE_PM_QUIRKS_1, + PMP_STATE_PM_QUIRKS_2, + PMP_STATE_PM_QUIRKS_3, PMP_STATE_PRECONFIG, PMP_STATE_RESET, PMP_STATE_CONNECT, @@ -319,7 +322,11 @@ pmpasync(void *callback_arg, u_int32_t c if (code == AC_SENT_BDR || code == AC_BUS_RESET) softc->found = 0; /* We have to reset everything. */ if (softc->state == PMP_STATE_NORMAL) { - softc->state = PMP_STATE_PRECONFIG; + if (softc->pm_pid == 0x37261095 || + softc->pm_pid == 0x38261095) + softc->state = PMP_STATE_PM_QUIRKS_1; + else + softc->state = PMP_STATE_PRECONFIG; cam_periph_acquire(periph); xpt_schedule(periph, CAM_PRIORITY_DEV); } else @@ -434,7 +441,10 @@ pmpstart(struct cam_periph *periph, unio if (softc->restart) { softc->restart = 0; - softc->state = min(softc->state, PMP_STATE_PRECONFIG); + if (softc->pm_pid == 0x37261095 || softc->pm_pid == 0x38261095) + softc->state = min(softc->state, PMP_STATE_PM_QUIRKS_1); + else + softc->state = min(softc->state, PMP_STATE_PRECONFIG); } /* Fetch user wanted device speed. */ if (softc->state == PMP_STATE_RESET || @@ -464,6 +474,32 @@ pmpstart(struct cam_periph *periph, unio pmp_default_timeout * 1000); ata_pm_read_cmd(ataio, 2, 15); break; + + case PMP_STATE_PM_QUIRKS_1: + case PMP_STATE_PM_QUIRKS_3: + cam_fill_ataio(ataio, + pmp_retry_count, + pmpdone, + /*flags*/CAM_DIR_NONE, + 0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + pmp_default_timeout * 1000); + ata_pm_read_cmd(ataio, 129, 15); + break; + + case PMP_STATE_PM_QUIRKS_2: + cam_fill_ataio(ataio, + pmp_retry_count, + pmpdone, + /*flags*/CAM_DIR_NONE, + 0, + /*data_ptr*/NULL, + /*dxfer_len*/0, + pmp_default_timeout * 1000); + ata_pm_write_cmd(ataio, 129, 15, softc->caps & ~0x1); + break; + case PMP_STATE_PRECONFIG: /* Get/update host SATA capabilities. */ bzero(&cts, sizeof(cts)); @@ -473,6 +509,8 @@ pmpstart(struct cam_periph *periph, unio xpt_action((union ccb *)&cts); if (cts.xport_specific.sata.valid & CTS_SATA_VALID_CAPS) softc->caps = cts.xport_specific.sata.caps; + else + softc->caps = 0; cam_fill_ataio(ataio, pmp_retry_count, pmpdone, @@ -582,7 +620,10 @@ pmpdone(struct cam_periph *periph, union if (softc->restart) { softc->restart = 0; xpt_release_ccb(done_ccb); - softc->state = min(softc->state, PMP_STATE_PRECONFIG); + if (softc->pm_pid == 0x37261095 || softc->pm_pid == 0x38261095) + softc->state = min(softc->state, PMP_STATE_PM_QUIRKS_1); + else + softc->state = min(softc->state, PMP_STATE_PRECONFIG); xpt_schedule(periph, priority); return; } @@ -623,10 +664,48 @@ pmpdone(struct cam_periph *periph, union printf("%s%d: %d fan-out ports\n", periph->periph_name, periph->unit_number, softc->pm_ports); + if (softc->pm_pid == 0x37261095 || softc->pm_pid == 0x38261095) + softc->state = PMP_STATE_PM_QUIRKS_1; + else + softc->state = PMP_STATE_PRECONFIG; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + + case PMP_STATE_PM_QUIRKS_1: + softc->caps = (ataio->res.lba_high << 24) + + (ataio->res.lba_mid << 16) + + (ataio->res.lba_low << 8) + + ataio->res.sector_count; + if (softc->caps & 0x1) + softc->state = PMP_STATE_PM_QUIRKS_2; + else + softc->state = PMP_STATE_PRECONFIG; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + + case PMP_STATE_PM_QUIRKS_2: + if (bootverbose) + softc->state = PMP_STATE_PM_QUIRKS_3; + else + softc->state = PMP_STATE_PRECONFIG; + xpt_release_ccb(done_ccb); + xpt_schedule(periph, priority); + return; + + case PMP_STATE_PM_QUIRKS_3: + res = (ataio->res.lba_high << 24) + + (ataio->res.lba_mid << 16) + + (ataio->res.lba_low << 8) + + ataio->res.sector_count; + printf("%s%d: Disabling SiI3x26 R_OK in GSCR_POLL: %x->%x\n", + periph->periph_name, periph->unit_number, softc->caps, res); softc->state = PMP_STATE_PRECONFIG; xpt_release_ccb(done_ccb); xpt_schedule(periph, priority); return; + case PMP_STATE_PRECONFIG: softc->pm_step = 0; softc->state = PMP_STATE_RESET; From owner-svn-src-stable@FreeBSD.ORG Wed May 29 16:55:33 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BAA611D2; Wed, 29 May 2013 16:55:33 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AC8C599E; Wed, 29 May 2013 16:55:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4TGtX9K062743; Wed, 29 May 2013 16:55:33 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4TGtXDx062742; Wed, 29 May 2013 16:55:33 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201305291655.r4TGtXDx062742@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Wed, 29 May 2013 16:55:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251104 - stable/8/crypto/openssh X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 16:55:33 -0000 Author: des Date: Wed May 29 16:55:33 2013 New Revision: 251104 URL: http://svnweb.freebsd.org/changeset/base/251104 Log: MF9 (r248915): remove harmless duplicate entry for VersionAddendum. Modified: stable/8/crypto/openssh/servconf.c Modified: stable/8/crypto/openssh/servconf.c ============================================================================== --- stable/8/crypto/openssh/servconf.c Wed May 29 16:51:03 2013 (r251103) +++ stable/8/crypto/openssh/servconf.c Wed May 29 16:55:33 2013 (r251104) @@ -499,7 +499,6 @@ static struct { { "kexalgorithms", sKexAlgorithms, SSHCFG_GLOBAL }, { "ipqos", sIPQoS, SSHCFG_ALL }, { "versionaddendum", sVersionAddendum, SSHCFG_GLOBAL }, - { "versionaddendum", sVersionAddendum, SSHCFG_GLOBAL }, { "hpndisabled", sHPNDisabled, SSHCFG_ALL }, { "hpnbuffersize", sHPNBufferSize, SSHCFG_ALL }, { "tcprcvbufpoll", sTcpRcvBufPoll, SSHCFG_ALL }, From owner-svn-src-stable@FreeBSD.ORG Wed May 29 17:31:35 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B9E978A8; Wed, 29 May 2013 17:31:35 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id ABBEEAFD; Wed, 29 May 2013 17:31:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4THVZ9p076227; Wed, 29 May 2013 17:31:35 GMT (envelope-from bdrewery@svn.freebsd.org) Received: (from bdrewery@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4THVZWJ076226; Wed, 29 May 2013 17:31:35 GMT (envelope-from bdrewery@svn.freebsd.org) Message-Id: <201305291731.r4THVZWJ076226@svn.freebsd.org> From: Bryan Drewery Date: Wed, 29 May 2013 17:31:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251106 - stable/8/crypto/openssh X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 17:31:35 -0000 Author: bdrewery (ports committer) Date: Wed May 29 17:31:34 2013 New Revision: 251106 URL: http://svnweb.freebsd.org/changeset/base/251106 Log: MFH r250595: The HPN patch added a new BUG bit for SSH_BUG_LARGEWINDOW and the update to 6.1 added SSH_BUG_DYNAMIC_RPORT with the same value. Fix the HPN SSH_BUG_LARGEWINDOW bit so it is unique. Modified: stable/8/crypto/openssh/compat.h Directory Properties: stable/8/crypto/openssh/ (props changed) Modified: stable/8/crypto/openssh/compat.h ============================================================================== --- stable/8/crypto/openssh/compat.h Wed May 29 17:04:43 2013 (r251105) +++ stable/8/crypto/openssh/compat.h Wed May 29 17:31:34 2013 (r251106) @@ -60,7 +60,7 @@ #define SSH_BUG_RFWD_ADDR 0x02000000 #define SSH_NEW_OPENSSH 0x04000000 #define SSH_BUG_DYNAMIC_RPORT 0x08000000 -#define SSH_BUG_LARGEWINDOW 0x08000000 +#define SSH_BUG_LARGEWINDOW 0x10000000 void enable_compat13(void); void enable_compat20(void); From owner-svn-src-stable@FreeBSD.ORG Wed May 29 21:07:25 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 567A4D33; Wed, 29 May 2013 21:07:25 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2D716957; Wed, 29 May 2013 21:07:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4TL7Prp051089; Wed, 29 May 2013 21:07:25 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4TL7P3u051088; Wed, 29 May 2013 21:07:25 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201305292107.r4TL7P3u051088@svn.freebsd.org> From: Mark Johnston Date: Wed, 29 May 2013 21:07:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251110 - stable/9/usr.sbin/newsyslog X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 21:07:25 -0000 Author: markj Date: Wed May 29 21:07:24 2013 New Revision: 251110 URL: http://svnweb.freebsd.org/changeset/base/251110 Log: MFC r250545: Some filesystems (NFS in particular) do not fill out the d_type field when returning directory entries through readdir(3). In this case we need to obtain the file type ourselves; otherwise newsyslog -t will not be able to find archived log files and will fail to both delete old log files and to do interval-based rotations properly. Modified: stable/9/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/9/usr.sbin/newsyslog/ (props changed) Modified: stable/9/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/9/usr.sbin/newsyslog/newsyslog.c Wed May 29 20:36:51 2013 (r251109) +++ stable/9/usr.sbin/newsyslog/newsyslog.c Wed May 29 21:07:24 2013 (r251110) @@ -1450,16 +1450,27 @@ oldlog_entry_compare(const void *a, cons * tm if this is the case; otherwise return false. */ static int -validate_old_timelog(const struct dirent *dp, const char *logfname, struct tm *tm) +validate_old_timelog(int fd, const struct dirent *dp, const char *logfname, + struct tm *tm) { + struct stat sb; size_t logfname_len; char *s; int c; logfname_len = strlen(logfname); - if (dp->d_type != DT_REG) - return (0); + if (dp->d_type != DT_REG) { + /* + * Some filesystems (e.g. NFS) don't fill out the d_type field + * and leave it set to DT_UNKNOWN; in this case we must obtain + * the file type ourselves. + */ + if (dp->d_type != DT_UNKNOWN || + fstatat(fd, dp->d_name, &sb, AT_SYMLINK_NOFOLLOW) != 0 || + !S_ISREG(sb.st_mode)) + return (0); + } /* Ignore everything but files with our logfile prefix. */ if (strncmp(dp->d_name, logfname, logfname_len) != 0) return (0); @@ -1545,7 +1556,7 @@ delete_oldest_timelog(const struct conf_ err(1, "Cannot open log directory '%s'", dir); dirfd = dirfd(dirp); while ((dp = readdir(dirp)) != NULL) { - if (validate_old_timelog(dp, logfname, &tm) == 0) + if (validate_old_timelog(dir_fd, dp, logfname, &tm) == 0) continue; /* @@ -2310,10 +2321,10 @@ mtime_old_timelog(const char *file) dir_fd = dirfd(dirp); /* Open the archive dir and find the most recent archive of logfname. */ while ((dp = readdir(dirp)) != NULL) { - if (validate_old_timelog(dp, logfname, &tm) == 0) + if (validate_old_timelog(dir_fd, dp, logfname, &tm) == 0) continue; - if (fstatat(dir_fd, logfname, &sb, 0) == -1) { + if (fstatat(dir_fd, logfname, &sb, AT_SYMLINK_NOFOLLOW) == -1) { warn("Cannot stat '%s'", file); continue; } From owner-svn-src-stable@FreeBSD.ORG Wed May 29 21:08:23 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E1418EAB; Wed, 29 May 2013 21:08:23 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C4216965; Wed, 29 May 2013 21:08:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4TL8N1R051369; Wed, 29 May 2013 21:08:23 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4TL8NgK051368; Wed, 29 May 2013 21:08:23 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201305292108.r4TL8NgK051368@svn.freebsd.org> From: Mark Johnston Date: Wed, 29 May 2013 21:08:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251111 - stable/8/usr.sbin/newsyslog X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 21:08:24 -0000 Author: markj Date: Wed May 29 21:08:23 2013 New Revision: 251111 URL: http://svnweb.freebsd.org/changeset/base/251111 Log: MFC r250545: Some filesystems (NFS in particular) do not fill out the d_type field when returning directory entries through readdir(3). In this case we need to obtain the file type ourselves; otherwise newsyslog -t will not be able to find archived log files and will fail to both delete old log files and to do interval-based rotations properly. Modified: stable/8/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/8/usr.sbin/newsyslog/ (props changed) Modified: stable/8/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.c Wed May 29 21:07:24 2013 (r251110) +++ stable/8/usr.sbin/newsyslog/newsyslog.c Wed May 29 21:08:23 2013 (r251111) @@ -1447,16 +1447,27 @@ oldlog_entry_compare(const void *a, cons * tm if this is the case; otherwise return false. */ static int -validate_old_timelog(const struct dirent *dp, const char *logfname, struct tm *tm) +validate_old_timelog(int fd, const struct dirent *dp, const char *logfname, + struct tm *tm) { + struct stat sb; size_t logfname_len; char *s; int c; logfname_len = strlen(logfname); - if (dp->d_type != DT_REG) - return (0); + if (dp->d_type != DT_REG) { + /* + * Some filesystems (e.g. NFS) don't fill out the d_type field + * and leave it set to DT_UNKNOWN; in this case we must obtain + * the file type ourselves. + */ + if (dp->d_type != DT_UNKNOWN || + fstatat(fd, dp->d_name, &sb, AT_SYMLINK_NOFOLLOW) != 0 || + !S_ISREG(sb.st_mode)) + return (0); + } /* Ignore everything but files with our logfile prefix. */ if (strncmp(dp->d_name, logfname, logfname_len) != 0) return (0); @@ -1508,7 +1519,7 @@ static void delete_oldest_timelog(const struct conf_entry *ent, const char *archive_dir) { char *logfname, *s, *dir, errbuf[80]; - int dirfd, i, logcnt, max_logcnt; + int dir_fd, i, logcnt, max_logcnt; struct oldlog_entry *oldlogs; struct dirent *dp; const char *cdir; @@ -1540,9 +1551,9 @@ delete_oldest_timelog(const struct conf_ /* First we create a 'list' of all archived logfiles */ if ((dirp = opendir(dir)) == NULL) err(1, "Cannot open log directory '%s'", dir); - dirfd = dirfd(dirp); + dir_fd = dirfd(dirp); while ((dp = readdir(dirp)) != NULL) { - if (validate_old_timelog(dp, logfname, &tm) == 0) + if (validate_old_timelog(dir_fd, dp, logfname, &tm) == 0) continue; /* @@ -2248,7 +2259,7 @@ mtime_old_timelog(const char *file) { struct stat sb; struct tm tm; - int dir_fd; + int dirfd; time_t t; struct dirent *dp; DIR *dirp; @@ -2273,13 +2284,13 @@ mtime_old_timelog(const char *file) warn("Cannot open log directory '%s'", dir); return (t); } - dir_fd = dirfd(dirp); + dirfd = dirfd(dirp); /* Open the archive dir and find the most recent archive of logfname. */ while ((dp = readdir(dirp)) != NULL) { - if (validate_old_timelog(dp, logfname, &tm) == 0) + if (validate_old_timelog(dir_fd, dp, logfname, &tm) == 0) continue; - if (fstatat(dir_fd, logfname, &sb, 0) == -1) { + if (fstatat(dir_fd, logfname, &sb, AT_SYMLINK_NOFOLLOW) == -1) { warn("Cannot stat '%s'", file); continue; } From owner-svn-src-stable@FreeBSD.ORG Wed May 29 22:29:33 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id BFCB4A88; Wed, 29 May 2013 22:29:33 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A0AD3CCA; Wed, 29 May 2013 22:29:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4TMTXrA079439; Wed, 29 May 2013 22:29:33 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4TMTXTO079438; Wed, 29 May 2013 22:29:33 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201305292229.r4TMTXTO079438@svn.freebsd.org> From: Mark Johnston Date: Wed, 29 May 2013 22:29:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251112 - stable/8/usr.sbin/newsyslog X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 22:29:33 -0000 Author: markj Date: Wed May 29 22:29:33 2013 New Revision: 251112 URL: http://svnweb.freebsd.org/changeset/base/251112 Log: Revert my previous merge. There's a variable name difference between head and stable (dirfd vs. dir_fd) and I managed to get it wrong again when I did the MFC, even after I tested. Modified: stable/8/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/8/usr.sbin/newsyslog/ (props changed) Modified: stable/8/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/8/usr.sbin/newsyslog/newsyslog.c Wed May 29 21:08:23 2013 (r251111) +++ stable/8/usr.sbin/newsyslog/newsyslog.c Wed May 29 22:29:33 2013 (r251112) @@ -1447,27 +1447,16 @@ oldlog_entry_compare(const void *a, cons * tm if this is the case; otherwise return false. */ static int -validate_old_timelog(int fd, const struct dirent *dp, const char *logfname, - struct tm *tm) +validate_old_timelog(const struct dirent *dp, const char *logfname, struct tm *tm) { - struct stat sb; size_t logfname_len; char *s; int c; logfname_len = strlen(logfname); - if (dp->d_type != DT_REG) { - /* - * Some filesystems (e.g. NFS) don't fill out the d_type field - * and leave it set to DT_UNKNOWN; in this case we must obtain - * the file type ourselves. - */ - if (dp->d_type != DT_UNKNOWN || - fstatat(fd, dp->d_name, &sb, AT_SYMLINK_NOFOLLOW) != 0 || - !S_ISREG(sb.st_mode)) - return (0); - } + if (dp->d_type != DT_REG) + return (0); /* Ignore everything but files with our logfile prefix. */ if (strncmp(dp->d_name, logfname, logfname_len) != 0) return (0); @@ -1519,7 +1508,7 @@ static void delete_oldest_timelog(const struct conf_entry *ent, const char *archive_dir) { char *logfname, *s, *dir, errbuf[80]; - int dir_fd, i, logcnt, max_logcnt; + int dirfd, i, logcnt, max_logcnt; struct oldlog_entry *oldlogs; struct dirent *dp; const char *cdir; @@ -1551,9 +1540,9 @@ delete_oldest_timelog(const struct conf_ /* First we create a 'list' of all archived logfiles */ if ((dirp = opendir(dir)) == NULL) err(1, "Cannot open log directory '%s'", dir); - dir_fd = dirfd(dirp); + dirfd = dirfd(dirp); while ((dp = readdir(dirp)) != NULL) { - if (validate_old_timelog(dir_fd, dp, logfname, &tm) == 0) + if (validate_old_timelog(dp, logfname, &tm) == 0) continue; /* @@ -2259,7 +2248,7 @@ mtime_old_timelog(const char *file) { struct stat sb; struct tm tm; - int dirfd; + int dir_fd; time_t t; struct dirent *dp; DIR *dirp; @@ -2284,13 +2273,13 @@ mtime_old_timelog(const char *file) warn("Cannot open log directory '%s'", dir); return (t); } - dirfd = dirfd(dirp); + dir_fd = dirfd(dirp); /* Open the archive dir and find the most recent archive of logfname. */ while ((dp = readdir(dirp)) != NULL) { - if (validate_old_timelog(dir_fd, dp, logfname, &tm) == 0) + if (validate_old_timelog(dp, logfname, &tm) == 0) continue; - if (fstatat(dir_fd, logfname, &sb, AT_SYMLINK_NOFOLLOW) == -1) { + if (fstatat(dir_fd, logfname, &sb, 0) == -1) { warn("Cannot stat '%s'", file); continue; } From owner-svn-src-stable@FreeBSD.ORG Wed May 29 22:30:30 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5F67EC01; Wed, 29 May 2013 22:30:30 +0000 (UTC) (envelope-from markj@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 38AD1CD6; Wed, 29 May 2013 22:30:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4TMUUZn079885; Wed, 29 May 2013 22:30:30 GMT (envelope-from markj@svn.freebsd.org) Received: (from markj@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4TMUUPX079884; Wed, 29 May 2013 22:30:30 GMT (envelope-from markj@svn.freebsd.org) Message-Id: <201305292230.r4TMUUPX079884@svn.freebsd.org> From: Mark Johnston Date: Wed, 29 May 2013 22:30:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251113 - stable/9/usr.sbin/newsyslog X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 22:30:30 -0000 Author: markj Date: Wed May 29 22:30:29 2013 New Revision: 251113 URL: http://svnweb.freebsd.org/changeset/base/251113 Log: Revert my previous merge. There's a variable name difference between head and stable (dirfd vs. dir_fd) and I managed to get it wrong again when I did the MFC, even after I tested. Modified: stable/9/usr.sbin/newsyslog/newsyslog.c Directory Properties: stable/9/usr.sbin/newsyslog/ (props changed) Modified: stable/9/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- stable/9/usr.sbin/newsyslog/newsyslog.c Wed May 29 22:29:33 2013 (r251112) +++ stable/9/usr.sbin/newsyslog/newsyslog.c Wed May 29 22:30:29 2013 (r251113) @@ -1450,27 +1450,16 @@ oldlog_entry_compare(const void *a, cons * tm if this is the case; otherwise return false. */ static int -validate_old_timelog(int fd, const struct dirent *dp, const char *logfname, - struct tm *tm) +validate_old_timelog(const struct dirent *dp, const char *logfname, struct tm *tm) { - struct stat sb; size_t logfname_len; char *s; int c; logfname_len = strlen(logfname); - if (dp->d_type != DT_REG) { - /* - * Some filesystems (e.g. NFS) don't fill out the d_type field - * and leave it set to DT_UNKNOWN; in this case we must obtain - * the file type ourselves. - */ - if (dp->d_type != DT_UNKNOWN || - fstatat(fd, dp->d_name, &sb, AT_SYMLINK_NOFOLLOW) != 0 || - !S_ISREG(sb.st_mode)) - return (0); - } + if (dp->d_type != DT_REG) + return (0); /* Ignore everything but files with our logfile prefix. */ if (strncmp(dp->d_name, logfname, logfname_len) != 0) return (0); @@ -1556,7 +1545,7 @@ delete_oldest_timelog(const struct conf_ err(1, "Cannot open log directory '%s'", dir); dirfd = dirfd(dirp); while ((dp = readdir(dirp)) != NULL) { - if (validate_old_timelog(dir_fd, dp, logfname, &tm) == 0) + if (validate_old_timelog(dp, logfname, &tm) == 0) continue; /* @@ -2321,10 +2310,10 @@ mtime_old_timelog(const char *file) dir_fd = dirfd(dirp); /* Open the archive dir and find the most recent archive of logfname. */ while ((dp = readdir(dirp)) != NULL) { - if (validate_old_timelog(dir_fd, dp, logfname, &tm) == 0) + if (validate_old_timelog(dp, logfname, &tm) == 0) continue; - if (fstatat(dir_fd, logfname, &sb, AT_SYMLINK_NOFOLLOW) == -1) { + if (fstatat(dir_fd, logfname, &sb, 0) == -1) { warn("Cannot stat '%s'", file); continue; } From owner-svn-src-stable@FreeBSD.ORG Wed May 29 22:37:21 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4FEA8F44; Wed, 29 May 2013 22:37:21 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-ie0-x236.google.com (mail-ie0-x236.google.com [IPv6:2607:f8b0:4001:c03::236]) by mx1.freebsd.org (Postfix) with ESMTP id 0647DD18; Wed, 29 May 2013 22:37:20 +0000 (UTC) Received: by mail-ie0-f182.google.com with SMTP id a14so26308677iee.41 for ; Wed, 29 May 2013 15:37:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=b9lMYYUcLvAD2UkGZjhWMpzx3vsd3m5NywEoY6Rs89A=; b=rQ2jInAvQP+4IqMy5xCWzWPNKBMR/QThHZ0fswaM4Js0ddg+ur3sUBoHAHDF1YEdAY pzr1LkoVFMZVeVcYnURWvHPUcE1u7EmkgQaGjGtO0sXUuMpfEJu3P+t4JVbBDOBjCH+V x7aiuv6bltSyeCcB3R/ChuYsDFxVfBUHg8qg/29eN/GLUAAeP1SzFqWY1dF2QI/x4vNP 3eN/bKsUyNtmYq7hVkCHBMpK5ryjoBjPZxW1qEk3xr92Z1y5vPXP4I93Pnr3s9J51Bbl nVtEwqkrYWBD3D8VyvV/Q6Mc9qBcI4wPCKtHqpNl0ksFD1Oe+p0hTKwuF9HkjlVtPgB8 aXvA== X-Received: by 10.50.128.134 with SMTP id no6mr10570885igb.10.1369867040763; Wed, 29 May 2013 15:37:20 -0700 (PDT) Received: from raichu (24-212-218-13.cable.teksavvy.com. [24.212.218.13]) by mx.google.com with ESMTPSA id y11sm11417508igy.10.2013.05.29.15.37.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 May 2013 15:37:20 -0700 (PDT) Sender: Mark Johnston Date: Wed, 29 May 2013 18:37:17 -0400 From: Mark Johnston To: src-committers@freebsd.org Subject: Re: svn commit: r251113 - stable/9/usr.sbin/newsyslog Message-ID: <20130529223717.GB59966@raichu> References: <201305292230.r4TMUUPX079884@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201305292230.r4TMUUPX079884@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 29 May 2013 22:37:21 -0000 I'm very sorry about this. I was going to merge r235647 first so that I wouldn't make the same mistake a second time, but I decided against it when I saw that the commit extended beyond newsyslog, and then managed to do the MFC incorrectly after verifying that newsyslog built on the stable branches. Is it possible to only do the newsyslog portion of this MFC, or is it a rule that either all or none of a given revision should be merged to the stable branches? Sorry again, -Mark On Wed, May 29, 2013 at 10:30:30PM +0000, Mark Johnston wrote: > Author: markj > Date: Wed May 29 22:30:29 2013 > New Revision: 251113 > URL: http://svnweb.freebsd.org/changeset/base/251113 > > Log: > Revert my previous merge. There's a variable name difference between head > and stable (dirfd vs. dir_fd) and I managed to get it wrong again when I > did the MFC, even after I tested. > > Modified: > stable/9/usr.sbin/newsyslog/newsyslog.c > Directory Properties: > stable/9/usr.sbin/newsyslog/ (props changed) > > Modified: stable/9/usr.sbin/newsyslog/newsyslog.c > ============================================================================== > --- stable/9/usr.sbin/newsyslog/newsyslog.c Wed May 29 22:29:33 2013 (r251112) > +++ stable/9/usr.sbin/newsyslog/newsyslog.c Wed May 29 22:30:29 2013 (r251113) > @@ -1450,27 +1450,16 @@ oldlog_entry_compare(const void *a, cons > * tm if this is the case; otherwise return false. > */ > static int > -validate_old_timelog(int fd, const struct dirent *dp, const char *logfname, > - struct tm *tm) > +validate_old_timelog(const struct dirent *dp, const char *logfname, struct tm *tm) > { > - struct stat sb; > size_t logfname_len; > char *s; > int c; > > logfname_len = strlen(logfname); > > - if (dp->d_type != DT_REG) { > - /* > - * Some filesystems (e.g. NFS) don't fill out the d_type field > - * and leave it set to DT_UNKNOWN; in this case we must obtain > - * the file type ourselves. > - */ > - if (dp->d_type != DT_UNKNOWN || > - fstatat(fd, dp->d_name, &sb, AT_SYMLINK_NOFOLLOW) != 0 || > - !S_ISREG(sb.st_mode)) > - return (0); > - } > + if (dp->d_type != DT_REG) > + return (0); > /* Ignore everything but files with our logfile prefix. */ > if (strncmp(dp->d_name, logfname, logfname_len) != 0) > return (0); > @@ -1556,7 +1545,7 @@ delete_oldest_timelog(const struct conf_ > err(1, "Cannot open log directory '%s'", dir); > dirfd = dirfd(dirp); > while ((dp = readdir(dirp)) != NULL) { > - if (validate_old_timelog(dir_fd, dp, logfname, &tm) == 0) > + if (validate_old_timelog(dp, logfname, &tm) == 0) > continue; > > /* > @@ -2321,10 +2310,10 @@ mtime_old_timelog(const char *file) > dir_fd = dirfd(dirp); > /* Open the archive dir and find the most recent archive of logfname. */ > while ((dp = readdir(dirp)) != NULL) { > - if (validate_old_timelog(dir_fd, dp, logfname, &tm) == 0) > + if (validate_old_timelog(dp, logfname, &tm) == 0) > continue; > > - if (fstatat(dir_fd, logfname, &sb, AT_SYMLINK_NOFOLLOW) == -1) { > + if (fstatat(dir_fd, logfname, &sb, 0) == -1) { > warn("Cannot stat '%s'", file); > continue; > } From owner-svn-src-stable@FreeBSD.ORG Thu May 30 00:55:35 2013 Return-Path: Delivered-To: svn-src-stable@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 97E7DE7B; Thu, 30 May 2013 00:55:35 +0000 (UTC) (envelope-from brooks@lor.one-eyed-alien.net) Received: from lor.one-eyed-alien.net (lor.one-eyed-alien.net [69.66.77.232]) by mx1.freebsd.org (Postfix) with ESMTP id 88EA2757; Thu, 30 May 2013 00:55:28 +0000 (UTC) Received: from lor.one-eyed-alien.net (localhost [127.0.0.1]) by lor.one-eyed-alien.net (8.14.5/8.14.5) with ESMTP id r4U0tRFD029076; Wed, 29 May 2013 19:55:27 -0500 (CDT) (envelope-from brooks@lor.one-eyed-alien.net) Received: (from brooks@localhost) by lor.one-eyed-alien.net (8.14.5/8.14.5/Submit) id r4U0tRKo029075; Wed, 29 May 2013 19:55:27 -0500 (CDT) (envelope-from brooks) Date: Wed, 29 May 2013 19:55:27 -0500 From: Brooks Davis To: Mark Johnston Subject: Re: svn commit: r251113 - stable/9/usr.sbin/newsyslog Message-ID: <20130530005527.GA29026@lor.one-eyed-alien.net> References: <201305292230.r4TMUUPX079884@svn.freebsd.org> <20130529223717.GB59966@raichu> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="cWoXeonUoKmBZSoM" Content-Disposition: inline In-Reply-To: <20130529223717.GB59966@raichu> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 00:55:35 -0000 --cWoXeonUoKmBZSoM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, May 29, 2013 at 06:37:17PM -0400, Mark Johnston wrote: > I'm very sorry about this. I was going to merge r235647 first so that I > wouldn't make the same mistake a second time, but I decided against it > when I saw that the commit extended beyond newsyslog, and then managed > to do the MFC incorrectly after verifying that newsyslog built on the > stable branches. Is it possible to only do the newsyslog portion of this > MFC, or is it a rule that either all or none of a given revision should > be merged to the stable branches? The approved way to merge a change like r235647 would be per-library and per-program so only merging changes to a single program would be fine. -- Brooks >=20 > Sorry again, > -Mark >=20 > On Wed, May 29, 2013 at 10:30:30PM +0000, Mark Johnston wrote: > > Author: markj > > Date: Wed May 29 22:30:29 2013 > > New Revision: 251113 > > URL: http://svnweb.freebsd.org/changeset/base/251113 > >=20 > > Log: > > Revert my previous merge. There's a variable name difference between = head > > and stable (dirfd vs. dir_fd) and I managed to get it wrong again whe= n I > > did the MFC, even after I tested. > >=20 > > Modified: > > stable/9/usr.sbin/newsyslog/newsyslog.c > > Directory Properties: > > stable/9/usr.sbin/newsyslog/ (props changed) > >=20 > > Modified: stable/9/usr.sbin/newsyslog/newsyslog.c > > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D > > --- stable/9/usr.sbin/newsyslog/newsyslog.c Wed May 29 22:29:33 2013 (r= 251112) > > +++ stable/9/usr.sbin/newsyslog/newsyslog.c Wed May 29 22:30:29 2013 (r= 251113) > > @@ -1450,27 +1450,16 @@ oldlog_entry_compare(const void *a, cons > > * tm if this is the case; otherwise return false. > > */ > > static int > > -validate_old_timelog(int fd, const struct dirent *dp, const char *logf= name, > > - struct tm *tm) > > +validate_old_timelog(const struct dirent *dp, const char *logfname, st= ruct tm *tm) > > { > > - struct stat sb; > > size_t logfname_len; > > char *s; > > int c; > > =20 > > logfname_len =3D strlen(logfname); > > =20 > > - if (dp->d_type !=3D DT_REG) { > > - /* > > - * Some filesystems (e.g. NFS) don't fill out the d_type field > > - * and leave it set to DT_UNKNOWN; in this case we must obtain > > - * the file type ourselves. > > - */ > > - if (dp->d_type !=3D DT_UNKNOWN || > > - fstatat(fd, dp->d_name, &sb, AT_SYMLINK_NOFOLLOW) !=3D 0 || > > - !S_ISREG(sb.st_mode)) > > - return (0); > > - } > > + if (dp->d_type !=3D DT_REG) > > + return (0); > > /* Ignore everything but files with our logfile prefix. */ > > if (strncmp(dp->d_name, logfname, logfname_len) !=3D 0) > > return (0); > > @@ -1556,7 +1545,7 @@ delete_oldest_timelog(const struct conf_ > > err(1, "Cannot open log directory '%s'", dir); > > dirfd =3D dirfd(dirp); > > while ((dp =3D readdir(dirp)) !=3D NULL) { > > - if (validate_old_timelog(dir_fd, dp, logfname, &tm) =3D=3D 0) > > + if (validate_old_timelog(dp, logfname, &tm) =3D=3D 0) > > continue; > > =20 > > /* > > @@ -2321,10 +2310,10 @@ mtime_old_timelog(const char *file) > > dir_fd =3D dirfd(dirp); > > /* Open the archive dir and find the most recent archive of logfname.= */ > > while ((dp =3D readdir(dirp)) !=3D NULL) { > > - if (validate_old_timelog(dir_fd, dp, logfname, &tm) =3D=3D 0) > > + if (validate_old_timelog(dp, logfname, &tm) =3D=3D 0) > > continue; > > =20 > > - if (fstatat(dir_fd, logfname, &sb, AT_SYMLINK_NOFOLLOW) =3D=3D -1) { > > + if (fstatat(dir_fd, logfname, &sb, 0) =3D=3D -1) { > > warn("Cannot stat '%s'", file); > > continue; > > } >=20 --cWoXeonUoKmBZSoM Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (FreeBSD) iD8DBQFRpqN/XY6L6fI4GtQRAlWvAKCfo1o7ShOOvE56C8UJAzCIFtmbYQCZAYsQ Y8wYpxVeZGwlqaKU7QvsqnA= =SDiT -----END PGP SIGNATURE----- --cWoXeonUoKmBZSoM-- From owner-svn-src-stable@FreeBSD.ORG Thu May 30 12:25:38 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B375DBDE; Thu, 30 May 2013 12:25:38 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8A990AF1; Thu, 30 May 2013 12:25:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UCPcge072912; Thu, 30 May 2013 12:25:38 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UCPcfB072907; Thu, 30 May 2013 12:25:38 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201305301225.r4UCPcfB072907@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 30 May 2013 12:25:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251134 - in stable/9: secure/libexec/ssh-keysign share/examples/etc share/man/man5 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 12:25:38 -0000 Author: des Date: Thu May 30 12:25:37 2013 New Revision: 251134 URL: http://svnweb.freebsd.org/changeset/base/251134 Log: MFH (r248617): retire the mislabeled ENABLE_SUID_SSH knob. Modified: stable/9/secure/libexec/ssh-keysign/Makefile stable/9/share/examples/etc/make.conf stable/9/share/man/man5/make.conf.5 Directory Properties: stable/9/secure/libexec/ssh-keysign/ (props changed) stable/9/share/examples/ (props changed) stable/9/share/examples/etc/ (props changed) stable/9/share/man/man5/ (props changed) Modified: stable/9/secure/libexec/ssh-keysign/Makefile ============================================================================== --- stable/9/secure/libexec/ssh-keysign/Makefile Thu May 30 12:16:55 2013 (r251133) +++ stable/9/secure/libexec/ssh-keysign/Makefile Thu May 30 12:25:37 2013 (r251134) @@ -4,9 +4,7 @@ PROG= ssh-keysign SRCS= ssh-keysign.c readconf.c roaming_dummy.c MAN= ssh-keysign.8 CFLAGS+=-I${SSHDIR} -include ssh_namespace.h -.if defined(ENABLE_SUID_SSH) -BINMODE=4511 -.endif +BINMODE=4555 DPADD= ${LIBSSH} ${LIBCRYPT} ${LIBCRYPTO} ${LIBZ} LDADD= -lssh -lcrypt -lcrypto -lz Modified: stable/9/share/examples/etc/make.conf ============================================================================== --- stable/9/share/examples/etc/make.conf Thu May 30 12:16:55 2013 (r251133) +++ stable/9/share/examples/etc/make.conf Thu May 30 12:25:37 2013 (r251134) @@ -96,9 +96,6 @@ # Mtree will follow symlinks #MTREE_FOLLOWS_SYMLINKS= -L # -# To enable installing ssh(1) with the setuid bit turned on -#ENABLE_SUID_SSH= -# # To enable installing newgrp(1) with the setuid bit turned on. # Without the setuid bit, newgrp cannot change users' groups. #ENABLE_SUID_NEWGRP= Modified: stable/9/share/man/man5/make.conf.5 ============================================================================== --- stable/9/share/man/man5/make.conf.5 Thu May 30 12:16:55 2013 (r251133) +++ stable/9/share/man/man5/make.conf.5 Thu May 30 12:25:37 2013 (r251134) @@ -454,11 +454,6 @@ with the set-user-ID bit set. Otherwise, .Xr newgrp 1 will not be able to change users' groups. -.It Va ENABLE_SUID_SSH -.Pq Vt bool -Set this to install -.Xr ssh 1 -with the set-user-ID bit turned on. .It Va LOADER_TFTP_SUPPORT .Pq Vt bool By default the From owner-svn-src-stable@FreeBSD.ORG Thu May 30 12:26:00 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 92A56D47; Thu, 30 May 2013 12:26:00 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8264FAF4; Thu, 30 May 2013 12:26:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UCQ0Zg073019; Thu, 30 May 2013 12:26:00 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UCPxvg072998; Thu, 30 May 2013 12:25:59 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201305301225.r4UCPxvg072998@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Thu, 30 May 2013 12:25:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251135 - in stable/9: crypto/openssh crypto/openssh/openbsd-compat crypto/openssh/scard secure/lib/libssh X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 12:26:00 -0000 Author: des Date: Thu May 30 12:25:58 2013 New Revision: 251135 URL: http://svnweb.freebsd.org/changeset/base/251135 Log: Pull in OpenSSH 6.2p2 from head. Added: stable/9/crypto/openssh/PROTOCOL.krl - copied unchanged from r248619, head/crypto/openssh/PROTOCOL.krl stable/9/crypto/openssh/krl.c - copied, changed from r248619, head/crypto/openssh/krl.c stable/9/crypto/openssh/krl.h - copied unchanged from r248619, head/crypto/openssh/krl.h stable/9/crypto/openssh/openbsd-compat/bsd-setres_id.c - copied unchanged from r248619, head/crypto/openssh/openbsd-compat/bsd-setres_id.c stable/9/crypto/openssh/openbsd-compat/bsd-setres_id.h - copied unchanged from r248619, head/crypto/openssh/openbsd-compat/bsd-setres_id.h stable/9/crypto/openssh/openbsd-compat/strtoull.c - copied unchanged from r248619, head/crypto/openssh/openbsd-compat/strtoull.c stable/9/crypto/openssh/scard/ - copied from r248619, head/crypto/openssh/scard/ stable/9/crypto/openssh/umac128.c - copied, changed from r248619, head/crypto/openssh/umac128.c Deleted: stable/9/crypto/openssh/acss.c stable/9/crypto/openssh/acss.h stable/9/crypto/openssh/cipher-acss.c Modified: stable/9/crypto/openssh/ChangeLog stable/9/crypto/openssh/INSTALL stable/9/crypto/openssh/PROTOCOL stable/9/crypto/openssh/PROTOCOL.agent stable/9/crypto/openssh/README stable/9/crypto/openssh/auth-options.c stable/9/crypto/openssh/auth-rsa.c stable/9/crypto/openssh/auth.c stable/9/crypto/openssh/auth.h stable/9/crypto/openssh/auth1.c stable/9/crypto/openssh/auth2-chall.c stable/9/crypto/openssh/auth2-gss.c stable/9/crypto/openssh/auth2-jpake.c stable/9/crypto/openssh/auth2-pubkey.c stable/9/crypto/openssh/auth2.c stable/9/crypto/openssh/authfile.c stable/9/crypto/openssh/channels.c stable/9/crypto/openssh/cipher-aes.c stable/9/crypto/openssh/cipher-ctr.c stable/9/crypto/openssh/cipher.c stable/9/crypto/openssh/cipher.h stable/9/crypto/openssh/clientloop.c stable/9/crypto/openssh/clientloop.h stable/9/crypto/openssh/compat.c stable/9/crypto/openssh/config.h stable/9/crypto/openssh/config.h.in stable/9/crypto/openssh/defines.h stable/9/crypto/openssh/includes.h stable/9/crypto/openssh/kex.c stable/9/crypto/openssh/kex.h stable/9/crypto/openssh/key.c stable/9/crypto/openssh/key.h stable/9/crypto/openssh/log.c stable/9/crypto/openssh/log.h stable/9/crypto/openssh/loginrec.c stable/9/crypto/openssh/mac.c stable/9/crypto/openssh/moduli stable/9/crypto/openssh/moduli.5 stable/9/crypto/openssh/monitor.c stable/9/crypto/openssh/monitor.h stable/9/crypto/openssh/monitor_wrap.c stable/9/crypto/openssh/mux.c stable/9/crypto/openssh/myproposal.h stable/9/crypto/openssh/openbsd-compat/bsd-cygwin_util.c stable/9/crypto/openssh/openbsd-compat/bsd-cygwin_util.h stable/9/crypto/openssh/openbsd-compat/bsd-misc.c stable/9/crypto/openssh/openbsd-compat/bsd-misc.h stable/9/crypto/openssh/openbsd-compat/openbsd-compat.h stable/9/crypto/openssh/openbsd-compat/openssl-compat.h stable/9/crypto/openssh/openbsd-compat/sys-queue.h stable/9/crypto/openssh/openbsd-compat/sys-tree.h stable/9/crypto/openssh/openbsd-compat/vis.c stable/9/crypto/openssh/openbsd-compat/vis.h stable/9/crypto/openssh/packet.c stable/9/crypto/openssh/platform.c stable/9/crypto/openssh/platform.h stable/9/crypto/openssh/readconf.c stable/9/crypto/openssh/readconf.h stable/9/crypto/openssh/scp.1 stable/9/crypto/openssh/scp.c stable/9/crypto/openssh/servconf.c stable/9/crypto/openssh/servconf.h stable/9/crypto/openssh/serverloop.c stable/9/crypto/openssh/session.c stable/9/crypto/openssh/sftp-server.8 stable/9/crypto/openssh/sftp-server.c stable/9/crypto/openssh/sftp.1 stable/9/crypto/openssh/sftp.c stable/9/crypto/openssh/ssh-add.1 stable/9/crypto/openssh/ssh-add.c stable/9/crypto/openssh/ssh-gss.h stable/9/crypto/openssh/ssh-keygen.1 stable/9/crypto/openssh/ssh-keygen.c stable/9/crypto/openssh/ssh-keyscan.1 stable/9/crypto/openssh/ssh.1 stable/9/crypto/openssh/ssh.c stable/9/crypto/openssh/ssh_config stable/9/crypto/openssh/ssh_config.5 stable/9/crypto/openssh/ssh_namespace.h stable/9/crypto/openssh/sshconnect.c stable/9/crypto/openssh/sshconnect2.c stable/9/crypto/openssh/sshd.8 stable/9/crypto/openssh/sshd.c stable/9/crypto/openssh/sshd_config stable/9/crypto/openssh/sshd_config.5 stable/9/crypto/openssh/uidswap.c stable/9/crypto/openssh/umac.c stable/9/crypto/openssh/umac.h stable/9/crypto/openssh/version.h stable/9/secure/lib/libssh/Makefile Directory Properties: stable/9/crypto/openssh/ (props changed) stable/9/secure/lib/libssh/ (props changed) Modified: stable/9/crypto/openssh/ChangeLog ============================================================================== --- stable/9/crypto/openssh/ChangeLog Thu May 30 12:25:37 2013 (r251134) +++ stable/9/crypto/openssh/ChangeLog Thu May 30 12:25:58 2013 (r251135) @@ -1,3 +1,709 @@ +20130510 + - (djm) OpenBSD CVS Cherrypick + - djm@cvs.openbsd.org 2013/04/11 02:27:50 + [packet.c] + quiet disconnect notifications on the server from error() back to logit() + if it is a normal client closure; bz#2057 ok+feedback dtucker@ + - (djm) [version.h contrib/caldera/openssh.spec contrib/redhat/openssh.spec] + [contrib/suse/openssh.spec] Crank version numbers for release. + +20130404 + - (dtucker) OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2013/02/17 23:16:57 + [readconf.c ssh.c readconf.h sshconnect2.c] + Keep track of which IndentityFile options were manually supplied and which + were default options, and don't warn if the latter are missing. + ok markus@ + - dtucker@cvs.openbsd.org 2013/02/19 02:12:47 + [krl.c] + Remove bogus include. ok djm + - dtucker@cvs.openbsd.org 2013/02/22 04:45:09 + [ssh.c readconf.c readconf.h] + Don't complain if IdentityFiles specified in system-wide configs are + missing. ok djm, deraadt. + - markus@cvs.openbsd.org 2013/02/22 19:13:56 + [sshconnect.c] + support ProxyCommand=- (stdin/out already point to the proxy); ok djm@ + - djm@cvs.openbsd.org 2013/02/22 22:09:01 + [ssh.c] + Allow IdenityFile=none; ok markus deraadt (and dtucker for an earlier + version) + +20130401 + - (dtucker) [openbsd-compat/bsd-cygwin_util.{c,h}] Don't include windows.h + to avoid conflicting definitions of __int64, adding the required bits. + Patch from Corinna Vinschen. + +20120322 + - (djm) [contrib/ssh-copy-id contrib/ssh-copy-id.1] Updated to Phil + Hands' greatly revised version. + - (djm) Release 6.2p1 + +20120318 + - (djm) [configure.ac log.c scp.c sshconnect2.c openbsd-compat/vis.c] + [openbsd-compat/vis.h] FreeBSD's strnvis isn't compatible with OpenBSD's + so mark it as broken. Patch from des AT des.no + +20120317 + - (tim) [configure.ac] OpenServer 5 wants lastlog even though it has none + of the bits the configure test looks for. + +20120316 + - (djm) [configure.ac] Disable utmp, wtmp and/or lastlog if the platform + is unable to successfully compile them. Based on patch from des AT + des.no + - (djm) [configure.ac openbsd-compat/bsd-misc.c openbsd-compat/bsd-misc.h] + Add a usleep replacement for platforms that lack it; ok dtucker + - (djm) [session.c] FreeBSD needs setusercontext(..., LOGIN_SETUMASK) to + occur after UID switch; patch from John Marshall via des AT des.no; + ok dtucker@ + +20120312 + - (dtucker) [regress/Makefile regress/cipher-speed.sh regress/test-exec.sh] + Improve portability of cipher-speed test, based mostly on a patch from + Iain Morgan. + - (dtucker) [auth.c configure.ac platform.c platform.h] Accept uid 2 ("bin") + in addition to root as an owner of system directories on AIX and HP-UX. + ok djm@ + +20130307 + - (dtucker) [INSTALL] Bump documented autoconf version to what we're + currently using. + - (dtucker) [defines.h] Remove SIZEOF_CHAR bits since the test for it + was removed in configure.ac rev 1.481 as it was redundant. + - (tim) [Makefile.in] Add another missing $(EXEEXT) I should have seen 3 days + ago. + - (djm) [configure.ac] Add a timeout to the select/rlimit test to give it a + chance to complete on broken systems; ok dtucker@ + +20130306 + - (dtucker) [regress/forward-control.sh] Wait longer for the forwarding + connection to start so that the test works on slower machines. + - (dtucker) [configure.ac] test that we can set number of file descriptors + to zero with setrlimit before enabling the rlimit sandbox. This affects + (at least) HPUX 11.11. + +20130305 + - (djm) [regress/modpipe.c] Compilation fix for AIX and parsing fix for + HP/UX. Spotted by Kevin Brott + - (dtucker) [configure.ac] use "=" for shell test and not "==". Spotted by + Amit Kulkarni and Kevin Brott. + - (dtucker) [Makefile.in] Remove trailing "\" on PATHS, which caused obscure + build breakage on (at least) HP-UX 11.11. Found by Amit Kulkarni and Kevin + Brott. + - (tim) [Makefile.in] Add missing $(EXEEXT). Found by Roumen Petrov. + +20130227 + - (djm) [README contrib/caldera/openssh.spec contrib/redhat/openssh.spec] + [contrib/suse/openssh.spec] Crank version numbers + - (tim) [regress/forward-control.sh] use sh in case login shell is csh. + - (tim) [regress/integrity.sh] shell portability fix. + - (tim) [regress/integrity.sh] keep old solaris awk from hanging. + - (tim) [regress/krl.sh] keep old solaris awk from hanging. + +20130226 + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/02/20 08:27:50 + [integrity.sh] + Add an option to modpipe that warns if the modification offset it not + reached in it's stream and turn it on for t-integrity. This should catch + cases where the session is not fuzzed for being too short (cf. my last + "oops" commit) + - (djm) [regress/integrity.sh] Run sshd via $SUDO; fixes tinderbox breakage + for UsePAM=yes configuration + +20130225 + - (dtucker) [configure.ac ssh-gss.h] bz#2073: additional #includes needed + to use Solaris native GSS libs. Patch from Pierre Ossman. + +20130223 + - (djm) [configure.ac includes.h loginrec.c mux.c sftp.c] Prefer + bsd/libutil.h to libutil.h to avoid deprecation warnings on Ubuntu. + ok tim + +20130222 + - (dtucker) [Makefile.in configure.ac] bz#2072: don't link krb5 libs to + ssh(1) since they're not needed. Patch from Pierre Ossman, ok djm. + - (dtucker) [configure.ac] bz#2073: look for Solaris' differently-named + libgss too. Patch from Pierre Ossman, ok djm. + - (djm) [configure.ac sandbox-seccomp-filter.c] Support for Linux + seccomp-bpf sandbox on ARM. Patch from shawnlandden AT gmail.com; + ok dtucker + +20130221 + - (tim) [regress/forward-control.sh] shell portability fix. + +20130220 + - (tim) [regress/cipher-speed.sh regress/try-ciphers.sh] shell portability fix. + - (tim) [krl.c Makefile.in regress/Makefile regress/modpipe.c] remove unneeded + err.h include from krl.c. Additional portability fixes for modpipe. OK djm + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/02/20 08:27:50 + [regress/integrity.sh regress/modpipe.c] + Add an option to modpipe that warns if the modification offset it not + reached in it's stream and turn it on for t-integrity. This should catch + cases where the session is not fuzzed for being too short (cf. my last + "oops" commit) + - djm@cvs.openbsd.org 2013/02/20 08:29:27 + [regress/modpipe.c] + s/Id/OpenBSD/ in RCS tag + +20130219 + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/02/18 22:26:47 + [integrity.sh] + crank the offset yet again; it was still fuzzing KEX one of Darren's + portable test hosts at 2800 + - djm@cvs.openbsd.org 2013/02/19 02:14:09 + [integrity.sh] + oops, forgot to increase the output of the ssh command to ensure that + we actually reach $offset + - (djm) [regress/integrity.sh] Skip SHA2-based MACs on configurations that + lack support for SHA2. + - (djm) [regress/modpipe.c] Add local err, and errx functions for platforms + that do not have them. + +20130217 + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/02/17 23:16:55 + [integrity.sh] + make the ssh command generates some output to ensure that there are at + least offset+tries bytes in the stream. + +20130216 + - OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/02/16 06:08:45 + [integrity.sh] + make sure the fuzz offset is actually past the end of KEX for all KEX + types. diffie-hellman-group-exchange-sha256 requires an offset around + 2700. Noticed via test failures in portable OpenSSH on platforms that + lack ECC and this the more byte-frugal ECDH KEX algorithms. + +20130215 + - (djm) [contrib/suse/rc.sshd] Use SSHD_BIN consistently; bz#2056 from + Iain Morgan + - (dtucker) [configure.ac openbsd-compat/bsd-misc.c openbsd-compat/bsd-misc.h] + Use getpgrp() if we don't have getpgid() (old BSDs, maybe others). + - (dtucker) [configure.ac openbsd-compat/Makefile.in openbsd-compat/strtoull.c + openbsd-compat/openbsd-compat.h] Add strtoull to compat library for + platforms that don't have it. + - (dtucker) [openbsd-compat/openbsd-compat.h] Add prototype for strtoul, + group strto* function prototypes together. + - (dtucker) [openbsd-compat/bsd-misc.c] Handle the case where setpgrp() takes + an argument. Pointed out by djm. + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/02/14 21:35:59 + [auth2-pubkey.c] + Correct error message that had a typo and was logging the wrong thing; + patch from Petr Lautrbach + - dtucker@cvs.openbsd.org 2013/02/15 00:21:01 + [sshconnect2.c] + Warn more loudly if an IdentityFile provided by the user cannot be read. + bz #1981, ok djm@ + +20130214 + - (djm) [regress/krl.sh] Don't use ecdsa keys in environment that lack ECC. + - (djm) [regress/krl.sh] typo; found by Iain Morgan + - (djm) [regress/integrity.sh] Start fuzzing from offset 2500 (instead + of 2300) to avoid clobbering the end of (non-MAC'd) KEX. Verified by + Iain Morgan + +20130212 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/01/24 21:45:37 + [krl.c] + fix handling of (unused) KRL signatures; skip string in correct buffer + - djm@cvs.openbsd.org 2013/01/24 22:08:56 + [krl.c] + skip serial lookup when cert's serial number is zero + - krw@cvs.openbsd.org 2013/01/25 05:00:27 + [krl.c] + Revert last. Breaks due to likely typo. Let djm@ fix later. + ok djm@ via dlg@ + - djm@cvs.openbsd.org 2013/01/25 10:22:19 + [krl.c] + redo last commit without the vi-vomit that snuck in: + skip serial lookup when cert's serial number is zero + (now with 100% better comment) + - djm@cvs.openbsd.org 2013/01/26 06:11:05 + [Makefile.in acss.c acss.h cipher-acss.c cipher.c] + [openbsd-compat/openssl-compat.h] + remove ACSS, now that it is gone from libcrypto too + - djm@cvs.openbsd.org 2013/01/27 10:06:12 + [krl.c] + actually use the xrealloc() return value; spotted by xi.wang AT gmail.com + - dtucker@cvs.openbsd.org 2013/02/06 00:20:42 + [servconf.c sshd_config sshd_config.5] + Change default of MaxStartups to 10:30:100 to start doing random early + drop at 10 connections up to 100 connections. This will make it harder + to DoS as CPUs have come a long way since the original value was set + back in 2000. Prompted by nion at debian org, ok markus@ + - dtucker@cvs.openbsd.org 2013/02/06 00:22:21 + [auth.c] + Fix comment, from jfree.e1 at gmail + - djm@cvs.openbsd.org 2013/02/08 00:41:12 + [sftp.c] + fix NULL deref when built without libedit and control characters + entered as command; debugging and patch from Iain Morgan an + Loganaden Velvindron in bz#1956 + - markus@cvs.openbsd.org 2013/02/10 21:19:34 + [version.h] + openssh 6.2 + - djm@cvs.openbsd.org 2013/02/10 23:32:10 + [ssh-keygen.c] + append to moduli file when screening candidates rather than overwriting. + allows resumption of interrupted screen; patch from Christophe Garault + in bz#1957; ok dtucker@ + - djm@cvs.openbsd.org 2013/02/10 23:35:24 + [packet.c] + record "Received disconnect" messages at ERROR rather than INFO priority, + since they are abnormal and result in a non-zero ssh exit status; patch + from Iain Morgan in bz#2057; ok dtucker@ + - dtucker@cvs.openbsd.org 2013/02/11 21:21:58 + [sshd.c] + Add openssl version to debug output similar to the client. ok markus@ + - djm@cvs.openbsd.org 2013/02/11 23:58:51 + [regress/try-ciphers.sh] + remove acss here too + - (djm) [regress/try-ciphers.sh] clean up CVS merge botch + +20130211 + - (djm) [configure.ac openbsd-compat/openssl-compat.h] Repair build on old + libcrypto that lacks EVP_CIPHER_CTX_ctrl + +20130208 + - (djm) [contrib/redhat/sshd.init] treat RETVAL as an integer; + patch from Iain Morgan in bz#2059 + - (dtucker) [configure.ac openbsd-compat/sys-tree.h] Test if compiler allows + __attribute__ on return values and work around if necessary. ok djm@ + +20130207 + - (djm) [configure.ac] Don't probe seccomp capability of running kernel + at configure time; the seccomp sandbox will fall back to rlimit at + runtime anyway. Patch from plautrba AT redhat.com in bz#2011 + +20130120 + - (djm) [cipher-aes.c cipher-ctr.c openbsd-compat/openssl-compat.h] + Move prototypes for replacement ciphers to openssl-compat.h; fix EVP + prototypes for openssl-1.0.0-fips. + - (djm) OpenBSD CVS Sync + - jmc@cvs.openbsd.org 2013/01/18 07:57:47 + [ssh-keygen.1] + tweak previous; + - jmc@cvs.openbsd.org 2013/01/18 07:59:46 + [ssh-keygen.c] + -u before -V in usage(); + - jmc@cvs.openbsd.org 2013/01/18 08:00:49 + [sshd_config.5] + tweak previous; + - jmc@cvs.openbsd.org 2013/01/18 08:39:04 + [ssh-keygen.1] + add -Q to the options list; ok djm + - jmc@cvs.openbsd.org 2013/01/18 21:48:43 + [ssh-keygen.1] + command-line (adj.) -> command line (n.); + - jmc@cvs.openbsd.org 2013/01/19 07:13:25 + [ssh-keygen.1] + fix some formatting; ok djm + - markus@cvs.openbsd.org 2013/01/19 12:34:55 + [krl.c] + RB_INSERT does not remove existing elments; ok djm@ + - (djm) [openbsd-compat/sys-tree.h] Sync with OpenBSD. krl.c needs newer + version. + - (djm) [regress/krl.sh] replacement for jot; most platforms lack it + +20130118 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/01/17 23:00:01 + [auth.c key.c key.h ssh-keygen.1 ssh-keygen.c sshd_config.5] + [krl.c krl.h PROTOCOL.krl] + add support for Key Revocation Lists (KRLs). These are a compact way to + represent lists of revoked keys and certificates, taking as little as + a single bit of incremental cost to revoke a certificate by serial number. + KRLs are loaded via the existing RevokedKeys sshd_config option. + feedback and ok markus@ + - djm@cvs.openbsd.org 2013/01/18 00:45:29 + [regress/Makefile regress/cert-userkey.sh regress/krl.sh] + Tests for Key Revocation Lists (KRLs) + - djm@cvs.openbsd.org 2013/01/18 03:00:32 + [krl.c] + fix KRL generation bug for list sections + +20130117 + - (djm) [regress/cipher-speed.sh regress/integrity.sh regress/try-ciphers.sh] + check for GCM support before testing GCM ciphers. + +20130112 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2013/01/12 11:22:04 + [cipher.c] + improve error message for integrity failure in AES-GCM modes; ok markus@ + - djm@cvs.openbsd.org 2013/01/12 11:23:53 + [regress/cipher-speed.sh regress/integrity.sh regress/try-ciphers.sh] + test AES-GCM modes; feedback markus@ + - (djm) [regress/integrity.sh] repair botched merge + +20130109 + - (djm) OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2012/12/14 05:26:43 + [auth.c] + use correct string in error message; from rustybsd at gmx.fr + - djm@cvs.openbsd.org 2013/01/02 00:32:07 + [clientloop.c mux.c] + channel_setup_local_fwd_listener() returns 0 on failure, not -ve + bz#2055 reported by mathieu.lacage AT gmail.com + - djm@cvs.openbsd.org 2013/01/02 00:33:49 + [PROTOCOL.agent] + correct format description for SSH_AGENTC_ADD_RSA_ID_CONSTRAINED + bz#2051 from david AT lechnology.com + - djm@cvs.openbsd.org 2013/01/03 05:49:36 + [servconf.h] + add a couple of ServerOptions members that should be copied to the privsep + child (for consistency, in this case they happen only to be accessed in + the monitor); ok dtucker@ + - djm@cvs.openbsd.org 2013/01/03 12:49:01 + [PROTOCOL] + fix description of MAC calculation for EtM modes; ok markus@ + - djm@cvs.openbsd.org 2013/01/03 12:54:49 + [sftp-server.8 sftp-server.c] + allow specification of an alternate start directory for sftp-server(8) + "I like this" markus@ + - djm@cvs.openbsd.org 2013/01/03 23:22:58 + [ssh-keygen.c] + allow fingerprinting of keys hosted in PKCS#11 tokens: ssh-keygen -lD ... + ok markus@ + - jmc@cvs.openbsd.org 2013/01/04 19:26:38 + [sftp-server.8 sftp-server.c] + sftp-server.8: add argument name to -d + sftp-server.c: add -d to usage() + ok djm + - markus@cvs.openbsd.org 2013/01/08 18:49:04 + [PROTOCOL authfile.c cipher.c cipher.h kex.c kex.h monitor_wrap.c] + [myproposal.h packet.c ssh_config.5 sshd_config.5] + support AES-GCM as defined in RFC 5647 (but with simpler KEX handling) + ok and feedback djm@ + - djm@cvs.openbsd.org 2013/01/09 05:40:17 + [ssh-keygen.c] + correctly initialise fingerprint type for fingerprinting PKCS#11 keys + - (djm) [cipher.c configure.ac openbsd-compat/openssl-compat.h] + Fix merge botch, automatically detect AES-GCM in OpenSSL, move a little + cipher compat code to openssl-compat.h + +20121217 + - (dtucker) [Makefile.in] Add some scaffolding so that the new regress + tests will work with VPATH directories. + +20121213 + - (djm) OpenBSD CVS Sync + - markus@cvs.openbsd.org 2012/12/12 16:45:52 + [packet.c] + reset incoming_packet buffer for each new packet in EtM-case, too; + this happens if packets are parsed only parially (e.g. ignore + messages sent when su/sudo turn off echo); noted by sthen/millert + - naddy@cvs.openbsd.org 2012/12/12 16:46:10 + [cipher.c] + use OpenSSL's EVP_aes_{128,192,256}_ctr() API and remove our hand-rolled + counter mode code; ok djm@ + - (djm) [configure.ac cipher-ctr.c] Adapt EVP AES CTR change to retain our + compat code for older OpenSSL + - (djm) [cipher.c] Fix missing prototype for compat code + +20121212 + - (djm) OpenBSD CVS Sync + - markus@cvs.openbsd.org 2012/12/11 22:16:21 + [monitor.c] + drain the log messages after receiving the keystate from the unpriv + child. otherwise it might block while sending. ok djm@ + - markus@cvs.openbsd.org 2012/12/11 22:31:18 + [PROTOCOL authfile.c cipher.c cipher.h kex.h mac.c myproposal.h] + [packet.c ssh_config.5 sshd_config.5] + add encrypt-then-mac (EtM) modes to openssh by defining new mac algorithms + that change the packet format and compute the MAC over the encrypted + message (including the packet size) instead of the plaintext data; + these EtM modes are considered more secure and used by default. + feedback and ok djm@ + - sthen@cvs.openbsd.org 2012/12/11 22:51:45 + [mac.c] + fix typo, s/tem/etm in hmac-ripemd160-tem. ok markus@ + - markus@cvs.openbsd.org 2012/12/11 22:32:56 + [regress/try-ciphers.sh] + add etm modes + - markus@cvs.openbsd.org 2012/12/11 22:42:11 + [regress/Makefile regress/modpipe.c regress/integrity.sh] + test the integrity of the packets; with djm@ + - markus@cvs.openbsd.org 2012/12/11 23:12:13 + [try-ciphers.sh] + add hmac-ripemd160-etm@openssh.com + - (djm) [mac.c] fix merge botch + - (djm) [regress/Makefile regress/integrity.sh] Make the integrity.sh test + work on platforms without 'jot' + - (djm) [regress/integrity.sh] Fix awk quoting, packet length skip + - (djm) [regress/Makefile] fix t-exec rule + +20121207 + - (dtucker) OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2012/12/06 06:06:54 + [regress/keys-command.sh] + Fix some problems with the keys-command test: + - use string comparison rather than numeric comparison + - check for existing KEY_COMMAND file and don't clobber if it exists + - clean up KEY_COMMAND file if we do create it. + - check that KEY_COMMAND is executable (which it won't be if eg /var/run + is mounted noexec). + ok djm. + - jmc@cvs.openbsd.org 2012/12/03 08:33:03 + [ssh-add.1 sshd_config.5] + tweak previous; + - markus@cvs.openbsd.org 2012/12/05 15:42:52 + [ssh-add.c] + prevent double-free of comment; ok djm@ + - dtucker@cvs.openbsd.org 2012/12/07 01:51:35 + [serverloop.c] + Cast signal to int for logging. A no-op on openbsd (they're always ints) + but will prevent warnings in portable. ok djm@ + +20121205 + - (tim) [defines.h] Some platforms are missing ULLONG_MAX. Feedback djm@. + +20121203 + - (djm) [openbsd-compat/sys-queue.h] Sync with OpenBSD to get + TAILQ_FOREACH_SAFE needed for upcoming changes. + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2012/12/02 20:26:11 + [ssh_config.5 sshconnect2.c] + Make IdentitiesOnly apply to keys obtained from a PKCS11Provider. + This allows control of which keys are offered from tokens using + IdentityFile. ok markus@ + - djm@cvs.openbsd.org 2012/12/02 20:42:15 + [ssh-add.1 ssh-add.c] + make deleting explicit keys "ssh-add -d" symmetric with adding keys - + try to delete the corresponding certificate too and respect the -k option + to allow deleting of the key only; feedback and ok markus@ + - djm@cvs.openbsd.org 2012/12/02 20:46:11 + [auth-options.c channels.c servconf.c servconf.h serverloop.c session.c] + [sshd_config.5] + make AllowTcpForwarding accept "local" and "remote" in addition to its + current "yes"/"no" to allow the server to specify whether just local or + remote TCP forwarding is enabled. ok markus@ + - dtucker@cvs.openbsd.org 2012/10/05 02:20:48 + [regress/cipher-speed.sh regress/try-ciphers.sh] + Add umac-128@openssh.com to the list of MACs to be tested + - djm@cvs.openbsd.org 2012/10/19 05:10:42 + [regress/cert-userkey.sh] + include a serial number when generating certs + - djm@cvs.openbsd.org 2012/11/22 22:49:30 + [regress/Makefile regress/keys-command.sh] + regress for AuthorizedKeysCommand; hints from markus@ + - djm@cvs.openbsd.org 2012/12/02 20:47:48 + [Makefile regress/forward-control.sh] + regress for AllowTcpForwarding local/remote; ok markus@ + - djm@cvs.openbsd.org 2012/12/03 00:14:06 + [auth2-chall.c ssh-keygen.c] + Fix compilation with -Wall -Werror (trivial type fixes) + - (djm) [configure.ac] Turn on -g for gcc compilers. Helps pre-installation + debugging. ok dtucker@ + - (djm) [configure.ac] Revert previous. configure.ac already does this + for us. + +20121114 + - (djm) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2012/11/14 02:24:27 + [auth2-pubkey.c] + fix username passed to helper program + prepare stdio fds before closefrom() + spotted by landry@ + - djm@cvs.openbsd.org 2012/11/14 02:32:15 + [ssh-keygen.c] + allow the full range of unsigned serial numbers; 'fine' deraadt@ + - djm@cvs.openbsd.org 2012/12/02 20:34:10 + [auth.c auth.h auth1.c auth2-chall.c auth2-gss.c auth2-jpake.c auth2.c] + [monitor.c monitor.h] + Fixes logging of partial authentication when privsep is enabled + Previously, we recorded "Failed xxx" since we reset authenticated before + calling auth_log() in auth2.c. This adds an explcit "Partial" state. + + Add a "submethod" to auth_log() to report which submethod is used + for keyboard-interactive. + + Fix multiple authentication when one of the methods is + keyboard-interactive. + + ok markus@ + - dtucker@cvs.openbsd.org 2012/10/05 02:05:30 + [regress/multiplex.sh] + Use 'kill -0' to test for the presence of a pid since it's more portable + +20121107 + - (djm) OpenBSD CVS Sync + - eric@cvs.openbsd.org 2011/11/28 08:46:27 + [moduli.5] + fix formula + ok djm@ + - jmc@cvs.openbsd.org 2012/09/26 17:34:38 + [moduli.5] + last stage of rfc changes, using consistent Rs/Re blocks, and moving the + references into a STANDARDS section; + +20121105 + - (dtucker) [uidswap.c openbsd-compat/Makefile.in + openbsd-compat/bsd-setres_id.c openbsd-compat/bsd-setres_id.h + openbsd-compat/openbsd-compat.h] Move the fallback code for setting uids + and gids from uidswap.c to the compat library, which allows it to work with + the new setresuid calls in auth2-pubkey. with tim@, ok djm@ + - (dtucker) [auth2-pubkey.c] wrap paths.h in an ifdef for platforms that + don't have it. Spotted by tim@. + +20121104 + - (djm) OpenBSD CVS Sync + - jmc@cvs.openbsd.org 2012/10/31 08:04:50 + [sshd_config.5] + tweak previous; + - djm@cvs.openbsd.org 2012/11/04 10:38:43 + [auth2-pubkey.c sshd.c sshd_config.5] + Remove default of AuthorizedCommandUser. Administrators are now expected + to explicitly specify a user. feedback and ok markus@ + - djm@cvs.openbsd.org 2012/11/04 11:09:15 + [auth.h auth1.c auth2.c monitor.c servconf.c servconf.h sshd.c] + [sshd_config.5] + Support multiple required authentication via an AuthenticationMethods + option. This option lists one or more comma-separated lists of + authentication method names. Successful completion of all the methods in + any list is required for authentication to complete; + feedback and ok markus@ + +20121030 + - (djm) OpenBSD CVS Sync + - markus@cvs.openbsd.org 2012/10/05 12:34:39 + [sftp.c] + fix signed vs unsigned warning; feedback & ok: djm@ + - djm@cvs.openbsd.org 2012/10/30 21:29:55 + [auth-rsa.c auth.c auth.h auth2-pubkey.c servconf.c servconf.h] + [sshd.c sshd_config sshd_config.5] + new sshd_config option AuthorizedKeysCommand to support fetching + authorized_keys from a command in addition to (or instead of) from + the filesystem. The command is run as the target server user unless + another specified via a new AuthorizedKeysCommandUser option. + + patch originally by jchadima AT redhat.com, reworked by me; feedback + and ok markus@ + +20121019 + - (tim) [buildpkg.sh.in] Double up on some backslashes so they end up in + the generated file as intended. + +20121005 + - (dtucker) OpenBSD CVS Sync + - djm@cvs.openbsd.org 2012/09/17 09:54:44 + [sftp.c] + an XXX for later + - markus@cvs.openbsd.org 2012/09/17 13:04:11 + [packet.c] + clear old keys on rekeing; ok djm + - dtucker@cvs.openbsd.org 2012/09/18 10:36:12 + [sftp.c] + Add bounds check on sftp tab-completion. Part of a patch from from + Jean-Marc Robert via tech@, ok djm + - dtucker@cvs.openbsd.org 2012/09/21 10:53:07 + [sftp.c] + Fix improper handling of absolute paths when PWD is part of the completed + path. Patch from Jean-Marc Robert via tech@, ok djm. + - dtucker@cvs.openbsd.org 2012/09/21 10:55:04 + [sftp.c] + Fix handling of filenames containing escaped globbing characters and + escape "#" and "*". Patch from Jean-Marc Robert via tech@, ok djm. + - jmc@cvs.openbsd.org 2012/09/26 16:12:13 + [ssh.1] + last stage of rfc changes, using consistent Rs/Re blocks, and moving the + references into a STANDARDS section; + - naddy@cvs.openbsd.org 2012/10/01 13:59:51 + [monitor_wrap.c] + pasto; ok djm@ + - djm@cvs.openbsd.org 2012/10/02 07:07:45 + [ssh-keygen.c] + fix -z option, broken in revision 1.215 + - markus@cvs.openbsd.org 2012/10/04 13:21:50 + [myproposal.h ssh_config.5 umac.h sshd_config.5 ssh.1 sshd.8 mac.c] + add umac128 variant; ok djm@ at n2k12 + - dtucker@cvs.openbsd.org 2012/09/06 04:11:07 + [regress/try-ciphers.sh] + Restore missing space. (Id sync only). + - dtucker@cvs.openbsd.org 2012/09/09 11:51:25 + [regress/multiplex.sh] + Add test for ssh -Ostop + - dtucker@cvs.openbsd.org 2012/09/10 00:49:21 + [regress/multiplex.sh] + Log -O cmd output to the log file and make logging consistent with the + other tests. Test clean shutdown of an existing channel when testing + "stop". + - dtucker@cvs.openbsd.org 2012/09/10 01:51:19 + [regress/multiplex.sh] + use -Ocheck and waiting for completions by PID to make multiplexing test + less racy and (hopefully) more reliable on slow hardware. + - [Makefile umac.c] Add special-case target to build umac128.o. + - [umac.c] Enforce allowed umac output sizes. From djm@. + - [Makefile.in] "Using $< in a non-suffix rule context is a GNUmake idiom". + +20120917 + - (dtucker) OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2012/09/13 23:37:36 + [servconf.c] + Fix comment line length + - markus@cvs.openbsd.org 2012/09/14 16:51:34 + [sshconnect.c] + remove unused variable + +20120907 + - (dtucker) OpenBSD CVS Sync + - dtucker@cvs.openbsd.org 2012/09/06 09:50:13 + [clientloop.c] + Make the escape command help (~?) context sensitive so that only commands + that will work in the current session are shown. ok markus@ + - jmc@cvs.openbsd.org 2012/09/06 13:57:42 + [ssh.1] + missing letter in previous; + - dtucker@cvs.openbsd.org 2012/09/07 00:30:19 + [clientloop.c] + Print '^Z' instead of a raw ^Z when the sequence is not supported. ok djm@ + - dtucker@cvs.openbsd.org 2012/09/07 01:10:21 + [clientloop.c] + Merge escape help text for ~v and ~V; ok djm@ + - dtucker@cvs.openbsd.org 2012/09/07 06:34:21 + [clientloop.c] + when muxmaster is run with -N, make it shut down gracefully when a client + sends it "-O stop" rather than hanging around (bz#1985). ok djm@ + +20120906 + - (dtucker) OpenBSD CVS Sync + - jmc@cvs.openbsd.org 2012/08/15 18:25:50 + [ssh-keygen.1] + a little more info on certificate validity; + requested by Ross L Richardson, and provided by djm + - dtucker@cvs.openbsd.org 2012/08/17 00:45:45 + [clientloop.c clientloop.h mux.c] + Force a clean shutdown of ControlMaster client sessions when the ~. escape + sequence is used. This means that ~. should now work in mux clients even + if the server is no longer responding. Found by tedu, ok djm. + - djm@cvs.openbsd.org 2012/08/17 01:22:56 + [kex.c] + add some comments about better handling first-KEX-follows notifications + from the server. Nothing uses these right now. No binary change + - djm@cvs.openbsd.org 2012/08/17 01:25:58 + [ssh-keygen.c] + print details of which host lines were deleted when using + "ssh-keygen -R host"; ok markus@ + - djm@cvs.openbsd.org 2012/08/17 01:30:00 + [compat.c sshconnect.c] + Send client banner immediately, rather than waiting for the server to + move first for SSH protocol 2 connections (the default). Patch based on + one in bz#1999 by tls AT panix.com, feedback dtucker@ ok markus@ + - dtucker@cvs.openbsd.org 2012/09/06 04:37:39 + [clientloop.c log.c ssh.1 log.h] + Add ~v and ~V escape sequences to raise and lower the logging level + respectively. Man page help from jmc, ok deraadt jmc + +20120830 + - (dtucker) [moduli] Import new moduli file. + 20120828 - (djm) Release openssh-6.1 @@ -172,6 +878,7 @@ [dns.c dns.h key.c key.h ssh-keygen.c] add support for RFC6594 SSHFP DNS records for ECDSA key types. patch from bugzilla-m67 AT nulld.me in bz#1978; ok + tweak markus@ + (Original authors OndÅ™ej Surý, OndÅ™ej Caletka and Daniel Black) - djm@cvs.openbsd.org 2012/06/01 00:49:35 [PROTOCOL.mux] correct types of port numbers (integers, not strings); bz#2004 from Modified: stable/9/crypto/openssh/INSTALL ============================================================================== --- stable/9/crypto/openssh/INSTALL Thu May 30 12:25:37 2013 (r251134) +++ stable/9/crypto/openssh/INSTALL Thu May 30 12:25:58 2013 (r251135) @@ -89,7 +89,7 @@ http://nlnetlabs.nl/projects/ldns/ Autoconf: If you modify configure.ac or configure doesn't exist (eg if you checked -the code out of CVS yourself) then you will need autoconf-2.61 to rebuild +the code out of CVS yourself) then you will need autoconf-2.68 to rebuild the automatically generated files by running "autoreconf". Earlier versions may also work but this is not guaranteed. @@ -266,4 +266,4 @@ Please refer to the "reporting bugs" sec http://www.openssh.com/ -$Id: INSTALL,v 1.87 2011/11/04 00:25:25 dtucker Exp $ +$Id: INSTALL,v 1.88 2013/03/07 01:33:35 dtucker Exp $ Modified: stable/9/crypto/openssh/PROTOCOL ============================================================================== --- stable/9/crypto/openssh/PROTOCOL Thu May 30 12:25:37 2013 (r251134) +++ stable/9/crypto/openssh/PROTOCOL Thu May 30 12:25:58 2013 (r251135) @@ -51,6 +51,46 @@ and ecdsa-sha2-nistp521 curves over GF(p curve points encoded using point compression are NOT accepted or generated. +1.5 transport: Protocol 2 Encrypt-then-MAC MAC algorithms + +OpenSSH supports MAC algorithms, whose names contain "-etm", that +perform the calculations in a different order to that defined in RFC +4253. These variants use the so-called "encrypt then MAC" ordering, +calculating the MAC over the packet ciphertext rather than the +plaintext. This ordering closes a security flaw in the SSH transport +protocol, where decryption of unauthenticated ciphertext provided a +"decryption oracle" that could, in conjunction with cipher flaws, reveal +session plaintext. + +Specifically, the "-etm" MAC algorithms modify the transport protocol +to calculate the MAC over the packet ciphertext and to send the packet +length unencrypted. This is necessary for the transport to obtain the +length of the packet and location of the MAC tag so that it may be +verified without decrypting unauthenticated data. + +As such, the MAC covers: + + mac = MAC(key, sequence_number || packet_length || encrypted_packet) + +where "packet_length" is encoded as a uint32 and "encrypted_packet" +contains: + + byte padding_length + byte[n1] payload; n1 = packet_length - padding_length - 1 + byte[n2] random padding; n2 = padding_length + +1.6 transport: AES-GCM + +OpenSSH supports the AES-GCM algorithm as specified in RFC 5647. +Because of problems with the specification of the key exchange +the behaviour of OpenSSH differs from the RFC as follows: + +AES-GCM is only negotiated as the cipher algorithms +"aes128-gcm@openssh.com" or "aes256-gcm@openssh.com" and never as +an MAC algorithm. Additionally, if AES-GCM is selected as the cipher +the exchanged MAC algorithms are ignored and there doesn't have to be +a matching MAC. + 2. Connection protocol changes 2.1. connection: Channel write close extension "eow@openssh.com" @@ -291,4 +331,4 @@ link(oldpath, newpath) and will respond This extension is advertised in the SSH_FXP_VERSION hello with version "1". -$OpenBSD: PROTOCOL,v 1.17 2010/12/04 00:18:01 djm Exp $ +$OpenBSD: PROTOCOL,v 1.20 2013/01/08 18:49:04 markus Exp $ Modified: stable/9/crypto/openssh/PROTOCOL.agent ============================================================================== --- stable/9/crypto/openssh/PROTOCOL.agent Thu May 30 12:25:37 2013 (r251134) +++ stable/9/crypto/openssh/PROTOCOL.agent Thu May 30 12:25:58 2013 (r251135) @@ -152,7 +152,7 @@ fully specified using just rsa_q, rsa_p computation. "key_constraints" may only be present if the request type is -SSH_AGENTC_ADD_RSA_IDENTITY. +SSH_AGENTC_ADD_RSA_ID_CONSTRAINED. The agent will reply with a SSH_AGENT_SUCCESS if the key has been successfully added or a SSH_AGENT_FAILURE if an error occurred. @@ -557,4 +557,4 @@ Locking and unlocking affects both proto SSH_AGENT_CONSTRAIN_LIFETIME 1 SSH_AGENT_CONSTRAIN_CONFIRM 2 -$OpenBSD: PROTOCOL.agent,v 1.6 2010/08/31 11:54:45 djm Exp $ +$OpenBSD: PROTOCOL.agent,v 1.7 2013/01/02 00:33:49 djm Exp $ Copied: stable/9/crypto/openssh/PROTOCOL.krl (from r248619, head/crypto/openssh/PROTOCOL.krl) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/crypto/openssh/PROTOCOL.krl Thu May 30 12:25:58 2013 (r251135, copy of r248619, head/crypto/openssh/PROTOCOL.krl) @@ -0,0 +1,164 @@ +This describes the key/certificate revocation list format for OpenSSH. + +1. Overall format + +The KRL consists of a header and zero or more sections. The header is: + +#define KRL_MAGIC 0x5353484b524c0a00ULL /* "SSHKRL\n\0" */ +#define KRL_FORMAT_VERSION 1 + + uint64 KRL_MAGIC + uint32 KRL_FORMAT_VERSION + uint64 krl_version + uint64 generated_date + uint64 flags + string reserved + string comment + +Where "krl_version" is a version number that increases each time the KRL +is modified, "generated_date" is the time in seconds since 1970-01-01 +00:00:00 UTC that the KRL was generated, "comment" is an optional comment +and "reserved" an extension field whose contents are currently ignored. +No "flags" are currently defined. + +Following the header are zero or more sections, each consisting of: + + byte section_type + string section_data + +Where "section_type" indicates the type of the "section_data". An exception +to this is the KRL_SECTION_SIGNATURE section, that has a slightly different +format (see below). + +The available section types are: + +#define KRL_SECTION_CERTIFICATES 1 +#define KRL_SECTION_EXPLICIT_KEY 2 +#define KRL_SECTION_FINGERPRINT_SHA1 3 +#define KRL_SECTION_SIGNATURE 4 + +3. Certificate serial section + +These sections use type KRL_SECTION_CERTIFICATES to revoke certificates by +serial number or key ID. The consist of the CA key that issued the +certificates to be revoked and a reserved field whose contents is currently +ignored. + + string ca_key + string reserved + +Followed by one or more sections: + + byte cert_section_type + string cert_section_data + +The certificate section types are: + +#define KRL_SECTION_CERT_SERIAL_LIST 0x20 +#define KRL_SECTION_CERT_SERIAL_RANGE 0x21 +#define KRL_SECTION_CERT_SERIAL_BITMAP 0x22 +#define KRL_SECTION_CERT_KEY_ID 0x23 + +2.1 Certificate serial list section + +This section is identified as KRL_SECTION_CERT_SERIAL_LIST. It revokes +certificates by listing their serial numbers. The cert_section_data in this +case contains: + + uint64 revoked_cert_serial + uint64 ... + +This section may appear multiple times. + +2.2. Certificate serial range section + +These sections use type KRL_SECTION_CERT_SERIAL_RANGE and hold +a range of serial numbers of certificates: + + uint64 serial_min + uint64 serial_max + +All certificates in the range serial_min <= serial <= serial_max are +revoked. + +This section may appear multiple times. + +2.3. Certificate serial bitmap section + +Bitmap sections use type KRL_SECTION_CERT_SERIAL_BITMAP and revoke keys +by listing their serial number in a bitmap. + + uint64 serial_offset + mpint revoked_keys_bitmap + +A bit set at index N in the bitmap corresponds to revocation of a keys with +serial number (serial_offset + N). + +This section may appear multiple times. + +2.4. Revoked key ID sections + +KRL_SECTION_CERT_KEY_ID sections revoke particular certificate "key +ID" strings. This may be useful in revoking all certificates +associated with a particular identity, e.g. a host or a user. + + string key_id[0] + ... + +This section must contain at least one "key_id". This section may appear +multiple times. + +3. Explicit key sections + +These sections, identified as KRL_SECTION_EXPLICIT_KEY, revoke keys +(not certificates). They are less space efficient than serial numbers, +but are able to revoke plain keys. + + string public_key_blob[0] + .... + +This section must contain at least one "public_key_blob". The blob +must be a raw key (i.e. not a certificate). + +This section may appear multiple times. + +4. SHA1 fingerprint sections + +These sections, identified as KRL_SECTION_FINGERPRINT_SHA1, revoke +plain keys (i.e. not certificates) by listing their SHA1 hashes: + + string public_key_hash[0] + .... + +This section must contain at least one "public_key_hash". The hash blob +is obtained by taking the SHA1 hash of the public key blob. Hashes in +this section must appear in numeric order, treating each hash as a big- +endian integer. + +This section may appear multiple times. + +5. KRL signature sections + +The KRL_SECTION_SIGNATURE section serves a different purpose to the +preceeding ones: to provide cryptographic authentication of a KRL that +is retrieved over a channel that does not provide integrity protection. +Its format is slightly different to the previously-described sections: +in order to simplify the signature generation, it includes as a "body" +two string components instead of one. + + byte KRL_SECTION_SIGNATURE + string signature_key + string signature + +The signature is calculated over the entire KRL from the KRL_MAGIC +to this subsection's "signature_key", including both and using the +signature generation rules appropriate for the type of "signature_key". + +This section must appear last in the KRL. If multiple signature sections +appear, they must appear consecutively at the end of the KRL file. + +Implementations that retrieve KRLs over untrusted channels must verify +signatures. Signature sections are optional for KRLs distributed by +trusted means. + +$OpenBSD: PROTOCOL.krl,v 1.2 2013/01/18 00:24:58 djm Exp $ Modified: stable/9/crypto/openssh/README ============================================================================== --- stable/9/crypto/openssh/README Thu May 30 12:25:37 2013 (r251134) +++ stable/9/crypto/openssh/README Thu May 30 12:25:58 2013 (r251135) @@ -1,4 +1,4 @@ -See http://www.openssh.com/txt/release-6.1 for the release notes. +See http://www.openssh.com/txt/release-6.2p2 for the release notes. - A Japanese translation of this document and of the OpenSSH FAQ is - available at http://www.unixuser.org/~haruyama/security/openssh/index.html @@ -62,4 +62,4 @@ References - [6] http://www.openbsd.org/cgi-bin/man.cgi?query=style&sektion=9 [7] http://www.openssh.com/faq.html -$Id: README,v 1.81 2012/08/22 11:57:13 djm Exp $ +$Id: README,v 1.82.2.1 2013/05/10 06:12:54 djm Exp $ Modified: stable/9/crypto/openssh/auth-options.c ============================================================================== --- stable/9/crypto/openssh/auth-options.c Thu May 30 12:25:37 2013 (r251134) +++ stable/9/crypto/openssh/auth-options.c Thu May 30 12:25:58 2013 (r251135) @@ -1,4 +1,4 @@ -/* $OpenBSD: auth-options.c,v 1.56 2011/10/18 04:58:26 djm Exp $ */ +/* $OpenBSD: auth-options.c,v 1.57 2012/12/02 20:46:11 djm Exp $ */ /* * Author: Tatu Ylonen * Copyright (c) 1995 Tatu Ylonen , Espoo, Finland @@ -349,7 +349,7 @@ auth_parse_options(struct passwd *pw, ch xfree(patterns); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Thu May 30 16:51:49 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E250F703; Thu, 30 May 2013 16:51:49 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C492165B; Thu, 30 May 2013 16:51:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UGpnb9066971; Thu, 30 May 2013 16:51:49 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UGpms6066966; Thu, 30 May 2013 16:51:48 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201305301651.r4UGpms6066966@svn.freebsd.org> From: Scott Long Date: Thu, 30 May 2013 16:51:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251144 - in stable/9/sys: fs/udf kern sys ufs/ffs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 16:51:50 -0000 Author: scottl Date: Thu May 30 16:51:48 2013 New Revision: 251144 URL: http://svnweb.freebsd.org/changeset/base/251144 Log: MFC r248282, in a modified fashion. From the original changelog: Add currently unused flag argument to the cluster_read(), cluster_write() and cluster_wbuild() functions. The flags to be allowed are a subset of the GB_* flags for getblk(). This merge adds a cluster_*_gb() API variant instead of changing the ABI with an added argument to the existing API. Most API consumers that were changed in the original rev have been left un-changed in this merge to reduce churn. The mergeinfo is recorded though for future merging convenience. This is effectively a no-op for the moment. Submitted by: kib, FF Obtained from: Netflix Modified: stable/9/sys/fs/udf/udf_vnops.c stable/9/sys/kern/vfs_bio.c stable/9/sys/kern/vfs_cluster.c stable/9/sys/sys/buf.h stable/9/sys/ufs/ffs/ffs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/fs/udf/udf_vnops.c ============================================================================== --- stable/9/sys/fs/udf/udf_vnops.c Thu May 30 16:16:28 2013 (r251143) +++ stable/9/sys/fs/udf/udf_vnops.c Thu May 30 16:51:48 2013 (r251144) @@ -479,8 +479,9 @@ udf_read(struct vop_read_args *ap) rablock = lbn + 1; if ((vp->v_mount->mnt_flag & MNT_NOCLUSTERR) == 0) { if (lblktosize(udfmp, rablock) < fsize) { - error = cluster_read(vp, fsize, lbn, size, NOCRED, - uio->uio_resid, (ap->a_ioflag >> 16), &bp); + error = cluster_read(vp, fsize, lbn, size, + NOCRED, uio->uio_resid, + (ap->a_ioflag >> 16), &bp); } else { error = bread(vp, lbn, size, NOCRED, &bp); } Modified: stable/9/sys/kern/vfs_bio.c ============================================================================== --- stable/9/sys/kern/vfs_bio.c Thu May 30 16:16:28 2013 (r251143) +++ stable/9/sys/kern/vfs_bio.c Thu May 30 16:51:48 2013 (r251144) @@ -1830,7 +1830,7 @@ vfs_bio_awrite(struct buf *bp) if (ncl != 1) { BUF_UNLOCK(bp); nwritten = cluster_wbuild(vp, size, lblkno - j, ncl); - return nwritten; + return (nwritten); } } bremfree(bp); Modified: stable/9/sys/kern/vfs_cluster.c ============================================================================== --- stable/9/sys/kern/vfs_cluster.c Thu May 30 16:16:28 2013 (r251143) +++ stable/9/sys/kern/vfs_cluster.c Thu May 30 16:51:48 2013 (r251144) @@ -87,15 +87,18 @@ extern vm_page_t bogus_page; * cluster_read replaces bread. */ int -cluster_read(vp, filesize, lblkno, size, cred, totread, seqcount, bpp) - struct vnode *vp; - u_quad_t filesize; - daddr_t lblkno; - long size; - struct ucred *cred; - long totread; - int seqcount; - struct buf **bpp; +cluster_read(struct vnode *vp, u_quad_t filesize, daddr_t lblkno, long size, + struct ucred *cred, long totread, int seqcount, struct buf **bpp) +{ + + return (cluster_read_gb(vp, filesize, lblkno, size, cred, totread, + seqcount, 0, bpp)); +} + +int +cluster_read_gb(struct vnode *vp, u_quad_t filesize, daddr_t lblkno, long size, + struct ucred *cred, long totread, int seqcount, int gbflags, + struct buf **bpp) { struct buf *bp, *rbp, *reqbp; struct bufobj *bo; @@ -610,6 +613,14 @@ cluster_wbuild_wb(struct vnode *vp, long void cluster_write(struct vnode *vp, struct buf *bp, u_quad_t filesize, int seqcount) { + + cluster_write_gb(vp, bp, filesize, seqcount, 0); +} + +void +cluster_write_gb(struct vnode *vp, struct buf *bp, u_quad_t filesize, + int seqcount, int gbflags) +{ daddr_t lbn; int maxclen, cursize; int lblocksize; @@ -754,11 +765,15 @@ cluster_write(struct vnode *vp, struct b * the current block (if last_bp == NULL). */ int -cluster_wbuild(vp, size, start_lbn, len) - struct vnode *vp; - long size; - daddr_t start_lbn; - int len; +cluster_wbuild(struct vnode *vp, long size, daddr_t start_lbn, int len) +{ + + return (cluster_wbuild_gb(vp, size, start_lbn, len, 0)); +} + +int +cluster_wbuild_gb(struct vnode *vp, long size, daddr_t start_lbn, int len, + int gbflags) { struct buf *bp, *tbp; struct bufobj *bo; Modified: stable/9/sys/sys/buf.h ============================================================================== --- stable/9/sys/sys/buf.h Thu May 30 16:16:28 2013 (r251143) +++ stable/9/sys/sys/buf.h Thu May 30 16:51:48 2013 (r251144) @@ -514,6 +514,10 @@ int cluster_read(struct vnode *, u_quad_ struct ucred *, long, int, struct buf **); int cluster_wbuild(struct vnode *, long, daddr_t, int); void cluster_write(struct vnode *, struct buf *, u_quad_t, int); +int cluster_read_gb(struct vnode *, u_quad_t, daddr_t, long, + struct ucred *, long, int, int, struct buf **); +int cluster_wbuild_gb(struct vnode *, long, daddr_t, int, int); +void cluster_write_gb(struct vnode *, struct buf *, u_quad_t, int, int); void vfs_bio_set_valid(struct buf *, int base, int size); void vfs_bio_clrbuf(struct buf *); void vfs_busy_pages(struct buf *, int clear_modify); Modified: stable/9/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- stable/9/sys/ufs/ffs/ffs_vnops.c Thu May 30 16:16:28 2013 (r251143) +++ stable/9/sys/ufs/ffs/ffs_vnops.c Thu May 30 16:51:48 2013 (r251144) @@ -518,7 +518,8 @@ ffs_read(ap) * doing sequential access. */ error = cluster_read(vp, ip->i_size, lbn, - size, NOCRED, blkoffset + uio->uio_resid, seqcount, &bp); + size, NOCRED, blkoffset + uio->uio_resid, + seqcount, &bp); } else if (seqcount > 1) { /* * If we are NOT allowed to cluster, then From owner-svn-src-stable@FreeBSD.ORG Thu May 30 17:17:23 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4F965B8D; Thu, 30 May 2013 17:17:23 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 27C287AF; Thu, 30 May 2013 17:17:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UHHNEc075333; Thu, 30 May 2013 17:17:23 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UHHMub075329; Thu, 30 May 2013 17:17:22 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201305301717.r4UHHMub075329@svn.freebsd.org> From: Scott Long Date: Thu, 30 May 2013 17:17:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251145 - in stable/9/sys: kern sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 17:17:23 -0000 Author: scottl Date: Thu May 30 17:17:22 2013 New Revision: 251145 URL: http://svnweb.freebsd.org/changeset/base/251145 Log: MFC r248504: Add a convenience macro bread_gb() to wrap a call to breadn_flags(). Comparing with bread(), it adds an argument to pass the flags to getblk(). The API implementation of bread() and friends is different in FreeBSD 9, so this merge is a little more complicated than the original commit. Submitted by: kib, FF Obtained from: Netflix Modified: stable/9/sys/kern/vfs_bio.c stable/9/sys/sys/buf.h Directory Properties: stable/9/sys/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/kern/vfs_bio.c ============================================================================== --- stable/9/sys/kern/vfs_bio.c Thu May 30 16:51:48 2013 (r251144) +++ stable/9/sys/kern/vfs_bio.c Thu May 30 17:17:22 2013 (r251145) @@ -833,6 +833,18 @@ breada(struct vnode * vp, daddr_t * rabl } /* + * Operates like bread, but with getblk flags. + */ +int +bread_gb(struct vnode * vp, daddr_t blkno, int cnt, struct ucred * cred, + int gbflags, struct buf **bpp) +{ + + return (breadn_flags(vp, blkno, cnt, NULL, NULL, 0, + cred, gbflags, bpp)); +} + +/* * Operates like bread, but also starts asynchronous I/O on * read-ahead blocks. */ Modified: stable/9/sys/sys/buf.h ============================================================================== --- stable/9/sys/sys/buf.h Thu May 30 16:51:48 2013 (r251144) +++ stable/9/sys/sys/buf.h Thu May 30 17:17:22 2013 (r251145) @@ -484,6 +484,8 @@ int buf_dirty_count_severe(void); void bremfree(struct buf *); void bremfreef(struct buf *); /* XXX Force bremfree, only for nfs. */ int bread(struct vnode *, daddr_t, int, struct ucred *, struct buf **); +int bread_gb(struct vnode *, daddr_t, int, struct ucred *, + int gbflags, struct buf **); void breada(struct vnode *, daddr_t *, int *, int, struct ucred *); int breadn(struct vnode *, daddr_t, int, daddr_t *, int *, int, struct ucred *, struct buf **); From owner-svn-src-stable@FreeBSD.ORG Thu May 30 19:14:37 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id B2B9F237; Thu, 30 May 2013 19:14:37 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A3808ECA; Thu, 30 May 2013 19:14:37 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UJEbbt017326; Thu, 30 May 2013 19:14:37 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UJEZuU017310; Thu, 30 May 2013 19:14:35 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305301914.r4UJEZuU017310@svn.freebsd.org> From: John Baldwin Date: Thu, 30 May 2013 19:14:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251147 - in stable/9/sys: fs/nfs fs/nfsclient kern nfsclient sys tools X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 19:14:37 -0000 Author: jhb Date: Thu May 30 19:14:34 2013 New Revision: 251147 URL: http://svnweb.freebsd.org/changeset/base/251147 Log: MFC 246417,247116,248584: Rework the handling of stop signals in the NFS client. The changes in 195702, 195703, and 195821 prevented a thread from suspending while holding locks inside of NFS by forcing the thread to fail sleeps with EINTR or ERESTART but defer the thread suspension to the user boundary. However, this had the effect that stopping a process during an NFS request could abort the request and trigger EINTR errors that were visible to userland processes (previously the thread would have suspended and completed the request once it was resumed). This change instead effectively masks stop signals while in the NFS client. It uses the existing TDF_SBDRY flag to effect this since SIGSTOP cannot be masked directly. Instead of setting PBDRY on individual sleeps, change the VFS_*() and VOP_*() methods to defer stop signals for filesystems which request this behavior via a new VFCF_SBDRY flag. Note that this has to be a VFC flag rather than a MNTK flag so that it works properly with VFS_MOUNT() when the mount is not yet fully constructed. For now, only the NFS clients set this new flag in VFS_SET(). A few other related changes: - Add an assertion to ensure that TDF_SBDRY doesn't leak to userland. - When a lookup request uses VOP_READLINK() to follow a symlink, mark the request as being on behalf of the thread performing the lookup (cnp_thread) rather than using a NULL thread pointer. This causes NFS to properly handle signals during this VOP on an interruptible mount. - Ignore thread suspend requests due to SIGSTOP if stop signals are currently deferred. This can occur if a process is stopped via SIGSTOP while a thread is running or runnable but before it has set TDF_SBDRY. Modified: stable/9/sys/fs/nfs/nfs_commonkrpc.c stable/9/sys/fs/nfsclient/nfs_clvfsops.c stable/9/sys/kern/kern_sig.c stable/9/sys/kern/kern_thread.c stable/9/sys/kern/subr_sleepqueue.c stable/9/sys/kern/subr_trap.c stable/9/sys/kern/vfs_export.c stable/9/sys/kern/vfs_lookup.c stable/9/sys/nfsclient/nfs_krpc.c stable/9/sys/nfsclient/nfs_vfsops.c stable/9/sys/sys/mount.h stable/9/sys/sys/signalvar.h stable/9/sys/tools/vnode_if.awk Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/sys/ (props changed) Modified: stable/9/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- stable/9/sys/fs/nfs/nfs_commonkrpc.c Thu May 30 17:24:36 2013 (r251146) +++ stable/9/sys/fs/nfs/nfs_commonkrpc.c Thu May 30 19:14:34 2013 (r251147) @@ -952,7 +952,6 @@ int newnfs_sig_set[] = { SIGTERM, SIGHUP, SIGKILL, - SIGSTOP, SIGQUIT }; @@ -973,7 +972,7 @@ nfs_sig_pending(sigset_t set) /* * The set/restore sigmask functions are used to (temporarily) overwrite - * the process p_sigmask during an RPC call (for example). These are also + * the thread td_sigmask during an RPC call (for example). These are also * used in other places in the NFS client that might tsleep(). */ void @@ -1002,8 +1001,9 @@ newnfs_set_sigmask(struct thread *td, si SIGDELSET(newset, newnfs_sig_set[i]); } mtx_unlock(&p->p_sigacts->ps_mtx); + kern_sigprocmask(td, SIG_SETMASK, &newset, oldset, + SIGPROCMASK_PROC_LOCKED); PROC_UNLOCK(p); - kern_sigprocmask(td, SIG_SETMASK, &newset, oldset, 0); } void Modified: stable/9/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clvfsops.c Thu May 30 17:24:36 2013 (r251146) +++ stable/9/sys/fs/nfsclient/nfs_clvfsops.c Thu May 30 19:14:34 2013 (r251147) @@ -133,7 +133,7 @@ static struct vfsops nfs_vfsops = { .vfs_unmount = nfs_unmount, .vfs_sysctl = nfs_sysctl, }; -VFS_SET(nfs_vfsops, nfs, VFCF_NETWORK); +VFS_SET(nfs_vfsops, nfs, VFCF_NETWORK | VFCF_SBDRY); /* So that loader and kldload(2) can find us, wherever we are.. */ MODULE_VERSION(nfs, 1); Modified: stable/9/sys/kern/kern_sig.c ============================================================================== --- stable/9/sys/kern/kern_sig.c Thu May 30 17:24:36 2013 (r251146) +++ stable/9/sys/kern/kern_sig.c Thu May 30 19:14:34 2013 (r251147) @@ -2352,6 +2352,13 @@ tdsigwakeup(struct thread *td, int sig, } /* + * Don't awaken a sleeping thread for SIGSTOP if the + * STOP signal is deferred. + */ + if ((prop & SA_STOP) && (td->td_flags & TDF_SBDRY)) + goto out; + + /* * Give low priority threads a better chance to run. */ if (td->td_priority > PUSER) @@ -2392,12 +2399,13 @@ sig_suspend_threads(struct thread *td, s if ((TD_IS_SLEEPING(td2) || TD_IS_SWAPPED(td2)) && (td2->td_flags & TDF_SINTR)) { if (td2->td_flags & TDF_SBDRY) { - if (TD_IS_SUSPENDED(td2)) - wakeup_swapper |= - thread_unsuspend_one(td2); - if (TD_ON_SLEEPQ(td2)) - wakeup_swapper |= - sleepq_abort(td2, ERESTART); + /* + * Once a thread is asleep with + * TDF_SBDRY set, it should never + * become suspended due to this check. + */ + KASSERT(!TD_IS_SUSPENDED(td2), + ("thread with deferred stops suspended")); } else if (!TD_IS_SUSPENDED(td2)) { thread_suspend_one(td2); } @@ -2517,6 +2525,40 @@ tdsigcleanup(struct thread *td) } /* + * Defer the delivery of SIGSTOP for the current thread. Returns true + * if stops were deferred and false if they were already deferred. + */ +int +sigdeferstop(void) +{ + struct thread *td; + + td = curthread; + if (td->td_flags & TDF_SBDRY) + return (0); + thread_lock(td); + td->td_flags |= TDF_SBDRY; + thread_unlock(td); + return (1); +} + +/* + * Permit the delivery of SIGSTOP for the current thread. This does + * not immediately suspend if a stop was posted. Instead, the thread + * will suspend either via ast() or a subsequent interruptible sleep. + */ +void +sigallowstop() +{ + struct thread *td; + + td = curthread; + thread_lock(td); + td->td_flags &= ~TDF_SBDRY; + thread_unlock(td); +} + +/* * If the current process has received a signal (should be caught or cause * termination, should interrupt current syscall), return the signal number. * Stop signals with default action are processed immediately, then cleared; @@ -2548,7 +2590,7 @@ issignal(struct thread *td, int stop_all SIGSETOR(sigpending, p->p_sigqueue.sq_signals); SIGSETNAND(sigpending, td->td_sigmask); - if (p->p_flag & P_PPWAIT) + if (p->p_flag & P_PPWAIT || td->td_flags & TDF_SBDRY) SIG_STOPSIGMASK(sigpending); if (SIGISEMPTY(sigpending)) /* no signal to send */ return (0); @@ -2663,10 +2705,6 @@ issignal(struct thread *td, int stop_all (p->p_pgrp->pg_jobc == 0 && prop & SA_TTYSTOP)) break; /* == ignore */ - - /* Ignore, but do not drop the stop signal. */ - if (stop_allowed != SIG_STOP_ALLOWED) - return (sig); mtx_unlock(&ps->ps_mtx); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, &p->p_mtx.lock_object, "Catching SIGSTOP"); Modified: stable/9/sys/kern/kern_thread.c ============================================================================== --- stable/9/sys/kern/kern_thread.c Thu May 30 17:24:36 2013 (r251146) +++ stable/9/sys/kern/kern_thread.c Thu May 30 19:14:34 2013 (r251147) @@ -796,6 +796,17 @@ thread_suspend_check(int return_instead) return (ERESTART); /* + * Ignore suspend requests for stop signals if they + * are deferred. + */ + if (P_SHOULDSTOP(p) == P_STOPPED_SIG && + td->td_flags & TDF_SBDRY) { + KASSERT(return_instead, + ("TDF_SBDRY set for unsafe thread_suspend_check")); + return (0); + } + + /* * If the process is waiting for us to exit, * this thread should just suicide. * Assumes that P_SINGLE_EXIT implies P_STOPPED_SINGLE. Modified: stable/9/sys/kern/subr_sleepqueue.c ============================================================================== --- stable/9/sys/kern/subr_sleepqueue.c Thu May 30 17:24:36 2013 (r251146) +++ stable/9/sys/kern/subr_sleepqueue.c Thu May 30 19:14:34 2013 (r251147) @@ -351,8 +351,6 @@ sleepq_add(void *wchan, struct lock_obje if (flags & SLEEPQ_INTERRUPTIBLE) { td->td_flags |= TDF_SINTR; td->td_flags &= ~TDF_SLEEPABORT; - if (flags & SLEEPQ_STOP_ON_BDRY) - td->td_flags |= TDF_SBDRY; } thread_unlock(td); } @@ -599,7 +597,7 @@ sleepq_check_signals(void) /* We are no longer in an interruptible sleep. */ if (td->td_flags & TDF_SINTR) - td->td_flags &= ~(TDF_SINTR | TDF_SBDRY); + td->td_flags &= ~TDF_SINTR; if (td->td_flags & TDF_SLEEPABORT) { td->td_flags &= ~TDF_SLEEPABORT; @@ -746,7 +744,7 @@ sleepq_resume_thread(struct sleepqueue * td->td_wmesg = NULL; td->td_wchan = NULL; - td->td_flags &= ~(TDF_SINTR | TDF_SBDRY); + td->td_flags &= ~TDF_SINTR; CTR3(KTR_PROC, "sleepq_wakeup: thread %p (pid %ld, %s)", (void *)td, (long)td->td_proc->p_pid, td->td_name); Modified: stable/9/sys/kern/subr_trap.c ============================================================================== --- stable/9/sys/kern/subr_trap.c Thu May 30 17:24:36 2013 (r251146) +++ stable/9/sys/kern/subr_trap.c Thu May 30 19:14:34 2013 (r251147) @@ -141,6 +141,8 @@ userret(struct thread *td, struct trapfr ("userret: Returning with %d locks held.", td->td_locks)); KASSERT(td->td_vp_reserv == 0, ("userret: Returning while holding vnode reservation")); + KASSERT((td->td_flags & TDF_SBDRY) == 0, + ("userret: Returning with stop signals deferred")); #ifdef VIMAGE /* Unfortunately td_vnet_lpush needs VNET_DEBUG. */ VNET_ASSERT(curvnet == NULL, Modified: stable/9/sys/kern/vfs_export.c ============================================================================== --- stable/9/sys/kern/vfs_export.c Thu May 30 17:24:36 2013 (r251146) +++ stable/9/sys/kern/vfs_export.c Thu May 30 19:14:34 2013 (r251147) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: stable/9/sys/kern/vfs_lookup.c ============================================================================== --- stable/9/sys/kern/vfs_lookup.c Thu May 30 17:24:36 2013 (r251146) +++ stable/9/sys/kern/vfs_lookup.c Thu May 30 19:14:34 2013 (r251147) @@ -348,7 +348,7 @@ namei(struct nameidata *ndp) auio.uio_offset = 0; auio.uio_rw = UIO_READ; auio.uio_segflg = UIO_SYSSPACE; - auio.uio_td = (struct thread *)0; + auio.uio_td = td; auio.uio_resid = MAXPATHLEN; error = VOP_READLINK(ndp->ni_vp, &auio, cnp->cn_cred); if (error) { Modified: stable/9/sys/nfsclient/nfs_krpc.c ============================================================================== --- stable/9/sys/nfsclient/nfs_krpc.c Thu May 30 17:24:36 2013 (r251146) +++ stable/9/sys/nfsclient/nfs_krpc.c Thu May 30 19:14:34 2013 (r251147) @@ -699,7 +699,6 @@ int nfs_sig_set[] = { SIGTERM, SIGHUP, SIGKILL, - SIGSTOP, SIGQUIT }; @@ -720,7 +719,7 @@ nfs_sig_pending(sigset_t set) /* * The set/restore sigmask functions are used to (temporarily) overwrite - * the process p_sigmask during an RPC call (for example). These are also + * the thread td_sigmask during an RPC call (for example). These are also * used in other places in the NFS client that might tsleep(). */ void @@ -749,8 +748,9 @@ nfs_set_sigmask(struct thread *td, sigse SIGDELSET(newset, nfs_sig_set[i]); } mtx_unlock(&p->p_sigacts->ps_mtx); + kern_sigprocmask(td, SIG_SETMASK, &newset, oldset, + SIGPROCMASK_PROC_LOCKED); PROC_UNLOCK(p); - kern_sigprocmask(td, SIG_SETMASK, &newset, oldset, 0); } void Modified: stable/9/sys/nfsclient/nfs_vfsops.c ============================================================================== --- stable/9/sys/nfsclient/nfs_vfsops.c Thu May 30 17:24:36 2013 (r251146) +++ stable/9/sys/nfsclient/nfs_vfsops.c Thu May 30 19:14:34 2013 (r251147) @@ -146,7 +146,7 @@ static struct vfsops nfs_vfsops = { .vfs_unmount = nfs_unmount, .vfs_sysctl = nfs_sysctl, }; -VFS_SET(nfs_vfsops, oldnfs, VFCF_NETWORK); +VFS_SET(nfs_vfsops, oldnfs, VFCF_NETWORK | VFCF_SBDRY); /* So that loader and kldload(2) can find us, wherever we are.. */ MODULE_VERSION(oldnfs, 1); Modified: stable/9/sys/sys/mount.h ============================================================================== --- stable/9/sys/sys/mount.h Thu May 30 17:24:36 2013 (r251146) +++ stable/9/sys/sys/mount.h Thu May 30 19:14:34 2013 (r251147) @@ -517,6 +517,7 @@ struct ovfsconf { #define VFCF_UNICODE 0x00200000 /* stores file names as Unicode */ #define VFCF_JAIL 0x00400000 /* can be mounted from within a jail */ #define VFCF_DELEGADMIN 0x00800000 /* supports delegated administration */ +#define VFCF_SBDRY 0x01000000 /* defer stop requests */ typedef uint32_t fsctlop_t; @@ -654,31 +655,6 @@ struct vfsops { vfs_statfs_t __vfs_statfs; -#define VFS_MOUNT(MP) (*(MP)->mnt_op->vfs_mount)(MP) -#define VFS_UNMOUNT(MP, FORCE) (*(MP)->mnt_op->vfs_unmount)(MP, FORCE) -#define VFS_ROOT(MP, FLAGS, VPP) \ - (*(MP)->mnt_op->vfs_root)(MP, FLAGS, VPP) -#define VFS_QUOTACTL(MP, C, U, A) \ - (*(MP)->mnt_op->vfs_quotactl)(MP, C, U, A) -#define VFS_STATFS(MP, SBP) __vfs_statfs((MP), (SBP)) -#define VFS_SYNC(MP, WAIT) (*(MP)->mnt_op->vfs_sync)(MP, WAIT) -#define VFS_VGET(MP, INO, FLAGS, VPP) \ - (*(MP)->mnt_op->vfs_vget)(MP, INO, FLAGS, VPP) -#define VFS_FHTOVP(MP, FIDP, FLAGS, VPP) \ - (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, FLAGS, VPP) -#define VFS_CHECKEXP(MP, NAM, EXFLG, CRED, NUMSEC, SEC) \ - (*(MP)->mnt_op->vfs_checkexp)(MP, NAM, EXFLG, CRED, NUMSEC, SEC) -#define VFS_EXTATTRCTL(MP, C, FN, NS, N) \ - (*(MP)->mnt_op->vfs_extattrctl)(MP, C, FN, NS, N) -#define VFS_SYSCTL(MP, OP, REQ) \ - (*(MP)->mnt_op->vfs_sysctl)(MP, OP, REQ) -#define VFS_SUSP_CLEAN(MP) \ - ({if (*(MP)->mnt_op->vfs_susp_clean != NULL) \ - (*(MP)->mnt_op->vfs_susp_clean)(MP); }) -#define VFS_RECLAIM_LOWERVP(MP, VP) \ - ({if (*(MP)->mnt_op->vfs_reclaim_lowervp != NULL) \ - (*(MP)->mnt_op->vfs_reclaim_lowervp)((MP), (VP)); }) - #define VFS_NEEDSGIANT_(MP) \ ((MP) != NULL && ((MP)->mnt_kern_flag & MNTK_MPSAFE) == 0) @@ -714,9 +690,127 @@ vfs_statfs_t __vfs_statfs; mtx_assert(&Giant, MA_OWNED); \ } while (0) +#define VFS_PROLOGUE(MP) do { \ + int _enable_stops; \ + \ + _enable_stops = ((MP) != NULL && \ + ((MP)->mnt_vfc->vfc_flags & VFCF_SBDRY) && sigdeferstop()) + +#define VFS_EPILOGUE(MP) \ + if (_enable_stops) \ + sigallowstop(); \ +} while (0) + +#define VFS_MOUNT(MP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_mount)(MP); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_UNMOUNT(MP, FORCE) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_unmount)(MP, FORCE); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_ROOT(MP, FLAGS, VPP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_root)(MP, FLAGS, VPP); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_QUOTACTL(MP, C, U, A) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_quotactl)(MP, C, U, A); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_STATFS(MP, SBP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = __vfs_statfs((MP), (SBP)); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_SYNC(MP, WAIT) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_sync)(MP, WAIT); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_VGET(MP, INO, FLAGS, VPP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_vget)(MP, INO, FLAGS, VPP); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_FHTOVP(MP, FIDP, FLAGS, VPP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, FLAGS, VPP); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_CHECKEXP(MP, NAM, EXFLG, CRED, NUMSEC, SEC) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_checkexp)(MP, NAM, EXFLG, CRED, NUMSEC,\ + SEC); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_EXTATTRCTL(MP, C, FN, NS, N) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_extattrctl)(MP, C, FN, NS, N); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_SYSCTL(MP, OP, REQ) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_sysctl)(MP, OP, REQ); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_SUSP_CLEAN(MP) do { \ + if (*(MP)->mnt_op->vfs_susp_clean != NULL) { \ + VFS_PROLOGUE(MP); \ + (*(MP)->mnt_op->vfs_susp_clean)(MP); \ + VFS_EPILOGUE(MP); \ + } \ +} while (0) + +#define VFS_RECLAIM_LOWERVP(MP, VP) do { \ + if (*(MP)->mnt_op->vfs_reclaim_lowervp != NULL) { \ + VFS_PROLOGUE(MP); \ + (*(MP)->mnt_op->vfs_reclaim_lowervp)((MP), (VP)); \ + VFS_EPILOGUE(MP); \ + } \ +} while (0) + #define VFS_UNLINK_LOWERVP(MP, VP) do { \ if (*(MP)->mnt_op->vfs_unlink_lowervp != NULL) { \ + VFS_PROLOGUE(MP); \ (*(MP)->mnt_op->vfs_unlink_lowervp)((MP), (VP)); \ + VFS_EPILOGUE(MP); \ } \ } while (0) Modified: stable/9/sys/sys/signalvar.h ============================================================================== --- stable/9/sys/sys/signalvar.h Thu May 30 17:24:36 2013 (r251146) +++ stable/9/sys/sys/signalvar.h Thu May 30 19:14:34 2013 (r251147) @@ -328,6 +328,8 @@ extern struct mtx sigio_lock; #define SIGPROCMASK_PS_LOCKED 0x0004 int cursig(struct thread *td, int stop_allowed); +int sigdeferstop(void); +void sigallowstop(void); void execsigs(struct proc *p); void gsignal(int pgid, int sig, ksiginfo_t *ksi); void killproc(struct proc *p, char *why); Modified: stable/9/sys/tools/vnode_if.awk ============================================================================== --- stable/9/sys/tools/vnode_if.awk Thu May 30 17:24:36 2013 (r251146) +++ stable/9/sys/tools/vnode_if.awk Thu May 30 19:14:34 2013 (r251147) @@ -172,6 +172,7 @@ if (cfile) { "#include \n" \ "#include \n" \ "#include \n" \ + "#include \n" \ "#include \n" \ "#include \n" \ "\n" \ @@ -378,10 +379,12 @@ while ((getline < srcfile) > 0) { for (i = 0; i < numargs; ++i) add_debug_code(name, args[i], "Entry", "\t"); add_pre(name); + printc("\tVFS_PROLOGUE(a->a_" args[0]"->v_mount);") printc("\tif (vop->"name" != NULL)") printc("\t\trc = vop->"name"(a);") printc("\telse") printc("\t\trc = vop->vop_bypass(&a->a_gen);") + printc("\tVFS_EPILOGUE(a->a_" args[0]"->v_mount);") printc(ctrstr); printc("\tSDT_PROBE(vfs, vop, " name ", return, a->a_" args[0] ", a, rc, 0, 0);\n"); printc("\tif (rc == 0) {"); From owner-svn-src-stable@FreeBSD.ORG Thu May 30 19:24:32 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 46B977B7; Thu, 30 May 2013 19:24:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 37362F6B; Thu, 30 May 2013 19:24:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UJOWgp020880; Thu, 30 May 2013 19:24:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UJOT2g020861; Thu, 30 May 2013 19:24:29 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305301924.r4UJOT2g020861@svn.freebsd.org> From: John Baldwin Date: Thu, 30 May 2013 19:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251148 - in stable/8/sys: fs/nfs fs/nfsclient gnu/fs/ext2fs kern nfsclient sys tools X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 19:24:32 -0000 Author: jhb Date: Thu May 30 19:24:29 2013 New Revision: 251148 URL: http://svnweb.freebsd.org/changeset/base/251148 Log: MFC 246417,247116,248584: Rework the handling of stop signals in the NFS client. The changes in 195702, 195703, and 195821 prevented a thread from suspending while holding locks inside of NFS by forcing the thread to fail sleeps with EINTR or ERESTART but defer the thread suspension to the user boundary. However, this had the effect that stopping a process during an NFS request could abort the request and trigger EINTR errors that were visible to userland processes (previously the thread would have suspended and completed the request once it was resumed). This change instead effectively masks stop signals while in the NFS client. It uses the existing TDF_SBDRY flag to effect this since SIGSTOP cannot be masked directly. Instead of setting PBDRY on individual sleeps, change the VFS_*() and VOP_*() methods to defer stop signals for filesystems which request this behavior via a new VFCF_SBDRY flag. Note that this has to be a VFC flag rather than a MNTK flag so that it works properly with VFS_MOUNT() when the mount is not yet fully constructed. For now, only the NFS clients set this new flag in VFS_SET(). A few other related changes: - Add an assertion to ensure that TDF_SBDRY doesn't leak to userland. - When a lookup request uses VOP_READLINK() to follow a symlink, mark the request as being on behalf of the thread performing the lookup (cnp_thread) rather than using a NULL thread pointer. This causes NFS to properly handle signals during this VOP on an interruptible mount. - Ignore thread suspend requests due to SIGSTOP if stop signals are currently deferred. This can occur if a process is stopped via SIGSTOP while a thread is running or runnable but before it has set TDF_SBDRY. Modified: stable/8/sys/fs/nfs/nfs_commonkrpc.c stable/8/sys/fs/nfsclient/nfs_clvfsops.c stable/8/sys/gnu/fs/ext2fs/ext2_alloc.c stable/8/sys/kern/kern_sig.c stable/8/sys/kern/kern_thread.c stable/8/sys/kern/subr_sleepqueue.c stable/8/sys/kern/subr_trap.c stable/8/sys/kern/vfs_export.c stable/8/sys/kern/vfs_lookup.c stable/8/sys/nfsclient/nfs_krpc.c stable/8/sys/nfsclient/nfs_vfsops.c stable/8/sys/sys/mount.h stable/8/sys/sys/signalvar.h stable/8/sys/tools/vnode_if.awk Directory Properties: stable/8/sys/ (props changed) stable/8/sys/fs/ (props changed) stable/8/sys/kern/ (props changed) stable/8/sys/nfsclient/ (props changed) stable/8/sys/sys/ (props changed) stable/8/sys/tools/ (props changed) Modified: stable/8/sys/fs/nfs/nfs_commonkrpc.c ============================================================================== --- stable/8/sys/fs/nfs/nfs_commonkrpc.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/fs/nfs/nfs_commonkrpc.c Thu May 30 19:24:29 2013 (r251148) @@ -885,7 +885,6 @@ int newnfs_sig_set[] = { SIGTERM, SIGHUP, SIGKILL, - SIGSTOP, SIGQUIT }; @@ -906,7 +905,7 @@ nfs_sig_pending(sigset_t set) /* * The set/restore sigmask functions are used to (temporarily) overwrite - * the process p_sigmask during an RPC call (for example). These are also + * the thread td_sigmask during an RPC call (for example). These are also * used in other places in the NFS client that might tsleep(). */ void @@ -935,8 +934,9 @@ newnfs_set_sigmask(struct thread *td, si SIGDELSET(newset, newnfs_sig_set[i]); } mtx_unlock(&p->p_sigacts->ps_mtx); + kern_sigprocmask(td, SIG_SETMASK, &newset, oldset, + SIGPROCMASK_PROC_LOCKED); PROC_UNLOCK(p); - kern_sigprocmask(td, SIG_SETMASK, &newset, oldset, 0); } void Modified: stable/8/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- stable/8/sys/fs/nfsclient/nfs_clvfsops.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/fs/nfsclient/nfs_clvfsops.c Thu May 30 19:24:29 2013 (r251148) @@ -130,7 +130,7 @@ static struct vfsops nfs_vfsops = { .vfs_unmount = nfs_unmount, .vfs_sysctl = nfs_sysctl, }; -VFS_SET(nfs_vfsops, newnfs, VFCF_NETWORK); +VFS_SET(nfs_vfsops, newnfs, VFCF_NETWORK | VFCF_SBDRY); /* So that loader and kldload(2) can find us, wherever we are.. */ MODULE_VERSION(newnfs, 1); Modified: stable/8/sys/gnu/fs/ext2fs/ext2_alloc.c ============================================================================== --- stable/8/sys/gnu/fs/ext2fs/ext2_alloc.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/gnu/fs/ext2fs/ext2_alloc.c Thu May 30 19:24:29 2013 (r251148) @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include Modified: stable/8/sys/kern/kern_sig.c ============================================================================== --- stable/8/sys/kern/kern_sig.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/kern/kern_sig.c Thu May 30 19:24:29 2013 (r251148) @@ -2351,6 +2351,13 @@ tdsigwakeup(struct thread *td, int sig, } /* + * Don't awaken a sleeping thread for SIGSTOP if the + * STOP signal is deferred. + */ + if ((prop & SA_STOP) && (td->td_flags & TDF_SBDRY)) + goto out; + + /* * Give low priority threads a better chance to run. */ if (td->td_priority > PUSER) @@ -2391,12 +2398,13 @@ sig_suspend_threads(struct thread *td, s if ((TD_IS_SLEEPING(td2) || TD_IS_SWAPPED(td2)) && (td2->td_flags & TDF_SINTR)) { if (td2->td_flags & TDF_SBDRY) { - if (TD_IS_SUSPENDED(td2)) - wakeup_swapper |= - thread_unsuspend_one(td2); - if (TD_ON_SLEEPQ(td2)) - wakeup_swapper |= - sleepq_abort(td2, ERESTART); + /* + * Once a thread is asleep with + * TDF_SBDRY set, it should never + * become suspended due to this check. + */ + KASSERT(!TD_IS_SUSPENDED(td2), + ("thread with deferred stops suspended")); } else if (!TD_IS_SUSPENDED(td2)) { thread_suspend_one(td2); } @@ -2519,6 +2527,40 @@ tdsigcleanup(struct thread *td) } /* + * Defer the delivery of SIGSTOP for the current thread. Returns true + * if stops were deferred and false if they were already deferred. + */ +int +sigdeferstop(void) +{ + struct thread *td; + + td = curthread; + if (td->td_flags & TDF_SBDRY) + return (0); + thread_lock(td); + td->td_flags |= TDF_SBDRY; + thread_unlock(td); + return (1); +} + +/* + * Permit the delivery of SIGSTOP for the current thread. This does + * not immediately suspend if a stop was posted. Instead, the thread + * will suspend either via ast() or a subsequent interruptible sleep. + */ +void +sigallowstop() +{ + struct thread *td; + + td = curthread; + thread_lock(td); + td->td_flags &= ~TDF_SBDRY; + thread_unlock(td); +} + +/* * If the current process has received a signal (should be caught or cause * termination, should interrupt current syscall), return the signal number. * Stop signals with default action are processed immediately, then cleared; @@ -2550,7 +2592,7 @@ issignal(struct thread *td, int stop_all SIGSETOR(sigpending, p->p_sigqueue.sq_signals); SIGSETNAND(sigpending, td->td_sigmask); - if (p->p_flag & P_PPWAIT) + if (p->p_flag & P_PPWAIT || td->td_flags & TDF_SBDRY) SIG_STOPSIGMASK(sigpending); if (SIGISEMPTY(sigpending)) /* no signal to send */ return (0); @@ -2665,10 +2707,6 @@ issignal(struct thread *td, int stop_all (p->p_pgrp->pg_jobc == 0 && prop & SA_TTYSTOP)) break; /* == ignore */ - - /* Ignore, but do not drop the stop signal. */ - if (stop_allowed != SIG_STOP_ALLOWED) - return (sig); mtx_unlock(&ps->ps_mtx); WITNESS_WARN(WARN_GIANTOK | WARN_SLEEPOK, &p->p_mtx.lock_object, "Catching SIGSTOP"); Modified: stable/8/sys/kern/kern_thread.c ============================================================================== --- stable/8/sys/kern/kern_thread.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/kern/kern_thread.c Thu May 30 19:24:29 2013 (r251148) @@ -741,6 +741,17 @@ thread_suspend_check(int return_instead) (p->p_flag & P_SINGLE_BOUNDARY) && return_instead) return (ERESTART); + /* + * Ignore suspend requests for stop signals if they + * are deferred. + */ + if (P_SHOULDSTOP(p) == P_STOPPED_SIG && + td->td_flags & TDF_SBDRY) { + KASSERT(return_instead, + ("TDF_SBDRY set for unsafe thread_suspend_check")); + return (0); + } + /* If thread will exit, flush its pending signals */ if ((p->p_flag & P_SINGLE_EXIT) && (p->p_singlethread != td)) sigqueue_flush(&td->td_sigqueue); Modified: stable/8/sys/kern/subr_sleepqueue.c ============================================================================== --- stable/8/sys/kern/subr_sleepqueue.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/kern/subr_sleepqueue.c Thu May 30 19:24:29 2013 (r251148) @@ -351,8 +351,6 @@ sleepq_add(void *wchan, struct lock_obje if (flags & SLEEPQ_INTERRUPTIBLE) { td->td_flags |= TDF_SINTR; td->td_flags &= ~TDF_SLEEPABORT; - if (flags & SLEEPQ_STOP_ON_BDRY) - td->td_flags |= TDF_SBDRY; } thread_unlock(td); } @@ -591,7 +589,7 @@ sleepq_check_signals(void) /* We are no longer in an interruptible sleep. */ if (td->td_flags & TDF_SINTR) - td->td_flags &= ~(TDF_SINTR | TDF_SBDRY); + td->td_flags &= ~TDF_SINTR; if (td->td_flags & TDF_SLEEPABORT) { td->td_flags &= ~TDF_SLEEPABORT; @@ -738,7 +736,7 @@ sleepq_resume_thread(struct sleepqueue * td->td_wmesg = NULL; td->td_wchan = NULL; - td->td_flags &= ~(TDF_SINTR | TDF_SBDRY); + td->td_flags &= ~TDF_SINTR; CTR3(KTR_PROC, "sleepq_wakeup: thread %p (pid %ld, %s)", (void *)td, (long)td->td_proc->p_pid, td->td_name); Modified: stable/8/sys/kern/subr_trap.c ============================================================================== --- stable/8/sys/kern/subr_trap.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/kern/subr_trap.c Thu May 30 19:24:29 2013 (r251148) @@ -134,6 +134,8 @@ userret(struct thread *td, struct trapfr ("userret: Returning with %d locks held.", td->td_locks)); KASSERT(td->td_vp_reserv == 0, ("userret: Returning while holding vnode reservation")); + KASSERT((td->td_flags & TDF_SBDRY) == 0, + ("userret: Returning with stop signals deferred")); #ifdef VIMAGE /* Unfortunately td_vnet_lpush needs VNET_DEBUG. */ VNET_ASSERT(curvnet == NULL, Modified: stable/8/sys/kern/vfs_export.c ============================================================================== --- stable/8/sys/kern/vfs_export.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/kern/vfs_export.c Thu May 30 19:24:29 2013 (r251148) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include Modified: stable/8/sys/kern/vfs_lookup.c ============================================================================== --- stable/8/sys/kern/vfs_lookup.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/kern/vfs_lookup.c Thu May 30 19:24:29 2013 (r251148) @@ -323,7 +323,7 @@ namei(struct nameidata *ndp) auio.uio_offset = 0; auio.uio_rw = UIO_READ; auio.uio_segflg = UIO_SYSSPACE; - auio.uio_td = (struct thread *)0; + auio.uio_td = td; auio.uio_resid = MAXPATHLEN; error = VOP_READLINK(ndp->ni_vp, &auio, cnp->cn_cred); if (error) { Modified: stable/8/sys/nfsclient/nfs_krpc.c ============================================================================== --- stable/8/sys/nfsclient/nfs_krpc.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/nfsclient/nfs_krpc.c Thu May 30 19:24:29 2013 (r251148) @@ -699,7 +699,6 @@ int nfs_sig_set[] = { SIGTERM, SIGHUP, SIGKILL, - SIGSTOP, SIGQUIT }; @@ -720,7 +719,7 @@ nfs_sig_pending(sigset_t set) /* * The set/restore sigmask functions are used to (temporarily) overwrite - * the process p_sigmask during an RPC call (for example). These are also + * the thread td_sigmask during an RPC call (for example). These are also * used in other places in the NFS client that might tsleep(). */ void @@ -749,8 +748,9 @@ nfs_set_sigmask(struct thread *td, sigse SIGDELSET(newset, nfs_sig_set[i]); } mtx_unlock(&p->p_sigacts->ps_mtx); + kern_sigprocmask(td, SIG_SETMASK, &newset, oldset, + SIGPROCMASK_PROC_LOCKED); PROC_UNLOCK(p); - kern_sigprocmask(td, SIG_SETMASK, &newset, oldset, 0); } void Modified: stable/8/sys/nfsclient/nfs_vfsops.c ============================================================================== --- stable/8/sys/nfsclient/nfs_vfsops.c Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/nfsclient/nfs_vfsops.c Thu May 30 19:24:29 2013 (r251148) @@ -144,7 +144,7 @@ static struct vfsops nfs_vfsops = { .vfs_unmount = nfs_unmount, .vfs_sysctl = nfs_sysctl, }; -VFS_SET(nfs_vfsops, nfs, VFCF_NETWORK); +VFS_SET(nfs_vfsops, nfs, VFCF_NETWORK | VFCF_SBDRY); /* So that loader and kldload(2) can find us, wherever we are.. */ MODULE_VERSION(nfs, 1); Modified: stable/8/sys/sys/mount.h ============================================================================== --- stable/8/sys/sys/mount.h Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/sys/mount.h Thu May 30 19:24:29 2013 (r251148) @@ -465,6 +465,7 @@ struct ovfsconf { #define VFCF_UNICODE 0x00200000 /* stores file names as Unicode */ #define VFCF_JAIL 0x00400000 /* can be mounted from within a jail */ #define VFCF_DELEGADMIN 0x00800000 /* supports delegated administration */ +#define VFCF_SBDRY 0x01000000 /* defer stop requests */ typedef uint32_t fsctlop_t; @@ -598,28 +599,6 @@ struct vfsops { vfs_statfs_t __vfs_statfs; -#define VFS_MOUNT(MP) (*(MP)->mnt_op->vfs_mount)(MP) -#define VFS_UNMOUNT(MP, FORCE) (*(MP)->mnt_op->vfs_unmount)(MP, FORCE) -#define VFS_ROOT(MP, FLAGS, VPP) \ - (*(MP)->mnt_op->vfs_root)(MP, FLAGS, VPP) -#define VFS_QUOTACTL(MP, C, U, A) \ - (*(MP)->mnt_op->vfs_quotactl)(MP, C, U, A) -#define VFS_STATFS(MP, SBP) __vfs_statfs((MP), (SBP)) -#define VFS_SYNC(MP, WAIT) (*(MP)->mnt_op->vfs_sync)(MP, WAIT) -#define VFS_VGET(MP, INO, FLAGS, VPP) \ - (*(MP)->mnt_op->vfs_vget)(MP, INO, FLAGS, VPP) -#define VFS_FHTOVP(MP, FIDP, VPP) \ - (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, VPP) -#define VFS_CHECKEXP(MP, NAM, EXFLG, CRED, NUMSEC, SEC) \ - (*(MP)->mnt_op->vfs_checkexp)(MP, NAM, EXFLG, CRED, NUMSEC, SEC) -#define VFS_EXTATTRCTL(MP, C, FN, NS, N) \ - (*(MP)->mnt_op->vfs_extattrctl)(MP, C, FN, NS, N) -#define VFS_SYSCTL(MP, OP, REQ) \ - (*(MP)->mnt_op->vfs_sysctl)(MP, OP, REQ) -#define VFS_SUSP_CLEAN(MP) \ - ({if (*(MP)->mnt_op->vfs_susp_clean != NULL) \ - (*(MP)->mnt_op->vfs_susp_clean)(MP); }) - #define VFS_NEEDSGIANT_(MP) \ ((MP) != NULL && ((MP)->mnt_kern_flag & MNTK_MPSAFE) == 0) @@ -651,6 +630,122 @@ vfs_statfs_t __vfs_statfs; mtx_assert(&Giant, MA_OWNED); \ } while (0) +#define VFS_PROLOGUE(MP) do { \ + int _enable_stops; \ + \ + _enable_stops = ((MP) != NULL && \ + ((MP)->mnt_vfc->vfc_flags & VFCF_SBDRY) && sigdeferstop()) + +#define VFS_EPILOGUE(MP) \ + if (_enable_stops) \ + sigallowstop(); \ +} while (0) + +#define VFS_MOUNT(MP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_mount)(MP); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_UNMOUNT(MP, FORCE) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_unmount)(MP, FORCE); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_ROOT(MP, FLAGS, VPP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_root)(MP, FLAGS, VPP); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_QUOTACTL(MP, C, U, A) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_quotactl)(MP, C, U, A); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_STATFS(MP, SBP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = __vfs_statfs((MP), (SBP)); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_SYNC(MP, WAIT) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_sync)(MP, WAIT); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_VGET(MP, INO, FLAGS, VPP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_vget)(MP, INO, FLAGS, VPP); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_FHTOVP(MP, FIDP, VPP) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_fhtovp)(MP, FIDP, VPP); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_CHECKEXP(MP, NAM, EXFLG, CRED, NUMSEC, SEC) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_checkexp)(MP, NAM, EXFLG, CRED, NUMSEC,\ + SEC); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_EXTATTRCTL(MP, C, FN, NS, N) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_extattrctl)(MP, C, FN, NS, N); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_SYSCTL(MP, OP, REQ) ({ \ + int _rc; \ + \ + VFS_PROLOGUE(MP); \ + _rc = (*(MP)->mnt_op->vfs_sysctl)(MP, OP, REQ); \ + VFS_EPILOGUE(MP); \ + _rc; }) + +#define VFS_SUSP_CLEAN(MP) do { \ + if (*(MP)->mnt_op->vfs_susp_clean != NULL) { \ + VFS_PROLOGUE(MP); \ + (*(MP)->mnt_op->vfs_susp_clean)(MP); \ + VFS_EPILOGUE(MP); \ + } \ +} while (0) + +#define VFS_RECLAIM_LOWERVP(MP, VP) do { \ + if (*(MP)->mnt_op->vfs_reclaim_lowervp != NULL) { \ + VFS_PROLOGUE(MP); \ + (*(MP)->mnt_op->vfs_reclaim_lowervp)((MP), (VP)); \ + VFS_EPILOGUE(MP); \ + } \ +} while (0) + #define VFS_KNOTE_LOCKED(vp, hint) do \ { \ if (((vp)->v_vflag & VV_NOKNOTE) == 0) \ Modified: stable/8/sys/sys/signalvar.h ============================================================================== --- stable/8/sys/sys/signalvar.h Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/sys/signalvar.h Thu May 30 19:24:29 2013 (r251148) @@ -327,6 +327,8 @@ extern int kern_logsigexit; /* Sysctl va * Machine-independent functions: */ int cursig(struct thread *td, int stop_allowed); +int sigdeferstop(void); +void sigallowstop(void); void execsigs(struct proc *p); void gsignal(int pgid, int sig, ksiginfo_t *ksi); void killproc(struct proc *p, char *why); Modified: stable/8/sys/tools/vnode_if.awk ============================================================================== --- stable/8/sys/tools/vnode_if.awk Thu May 30 19:14:34 2013 (r251147) +++ stable/8/sys/tools/vnode_if.awk Thu May 30 19:24:29 2013 (r251148) @@ -172,6 +172,7 @@ if (cfile) { "#include \n" \ "#include \n" \ "#include \n" \ + "#include \n" \ "#include \n" \ "#include \n" \ "\n" \ @@ -378,10 +379,12 @@ while ((getline < srcfile) > 0) { for (i = 0; i < numargs; ++i) add_debug_code(name, args[i], "Entry", "\t"); add_pre(name); + printc("\tVFS_PROLOGUE(a->a_" args[0]"->v_mount);") printc("\tif (vop->"name" != NULL)") printc("\t\trc = vop->"name"(a);") printc("\telse") printc("\t\trc = vop->vop_bypass(&a->a_gen);") + printc("\tVFS_EPILOGUE(a->a_" args[0]"->v_mount);") printc(ctrstr); printc("\tSDT_PROBE(vfs, vop, " name ", return, a->a_" args[0] ", a, rc, 0, 0);\n"); printc("\tif (rc == 0) {"); From owner-svn-src-stable@FreeBSD.ORG Thu May 30 20:09:21 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E6C01A5D; Thu, 30 May 2013 20:09:21 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D7C542AF; Thu, 30 May 2013 20:09:21 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UK9Lue036107; Thu, 30 May 2013 20:09:21 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UK9Lbt036106; Thu, 30 May 2013 20:09:21 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305302009.r4UK9Lbt036106@svn.freebsd.org> From: John Baldwin Date: Thu, 30 May 2013 20:09:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251152 - stable/9/lib/libc/gen X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 20:09:22 -0000 Author: jhb Date: Thu May 30 20:09:21 2013 New Revision: 251152 URL: http://svnweb.freebsd.org/changeset/base/251152 Log: MFC 249567: mdoc: remove superfluous paragraph macro. Modified: stable/9/lib/libc/gen/sem_wait.3 Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/sem_wait.3 ============================================================================== --- stable/9/lib/libc/gen/sem_wait.3 Thu May 30 20:00:19 2013 (r251151) +++ stable/9/lib/libc/gen/sem_wait.3 Thu May 30 20:09:21 2013 (r251152) @@ -78,7 +78,6 @@ Additionally, .Fn sem_wait will fail if: .Bl -tag -width Er -.Pp .It Bq Er EINTR A signal interrupted this function. .El From owner-svn-src-stable@FreeBSD.ORG Thu May 30 20:11:32 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6762DC49; Thu, 30 May 2013 20:11:32 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 59B482D0; Thu, 30 May 2013 20:11:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UKBWBK038313; Thu, 30 May 2013 20:11:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UKBWqN038312; Thu, 30 May 2013 20:11:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305302011.r4UKBWqN038312@svn.freebsd.org> From: John Baldwin Date: Thu, 30 May 2013 20:11:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251153 - stable/8/lib/libc/gen X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 20:11:32 -0000 Author: jhb Date: Thu May 30 20:11:31 2013 New Revision: 251153 URL: http://svnweb.freebsd.org/changeset/base/251153 Log: MFC 249566-249567: Document that sem_wait() can fail with EINTR if it is interrupted by a signal. Modified: stable/8/lib/libc/gen/sem_wait.3 Directory Properties: stable/8/lib/libc/ (props changed) Modified: stable/8/lib/libc/gen/sem_wait.3 ============================================================================== --- stable/8/lib/libc/gen/sem_wait.3 Thu May 30 20:09:21 2013 (r251152) +++ stable/8/lib/libc/gen/sem_wait.3 Thu May 30 20:11:31 2013 (r251153) @@ -27,7 +27,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 15, 2000 +.Dd April 16, 2013 .Dt SEM_WAIT 3 .Os .Sh NAME @@ -75,6 +75,13 @@ points to an invalid semaphore. .El .Pp Additionally, +.Fn sem_wait +will fail if: +.Bl -tag -width Er +.It Bq Er EINTR +A signal interrupted this function. +.El +Additionally, .Fn sem_trywait will fail if: .Bl -tag -width Er From owner-svn-src-stable@FreeBSD.ORG Thu May 30 20:40:22 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 6D8BC463; Thu, 30 May 2013 20:40:22 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5EC106A2; Thu, 30 May 2013 20:40:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UKeLT0046831; Thu, 30 May 2013 20:40:21 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UKeHDo046790; Thu, 30 May 2013 20:40:17 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305302040.r4UKeHDo046790@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 20:40:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251154 - in stable/9: contrib/less usr.bin/less X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 20:40:22 -0000 Author: delphij Date: Thu May 30 20:40:16 2013 New Revision: 251154 URL: http://svnweb.freebsd.org/changeset/base/251154 Log: MFC: less v458. Modified: stable/9/contrib/less/NEWS stable/9/contrib/less/README stable/9/contrib/less/cmdbuf.c stable/9/contrib/less/configure stable/9/contrib/less/configure.ac stable/9/contrib/less/defines.ds stable/9/contrib/less/defines.h.in stable/9/contrib/less/defines.o2 stable/9/contrib/less/defines.o9 stable/9/contrib/less/defines.wn stable/9/contrib/less/help.c stable/9/contrib/less/less.hlp stable/9/contrib/less/less.man stable/9/contrib/less/less.nro stable/9/contrib/less/lessecho.man stable/9/contrib/less/lessecho.nro stable/9/contrib/less/lesskey.man stable/9/contrib/less/lesskey.nro stable/9/contrib/less/option.c stable/9/contrib/less/opttbl.c stable/9/contrib/less/output.c stable/9/contrib/less/position.c stable/9/contrib/less/screen.c stable/9/contrib/less/version.c stable/9/usr.bin/less/defines.h Directory Properties: stable/9/contrib/less/ (props changed) stable/9/usr.bin/less/ (props changed) Modified: stable/9/contrib/less/NEWS ============================================================================== --- stable/9/contrib/less/NEWS Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/NEWS Thu May 30 20:40:16 2013 (r251154) @@ -11,6 +11,25 @@ ====================================================================== + Major changes between "less" versions 451 and 458 + +* Allow backslash escaping of metacharacters in LESS environment variable + after the --use-backslash option. + +* Don't quit if syntax errors are found in command line options. + +* Increase sizes of some internal buffers. + +* Fix configure bug with --with-regex=none. + +* Fix crash with "stty rows 0". + +* Fix Win32 attribute display bug. + +* Fix display bug when using up/down arrow on the command line. + +====================================================================== + Major changes between "less" versions 444 and 451 * Add ESC-F command to keep reading data until a pattern is found. Modified: stable/9/contrib/less/README ============================================================================== --- stable/9/contrib/less/README Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/README Thu May 30 20:40:16 2013 (r251154) @@ -7,9 +7,9 @@ ************************************************************************** ************************************************************************** - Less, version 451 + Less, version 458 - This is the distribution of less, version 451, released 21 Jul 2012. + This is the distribution of less, version 458, released 04 Apr 2013. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or Modified: stable/9/contrib/less/cmdbuf.c ============================================================================== --- stable/9/contrib/less/cmdbuf.c Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/cmdbuf.c Thu May 30 20:40:16 2013 (r251154) @@ -727,9 +727,9 @@ cmd_updown(action) s = ml->string; if (s == NULL) s = ""; - strcpy(cmdbuf, s); cmd_home(); clear_eol(); + strcpy(cmdbuf, s); for (cp = cmdbuf; *cp != '\0'; ) cmd_right(); return (CC_OK); Modified: stable/9/contrib/less/configure ============================================================================== --- stable/9/contrib/less/configure Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/configure Thu May 30 20:40:16 2013 (r251154) @@ -5188,8 +5188,7 @@ fi # Checks for regular expression functions. have_regex=no have_posix_regex=unknown -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for regcomp" >&5 -$as_echo_n "checking for regcomp... " >&6; } +supported_regex="" # Select a regular expression library. WANT_REGEX=auto @@ -5204,6 +5203,8 @@ if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = posix; then # Some versions of Solaris have a regcomp() function, but it doesn't work! # So we run a test program. If we're cross-compiling, do it the old way. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for POSIX regcomp" >&5 +$as_echo_n "checking for POSIX regcomp... " >&6; } if test "$cross_compiling" = yes; then : have_posix_regex=unknown else @@ -5232,10 +5233,10 @@ rm -f core *.core core.conftest.* gmon.o fi if test $have_posix_regex = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using POSIX regcomp" >&5 -$as_echo "using POSIX regcomp" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } $as_echo "#define HAVE_POSIX_REGCOMP 1" >>confdefs.h - + supported_regex="$supported_regex posix" have_regex=yes elif test $have_posix_regex = unknown; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5252,10 +5253,10 @@ regex_t *r; regfree(r); } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using POSIX regcomp" >&5 -$as_echo "using POSIX regcomp" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } $as_echo "#define HAVE_POSIX_REGCOMP 1" >>confdefs.h - have_regex=yes + have_regex=yes; supported_regex="$supported_regex posix" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -5267,14 +5268,14 @@ fi fi if test $have_regex = no; then -if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for re_compile_pattern in -lc" >&5 -$as_echo_n "checking for re_compile_pattern in -lc... " >&6; } -if ${ac_cv_lib_c_re_compile_pattern+:} false; then : +if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre_compile in -lpcre" >&5 +$as_echo_n "checking for pcre_compile in -lpcre... " >&6; } +if ${ac_cv_lib_pcre_pcre_compile+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lc $LIBS" +LIBS="-lpcre $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5284,44 +5285,43 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ #ifdef __cplusplus extern "C" #endif -char re_compile_pattern (); +char pcre_compile (); int main () { -return re_compile_pattern (); +return pcre_compile (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_c_re_compile_pattern=yes + ac_cv_lib_pcre_pcre_compile=yes else - ac_cv_lib_c_re_compile_pattern=no + ac_cv_lib_pcre_pcre_compile=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_re_compile_pattern" >&5 -$as_echo "$ac_cv_lib_c_re_compile_pattern" >&6; } -if test "x$ac_cv_lib_c_re_compile_pattern" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using gnu" >&5 -$as_echo "using gnu" >&6; }; $as_echo "#define HAVE_GNU_REGEX 1" >>confdefs.h - have_regex=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcre_pcre_compile" >&5 +$as_echo "$ac_cv_lib_pcre_pcre_compile" >&6; } +if test "x$ac_cv_lib_pcre_pcre_compile" = xyes; then : + $as_echo "#define HAVE_PCRE 1" >>confdefs.h + LIBS="$LIBS -lpcre" have_regex=yes; supported_regex="$supported_regex pcre" fi fi fi if test $have_regex = no; then -if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre_compile in -lpcre" >&5 -$as_echo_n "checking for pcre_compile in -lpcre... " >&6; } -if ${ac_cv_lib_pcre_pcre_compile+:} false; then : +if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for re_compile_pattern in -lc" >&5 +$as_echo_n "checking for re_compile_pattern in -lc... " >&6; } +if ${ac_cv_lib_c_re_compile_pattern+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lpcre $LIBS" +LIBS="-lc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5331,30 +5331,29 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ #ifdef __cplusplus extern "C" #endif -char pcre_compile (); +char re_compile_pattern (); int main () { -return pcre_compile (); +return re_compile_pattern (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pcre_pcre_compile=yes + ac_cv_lib_c_re_compile_pattern=yes else - ac_cv_lib_pcre_pcre_compile=no + ac_cv_lib_c_re_compile_pattern=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcre_pcre_compile" >&5 -$as_echo "$ac_cv_lib_pcre_pcre_compile" >&6; } -if test "x$ac_cv_lib_pcre_pcre_compile" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using pcre" >&5 -$as_echo "using pcre" >&6; }; $as_echo "#define HAVE_PCRE 1" >>confdefs.h - LIBS="$LIBS -lpcre" have_regex=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_re_compile_pattern" >&5 +$as_echo "$ac_cv_lib_c_re_compile_pattern" >&6; } +if test "x$ac_cv_lib_c_re_compile_pattern" = xyes; then : + $as_echo "#define HAVE_GNU_REGEX 1" >>confdefs.h + have_regex=yes; supported_regex="$supported_regex gnu" fi fi @@ -5364,9 +5363,8 @@ if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcmp; then ac_fn_c_check_func "$LINENO" "regcmp" "ac_cv_func_regcmp" if test "x$ac_cv_func_regcmp" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using regcmp" >&5 -$as_echo "using regcmp" >&6; }; $as_echo "#define HAVE_REGCMP 1" >>confdefs.h - have_regex=yes + $as_echo "#define HAVE_REGCMP 1" >>confdefs.h + have_regex=yes; supported_regex="$supported_regex regcmp" fi fi @@ -5374,6 +5372,8 @@ fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for V8 regcomp" >&5 +$as_echo_n "checking for V8 regcomp... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5387,9 +5387,12 @@ regcomp(""); } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using V8 regcomp" >&5 -$as_echo "using V8 regcomp" >&6; }; $as_echo "#define HAVE_V8_REGCOMP 1" >>confdefs.h - have_regex=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; $as_echo "#define HAVE_V8_REGCOMP 1" >>confdefs.h + have_regex=yes; supported_regex="$supported_regex regcomp" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -5400,18 +5403,21 @@ if test $have_regex = no && test -f ${sr if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp-local; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: using V8 regcomp -- local source" >&5 $as_echo "using V8 regcomp -- local source" >&6; }; $as_echo "#define HAVE_V8_REGCOMP 1" >>confdefs.h - $as_echo "#define HAVE_REGEXEC2 1" >>confdefs.h + +supported_regex="$supported_regex regcomp-local" +$as_echo "#define HAVE_REGEXEC2 1" >>confdefs.h REGEX_O='regexp.$(O)' have_regex=yes fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = re_comp; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: using re_comp" >&5 -$as_echo "using re_comp" >&6; }; ac_fn_c_check_func "$LINENO" "re_comp" "ac_cv_func_re_comp" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for re_comp" >&5 +$as_echo_n "checking for re_comp... " >&6; } +ac_fn_c_check_func "$LINENO" "re_comp" "ac_cv_func_re_comp" if test "x$ac_cv_func_re_comp" = xyes; then : $as_echo "#define HAVE_RE_COMP 1" >>confdefs.h - have_regex=yes + have_regex=yes; supported_regex="$supported_regex re_comp" fi fi @@ -5420,15 +5426,17 @@ fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = none; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: using no regex" >&5 -$as_echo "using no regex" >&6; }; have_regex=yes; +$as_echo "using no regex" >&6; } +else +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find regular expression library" >&5 +$as_echo "$as_me: WARNING: cannot find regular expression library" >&2;} fi +$as_echo "#define NO_REGEX 1" >>confdefs.h + supported_regex="$supported_regex none" fi -if test $have_regex = no; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot find regular expression library" >&5 -$as_echo "cannot find regular expression library" >&6; }; $as_echo "#define NO_REGEX 1" >>confdefs.h - -fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: regular expression library: $supported_regex" >&5 +$as_echo "regular expression library: $supported_regex" >&6; } # Check whether --with-editor was given. Modified: stable/9/contrib/less/configure.ac ============================================================================== --- stable/9/contrib/less/configure.ac Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/configure.ac Thu May 30 20:40:16 2013 (r251154) @@ -383,7 +383,7 @@ fi # Checks for regular expression functions. have_regex=no have_posix_regex=unknown -AC_MSG_CHECKING(for regcomp) +supported_regex="" # Select a regular expression library. WANT_REGEX=auto @@ -395,6 +395,7 @@ if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = posix; then # Some versions of Solaris have a regcomp() function, but it doesn't work! # So we run a test program. If we're cross-compiling, do it the old way. +AC_MSG_CHECKING(for POSIX regcomp) AC_TRY_RUN([ #include #include @@ -409,16 +410,16 @@ if (rm.rm_sp != text + 1) exit(1); /* ch exit(0); }], have_posix_regex=yes, have_posix_regex=no, have_posix_regex=unknown) if test $have_posix_regex = yes; then - AC_MSG_RESULT(using POSIX regcomp) - AC_DEFINE(HAVE_POSIX_REGCOMP) + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_POSIX_REGCOMP) supported_regex="$supported_regex posix" have_regex=yes elif test $have_posix_regex = unknown; then AC_TRY_LINK([ #include #include ], [regex_t *r; regfree(r);], - AC_MSG_RESULT(using POSIX regcomp) - AC_DEFINE(HAVE_POSIX_REGCOMP) have_regex=yes) + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_POSIX_REGCOMP) have_regex=yes; supported_regex="$supported_regex posix") else AC_MSG_RESULT(no) fi @@ -426,55 +427,61 @@ fi fi if test $have_regex = no; then -if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then -AC_CHECK_LIB(c, re_compile_pattern, -[AC_MSG_RESULT(using gnu); AC_DEFINE(HAVE_GNU_REGEX) have_regex=yes], []) +if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then +AC_CHECK_LIB(pcre, pcre_compile, +[AC_DEFINE(HAVE_PCRE) LIBS="$LIBS -lpcre" have_regex=yes; supported_regex="$supported_regex pcre"], []) fi fi if test $have_regex = no; then -if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then -AC_CHECK_LIB(pcre, pcre_compile, -[AC_MSG_RESULT(using pcre); AC_DEFINE(HAVE_PCRE) LIBS="$LIBS -lpcre" have_regex=yes], []) +if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then +AC_CHECK_LIB(c, re_compile_pattern, +[AC_DEFINE(HAVE_GNU_REGEX) have_regex=yes; supported_regex="$supported_regex gnu"], []) fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcmp; then AC_CHECK_FUNC(regcmp, -AC_MSG_RESULT(using regcmp); AC_DEFINE(HAVE_REGCMP) have_regex=yes) +[AC_DEFINE(HAVE_REGCMP) have_regex=yes; supported_regex="$supported_regex regcmp"],[]) fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp; then +AC_MSG_CHECKING(for V8 regcomp) AC_TRY_LINK([ #include "regexp.h"], [regcomp("");], -AC_MSG_RESULT(using V8 regcomp); AC_DEFINE(HAVE_V8_REGCOMP) have_regex=yes) +[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_V8_REGCOMP) have_regex=yes; supported_regex="$supported_regex regcomp"],[AC_MSG_RESULT(no)]) fi fi if test $have_regex = no && test -f ${srcdir}/regexp.c; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp-local; then -AC_MSG_RESULT(using V8 regcomp -- local source); AC_DEFINE(HAVE_V8_REGCOMP) AC_DEFINE(HAVE_REGEXEC2) REGEX_O='regexp.$(O)' AC_SUBST(REGEX_O) have_regex=yes +AC_MSG_RESULT(using V8 regcomp -- local source); AC_DEFINE(HAVE_V8_REGCOMP) +supported_regex="$supported_regex regcomp-local" +AC_DEFINE(HAVE_REGEXEC2) REGEX_O='regexp.$(O)' AC_SUBST(REGEX_O) have_regex=yes fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = re_comp; then -AC_MSG_RESULT(using re_comp); AC_CHECK_FUNC(re_comp, AC_DEFINE(HAVE_RE_COMP) have_regex=yes) +AC_MSG_CHECKING(for re_comp) +AC_CHECK_FUNC(re_comp, +[AC_DEFINE(HAVE_RE_COMP) have_regex=yes; supported_regex="$supported_regex re_comp"],[]) fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = none; then -AC_MSG_RESULT(using no regex); have_regex=yes; +AC_MSG_RESULT(using no regex) +else +AC_MSG_WARN(cannot find regular expression library) fi +AC_DEFINE(NO_REGEX) supported_regex="$supported_regex none" fi -if test $have_regex = no; then -AC_MSG_RESULT(cannot find regular expression library); AC_DEFINE(NO_REGEX) -fi +AC_MSG_RESULT(regular expression library: $supported_regex) AC_ARG_WITH(editor, [ --with-editor=PROGRAM use PROGRAM as the default editor [vi]], @@ -662,6 +669,7 @@ AH_TOP([ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines */ #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -671,6 +679,17 @@ AH_TOP([ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Settings automatically determined by configure. */ ]) Modified: stable/9/contrib/less/defines.ds ============================================================================== --- stable/9/contrib/less/defines.ds Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/defines.ds Thu May 30 20:40:16 2013 (r251154) @@ -185,6 +185,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -194,6 +195,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Define to `long' if doesn't define. */ #if MSDOS_COMPILER==BORLANDC Modified: stable/9/contrib/less/defines.h.in ============================================================================== --- stable/9/contrib/less/defines.h.in Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/defines.h.in Thu May 30 20:40:16 2013 (r251154) @@ -182,6 +182,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines */ #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -191,6 +192,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Settings automatically determined by configure. */ Modified: stable/9/contrib/less/defines.o2 ============================================================================== --- stable/9/contrib/less/defines.o2 Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/defines.o2 Thu May 30 20:40:16 2013 (r251154) @@ -166,6 +166,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -175,6 +176,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Define to `long' if doesn't define. */ /* #define off_t long */ Modified: stable/9/contrib/less/defines.o9 ============================================================================== --- stable/9/contrib/less/defines.o9 Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/defines.o9 Thu May 30 20:40:16 2013 (r251154) @@ -173,6 +173,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -182,6 +183,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Define to `long' if doesn't define. */ #define off_t long Modified: stable/9/contrib/less/defines.wn ============================================================================== --- stable/9/contrib/less/defines.wn Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/defines.wn Thu May 30 20:40:16 2013 (r251154) @@ -167,6 +167,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -176,6 +177,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Define to `long' if doesn't define. */ /* #define off_t long */ Modified: stable/9/contrib/less/help.c ============================================================================== --- stable/9/contrib/less/help.c Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/help.c Thu May 30 20:40:16 2013 (r251154) @@ -110,7 +110,7 @@ constant char helpdata[] = { ' ',' ',' ',' ',' ',' ',' ',' ','M','o','s','t',' ','o','p','t','i','o','n','s',' ','m','a','y',' ','b','e',' ','c','h','a','n','g','e','d',' ','e','i','t','h','e','r',' ','o','n',' ','t','h','e',' ','c','o','m','m','a','n','d',' ','l','i','n','e',',','\n', ' ',' ',' ',' ',' ',' ',' ',' ','o','r',' ','f','r','o','m',' ','w','i','t','h','i','n',' ','l','e','s','s',' ','b','y',' ','u','s','i','n','g',' ','t','h','e',' ','-',' ','o','r',' ','-','-',' ','c','o','m','m','a','n','d','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ','O','p','t','i','o','n','s',' ','m','a','y',' ','b','e',' ','g','i','v','e','n',' ','i','n',' ','o','n','e',' ','o','f',' ','t','w','o',' ','f','o','r','m','s',':',' ','e','i','t','h','e','r',' ','a',' ','s','i','n','g','l','e','\n', -' ',' ',' ',' ',' ',' ',' ',' ','c','h','a','r','a','c','t','e','r',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','a',' ','-',',',' ','o','r',' ','a',' ','n','a','m','e',' ','p','r','e','c','e','e','d','e','d',' ','b','y',' ','-','-','.','\n', +' ',' ',' ',' ',' ',' ',' ',' ','c','h','a','r','a','c','t','e','r',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','a',' ','-',',',' ','o','r',' ','a',' ','n','a','m','e',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','-','-','.','\n', '\n', ' ',' ','-','?',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','h','e','l','p','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','i','s','p','l','a','y',' ','h','e','l','p',' ','(','f','r','o','m',' ','c','o','m','m','a','n','d',' ','l','i','n','e',')','.','\n', Modified: stable/9/contrib/less/less.hlp ============================================================================== --- stable/9/contrib/less/less.hlp Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/less.hlp Thu May 30 20:40:16 2013 (r251154) @@ -107,7 +107,7 @@ Most options may be changed either on the command line, or from within less by using the - or -- command. Options may be given in one of two forms: either a single - character preceded by a -, or a name preceeded by --. + character preceded by a -, or a name preceded by --. -? ........ --help Display help (from command line). Modified: stable/9/contrib/less/less.man ============================================================================== --- stable/9/contrib/less/less.man Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/less.man Thu May 30 20:40:16 2013 (r251154) @@ -437,13 +437,18 @@ LESS(1) appears in the LESS variable, it can be reset to its default value on the command line by beginning the command line option with "-+". - For options like -P or -D which take a following string, a dollar sign - ($) must be used to signal the end of the string. For example, to set - two -D options on MS-DOS, you must have a dollar sign between them, + Some options like -k or -D require a string to follow the option let- + ter. The string for that option is considered to end when a dollar + sign ($) is found. For example, you can set two -D options on MS-DOS like this: - LESS="-Dn9.1$-Ds4.1" + LESS="Dn9.1$Ds4.1" + If the --use-backslash option appears earlier in the options, then a + dollar sign or backslash may be included literally in an option string + by preceding it with a backslash. If the --use-backslash option is not + in effect, then backslashes are not treated specially, and there is no + way to include a dollar sign in the option string. -? or --help This option displays a summary of the commands accepted by less @@ -836,11 +841,6 @@ LESS(1) actual scroll remains at the specified fraction of the screen width. - --no-keypad - Disables sending the keypad initialization and deinitialization - strings to the terminal. This is sometimes useful if the keypad - strings make the numeric keypad behave in an undesirable manner. - --follow-name Normally, if the input file is renamed while an F command is executing, less will continue to display the contents of the @@ -851,6 +851,18 @@ LESS(1) has been created with the same name as the original (now renamed) file), less will display the contents of that new file. + --no-keypad + Disables sending the keypad initialization and deinitialization + strings to the terminal. This is sometimes useful if the keypad + strings make the numeric keypad behave in an undesirable manner. + + --use-backslash + This option changes the interpretations of options which follow + this one. After the --use-backslash option, any backslash in an + option string is removed and the following character is taken + literally. This allows a dollar sign to be included in option + strings. + -- A command line argument of "--" marks the end of option argu- ments. Any arguments following this are interpreted as file- names. This can be useful when viewing a file whose name begins @@ -1597,8 +1609,8 @@ LESS(1) AUTHOR - Mark Nudelman - Send bug reports or comments to bug-less@gnu.org. + Mark Nudelman + Send bug reports or comments to See http://www.greenwoodsoftware.com/less/bugs.html for the latest list of known bugs in less. For more information, see the less homepage at @@ -1606,4 +1618,4 @@ LESS(1) - Version 451: 21 Jul 2012 LESS(1) + Version 458: 04 Apr 2013 LESS(1) Modified: stable/9/contrib/less/less.nro ============================================================================== --- stable/9/contrib/less/less.nro Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/less.nro Thu May 30 20:40:16 2013 (r251154) @@ -1,4 +1,4 @@ -.TH LESS 1 "Version 451: 21 Jul 2012" +.TH LESS 1 "Version 458: 04 Apr 2013" .SH NAME less \- opposite of more .SH SYNOPSIS @@ -455,13 +455,18 @@ If an option appears in the LESS variabl to its default value on the command line by beginning the command line option with "\-+". .sp -For options like \-P or \-D which take a following string, -a dollar sign ($) must be used to signal the end of the string. -For example, to set two \-D options on MS-DOS, you must have -a dollar sign between them, like this: +Some options like \-k or \-D require a string to follow the option letter. +The string for that option is considered to end when a dollar sign ($) is found. +For example, you can set two \-D options on MS-DOS like this: .sp -LESS="-Dn9.1$-Ds4.1" +LESS="Dn9.1$Ds4.1" .sp +If the --use-backslash option appears earlier in the options, then +a dollar sign or backslash may be included literally in an option string +by preceding it with a backslash. +If the --use-backslash option is not in effect, then backslashes are +not treated specially, and there is no way to include a dollar sign +in the option string. .IP "\-? or \-\-help" This option displays a summary of the commands accepted by .I less @@ -890,11 +895,6 @@ If the number is specified as a fraction scroll positions is recalculated if the terminal window is resized, so that the actual scroll remains at the specified fraction of the screen width. -.IP "\-\-no-keypad" -Disables sending the keypad initialization and deinitialization strings -to the terminal. -This is sometimes useful if the keypad strings make the numeric -keypad behave in an undesirable manner. .IP "\-\-follow-name" Normally, if the input file is renamed while an F command is executing, .I less @@ -908,6 +908,16 @@ If the reopen succeeds and the file is a with the same name as the original (now renamed) file), .I less will display the contents of that new file. +.IP "\-\-no-keypad" +Disables sending the keypad initialization and deinitialization strings +to the terminal. +This is sometimes useful if the keypad strings make the numeric +keypad behave in an undesirable manner. +.IP "\-\-use-backslash" +This option changes the interpretations of options which follow this one. +After the \-\-use-backslash option, any backslash in an option string is +removed and the following character is taken literally. +This allows a dollar sign to be included in option strings. .IP \-\- A command line argument of "\-\-" marks the end of option arguments. Any arguments following this are interpreted as filenames. @@ -1739,9 +1749,9 @@ See the GNU General Public License for m .SH AUTHOR .PP -Mark Nudelman +Mark Nudelman .br -Send bug reports or comments to bug-less@gnu.org. +Send bug reports or comments to .br See http://www.greenwoodsoftware.com/less/bugs.html for the latest list of known bugs in less. .br Modified: stable/9/contrib/less/lessecho.man ============================================================================== --- stable/9/contrib/less/lessecho.man Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/lessecho.man Thu May 30 20:40:16 2013 (r251154) @@ -51,4 +51,4 @@ LESSECHO(1) - Version 451: 21 Jul 2012 LESSECHO(1) + Version 458: 04 Apr 2013 LESSECHO(1) Modified: stable/9/contrib/less/lessecho.nro ============================================================================== --- stable/9/contrib/less/lessecho.nro Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/lessecho.nro Thu May 30 20:40:16 2013 (r251154) @@ -1,4 +1,4 @@ -.TH LESSECHO 1 "Version 451: 21 Jul 2012" +.TH LESSECHO 1 "Version 458: 04 Apr 2013" .SH NAME lessecho \- expand metacharacters .SH SYNOPSIS Modified: stable/9/contrib/less/lesskey.man ============================================================================== --- stable/9/contrib/less/lesskey.man Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/lesskey.man Thu May 30 20:40:16 2013 (r251154) @@ -353,4 +353,4 @@ LESSKEY(1) - Version 451: 21 Jul 2012 LESSKEY(1) + Version 458: 04 Apr 2013 LESSKEY(1) Modified: stable/9/contrib/less/lesskey.nro ============================================================================== --- stable/9/contrib/less/lesskey.nro Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/lesskey.nro Thu May 30 20:40:16 2013 (r251154) @@ -1,4 +1,4 @@ -.TH LESSKEY 1 "Version 451: 21 Jul 2012" +.TH LESSKEY 1 "Version 458: 04 Apr 2013" .SH NAME lesskey \- specify key bindings for less .SH SYNOPSIS Modified: stable/9/contrib/less/option.c ============================================================================== --- stable/9/contrib/less/option.c Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/option.c Thu May 30 20:40:16 2013 (r251154) @@ -30,6 +30,7 @@ extern int screen_trashed; extern int less_is_more; extern int quit_at_eof; extern char *every_first_cmd; +extern int opt_use_backslash; /* * Return a printable description of an option. @@ -146,10 +147,13 @@ scan_option(s) */ plusoption = TRUE; s = optstring(s, &str, propt('+'), NULL); + if (s == NULL) + return; if (*str == '+') - every_first_cmd = save(++str); + every_first_cmd = save(str+1); else ungetsc(str); + free(str); continue; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': @@ -202,7 +206,7 @@ scan_option(s) parg.p_string = printopt; error("The %s option should not be followed by =", &parg); - quit(QUIT_ERROR); + return; } s++; } else @@ -223,7 +227,7 @@ scan_option(s) else error("There is no %s option (\"less --help\" for help)", &parg); - quit(QUIT_ERROR); + return; } str = NULL; @@ -260,6 +264,8 @@ scan_option(s) while (*s == ' ') s++; s = optstring(s, &str, printopt, o->odesc[1]); + if (s == NULL) + return; break; case NUMBER: if (*s == '\0') @@ -275,6 +281,8 @@ scan_option(s) */ if (o->ofunc != NULL) (*o->ofunc)(INIT, str); + if (str != NULL) + free(str); } } @@ -558,35 +566,33 @@ optstring(s, p_str, printopt, validchars char *validchars; { register char *p; + register char *out; if (*s == '\0') { nostring(printopt); - quit(QUIT_ERROR); + return (NULL); } - *p_str = s; + /* Alloc could be more than needed, but not worth trimming. */ + *p_str = (char *) ecalloc(strlen(s)+1, sizeof(char)); + out = *p_str; + for (p = s; *p != '\0'; p++) { - if (*p == END_OPTION_STRING || - (validchars != NULL && strchr(validchars, *p) == NULL)) + if (opt_use_backslash && *p == '\\' && p[1] != '\0') { - switch (*p) - { - case END_OPTION_STRING: - case ' ': case '\t': case '-': - /* Replace the char with a null to terminate string. */ - *p++ = '\0'; - break; - default: - /* Cannot replace char; make a copy of the string. */ - *p_str = (char *) ecalloc(p-s+1, sizeof(char)); - strncpy(*p_str, s, p-s); - (*p_str)[p-s] = '\0'; + /* Take next char literally. */ + ++p; + } else + { + if (*p == END_OPTION_STRING || + (validchars != NULL && strchr(validchars, *p) == NULL)) + /* End of option string. */ break; - } - break; } + *out++ = *p; } + *out = '\0'; return (p); } @@ -609,8 +615,6 @@ num_error(printopt, errp) parg.p_string = printopt; error("Number is required after %s", &parg); } - quit(QUIT_ERROR); - /* NOTREACHED */ return (-1); } Modified: stable/9/contrib/less/opttbl.c ============================================================================== --- stable/9/contrib/less/opttbl.c Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/opttbl.c Thu May 30 20:40:16 2013 (r251154) @@ -52,6 +52,7 @@ public int use_lessopen; /* Use the LESS public int quit_on_intr; /* Quit on interrupt */ public int follow_mode; /* F cmd Follows file desc or file name? */ public int oldbot; /* Old bottom of screen behavior {{REMOVE}} */ +public int opt_use_backslash; /* Use backslash escaping in option parsing */ #if HILITE_SEARCH public int hilite_search; /* Highlight matched search patterns? */ #endif @@ -115,6 +116,7 @@ static struct optname pound_optname = { static struct optname keypad_optname = { "no-keypad", NULL }; static struct optname oldbot_optname = { "old-bot", NULL }; static struct optname follow_optname = { "follow-name", NULL }; +static struct optname use_backslash_optname = { "use-backslash", NULL }; /* @@ -446,6 +448,14 @@ static struct loption option[] = NULL } }, + { OLETTER_NONE, &use_backslash_optname, + BOOL, OPT_OFF, &opt_use_backslash, NULL, + { + "Use backslash escaping in command line parameters", + "Don't use backslash escaping in command line parameters", + NULL + } + }, { '\0', NULL, NOVAR, 0, NULL, NULL, { NULL, NULL, NULL } } }; Modified: stable/9/contrib/less/output.c ============================================================================== --- stable/9/contrib/less/output.c Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/output.c Thu May 30 20:40:16 2013 (r251154) @@ -278,8 +278,13 @@ flush() */ if (p[-2] == '[') { +#if MSDOS_COMPILER==WIN32C + fg |= FOREGROUND_INTENSITY; + bg |= BACKGROUND_INTENSITY; +#else fg = bo_fg_color; bg = bo_bg_color; +#endif } else fg |= 8; } else if (at & 2) Modified: stable/9/contrib/less/position.c ============================================================================== --- stable/9/contrib/less/position.c Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/position.c Thu May 30 20:40:16 2013 (r251154) @@ -162,7 +162,7 @@ empty_lines(s, e) register int i; for (i = s; i <= e; i++) - if (table[i] != NULL_POSITION) + if (table[i] != NULL_POSITION && table[i] != 0) return (0); return (1); } Modified: stable/9/contrib/less/screen.c ============================================================================== --- stable/9/contrib/less/screen.c Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/screen.c Thu May 30 20:40:16 2013 (r251154) @@ -802,7 +802,7 @@ scrsize() else if ((n = ltgetnum("li")) > 0) sc_height = n; #endif - else + if (sc_height <= 0) sc_height = DEF_SC_HEIGHT; if (sys_width > 0) @@ -813,7 +813,7 @@ scrsize() else if ((n = ltgetnum("co")) > 0) sc_width = n; #endif - else + if (sc_width <= 0) sc_width = DEF_SC_WIDTH; } Modified: stable/9/contrib/less/version.c ============================================================================== --- stable/9/contrib/less/version.c Thu May 30 20:11:31 2013 (r251153) +++ stable/9/contrib/less/version.c Thu May 30 20:40:16 2013 (r251154) @@ -753,6 +753,15 @@ v448 6/15/12 Print name of regex libr v449 6/23/12 Allow config option --with-regex=none. v450 7/4/12 Fix EOF bug with ESC-F. v451 7/20/12 Fix typo. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Thu May 30 20:42:56 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8B483625; Thu, 30 May 2013 20:42:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7C95A6C6; Thu, 30 May 2013 20:42:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UKgunr048888; Thu, 30 May 2013 20:42:56 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UKgpZF048852; Thu, 30 May 2013 20:42:51 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305302042.r4UKgpZF048852@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 20:42:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251155 - in stable/8: contrib/less usr.bin/less X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 20:42:56 -0000 Author: delphij Date: Thu May 30 20:42:51 2013 New Revision: 251155 URL: http://svnweb.freebsd.org/changeset/base/251155 Log: MFC: less v458. Modified: stable/8/contrib/less/NEWS stable/8/contrib/less/README stable/8/contrib/less/cmdbuf.c stable/8/contrib/less/configure stable/8/contrib/less/configure.ac stable/8/contrib/less/defines.ds stable/8/contrib/less/defines.h.in stable/8/contrib/less/defines.o2 stable/8/contrib/less/defines.o9 stable/8/contrib/less/defines.wn stable/8/contrib/less/help.c stable/8/contrib/less/less.hlp stable/8/contrib/less/less.man stable/8/contrib/less/less.nro stable/8/contrib/less/lessecho.man stable/8/contrib/less/lessecho.nro stable/8/contrib/less/lesskey.man stable/8/contrib/less/lesskey.nro stable/8/contrib/less/option.c stable/8/contrib/less/opttbl.c stable/8/contrib/less/output.c stable/8/contrib/less/position.c stable/8/contrib/less/screen.c stable/8/contrib/less/version.c stable/8/usr.bin/less/defines.h Directory Properties: stable/8/contrib/less/ (props changed) stable/8/usr.bin/less/ (props changed) Modified: stable/8/contrib/less/NEWS ============================================================================== --- stable/8/contrib/less/NEWS Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/NEWS Thu May 30 20:42:51 2013 (r251155) @@ -11,6 +11,25 @@ ====================================================================== + Major changes between "less" versions 451 and 458 + +* Allow backslash escaping of metacharacters in LESS environment variable + after the --use-backslash option. + +* Don't quit if syntax errors are found in command line options. + +* Increase sizes of some internal buffers. + +* Fix configure bug with --with-regex=none. + +* Fix crash with "stty rows 0". + +* Fix Win32 attribute display bug. + +* Fix display bug when using up/down arrow on the command line. + +====================================================================== + Major changes between "less" versions 444 and 451 * Add ESC-F command to keep reading data until a pattern is found. Modified: stable/8/contrib/less/README ============================================================================== --- stable/8/contrib/less/README Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/README Thu May 30 20:42:51 2013 (r251155) @@ -7,9 +7,9 @@ ************************************************************************** ************************************************************************** - Less, version 451 + Less, version 458 - This is the distribution of less, version 451, released 21 Jul 2012. + This is the distribution of less, version 458, released 04 Apr 2013. This program is part of the GNU project (http://www.gnu.org). This program is free software. You may redistribute it and/or Modified: stable/8/contrib/less/cmdbuf.c ============================================================================== --- stable/8/contrib/less/cmdbuf.c Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/cmdbuf.c Thu May 30 20:42:51 2013 (r251155) @@ -727,9 +727,9 @@ cmd_updown(action) s = ml->string; if (s == NULL) s = ""; - strcpy(cmdbuf, s); cmd_home(); clear_eol(); + strcpy(cmdbuf, s); for (cp = cmdbuf; *cp != '\0'; ) cmd_right(); return (CC_OK); Modified: stable/8/contrib/less/configure ============================================================================== --- stable/8/contrib/less/configure Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/configure Thu May 30 20:42:51 2013 (r251155) @@ -5188,8 +5188,7 @@ fi # Checks for regular expression functions. have_regex=no have_posix_regex=unknown -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for regcomp" >&5 -$as_echo_n "checking for regcomp... " >&6; } +supported_regex="" # Select a regular expression library. WANT_REGEX=auto @@ -5204,6 +5203,8 @@ if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = posix; then # Some versions of Solaris have a regcomp() function, but it doesn't work! # So we run a test program. If we're cross-compiling, do it the old way. +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for POSIX regcomp" >&5 +$as_echo_n "checking for POSIX regcomp... " >&6; } if test "$cross_compiling" = yes; then : have_posix_regex=unknown else @@ -5232,10 +5233,10 @@ rm -f core *.core core.conftest.* gmon.o fi if test $have_posix_regex = yes; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using POSIX regcomp" >&5 -$as_echo "using POSIX regcomp" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } $as_echo "#define HAVE_POSIX_REGCOMP 1" >>confdefs.h - + supported_regex="$supported_regex posix" have_regex=yes elif test $have_posix_regex = unknown; then cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -5252,10 +5253,10 @@ regex_t *r; regfree(r); } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using POSIX regcomp" >&5 -$as_echo "using POSIX regcomp" >&6; } + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } $as_echo "#define HAVE_POSIX_REGCOMP 1" >>confdefs.h - have_regex=yes + have_regex=yes; supported_regex="$supported_regex posix" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -5267,14 +5268,14 @@ fi fi if test $have_regex = no; then -if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for re_compile_pattern in -lc" >&5 -$as_echo_n "checking for re_compile_pattern in -lc... " >&6; } -if ${ac_cv_lib_c_re_compile_pattern+:} false; then : +if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre_compile in -lpcre" >&5 +$as_echo_n "checking for pcre_compile in -lpcre... " >&6; } +if ${ac_cv_lib_pcre_pcre_compile+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lc $LIBS" +LIBS="-lpcre $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5284,44 +5285,43 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ #ifdef __cplusplus extern "C" #endif -char re_compile_pattern (); +char pcre_compile (); int main () { -return re_compile_pattern (); +return pcre_compile (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_c_re_compile_pattern=yes + ac_cv_lib_pcre_pcre_compile=yes else - ac_cv_lib_c_re_compile_pattern=no + ac_cv_lib_pcre_pcre_compile=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_re_compile_pattern" >&5 -$as_echo "$ac_cv_lib_c_re_compile_pattern" >&6; } -if test "x$ac_cv_lib_c_re_compile_pattern" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using gnu" >&5 -$as_echo "using gnu" >&6; }; $as_echo "#define HAVE_GNU_REGEX 1" >>confdefs.h - have_regex=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcre_pcre_compile" >&5 +$as_echo "$ac_cv_lib_pcre_pcre_compile" >&6; } +if test "x$ac_cv_lib_pcre_pcre_compile" = xyes; then : + $as_echo "#define HAVE_PCRE 1" >>confdefs.h + LIBS="$LIBS -lpcre" have_regex=yes; supported_regex="$supported_regex pcre" fi fi fi if test $have_regex = no; then -if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for pcre_compile in -lpcre" >&5 -$as_echo_n "checking for pcre_compile in -lpcre... " >&6; } -if ${ac_cv_lib_pcre_pcre_compile+:} false; then : +if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for re_compile_pattern in -lc" >&5 +$as_echo_n "checking for re_compile_pattern in -lc... " >&6; } +if ${ac_cv_lib_c_re_compile_pattern+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS -LIBS="-lpcre $LIBS" +LIBS="-lc $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5331,30 +5331,29 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ #ifdef __cplusplus extern "C" #endif -char pcre_compile (); +char re_compile_pattern (); int main () { -return pcre_compile (); +return re_compile_pattern (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_pcre_pcre_compile=yes + ac_cv_lib_c_re_compile_pattern=yes else - ac_cv_lib_pcre_pcre_compile=no + ac_cv_lib_c_re_compile_pattern=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pcre_pcre_compile" >&5 -$as_echo "$ac_cv_lib_pcre_pcre_compile" >&6; } -if test "x$ac_cv_lib_pcre_pcre_compile" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using pcre" >&5 -$as_echo "using pcre" >&6; }; $as_echo "#define HAVE_PCRE 1" >>confdefs.h - LIBS="$LIBS -lpcre" have_regex=yes +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_c_re_compile_pattern" >&5 +$as_echo "$ac_cv_lib_c_re_compile_pattern" >&6; } +if test "x$ac_cv_lib_c_re_compile_pattern" = xyes; then : + $as_echo "#define HAVE_GNU_REGEX 1" >>confdefs.h + have_regex=yes; supported_regex="$supported_regex gnu" fi fi @@ -5364,9 +5363,8 @@ if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcmp; then ac_fn_c_check_func "$LINENO" "regcmp" "ac_cv_func_regcmp" if test "x$ac_cv_func_regcmp" = xyes; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using regcmp" >&5 -$as_echo "using regcmp" >&6; }; $as_echo "#define HAVE_REGCMP 1" >>confdefs.h - have_regex=yes + $as_echo "#define HAVE_REGCMP 1" >>confdefs.h + have_regex=yes; supported_regex="$supported_regex regcmp" fi fi @@ -5374,6 +5372,8 @@ fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp; then +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for V8 regcomp" >&5 +$as_echo_n "checking for V8 regcomp... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -5387,9 +5387,12 @@ regcomp(""); } _ACEOF if ac_fn_c_try_link "$LINENO"; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: result: using V8 regcomp" >&5 -$as_echo "using V8 regcomp" >&6; }; $as_echo "#define HAVE_V8_REGCOMP 1" >>confdefs.h - have_regex=yes + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; }; $as_echo "#define HAVE_V8_REGCOMP 1" >>confdefs.h + have_regex=yes; supported_regex="$supported_regex regcomp" +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext @@ -5400,18 +5403,21 @@ if test $have_regex = no && test -f ${sr if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp-local; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: using V8 regcomp -- local source" >&5 $as_echo "using V8 regcomp -- local source" >&6; }; $as_echo "#define HAVE_V8_REGCOMP 1" >>confdefs.h - $as_echo "#define HAVE_REGEXEC2 1" >>confdefs.h + +supported_regex="$supported_regex regcomp-local" +$as_echo "#define HAVE_REGEXEC2 1" >>confdefs.h REGEX_O='regexp.$(O)' have_regex=yes fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = re_comp; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: using re_comp" >&5 -$as_echo "using re_comp" >&6; }; ac_fn_c_check_func "$LINENO" "re_comp" "ac_cv_func_re_comp" +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for re_comp" >&5 +$as_echo_n "checking for re_comp... " >&6; } +ac_fn_c_check_func "$LINENO" "re_comp" "ac_cv_func_re_comp" if test "x$ac_cv_func_re_comp" = xyes; then : $as_echo "#define HAVE_RE_COMP 1" >>confdefs.h - have_regex=yes + have_regex=yes; supported_regex="$supported_regex re_comp" fi fi @@ -5420,15 +5426,17 @@ fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = none; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: using no regex" >&5 -$as_echo "using no regex" >&6; }; have_regex=yes; +$as_echo "using no regex" >&6; } +else +{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find regular expression library" >&5 +$as_echo "$as_me: WARNING: cannot find regular expression library" >&2;} fi +$as_echo "#define NO_REGEX 1" >>confdefs.h + supported_regex="$supported_regex none" fi -if test $have_regex = no; then -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: cannot find regular expression library" >&5 -$as_echo "cannot find regular expression library" >&6; }; $as_echo "#define NO_REGEX 1" >>confdefs.h - -fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: regular expression library: $supported_regex" >&5 +$as_echo "regular expression library: $supported_regex" >&6; } # Check whether --with-editor was given. Modified: stable/8/contrib/less/configure.ac ============================================================================== --- stable/8/contrib/less/configure.ac Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/configure.ac Thu May 30 20:42:51 2013 (r251155) @@ -383,7 +383,7 @@ fi # Checks for regular expression functions. have_regex=no have_posix_regex=unknown -AC_MSG_CHECKING(for regcomp) +supported_regex="" # Select a regular expression library. WANT_REGEX=auto @@ -395,6 +395,7 @@ if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = posix; then # Some versions of Solaris have a regcomp() function, but it doesn't work! # So we run a test program. If we're cross-compiling, do it the old way. +AC_MSG_CHECKING(for POSIX regcomp) AC_TRY_RUN([ #include #include @@ -409,16 +410,16 @@ if (rm.rm_sp != text + 1) exit(1); /* ch exit(0); }], have_posix_regex=yes, have_posix_regex=no, have_posix_regex=unknown) if test $have_posix_regex = yes; then - AC_MSG_RESULT(using POSIX regcomp) - AC_DEFINE(HAVE_POSIX_REGCOMP) + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_POSIX_REGCOMP) supported_regex="$supported_regex posix" have_regex=yes elif test $have_posix_regex = unknown; then AC_TRY_LINK([ #include #include ], [regex_t *r; regfree(r);], - AC_MSG_RESULT(using POSIX regcomp) - AC_DEFINE(HAVE_POSIX_REGCOMP) have_regex=yes) + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_POSIX_REGCOMP) have_regex=yes; supported_regex="$supported_regex posix") else AC_MSG_RESULT(no) fi @@ -426,55 +427,61 @@ fi fi if test $have_regex = no; then -if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then -AC_CHECK_LIB(c, re_compile_pattern, -[AC_MSG_RESULT(using gnu); AC_DEFINE(HAVE_GNU_REGEX) have_regex=yes], []) +if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then +AC_CHECK_LIB(pcre, pcre_compile, +[AC_DEFINE(HAVE_PCRE) LIBS="$LIBS -lpcre" have_regex=yes; supported_regex="$supported_regex pcre"], []) fi fi if test $have_regex = no; then -if test $WANT_REGEX = auto -o $WANT_REGEX = pcre; then -AC_CHECK_LIB(pcre, pcre_compile, -[AC_MSG_RESULT(using pcre); AC_DEFINE(HAVE_PCRE) LIBS="$LIBS -lpcre" have_regex=yes], []) +if test $WANT_REGEX = auto -o $WANT_REGEX = gnu; then +AC_CHECK_LIB(c, re_compile_pattern, +[AC_DEFINE(HAVE_GNU_REGEX) have_regex=yes; supported_regex="$supported_regex gnu"], []) fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcmp; then AC_CHECK_FUNC(regcmp, -AC_MSG_RESULT(using regcmp); AC_DEFINE(HAVE_REGCMP) have_regex=yes) +[AC_DEFINE(HAVE_REGCMP) have_regex=yes; supported_regex="$supported_regex regcmp"],[]) fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp; then +AC_MSG_CHECKING(for V8 regcomp) AC_TRY_LINK([ #include "regexp.h"], [regcomp("");], -AC_MSG_RESULT(using V8 regcomp); AC_DEFINE(HAVE_V8_REGCOMP) have_regex=yes) +[AC_MSG_RESULT(yes); AC_DEFINE(HAVE_V8_REGCOMP) have_regex=yes; supported_regex="$supported_regex regcomp"],[AC_MSG_RESULT(no)]) fi fi if test $have_regex = no && test -f ${srcdir}/regexp.c; then if test $WANT_REGEX = auto -o $WANT_REGEX = regcomp-local; then -AC_MSG_RESULT(using V8 regcomp -- local source); AC_DEFINE(HAVE_V8_REGCOMP) AC_DEFINE(HAVE_REGEXEC2) REGEX_O='regexp.$(O)' AC_SUBST(REGEX_O) have_regex=yes +AC_MSG_RESULT(using V8 regcomp -- local source); AC_DEFINE(HAVE_V8_REGCOMP) +supported_regex="$supported_regex regcomp-local" +AC_DEFINE(HAVE_REGEXEC2) REGEX_O='regexp.$(O)' AC_SUBST(REGEX_O) have_regex=yes fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = re_comp; then -AC_MSG_RESULT(using re_comp); AC_CHECK_FUNC(re_comp, AC_DEFINE(HAVE_RE_COMP) have_regex=yes) +AC_MSG_CHECKING(for re_comp) +AC_CHECK_FUNC(re_comp, +[AC_DEFINE(HAVE_RE_COMP) have_regex=yes; supported_regex="$supported_regex re_comp"],[]) fi fi if test $have_regex = no; then if test $WANT_REGEX = auto -o $WANT_REGEX = none; then -AC_MSG_RESULT(using no regex); have_regex=yes; +AC_MSG_RESULT(using no regex) +else +AC_MSG_WARN(cannot find regular expression library) fi +AC_DEFINE(NO_REGEX) supported_regex="$supported_regex none" fi -if test $have_regex = no; then -AC_MSG_RESULT(cannot find regular expression library); AC_DEFINE(NO_REGEX) -fi +AC_MSG_RESULT(regular expression library: $supported_regex) AC_ARG_WITH(editor, [ --with-editor=PROGRAM use PROGRAM as the default editor [vi]], @@ -662,6 +669,7 @@ AH_TOP([ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines */ #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -671,6 +679,17 @@ AH_TOP([ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Settings automatically determined by configure. */ ]) Modified: stable/8/contrib/less/defines.ds ============================================================================== --- stable/8/contrib/less/defines.ds Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/defines.ds Thu May 30 20:42:51 2013 (r251155) @@ -185,6 +185,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -194,6 +195,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Define to `long' if doesn't define. */ #if MSDOS_COMPILER==BORLANDC Modified: stable/8/contrib/less/defines.h.in ============================================================================== --- stable/8/contrib/less/defines.h.in Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/defines.h.in Thu May 30 20:42:51 2013 (r251155) @@ -182,6 +182,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines */ #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -191,6 +192,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Settings automatically determined by configure. */ Modified: stable/8/contrib/less/defines.o2 ============================================================================== --- stable/8/contrib/less/defines.o2 Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/defines.o2 Thu May 30 20:42:51 2013 (r251155) @@ -166,6 +166,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -175,6 +176,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Define to `long' if doesn't define. */ /* #define off_t long */ Modified: stable/8/contrib/less/defines.o9 ============================================================================== --- stable/8/contrib/less/defines.o9 Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/defines.o9 Thu May 30 20:42:51 2013 (r251155) @@ -173,6 +173,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -182,6 +183,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Define to `long' if doesn't define. */ #define off_t long Modified: stable/8/contrib/less/defines.wn ============================================================================== --- stable/8/contrib/less/defines.wn Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/defines.wn Thu May 30 20:42:51 2013 (r251155) @@ -167,6 +167,7 @@ /* * Sizes of various buffers. */ +#if 0 /* old sizes for small memory machines #define CMDBUF_SIZE 512 /* Buffer for multichar commands */ #define UNGOT_SIZE 100 /* Max chars to unget() */ #define LINEBUF_SIZE 1024 /* Max size of line in input file */ @@ -176,6 +177,17 @@ #define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ #define TAGLINE_SIZE 512 /* Max size of line in tags file */ #define TABSTOP_MAX 32 /* Max number of custom tab stops */ +#else /* more reasonable sizes for modern machines */ +#define CMDBUF_SIZE 2048 /* Buffer for multichar commands */ +#define UNGOT_SIZE 200 /* Max chars to unget() */ +#define LINEBUF_SIZE 1024 /* Initial max size of line in input file */ +#define OUTBUF_SIZE 1024 /* Output buffer */ +#define PROMPT_SIZE 2048 /* Max size of prompt string */ +#define TERMBUF_SIZE 2048 /* Termcap buffer for tgetent */ +#define TERMSBUF_SIZE 1024 /* Buffer to hold termcap strings */ +#define TAGLINE_SIZE 1024 /* Max size of line in tags file */ +#define TABSTOP_MAX 128 /* Max number of custom tab stops */ +#endif /* Define to `long' if doesn't define. */ /* #define off_t long */ Modified: stable/8/contrib/less/help.c ============================================================================== --- stable/8/contrib/less/help.c Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/help.c Thu May 30 20:42:51 2013 (r251155) @@ -110,7 +110,7 @@ constant char helpdata[] = { ' ',' ',' ',' ',' ',' ',' ',' ','M','o','s','t',' ','o','p','t','i','o','n','s',' ','m','a','y',' ','b','e',' ','c','h','a','n','g','e','d',' ','e','i','t','h','e','r',' ','o','n',' ','t','h','e',' ','c','o','m','m','a','n','d',' ','l','i','n','e',',','\n', ' ',' ',' ',' ',' ',' ',' ',' ','o','r',' ','f','r','o','m',' ','w','i','t','h','i','n',' ','l','e','s','s',' ','b','y',' ','u','s','i','n','g',' ','t','h','e',' ','-',' ','o','r',' ','-','-',' ','c','o','m','m','a','n','d','.','\n', ' ',' ',' ',' ',' ',' ',' ',' ','O','p','t','i','o','n','s',' ','m','a','y',' ','b','e',' ','g','i','v','e','n',' ','i','n',' ','o','n','e',' ','o','f',' ','t','w','o',' ','f','o','r','m','s',':',' ','e','i','t','h','e','r',' ','a',' ','s','i','n','g','l','e','\n', -' ',' ',' ',' ',' ',' ',' ',' ','c','h','a','r','a','c','t','e','r',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','a',' ','-',',',' ','o','r',' ','a',' ','n','a','m','e',' ','p','r','e','c','e','e','d','e','d',' ','b','y',' ','-','-','.','\n', +' ',' ',' ',' ',' ',' ',' ',' ','c','h','a','r','a','c','t','e','r',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','a',' ','-',',',' ','o','r',' ','a',' ','n','a','m','e',' ','p','r','e','c','e','d','e','d',' ','b','y',' ','-','-','.','\n', '\n', ' ',' ','-','?',' ',' ','.','.','.','.','.','.','.','.',' ',' ','-','-','h','e','l','p','\n', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','D','i','s','p','l','a','y',' ','h','e','l','p',' ','(','f','r','o','m',' ','c','o','m','m','a','n','d',' ','l','i','n','e',')','.','\n', Modified: stable/8/contrib/less/less.hlp ============================================================================== --- stable/8/contrib/less/less.hlp Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/less.hlp Thu May 30 20:42:51 2013 (r251155) @@ -107,7 +107,7 @@ Most options may be changed either on the command line, or from within less by using the - or -- command. Options may be given in one of two forms: either a single - character preceded by a -, or a name preceeded by --. + character preceded by a -, or a name preceded by --. -? ........ --help Display help (from command line). Modified: stable/8/contrib/less/less.man ============================================================================== --- stable/8/contrib/less/less.man Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/less.man Thu May 30 20:42:51 2013 (r251155) @@ -437,13 +437,18 @@ LESS(1) appears in the LESS variable, it can be reset to its default value on the command line by beginning the command line option with "-+". - For options like -P or -D which take a following string, a dollar sign - ($) must be used to signal the end of the string. For example, to set - two -D options on MS-DOS, you must have a dollar sign between them, + Some options like -k or -D require a string to follow the option let- + ter. The string for that option is considered to end when a dollar + sign ($) is found. For example, you can set two -D options on MS-DOS like this: - LESS="-Dn9.1$-Ds4.1" + LESS="Dn9.1$Ds4.1" + If the --use-backslash option appears earlier in the options, then a + dollar sign or backslash may be included literally in an option string + by preceding it with a backslash. If the --use-backslash option is not + in effect, then backslashes are not treated specially, and there is no + way to include a dollar sign in the option string. -? or --help This option displays a summary of the commands accepted by less @@ -836,11 +841,6 @@ LESS(1) actual scroll remains at the specified fraction of the screen width. - --no-keypad - Disables sending the keypad initialization and deinitialization - strings to the terminal. This is sometimes useful if the keypad - strings make the numeric keypad behave in an undesirable manner. - --follow-name Normally, if the input file is renamed while an F command is executing, less will continue to display the contents of the @@ -851,6 +851,18 @@ LESS(1) has been created with the same name as the original (now renamed) file), less will display the contents of that new file. + --no-keypad + Disables sending the keypad initialization and deinitialization + strings to the terminal. This is sometimes useful if the keypad + strings make the numeric keypad behave in an undesirable manner. + + --use-backslash + This option changes the interpretations of options which follow + this one. After the --use-backslash option, any backslash in an + option string is removed and the following character is taken + literally. This allows a dollar sign to be included in option + strings. + -- A command line argument of "--" marks the end of option argu- ments. Any arguments following this are interpreted as file- names. This can be useful when viewing a file whose name begins @@ -1597,8 +1609,8 @@ LESS(1) AUTHOR - Mark Nudelman - Send bug reports or comments to bug-less@gnu.org. + Mark Nudelman + Send bug reports or comments to See http://www.greenwoodsoftware.com/less/bugs.html for the latest list of known bugs in less. For more information, see the less homepage at @@ -1606,4 +1618,4 @@ LESS(1) - Version 451: 21 Jul 2012 LESS(1) + Version 458: 04 Apr 2013 LESS(1) Modified: stable/8/contrib/less/less.nro ============================================================================== --- stable/8/contrib/less/less.nro Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/less.nro Thu May 30 20:42:51 2013 (r251155) @@ -1,4 +1,4 @@ -.TH LESS 1 "Version 451: 21 Jul 2012" +.TH LESS 1 "Version 458: 04 Apr 2013" .SH NAME less \- opposite of more .SH SYNOPSIS @@ -455,13 +455,18 @@ If an option appears in the LESS variabl to its default value on the command line by beginning the command line option with "\-+". .sp -For options like \-P or \-D which take a following string, -a dollar sign ($) must be used to signal the end of the string. -For example, to set two \-D options on MS-DOS, you must have -a dollar sign between them, like this: +Some options like \-k or \-D require a string to follow the option letter. +The string for that option is considered to end when a dollar sign ($) is found. +For example, you can set two \-D options on MS-DOS like this: .sp -LESS="-Dn9.1$-Ds4.1" +LESS="Dn9.1$Ds4.1" .sp +If the --use-backslash option appears earlier in the options, then +a dollar sign or backslash may be included literally in an option string +by preceding it with a backslash. +If the --use-backslash option is not in effect, then backslashes are +not treated specially, and there is no way to include a dollar sign +in the option string. .IP "\-? or \-\-help" This option displays a summary of the commands accepted by .I less @@ -890,11 +895,6 @@ If the number is specified as a fraction scroll positions is recalculated if the terminal window is resized, so that the actual scroll remains at the specified fraction of the screen width. -.IP "\-\-no-keypad" -Disables sending the keypad initialization and deinitialization strings -to the terminal. -This is sometimes useful if the keypad strings make the numeric -keypad behave in an undesirable manner. .IP "\-\-follow-name" Normally, if the input file is renamed while an F command is executing, .I less @@ -908,6 +908,16 @@ If the reopen succeeds and the file is a with the same name as the original (now renamed) file), .I less will display the contents of that new file. +.IP "\-\-no-keypad" +Disables sending the keypad initialization and deinitialization strings +to the terminal. +This is sometimes useful if the keypad strings make the numeric +keypad behave in an undesirable manner. +.IP "\-\-use-backslash" +This option changes the interpretations of options which follow this one. +After the \-\-use-backslash option, any backslash in an option string is +removed and the following character is taken literally. +This allows a dollar sign to be included in option strings. .IP \-\- A command line argument of "\-\-" marks the end of option arguments. Any arguments following this are interpreted as filenames. @@ -1739,9 +1749,9 @@ See the GNU General Public License for m .SH AUTHOR .PP -Mark Nudelman +Mark Nudelman .br -Send bug reports or comments to bug-less@gnu.org. +Send bug reports or comments to .br See http://www.greenwoodsoftware.com/less/bugs.html for the latest list of known bugs in less. .br Modified: stable/8/contrib/less/lessecho.man ============================================================================== --- stable/8/contrib/less/lessecho.man Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/lessecho.man Thu May 30 20:42:51 2013 (r251155) @@ -51,4 +51,4 @@ LESSECHO(1) - Version 451: 21 Jul 2012 LESSECHO(1) + Version 458: 04 Apr 2013 LESSECHO(1) Modified: stable/8/contrib/less/lessecho.nro ============================================================================== --- stable/8/contrib/less/lessecho.nro Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/lessecho.nro Thu May 30 20:42:51 2013 (r251155) @@ -1,4 +1,4 @@ -.TH LESSECHO 1 "Version 451: 21 Jul 2012" +.TH LESSECHO 1 "Version 458: 04 Apr 2013" .SH NAME lessecho \- expand metacharacters .SH SYNOPSIS Modified: stable/8/contrib/less/lesskey.man ============================================================================== --- stable/8/contrib/less/lesskey.man Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/lesskey.man Thu May 30 20:42:51 2013 (r251155) @@ -353,4 +353,4 @@ LESSKEY(1) - Version 451: 21 Jul 2012 LESSKEY(1) + Version 458: 04 Apr 2013 LESSKEY(1) Modified: stable/8/contrib/less/lesskey.nro ============================================================================== --- stable/8/contrib/less/lesskey.nro Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/lesskey.nro Thu May 30 20:42:51 2013 (r251155) @@ -1,4 +1,4 @@ -.TH LESSKEY 1 "Version 451: 21 Jul 2012" +.TH LESSKEY 1 "Version 458: 04 Apr 2013" .SH NAME lesskey \- specify key bindings for less .SH SYNOPSIS Modified: stable/8/contrib/less/option.c ============================================================================== --- stable/8/contrib/less/option.c Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/option.c Thu May 30 20:42:51 2013 (r251155) @@ -30,6 +30,7 @@ extern int screen_trashed; extern int less_is_more; extern int quit_at_eof; extern char *every_first_cmd; +extern int opt_use_backslash; /* * Return a printable description of an option. @@ -146,10 +147,13 @@ scan_option(s) */ plusoption = TRUE; s = optstring(s, &str, propt('+'), NULL); + if (s == NULL) + return; if (*str == '+') - every_first_cmd = save(++str); + every_first_cmd = save(str+1); else ungetsc(str); + free(str); continue; case '0': case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': @@ -202,7 +206,7 @@ scan_option(s) parg.p_string = printopt; error("The %s option should not be followed by =", &parg); - quit(QUIT_ERROR); + return; } s++; } else @@ -223,7 +227,7 @@ scan_option(s) else error("There is no %s option (\"less --help\" for help)", &parg); - quit(QUIT_ERROR); + return; } str = NULL; @@ -260,6 +264,8 @@ scan_option(s) while (*s == ' ') s++; s = optstring(s, &str, printopt, o->odesc[1]); + if (s == NULL) + return; break; case NUMBER: if (*s == '\0') @@ -275,6 +281,8 @@ scan_option(s) */ if (o->ofunc != NULL) (*o->ofunc)(INIT, str); + if (str != NULL) + free(str); } } @@ -558,35 +566,33 @@ optstring(s, p_str, printopt, validchars char *validchars; { register char *p; + register char *out; if (*s == '\0') { nostring(printopt); - quit(QUIT_ERROR); + return (NULL); } - *p_str = s; + /* Alloc could be more than needed, but not worth trimming. */ + *p_str = (char *) ecalloc(strlen(s)+1, sizeof(char)); + out = *p_str; + for (p = s; *p != '\0'; p++) { - if (*p == END_OPTION_STRING || - (validchars != NULL && strchr(validchars, *p) == NULL)) + if (opt_use_backslash && *p == '\\' && p[1] != '\0') { - switch (*p) - { - case END_OPTION_STRING: - case ' ': case '\t': case '-': - /* Replace the char with a null to terminate string. */ - *p++ = '\0'; - break; - default: - /* Cannot replace char; make a copy of the string. */ - *p_str = (char *) ecalloc(p-s+1, sizeof(char)); - strncpy(*p_str, s, p-s); - (*p_str)[p-s] = '\0'; + /* Take next char literally. */ + ++p; + } else + { + if (*p == END_OPTION_STRING || + (validchars != NULL && strchr(validchars, *p) == NULL)) + /* End of option string. */ break; - } - break; } + *out++ = *p; } + *out = '\0'; return (p); } @@ -609,8 +615,6 @@ num_error(printopt, errp) parg.p_string = printopt; error("Number is required after %s", &parg); } - quit(QUIT_ERROR); - /* NOTREACHED */ return (-1); } Modified: stable/8/contrib/less/opttbl.c ============================================================================== --- stable/8/contrib/less/opttbl.c Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/opttbl.c Thu May 30 20:42:51 2013 (r251155) @@ -52,6 +52,7 @@ public int use_lessopen; /* Use the LESS public int quit_on_intr; /* Quit on interrupt */ public int follow_mode; /* F cmd Follows file desc or file name? */ public int oldbot; /* Old bottom of screen behavior {{REMOVE}} */ +public int opt_use_backslash; /* Use backslash escaping in option parsing */ #if HILITE_SEARCH public int hilite_search; /* Highlight matched search patterns? */ #endif @@ -115,6 +116,7 @@ static struct optname pound_optname = { static struct optname keypad_optname = { "no-keypad", NULL }; static struct optname oldbot_optname = { "old-bot", NULL }; static struct optname follow_optname = { "follow-name", NULL }; +static struct optname use_backslash_optname = { "use-backslash", NULL }; /* @@ -446,6 +448,14 @@ static struct loption option[] = NULL } }, + { OLETTER_NONE, &use_backslash_optname, + BOOL, OPT_OFF, &opt_use_backslash, NULL, + { + "Use backslash escaping in command line parameters", + "Don't use backslash escaping in command line parameters", + NULL + } + }, { '\0', NULL, NOVAR, 0, NULL, NULL, { NULL, NULL, NULL } } }; Modified: stable/8/contrib/less/output.c ============================================================================== --- stable/8/contrib/less/output.c Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/output.c Thu May 30 20:42:51 2013 (r251155) @@ -278,8 +278,13 @@ flush() */ if (p[-2] == '[') { +#if MSDOS_COMPILER==WIN32C + fg |= FOREGROUND_INTENSITY; + bg |= BACKGROUND_INTENSITY; +#else fg = bo_fg_color; bg = bo_bg_color; +#endif } else fg |= 8; } else if (at & 2) Modified: stable/8/contrib/less/position.c ============================================================================== --- stable/8/contrib/less/position.c Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/position.c Thu May 30 20:42:51 2013 (r251155) @@ -162,7 +162,7 @@ empty_lines(s, e) register int i; for (i = s; i <= e; i++) - if (table[i] != NULL_POSITION) + if (table[i] != NULL_POSITION && table[i] != 0) return (0); return (1); } Modified: stable/8/contrib/less/screen.c ============================================================================== --- stable/8/contrib/less/screen.c Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/screen.c Thu May 30 20:42:51 2013 (r251155) @@ -802,7 +802,7 @@ scrsize() else if ((n = ltgetnum("li")) > 0) sc_height = n; #endif - else + if (sc_height <= 0) sc_height = DEF_SC_HEIGHT; if (sys_width > 0) @@ -813,7 +813,7 @@ scrsize() else if ((n = ltgetnum("co")) > 0) sc_width = n; #endif - else + if (sc_width <= 0) sc_width = DEF_SC_WIDTH; } Modified: stable/8/contrib/less/version.c ============================================================================== --- stable/8/contrib/less/version.c Thu May 30 20:40:16 2013 (r251154) +++ stable/8/contrib/less/version.c Thu May 30 20:42:51 2013 (r251155) @@ -753,6 +753,15 @@ v448 6/15/12 Print name of regex libr v449 6/23/12 Allow config option --with-regex=none. v450 7/4/12 Fix EOF bug with ESC-F. v451 7/20/12 Fix typo. *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Thu May 30 20:45:58 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1A40D808; Thu, 30 May 2013 20:45:58 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0D69774F; Thu, 30 May 2013 20:45:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UKjvqU049545; Thu, 30 May 2013 20:45:57 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UKjvxW049544; Thu, 30 May 2013 20:45:57 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305302045.r4UKjvxW049544@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 20:45:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251156 - stable/9/bin/kenv X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 20:45:58 -0000 Author: delphij Date: Thu May 30 20:45:57 2013 New Revision: 251156 URL: http://svnweb.freebsd.org/changeset/base/251156 Log: MFC r250666: Constify parameters, no functional or binary change. Modified: stable/9/bin/kenv/kenv.c Directory Properties: stable/9/bin/kenv/ (props changed) Modified: stable/9/bin/kenv/kenv.c ============================================================================== --- stable/9/bin/kenv/kenv.c Thu May 30 20:42:51 2013 (r251155) +++ stable/9/bin/kenv/kenv.c Thu May 30 20:45:57 2013 (r251156) @@ -37,9 +37,9 @@ __FBSDID("$FreeBSD$"); static void usage(void); static int kdumpenv(void); -static int kgetenv(char *); -static int ksetenv(char *, char *); -static int kunsetenv(char *); +static int kgetenv(const char *); +static int ksetenv(const char *, char *); +static int kunsetenv(const char *); static int hflag = 0; static int Nflag = 0; @@ -170,7 +170,7 @@ kdumpenv(void) } static int -kgetenv(char *env) +kgetenv(const char *env) { char buf[1024]; int ret; @@ -186,7 +186,7 @@ kgetenv(char *env) } static int -ksetenv(char *env, char *val) +ksetenv(const char *env, char *val) { int ret; @@ -197,7 +197,7 @@ ksetenv(char *env, char *val) } static int -kunsetenv(char *env) +kunsetenv(const char *env) { int ret; From owner-svn-src-stable@FreeBSD.ORG Thu May 30 20:46:56 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C895B9A5; Thu, 30 May 2013 20:46:56 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id BA951767; Thu, 30 May 2013 20:46:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UKkuq1049775; Thu, 30 May 2013 20:46:56 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UKkubT049774; Thu, 30 May 2013 20:46:56 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305302046.r4UKkubT049774@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 20:46:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251157 - stable/9/sbin/tunefs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 20:46:56 -0000 Author: delphij Date: Thu May 30 20:46:56 2013 New Revision: 251157 URL: http://svnweb.freebsd.org/changeset/base/251157 Log: MFC r250718: Constify string pointers. Modified: stable/9/sbin/tunefs/tunefs.c Directory Properties: stable/9/sbin/tunefs/ (props changed) Modified: stable/9/sbin/tunefs/tunefs.c ============================================================================== --- stable/9/sbin/tunefs/tunefs.c Thu May 30 20:45:57 2013 (r251156) +++ stable/9/sbin/tunefs/tunefs.c Thu May 30 20:46:56 2013 (r251157) @@ -82,8 +82,8 @@ void sbdirty(void); int main(int argc, char *argv[]) { - char *avalue, *jvalue, *Jvalue, *Lvalue, *lvalue, *Nvalue, *nvalue; - char *tvalue; + const char *avalue, *jvalue, *Jvalue, *Lvalue, *lvalue, *Nvalue, *nvalue; + const char *tvalue; const char *special, *on; const char *name; int active; @@ -712,7 +712,7 @@ journal_findfile(void) } static void -dir_clear_block(char *block, off_t off) +dir_clear_block(const char *block, off_t off) { struct direct *dp; From owner-svn-src-stable@FreeBSD.ORG Thu May 30 21:49:43 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A23901EF; Thu, 30 May 2013 21:49:43 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 944A3C01; Thu, 30 May 2013 21:49:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4ULnhxg071461; Thu, 30 May 2013 21:49:43 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4ULnhmr071460; Thu, 30 May 2013 21:49:43 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305302149.r4ULnhmr071460@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 21:49:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251162 - stable/9/sys/dev/hptiop X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 21:49:43 -0000 Author: delphij Date: Thu May 30 21:49:43 2013 New Revision: 251162 URL: http://svnweb.freebsd.org/changeset/base/251162 Log: MFC r250050: Add missing braces. Submitted by: Sascha Wildner Obtained from: DragonFly Modified: stable/9/sys/dev/hptiop/hptiop.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/hptiop/hptiop.c ============================================================================== --- stable/9/sys/dev/hptiop/hptiop.c Thu May 30 21:25:55 2013 (r251161) +++ stable/9/sys/dev/hptiop/hptiop.c Thu May 30 21:49:43 2013 (r251162) @@ -1704,10 +1704,11 @@ static int hptiop_internal_memalloc_mvfr hba->u.mvfrey.internal_mem_size, hptiop_mvfrey_map_ctlcfg, hba, 0)) { device_printf(hba->pcidev, "bus_dmamap_load failed!\n"); - if (hba->ctlcfg_dmat) + if (hba->ctlcfg_dmat) { bus_dmamem_free(hba->ctlcfg_dmat, hba->ctlcfg_ptr, hba->ctlcfg_dmamap); bus_dma_tag_destroy(hba->ctlcfg_dmat); + } return -1; } From owner-svn-src-stable@FreeBSD.ORG Thu May 30 21:50:25 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 975BF3C9; Thu, 30 May 2013 21:50:25 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8A463C1C; Thu, 30 May 2013 21:50:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4ULoPvB071700; Thu, 30 May 2013 21:50:25 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4ULoPW4071699; Thu, 30 May 2013 21:50:25 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305302150.r4ULoPW4071699@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 21:50:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r251163 - stable/8/sys/dev/hptiop X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 21:50:25 -0000 Author: delphij Date: Thu May 30 21:50:25 2013 New Revision: 251163 URL: http://svnweb.freebsd.org/changeset/base/251163 Log: MFC r250050: Add missing braces. Submitted by: Sascha Wildner Obtained from: DragonFly Modified: stable/8/sys/dev/hptiop/hptiop.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/hptiop/ (props changed) Modified: stable/8/sys/dev/hptiop/hptiop.c ============================================================================== --- stable/8/sys/dev/hptiop/hptiop.c Thu May 30 21:49:43 2013 (r251162) +++ stable/8/sys/dev/hptiop/hptiop.c Thu May 30 21:50:25 2013 (r251163) @@ -1704,10 +1704,11 @@ static int hptiop_internal_memalloc_mvfr hba->u.mvfrey.internal_mem_size, hptiop_mvfrey_map_ctlcfg, hba, 0)) { device_printf(hba->pcidev, "bus_dmamap_load failed!\n"); - if (hba->ctlcfg_dmat) + if (hba->ctlcfg_dmat) { bus_dmamem_free(hba->ctlcfg_dmat, hba->ctlcfg_ptr, hba->ctlcfg_dmamap); bus_dma_tag_destroy(hba->ctlcfg_dmat); + } return -1; } From owner-svn-src-stable@FreeBSD.ORG Thu May 30 21:54:50 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 213D85F3; Thu, 30 May 2013 21:54:50 +0000 (UTC) (envelope-from scottl@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 029AFCD8; Thu, 30 May 2013 21:54:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4ULsnFE074068; Thu, 30 May 2013 21:54:49 GMT (envelope-from scottl@svn.freebsd.org) Received: (from scottl@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4ULsmZJ074053; Thu, 30 May 2013 21:54:48 GMT (envelope-from scottl@svn.freebsd.org) Message-Id: <201305302154.r4ULsmZJ074053@svn.freebsd.org> From: Scott Long Date: Thu, 30 May 2013 21:54:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251164 - in stable/9/sys/dev: advansys aha ahb buslogic dpt X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 21:54:50 -0000 Author: scottl Date: Thu May 30 21:54:48 2013 New Revision: 251164 URL: http://svnweb.freebsd.org/changeset/base/251164 Log: MFC 241492, 241588, 241589, 241590, 241592, 241593, 241603, 241605 Modernize and lock the aha, ahb, adv, adw, bt, and dpt drivers. Submitted by: jhb Obtained from: Netflix Modified: stable/9/sys/dev/advansys/adv_eisa.c stable/9/sys/dev/advansys/adv_isa.c stable/9/sys/dev/advansys/adv_pci.c stable/9/sys/dev/advansys/advansys.c stable/9/sys/dev/advansys/advansys.h stable/9/sys/dev/advansys/advlib.c stable/9/sys/dev/advansys/advlib.h stable/9/sys/dev/advansys/adw_pci.c stable/9/sys/dev/advansys/adwcam.c stable/9/sys/dev/advansys/adwlib.c stable/9/sys/dev/advansys/adwlib.h stable/9/sys/dev/advansys/adwvar.h stable/9/sys/dev/aha/aha.c stable/9/sys/dev/aha/aha_isa.c stable/9/sys/dev/aha/aha_mca.c stable/9/sys/dev/aha/ahareg.h stable/9/sys/dev/ahb/ahb.c stable/9/sys/dev/ahb/ahbreg.h stable/9/sys/dev/buslogic/bt.c stable/9/sys/dev/buslogic/bt_eisa.c stable/9/sys/dev/buslogic/bt_isa.c stable/9/sys/dev/buslogic/bt_mca.c stable/9/sys/dev/buslogic/bt_pci.c stable/9/sys/dev/buslogic/btreg.h stable/9/sys/dev/dpt/dpt.h stable/9/sys/dev/dpt/dpt_eisa.c stable/9/sys/dev/dpt/dpt_isa.c stable/9/sys/dev/dpt/dpt_pci.c stable/9/sys/dev/dpt/dpt_scsi.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/advansys/adv_eisa.c ============================================================================== --- stable/9/sys/dev/advansys/adv_eisa.c Thu May 30 21:50:25 2013 (r251163) +++ stable/9/sys/dev/advansys/adv_eisa.c Thu May 30 21:54:48 2013 (r251164) @@ -131,17 +131,27 @@ adv_eisa_probe(device_t dev) return 0; } +/* + * The adv_b stuff to handle twin-channel cards will not work in its current + * incarnation. It tries to reuse the same softc since adv_alloc() doesn't + * actually allocate a softc. It also tries to reuse the same unit number + * for both sims. This can be re-enabled if someone fixes it properly. + */ static int adv_eisa_attach(device_t dev) { struct adv_softc *adv; +#if 0 struct adv_softc *adv_b; +#endif struct resource *io; struct resource *irq; int rid, error; void *ih; +#if 0 adv_b = NULL; +#endif rid = 0; io = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &rid, RF_ACTIVE); @@ -162,8 +172,8 @@ adv_eisa_attach(device_t dev) switch (eisa_get_id(dev) & ~0xF) { case EISA_DEVICE_ID_ADVANSYS_750: - adv_b = adv_alloc(dev, rman_get_bustag(io), - rman_get_bushandle(io) + ADV_EISA_OFFSET_CHAN2); +#if 0 + adv_b = adv_alloc(dev, io, ADV_EISA_OFFSET_CHAN2); if (adv_b == NULL) goto bad; @@ -183,26 +193,28 @@ adv_eisa_attach(device_t dev) /* nsegments */ ~0, /* maxsegsz */ ADV_EISA_MAX_DMA_COUNT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &adv_b->parent_dmat); if (error != 0) { - printf("%s: Could not allocate DMA tag - error %d\n", - adv_name(adv_b), error); + device_printf(dev, "Could not allocate DMA tag - error %d\n", + error); adv_free(adv_b); goto bad; } adv_b->init_level++; +#endif /* FALLTHROUGH */ case EISA_DEVICE_ID_ADVANSYS_740: - adv = adv_alloc(dev, rman_get_bustag(io), - rman_get_bushandle(io) + ADV_EISA_OFFSET_CHAN1); + adv = adv_alloc(dev, io, ADV_EISA_OFFSET_CHAN1); if (adv == NULL) { +#if 0 if (adv_b != NULL) adv_free(adv_b); +#endif goto bad; } @@ -222,13 +234,13 @@ adv_eisa_attach(device_t dev) /* nsegments */ ~0, /* maxsegsz */ ADV_EISA_MAX_DMA_COUNT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &adv->parent_dmat); if (error != 0) { - printf("%s: Could not allocate DMA tag - error %d\n", - adv_name(adv), error); + device_printf(dev, "Could not allocate DMA tag - error %d\n", + error); adv_free(adv); goto bad; } @@ -244,7 +256,7 @@ adv_eisa_attach(device_t dev) if (overrun_buf == NULL) { /* Need to allocate our overrun buffer */ if (bus_dma_tag_create( - /* parent */ adv->parent_dmat, + /* parent */ bus_get_dma_tag(dev), /* alignment */ 8, /* boundary */ 0, /* lowaddr */ ADV_EISA_MAX_DMA_ADDR, @@ -255,8 +267,8 @@ adv_eisa_attach(device_t dev) /* nsegments */ 1, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &overrun_dmat) != 0) { adv_free(adv); goto bad; @@ -292,14 +304,17 @@ adv_eisa_attach(device_t dev) if (adv_init(adv) != 0) { adv_free(adv); +#if 0 if (adv_b != NULL) adv_free(adv_b); - return(-1); +#endif + goto bad; } adv->max_dma_count = ADV_EISA_MAX_DMA_COUNT; adv->max_dma_addr = ADV_EISA_MAX_DMA_ADDR; +#if 0 if (adv_b != NULL) { /* * Stop the chip. @@ -317,24 +332,33 @@ adv_eisa_attach(device_t dev) adv_b->max_dma_addr = ADV_EISA_MAX_DMA_ADDR; } } +#endif /* * Enable our interrupt handler. */ - bus_setup_intr(dev, irq, INTR_TYPE_CAM|INTR_ENTROPY, NULL, adv_intr, - adv, &ih); + if (bus_setup_intr(dev, irq, INTR_TYPE_CAM|INTR_ENTROPY|INTR_MPSAFE, NULL, + adv_intr, adv, &ih) != 0) { + adv_free(adv); + goto bad; + } - /* Attach sub-devices - always succeeds */ - adv_attach(adv); + /* Attach sub-devices */ + if (adv_attach(adv) != 0) { + adv_free(adv); + goto bad; + } +#if 0 if (adv_b != NULL) adv_attach(adv_b); +#endif return 0; bad: bus_release_resource(dev, SYS_RES_IOPORT, 0, io); bus_release_resource(dev, SYS_RES_IRQ, 0, irq); - return -1; + return ENXIO; } static device_method_t adv_eisa_methods[] = { Modified: stable/9/sys/dev/advansys/adv_isa.c ============================================================================== --- stable/9/sys/dev/advansys/adv_isa.c Thu May 30 21:50:25 2013 (r251163) +++ stable/9/sys/dev/advansys/adv_isa.c Thu May 30 21:54:48 2013 (r251164) @@ -135,12 +135,13 @@ adv_isa_probe(device_t dev) if ((port_index > max_port_index) || (iobase != adv_isa_ioports[port_index])) { if (bootverbose) - printf("adv%d: Invalid baseport of 0x%lx specified. " - "Nearest valid baseport is 0x%x. Failing " - "probe.\n", device_get_unit(dev), iobase, - (port_index <= max_port_index) ? - adv_isa_ioports[port_index] : - adv_isa_ioports[max_port_index]); + device_printf(dev, + "Invalid baseport of 0x%lx specified. " + "Nearest valid baseport is 0x%x. Failing " + "probe.\n", iobase, + (port_index <= max_port_index) ? + adv_isa_ioports[port_index] : + adv_isa_ioports[max_port_index]); return ENXIO; } max_port_index = port_index; @@ -169,8 +170,7 @@ adv_isa_probe(device_t dev) if (iores == NULL) continue; - if (adv_find_signature(rman_get_bustag(iores), - rman_get_bushandle(iores)) == 0) { + if (adv_find_signature(iores) == 0) { bus_release_resource(dev, SYS_RES_IOPORT, 0, iores); continue; } @@ -179,8 +179,7 @@ adv_isa_probe(device_t dev) * Got one. Now allocate our softc * and see if we can initialize the card. */ - adv = adv_alloc(dev, rman_get_bustag(iores), - rman_get_bushandle(iores)); + adv = adv_alloc(dev, iores, 0); if (adv == NULL) { bus_release_resource(dev, SYS_RES_IOPORT, 0, iores); break; @@ -238,13 +237,13 @@ adv_isa_probe(device_t dev) /* nsegments */ ~0, /* maxsegsz */ maxsegsz, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &adv->parent_dmat); if (error != 0) { - printf("%s: Could not allocate DMA tag - error %d\n", - adv_name(adv), error); + device_printf(dev, + "Could not allocate DMA tag - error %d\n", error); adv_free(adv); bus_release_resource(dev, SYS_RES_IOPORT, 0, iores); break; @@ -335,8 +334,11 @@ adv_isa_probe(device_t dev) irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, RF_ACTIVE); if (irqres == NULL || - bus_setup_intr(dev, irqres, INTR_TYPE_CAM|INTR_ENTROPY, - NULL, adv_intr, adv, &ih)) { + bus_setup_intr(dev, irqres, INTR_TYPE_CAM|INTR_ENTROPY| + INTR_MPSAFE, NULL, adv_intr, adv, &ih) != 0) { + if (irqres != NULL) + bus_release_resource(dev, SYS_RES_IRQ, rid, + irqres); bus_dmamap_unload(overrun_dmat, overrun_dmamap); bus_dmamem_free(overrun_dmat, overrun_buf, overrun_dmamap); Modified: stable/9/sys/dev/advansys/adv_pci.c ============================================================================== --- stable/9/sys/dev/advansys/adv_pci.c Thu May 30 21:50:25 2013 (r251163) +++ stable/9/sys/dev/advansys/adv_pci.c Thu May 30 21:54:48 2013 (r251164) @@ -138,7 +138,6 @@ adv_pci_attach(device_t dev) { struct adv_softc *adv; u_int32_t id; - u_int32_t command; int error, rid, irqrid; void *ih; struct resource *iores, *irqres; @@ -146,19 +145,8 @@ adv_pci_attach(device_t dev) /* * Determine the chip version. */ - id = pci_read_config(dev, PCIR_DEVVENDOR, /*bytes*/4); - command = pci_read_config(dev, PCIR_COMMAND, /*bytes*/1); - - /* - * These cards do not allow memory mapped accesses, so we must - * ensure that I/O accesses are available or we won't be able - * to talk to them. - */ - if ((command & (PCIM_CMD_PORTEN|PCIM_CMD_BUSMASTEREN)) - != (PCIM_CMD_PORTEN|PCIM_CMD_BUSMASTEREN)) { - command |= PCIM_CMD_PORTEN|PCIM_CMD_BUSMASTEREN; - pci_write_config(dev, PCIR_COMMAND, command, /*bytes*/1); - } + id = pci_get_devid(dev); + pci_enable_busmaster(dev); /* * Early chips can't handle non-zero latency timer settings. @@ -174,13 +162,12 @@ adv_pci_attach(device_t dev) if (iores == NULL) return ENXIO; - if (adv_find_signature(rman_get_bustag(iores), - rman_get_bushandle(iores)) == 0) { + if (adv_find_signature(iores) == 0) { bus_release_resource(dev, SYS_RES_IOPORT, rid, iores); return ENXIO; } - adv = adv_alloc(dev, rman_get_bustag(iores), rman_get_bushandle(iores)); + adv = adv_alloc(dev, iores, 0); if (adv == NULL) { bus_release_resource(dev, SYS_RES_IOPORT, rid, iores); return ENXIO; @@ -199,13 +186,13 @@ adv_pci_attach(device_t dev) /* nsegments */ ~0, /* maxsegsz */ ADV_PCI_MAX_DMA_COUNT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &adv->parent_dmat); if (error != 0) { - printf("%s: Could not allocate DMA tag - error %d\n", - adv_name(adv), error); + device_printf(dev, "Could not allocate DMA tag - error %d\n", + error); adv_free(adv); bus_release_resource(dev, SYS_RES_IOPORT, rid, iores); return ENXIO; @@ -227,8 +214,8 @@ adv_pci_attach(device_t dev) /* nsegments */ 1, /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, - /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockfunc */ NULL, + /* lockarg */ NULL, &overrun_dmat) != 0) { bus_dma_tag_destroy(adv->parent_dmat); adv_free(adv); @@ -308,14 +295,22 @@ adv_pci_attach(device_t dev) irqres = bus_alloc_resource_any(dev, SYS_RES_IRQ, &irqrid, RF_SHAREABLE | RF_ACTIVE); if (irqres == NULL || - bus_setup_intr(dev, irqres, INTR_TYPE_CAM|INTR_ENTROPY, NULL, - adv_intr, adv, &ih)) { + bus_setup_intr(dev, irqres, INTR_TYPE_CAM|INTR_ENTROPY|INTR_MPSAFE, + NULL, adv_intr, adv, &ih) != 0) { + if (irqres != NULL) + bus_release_resource(dev, SYS_RES_IRQ, irqrid, irqres); adv_free(adv); bus_release_resource(dev, SYS_RES_IOPORT, rid, iores); return ENXIO; } - adv_attach(adv); + if (adv_attach(adv) != 0) { + bus_teardown_intr(dev, irqres, ih); + bus_release_resource(dev, SYS_RES_IRQ, irqrid, irqres); + adv_free(adv); + bus_release_resource(dev, SYS_RES_IOPORT, rid, iores); + return ENXIO; + } return 0; } Modified: stable/9/sys/dev/advansys/advansys.c ============================================================================== --- stable/9/sys/dev/advansys/advansys.c Thu May 30 21:50:25 2013 (r251163) +++ stable/9/sys/dev/advansys/advansys.c Thu May 30 21:54:48 2013 (r251164) @@ -49,6 +49,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -79,6 +80,7 @@ __FBSDID("$FreeBSD$"); static void adv_action(struct cam_sim *sim, union ccb *ccb); static void adv_execute_ccb(void *arg, bus_dma_segment_t *dm_segs, int nsegments, int error); +static void adv_intr_locked(struct adv_softc *adv); static void adv_poll(struct cam_sim *sim); static void adv_run_doneq(struct adv_softc *adv); static struct adv_ccb_info * @@ -97,15 +99,14 @@ static __inline struct adv_ccb_info * adv_get_ccb_info(struct adv_softc *adv) { struct adv_ccb_info *cinfo; - int opri; - opri = splcam(); + if (!dumping) + mtx_assert(&adv->lock, MA_OWNED); if ((cinfo = SLIST_FIRST(&adv->free_ccb_infos)) != NULL) { SLIST_REMOVE_HEAD(&adv->free_ccb_infos, links); } else { cinfo = adv_alloc_ccb_info(adv); } - splx(opri); return (cinfo); } @@ -113,12 +114,11 @@ adv_get_ccb_info(struct adv_softc *adv) static __inline void adv_free_ccb_info(struct adv_softc *adv, struct adv_ccb_info *cinfo) { - int opri; - opri = splcam(); + if (!dumping) + mtx_assert(&adv->lock, MA_OWNED); cinfo->state = ACCB_FREE; SLIST_INSERT_HEAD(&adv->free_ccb_infos, cinfo, links); - splx(opri); } static __inline void @@ -139,6 +139,9 @@ adv_clear_state(struct adv_softc *adv, u static void adv_clear_state_really(struct adv_softc *adv, union ccb* ccb) { + + if (!dumping) + mtx_assert(&adv->lock, MA_OWNED); if ((adv->state & ADV_BUSDMA_BLOCK_CLEARED) != 0) adv->state &= ~(ADV_BUSDMA_BLOCK_CLEARED|ADV_BUSDMA_BLOCK); if ((adv->state & ADV_RESOURCE_SHORTAGE) != 0) { @@ -164,13 +167,14 @@ adv_clear_state_really(struct adv_softc */ ccb_h = LIST_FIRST(&adv->pending_ccbs); while (ccb_h != NULL) { - ccb_h->timeout_ch = - timeout(adv_timeout, (caddr_t)ccb_h, - (ccb_h->timeout * hz) / 1000); + cinfo = ccb_h->ccb_cinfo_ptr; + callout_reset(&cinfo->timer, + ccb_h->timeout * hz / 1000, adv_timeout, + ccb_h); ccb_h = LIST_NEXT(ccb_h, sim_links.le); } adv->state &= ~ADV_IN_TIMEOUT; - printf("%s: No longer in timeout\n", adv_name(adv)); + device_printf(adv->dev, "No longer in timeout\n"); } } if (adv->state == 0) @@ -186,15 +190,6 @@ adv_map(void *arg, bus_dma_segment_t *se *physaddr = segs->ds_addr; } -char * -adv_name(struct adv_softc *adv) -{ - static char name[10]; - - snprintf(name, sizeof(name), "adv%d", adv->unit); - return (name); -} - static void adv_action(struct cam_sim *sim, union ccb *ccb) { @@ -203,6 +198,7 @@ adv_action(struct cam_sim *sim, union cc CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("adv_action\n")); adv = (struct adv_softc *)cam_sim_softc(sim); + mtx_assert(&adv->lock, MA_OWNED); switch (ccb->ccb_h.func_code) { /* Common cases first */ @@ -229,10 +225,8 @@ adv_action(struct cam_sim *sim, union cc * to a single buffer */ if ((ccb_h->flags & CAM_DATA_PHYS) == 0) { - int s; int error; - s = splsoftvm(); error = bus_dmamap_load(adv->buffer_dmat, cinfo->dmamap, @@ -250,7 +244,6 @@ adv_action(struct cam_sim *sim, union cc adv_set_state(adv, ADV_BUSDMA_BLOCK); } - splx(s); } else { struct bus_dma_segment seg; @@ -299,7 +292,6 @@ adv_action(struct cam_sim *sim, union cc target_bit_vector targ_mask; struct adv_transinfo *tconf; u_int update_type; - int s; cts = &ccb->cts; targ_mask = ADV_TID_TO_TARGET_MASK(cts->ccb_h.target_id); @@ -320,7 +312,6 @@ adv_action(struct cam_sim *sim, union cc break; } - s = splcam(); scsi = &cts->proto_specific.scsi; spi = &cts->xport_specific.spi; if ((update_type & ADV_TRANS_GOAL) != 0) { @@ -387,7 +378,6 @@ adv_action(struct cam_sim *sim, union cc spi->sync_offset, update_type); } - splx(s); ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); break; @@ -400,7 +390,6 @@ adv_action(struct cam_sim *sim, union cc struct ccb_trans_settings *cts; struct adv_transinfo *tconf; target_bit_vector target_mask; - int s; cts = &ccb->cts; target_mask = ADV_TID_TO_TARGET_MASK(cts->ccb_h.target_id); @@ -416,7 +405,6 @@ adv_action(struct cam_sim *sim, union cc scsi->flags &= ~CTS_SCSI_FLAGS_TAG_ENB; spi->flags &= ~CTS_SPI_FLAGS_DISC_ENB; - s = splcam(); if (cts->type == CTS_TYPE_CURRENT_SETTINGS) { tconf = &adv->tinfo[cts->ccb_h.target_id].current; if ((adv->disc_enable & target_mask) != 0) @@ -432,7 +420,6 @@ adv_action(struct cam_sim *sim, union cc } spi->sync_period = tconf->period; spi->sync_offset = tconf->offset; - splx(s); spi->bus_width = MSG_EXT_WDTR_BUS_8_BIT; spi->valid = CTS_SPI_VALID_SYNC_RATE | CTS_SPI_VALID_SYNC_OFFSET @@ -454,13 +441,10 @@ adv_action(struct cam_sim *sim, union cc } case XPT_RESET_BUS: /* Reset the specified SCSI bus */ { - int s; - s = splcam(); adv_stop_execution(adv); adv_reset_bus(adv, /*initiate_reset*/TRUE); adv_start_execution(adv); - splx(s); ccb->ccb_h.status = CAM_REQ_CMP; xpt_done(ccb); @@ -521,13 +505,14 @@ adv_execute_ccb(void *arg, bus_dma_segme struct adv_ccb_info *cinfo; struct adv_scsi_q scsiq; struct adv_sg_head sghead; - int s; csio = (struct ccb_scsiio *)arg; ccb_h = &csio->ccb_h; sim = xpt_path_sim(ccb_h->path); adv = (struct adv_softc *)cam_sim_softc(sim); cinfo = (struct adv_ccb_info *)csio->ccb_h.ccb_cinfo_ptr; + if (!dumping) + mtx_assert(&adv->lock, MA_OWNED); /* * Setup our done routine to release the simq on @@ -596,8 +581,6 @@ adv_execute_ccb(void *arg, bus_dma_segme scsiq.sg_head = NULL; } - s = splcam(); - /* * Last time we need to check if this SCB needs to * be aborted. @@ -608,7 +591,6 @@ adv_execute_ccb(void *arg, bus_dma_segme adv_clear_state(adv, (union ccb *)csio); adv_free_ccb_info(adv, cinfo); xpt_done((union ccb *)csio); - splx(s); return; } @@ -621,16 +603,14 @@ adv_execute_ccb(void *arg, bus_dma_segme adv_clear_state(adv, (union ccb *)csio); adv_free_ccb_info(adv, cinfo); xpt_done((union ccb *)csio); - splx(s); return; } cinfo->state |= ACCB_ACTIVE; ccb_h->status |= CAM_SIM_QUEUED; LIST_INSERT_HEAD(&adv->pending_ccbs, ccb_h, sim_links.le); /* Schedule our timeout */ - ccb_h->timeout_ch = - timeout(adv_timeout, csio, (ccb_h->timeout * hz)/1000); - splx(s); + callout_reset(&cinfo->timer, ccb_h->timeout * hz /1000, adv_timeout, + csio); } static struct adv_ccb_info * @@ -641,11 +621,12 @@ adv_alloc_ccb_info(struct adv_softc *adv cinfo = &adv->ccb_infos[adv->ccb_infos_allocated]; cinfo->state = ACCB_FREE; + callout_init_mtx(&cinfo->timer, &adv->lock, 0); error = bus_dmamap_create(adv->buffer_dmat, /*flags*/0, &cinfo->dmamap); if (error != 0) { - printf("%s: Unable to allocate CCB info " - "dmamap - error %d\n", adv_name(adv), error); + device_printf(adv->dev, "Unable to allocate CCB info " + "dmamap - error %d\n", error); return (NULL); } adv->ccb_infos_allocated++; @@ -655,28 +636,28 @@ adv_alloc_ccb_info(struct adv_softc *adv static void adv_destroy_ccb_info(struct adv_softc *adv, struct adv_ccb_info *cinfo) { + + callout_drain(&cinfo->timer); bus_dmamap_destroy(adv->buffer_dmat, cinfo->dmamap); } void adv_timeout(void *arg) { - int s; union ccb *ccb; struct adv_softc *adv; - struct adv_ccb_info *cinfo; + struct adv_ccb_info *cinfo, *cinfo2; ccb = (union ccb *)arg; adv = (struct adv_softc *)xpt_path_sim(ccb->ccb_h.path)->softc; cinfo = (struct adv_ccb_info *)ccb->ccb_h.ccb_cinfo_ptr; + mtx_assert(&adv->lock, MA_OWNED); xpt_print_path(ccb->ccb_h.path); printf("Timed out\n"); - s = splcam(); /* Have we been taken care of already?? */ if (cinfo == NULL || cinfo->state == ACCB_FREE) { - splx(s); return; } @@ -702,7 +683,8 @@ adv_timeout(void *arg) ccb_h = LIST_FIRST(&adv->pending_ccbs); while (ccb_h != NULL) { - untimeout(adv_timeout, ccb_h, ccb_h->timeout_ch); + cinfo2 = ccb_h->ccb_cinfo_ptr; + callout_stop(&cinfo2->timer); ccb_h = LIST_NEXT(ccb_h, sim_links.le); } @@ -713,8 +695,7 @@ adv_timeout(void *arg) adv_abort_ccb(adv, ccb->ccb_h.target_id, ccb->ccb_h.target_lun, ccb, CAM_CMD_TIMEOUT, /*queued_only*/FALSE); - ccb->ccb_h.timeout_ch = - timeout(adv_timeout, ccb, 2 * hz); + callout_reset(&cinfo->timer, 2 * hz, adv_timeout, ccb); } else { /* Our attempt to perform an abort failed, go for a reset */ xpt_print_path(ccb->ccb_h.path); @@ -724,11 +705,10 @@ adv_timeout(void *arg) adv_reset_bus(adv, /*initiate_reset*/TRUE); } adv_start_execution(adv); - splx(s); } struct adv_softc * -adv_alloc(device_t dev, bus_space_tag_t tag, bus_space_handle_t bsh) +adv_alloc(device_t dev, struct resource *res, long offset) { struct adv_softc *adv = device_get_softc(dev); @@ -738,9 +718,9 @@ adv_alloc(device_t dev, bus_space_tag_t LIST_INIT(&adv->pending_ccbs); SLIST_INIT(&adv->free_ccb_infos); adv->dev = dev; - adv->unit = device_get_unit(dev); - adv->tag = tag; - adv->bsh = bsh; + adv->res = res; + adv->reg_off = offset; + mtx_init(&adv->lock, "adv", NULL, MTX_DEF); return(adv); } @@ -773,6 +753,7 @@ adv_free(struct adv_softc *adv) if (adv->ccb_infos != NULL) free(adv->ccb_infos, M_DEVBUF); case 0: + mtx_destroy(&adv->lock); break; } } @@ -786,6 +767,7 @@ adv_init(struct adv_softc *adv) u_int16_t config_lsw; u_int16_t config_msw; + mtx_lock(&adv->lock); adv_lib_init(adv); /* @@ -794,14 +776,16 @@ adv_init(struct adv_softc *adv) adv_write_lram_16(adv, ADV_HALTCODE_W, 0x00FE); adv_stop_execution(adv); if (adv_stop_chip(adv) == 0 || adv_is_chip_halted(adv) == 0) { - printf("adv%d: Unable to halt adapter. Initialization" - "failed\n", adv->unit); + mtx_unlock(&adv->lock); + device_printf(adv->dev, + "Unable to halt adapter. Initialization failed\n"); return (1); } ADV_OUTW(adv, ADV_REG_PROG_COUNTER, ADV_MCODE_START_ADDR); if (ADV_INW(adv, ADV_REG_PROG_COUNTER) != ADV_MCODE_START_ADDR) { - printf("adv%d: Unable to set program counter. Initialization" - "failed\n", adv->unit); + mtx_unlock(&adv->lock); + device_printf(adv->dev, + "Unable to set program counter. Initialization failed\n"); return (1); } @@ -876,8 +860,8 @@ adv_init(struct adv_softc *adv) } else { u_int8_t sync_data; - printf("adv%d: Warning EEPROM Checksum mismatch. " - "Using default device parameters\n", adv->unit); + device_printf(adv->dev, "Warning EEPROM Checksum mismatch. " + "Using default device parameters\n"); /* Set reasonable defaults since we can't read the EEPROM */ adv->isa_dma_speed = /*ADV_DEF_ISA_DMA_SPEED*/1; @@ -940,13 +924,15 @@ adv_init(struct adv_softc *adv) * to be 100% correct. */ if (adv_set_eeprom_config(adv, &eeprom_config) != 0) - printf("%s: WARNING! Failure writing to EEPROM.\n", - adv_name(adv)); + device_printf(adv->dev, + "WARNING! Failure writing to EEPROM.\n"); #endif adv_set_chip_scsiid(adv, adv->scsi_id); - if (adv_init_lram_and_mcode(adv)) + if (adv_init_lram_and_mcode(adv)) { + mtx_unlock(&adv->lock); return (1); + } adv->disc_enable = adv->user_disc_enable; @@ -969,10 +955,12 @@ adv_init(struct adv_softc *adv) } adv_write_lram_8(adv, ADVV_USE_TAGGED_QNG_B, TARGET_BIT_VECTOR_SET); adv_write_lram_8(adv, ADVV_CAN_TAGGED_QNG_B, TARGET_BIT_VECTOR_SET); - printf("adv%d: AdvanSys %s Host Adapter, SCSI ID %d, queue depth %d\n", - adv->unit, (adv->type & ADV_ULTRA) && (max_sync == 0) - ? "Ultra SCSI" : "SCSI", - adv->scsi_id, adv->max_openings); + device_printf(adv->dev, + "AdvanSys %s Host Adapter, SCSI ID %d, queue depth %d\n", + (adv->type & ADV_ULTRA) && (max_sync == 0) + ? "Ultra SCSI" : "SCSI", + adv->scsi_id, adv->max_openings); + mtx_unlock(&adv->lock); return (0); } @@ -980,14 +968,24 @@ void adv_intr(void *arg) { struct adv_softc *adv; + + adv = arg; + mtx_lock(&adv->lock); + adv_intr_locked(adv); + mtx_unlock(&adv->lock); +} + +void +adv_intr_locked(struct adv_softc *adv) +{ u_int16_t chipstat; u_int16_t saved_ram_addr; u_int8_t ctrl_reg; u_int8_t saved_ctrl_reg; u_int8_t host_flag; - adv = (struct adv_softc *)arg; - + if (!dumping) + mtx_assert(&adv->lock, MA_OWNED); chipstat = ADV_INW(adv, ADV_CHIP_STATUS); /* Is it for us? */ @@ -1000,7 +998,7 @@ adv_intr(void *arg) ADV_CC_TEST)); if ((chipstat & (ADV_CSW_SCSI_RESET_LATCH|ADV_CSW_SCSI_RESET_ACTIVE))) { - printf("Detected Bus Reset\n"); + device_printf(adv->dev, "Detected Bus Reset\n"); adv_reset_bus(adv, /*initiate_reset*/FALSE); return; } @@ -1128,9 +1126,11 @@ adv_done(struct adv_softc *adv, union cc { struct adv_ccb_info *cinfo; + if (!dumping) + mtx_assert(&adv->lock, MA_OWNED); cinfo = (struct adv_ccb_info *)ccb->ccb_h.ccb_cinfo_ptr; LIST_REMOVE(&ccb->ccb_h, sim_links.le); - untimeout(adv_timeout, ccb, ccb->ccb_h.timeout_ch); + callout_stop(&cinfo->timer); if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { bus_dmasync_op_t op; @@ -1239,7 +1239,7 @@ adv_done(struct adv_softc *adv, union cc case QHSTA_M_MICRO_CODE_ERROR_HALT: default: panic("%s: Unhandled Host status error %x", - adv_name(adv), host_stat); + device_get_nameunit(adv->dev), host_stat); /* NOTREACHED */ } break; @@ -1280,7 +1280,8 @@ adv_done(struct adv_softc *adv, union cc static void adv_poll(struct cam_sim *sim) { - adv_intr(cam_sim_softc(sim)); + + adv_intr_locked(cam_sim_softc(sim)); } /* @@ -1350,7 +1351,7 @@ adv_attach(adv) /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ BUS_DMA_ALLOCNOW, /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockarg */ &adv->lock, &adv->buffer_dmat) != 0) { return (ENXIO); } @@ -1371,7 +1372,7 @@ adv_attach(adv) /* maxsegsz */ BUS_SPACE_MAXSIZE_32BIT, /* flags */ 0, /* lockfunc */ busdma_lock_mutex, - /* lockarg */ &Giant, + /* lockarg */ &adv->lock, &adv->sense_dmat) != 0) { return (ENXIO); } @@ -1398,8 +1399,8 @@ adv_attach(adv) * Fire up the chip */ if (adv_start_chip(adv) != 1) { - printf("adv%d: Unable to start on board processor. Aborting.\n", - adv->unit); + device_printf(adv->dev, + "Unable to start on board processor. Aborting.\n"); return (ENXIO); } @@ -1413,8 +1414,8 @@ adv_attach(adv) /* * Construct our SIM entry. */ - adv->sim = cam_sim_alloc(adv_action, adv_poll, "adv", adv, adv->unit, - &Giant, 1, adv->max_openings, devq); + adv->sim = cam_sim_alloc(adv_action, adv_poll, "adv", adv, + device_get_unit(adv->dev), &adv->lock, 1, adv->max_openings, devq); if (adv->sim == NULL) return (ENOMEM); @@ -1423,8 +1424,10 @@ adv_attach(adv) * * XXX Twin Channel EISA Cards??? */ + mtx_lock(&adv->lock); if (xpt_bus_register(adv->sim, adv->dev, 0) != CAM_SUCCESS) { cam_sim_free(adv->sim, /*free devq*/TRUE); + mtx_unlock(&adv->lock); return (ENXIO); } @@ -1433,6 +1436,7 @@ adv_attach(adv) != CAM_REQ_CMP) { xpt_bus_deregister(cam_sim_path(adv->sim)); cam_sim_free(adv->sim, /*free devq*/TRUE); + mtx_unlock(&adv->lock); return (ENXIO); } @@ -1442,6 +1446,7 @@ adv_attach(adv) csa.callback = advasync; csa.callback_arg = adv; xpt_action((union ccb *)&csa); + mtx_unlock(&adv->lock); return (0); } MODULE_DEPEND(adv, cam, 1, 1, 1); Modified: stable/9/sys/dev/advansys/advansys.h ============================================================================== --- stable/9/sys/dev/advansys/advansys.h Thu May 30 21:50:25 2013 (r251163) +++ stable/9/sys/dev/advansys/advansys.h Thu May 30 21:54:48 2013 (r251164) @@ -38,9 +38,7 @@ #include -struct adv_softc * adv_alloc(device_t dev, bus_space_tag_t tag, - bus_space_handle_t bsh); -char * adv_name(struct adv_softc *adv); +struct adv_softc * adv_alloc(device_t dev, struct resource *res, long offset); void adv_map(void *arg, bus_dma_segment_t *segs, int nseg, int error); void adv_free(struct adv_softc *adv); @@ -50,6 +48,6 @@ int adv_attach(struct adv_softc *adv); void adv_done(struct adv_softc *adv, union ccb* ccb, u_int done_stat, u_int host_stat, u_int scsi_stat, u_int q_no); -timeout_t adv_timeout; +void adv_timeout(void *arg); #endif /* _ADVANSYS_H_ */ Modified: stable/9/sys/dev/advansys/advlib.c ============================================================================== --- stable/9/sys/dev/advansys/advlib.c Thu May 30 21:50:25 2013 (r251163) +++ stable/9/sys/dev/advansys/advlib.c Thu May 30 21:54:48 2013 (r251164) @@ -45,7 +45,10 @@ __FBSDID("$FreeBSD$"); #include +#include +#include #include +#include #include #include @@ -298,6 +301,7 @@ advasync(void *callback_arg, u_int32_t c struct adv_softc *adv; adv = (struct adv_softc *)callback_arg; + mtx_assert(&adv->lock, MA_OWNED); switch (code) { case AC_FOUND_DEVICE: { @@ -460,12 +464,12 @@ adv_write_lram_16(struct adv_softc *adv, * found, 0 otherwise. */ int -adv_find_signature(bus_space_tag_t tag, bus_space_handle_t bsh) +adv_find_signature(struct resource *res) { u_int16_t signature; - if (bus_space_read_1(tag, bsh, ADV_SIGNATURE_BYTE) == ADV_1000_ID1B) { - signature = bus_space_read_2(tag, bsh, ADV_SIGNATURE_WORD); + if (bus_read_1(res, ADV_SIGNATURE_BYTE) == ADV_1000_ID1B) { + signature = bus_read_2(res, ADV_SIGNATURE_WORD); if ((signature == ADV_1000_ID0W) || (signature == ADV_1000_ID0W_FIX)) return (1); @@ -594,8 +598,8 @@ adv_init_lram_and_mcode(struct adv_softc retval = adv_load_microcode(adv, 0, (u_int16_t *)adv_mcode, adv_mcode_size); if (retval != adv_mcode_chksum) { - printf("adv%d: Microcode download failed checksum!\n", - adv->unit); + device_printf(adv->dev, + "Microcode download failed checksum!\n"); return (1); } @@ -692,6 +696,8 @@ adv_execute_scsi_queue(struct adv_softc u_int8_t sg_entry_cnt_minus_one; u_int8_t tid_no; + if (!dumping) + mtx_assert(&adv->lock, MA_OWNED); scsiq->q1.q_no = 0; retval = 1; /* Default to error case */ target_ix = scsiq->q2.target_ix; @@ -938,6 +944,8 @@ adv_isr_chip_halted(struct adv_softc *ad u_int8_t q_cntl; u_int8_t tid_no; + if (!dumping) + mtx_assert(&adv->lock, MA_OWNED); int_halt_code = adv_read_lram_16(adv, ADVV_HALTCODE_W); halt_qp = adv_read_lram_8(adv, ADVV_CURCDB_B); halt_q_addr = ADV_QNO_TO_QADDR(halt_qp); @@ -966,6 +974,7 @@ adv_isr_chip_halted(struct adv_softc *ad target_mask, tid_no); } else if (int_halt_code == ADV_HALT_CHK_CONDITION) { struct adv_target_transinfo* tinfo; + struct adv_ccb_info *cinfo; union ccb *ccb; u_int32_t cinfo_index; u_int8_t tag_code; @@ -1008,6 +1017,7 @@ adv_isr_chip_halted(struct adv_softc *ad */ cinfo_index = adv_read_lram_32(adv, halt_q_addr + ADV_SCSIQ_D_CINFO_IDX); + cinfo = &adv->ccb_infos[cinfo_index]; ccb = adv->ccb_infos[cinfo_index].ccb; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Thu May 30 21:56:54 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 26C577AD; Thu, 30 May 2013 21:56:54 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F332DCFB; Thu, 30 May 2013 21:56:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4ULurN7074557; Thu, 30 May 2013 21:56:53 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4ULur6b074556; Thu, 30 May 2013 21:56:53 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305302156.r4ULur6b074556@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 21:56:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251165 - stable/9/lib/libc/stdlib X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 21:56:54 -0000 Author: delphij Date: Thu May 30 21:56:53 2013 New Revision: 251165 URL: http://svnweb.freebsd.org/changeset/base/251165 Log: MFC r241031 (des): Slight stylification. Modified: stable/9/lib/libc/stdlib/random.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/stdlib/random.c ============================================================================== --- stable/9/lib/libc/stdlib/random.c Thu May 30 21:54:48 2013 (r251164) +++ stable/9/lib/libc/stdlib/random.c Thu May 30 21:56:53 2013 (r251165) @@ -216,10 +216,8 @@ static int rand_deg = DEG_3; static int rand_sep = SEP_3; static uint32_t *end_ptr = &randtbl[DEG_3 + 1]; -static inline uint32_t good_rand(int32_t); - -static inline uint32_t good_rand (x) - int32_t x; +static inline uint32_t +good_rand(int32_t x) { #ifdef USE_WEAK_SEEDING /* @@ -264,8 +262,7 @@ static inline uint32_t good_rand (x) * for default usage relies on values produced by this routine. */ void -srandom(x) - unsigned long x; +srandom(unsigned long x) { int i, lim; @@ -295,7 +292,7 @@ srandom(x) * a fixed seed. */ void -srandomdev() +srandomdev(void) { int fd, done; size_t len; @@ -351,10 +348,7 @@ srandomdev() * complain about mis-alignment, but you should disregard these messages. */ char * -initstate(seed, arg_state, n) - unsigned long seed; /* seed for R.N.G. */ - char *arg_state; /* pointer to state array */ - long n; /* # bytes of state info */ +initstate(unsigned long seed, char *arg_state, long n) { char *ostate = (char *)(&state[-1]); uint32_t *int_arg_state = (uint32_t *)arg_state; @@ -366,7 +360,7 @@ initstate(seed, arg_state, n) if (n < BREAK_0) { (void)fprintf(stderr, "random: not enough state (%ld bytes); ignored.\n", n); - return(0); + return (0); } if (n < BREAK_1) { rand_type = TYPE_0; @@ -396,7 +390,7 @@ initstate(seed, arg_state, n) int_arg_state[0] = rand_type; else int_arg_state[0] = MAX_TYPES * (rptr - state) + rand_type; - return(ostate); + return (ostate); } /* @@ -419,8 +413,7 @@ initstate(seed, arg_state, n) * complain about mis-alignment, but you should disregard these messages. */ char * -setstate(arg_state) - char *arg_state; /* pointer to state array */ +setstate(char *arg_state) { uint32_t *new_state = (uint32_t *)arg_state; uint32_t type = new_state[0] % MAX_TYPES; @@ -451,7 +444,7 @@ setstate(arg_state) fptr = &state[(rear + rand_sep) % rand_deg]; } end_ptr = &state[rand_deg]; /* set end_ptr too */ - return(ostate); + return (ostate); } /* @@ -472,7 +465,7 @@ setstate(arg_state) * Returns a 31-bit random number. */ long -random() +random(void) { uint32_t i; uint32_t *f, *r; @@ -497,5 +490,5 @@ random() fptr = f; rptr = r; } - return((long)i); + return ((long)i); } From owner-svn-src-stable@FreeBSD.ORG Thu May 30 22:01:07 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E9934E4F; Thu, 30 May 2013 22:01:07 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id C80FAD7F; Thu, 30 May 2013 22:01:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4UM17ct077215; Thu, 30 May 2013 22:01:07 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4UM17EA077209; Thu, 30 May 2013 22:01:07 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201305302201.r4UM17EA077209@svn.freebsd.org> From: Xin LI Date: Thu, 30 May 2013 22:01:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251168 - stable/9/lib/libc/stdlib X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 May 2013 22:01:08 -0000 Author: delphij Date: Thu May 30 22:01:06 2013 New Revision: 251168 URL: http://svnweb.freebsd.org/changeset/base/251168 Log: MFC r249035: Replace access to /dev/random with the kernel pseudo-random number source sysctl(KERN_ARND) and remove the fallback code. Obtained from: OpenBSD Modified: stable/9/lib/libc/stdlib/rand.3 stable/9/lib/libc/stdlib/rand.c stable/9/lib/libc/stdlib/random.3 stable/9/lib/libc/stdlib/random.c Directory Properties: stable/9/lib/libc/ (props changed) Modified: stable/9/lib/libc/stdlib/rand.3 ============================================================================== --- stable/9/lib/libc/stdlib/rand.3 Thu May 30 21:59:29 2013 (r251167) +++ stable/9/lib/libc/stdlib/rand.3 Thu May 30 22:01:06 2013 (r251168) @@ -32,7 +32,7 @@ .\" @(#)rand.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 4, 2012 +.Dd April 2, 2013 .Dt RAND 3 .Os .Sh NAME @@ -91,9 +91,7 @@ seeded with a value of 1. .Pp The .Fn sranddev -function initializes a seed using the -.Xr random 4 -random number device which returns good random numbers. +function initializes a seed using pseudo-random numbers obtained from the kernel. .Pp The .Fn rand_r Modified: stable/9/lib/libc/stdlib/rand.c ============================================================================== --- stable/9/lib/libc/stdlib/rand.c Thu May 30 21:59:29 2013 (r251167) +++ stable/9/lib/libc/stdlib/rand.c Thu May 30 22:01:06 2013 (r251168) @@ -36,11 +36,10 @@ static char sccsid[] = "@(#)rand.c 8.1 ( __FBSDID("$FreeBSD$"); #include "namespace.h" -#include /* for sranddev() */ +#include +#include #include -#include /* for sranddev() */ #include -#include /* for sranddev() */ #include "un-namespace.h" #ifdef TEST @@ -112,28 +111,20 @@ u_int seed; * sranddev: * * Many programs choose the seed value in a totally predictable manner. - * This often causes problems. We seed the generator using the much more - * secure random(4) interface. + * This often causes problems. We seed the generator using pseudo-random + * data from the kernel. */ void sranddev() { - int fd, done; + int mib[2]; + size_t len; - done = 0; - fd = _open("/dev/random", O_RDONLY, 0); - if (fd >= 0) { - if (_read(fd, (void *) &next, sizeof(next)) == sizeof(next)) - done = 1; - _close(fd); - } - - if (!done) { - struct timeval tv; - - gettimeofday(&tv, NULL); - srand((getpid() << 16) ^ tv.tv_sec ^ tv.tv_usec); - } + len = sizeof(next); + + mib[0] = CTL_KERN; + mib[1] = KERN_ARND; + sysctl(mib, 2, (void *)&next, &len, NULL, 0); } Modified: stable/9/lib/libc/stdlib/random.3 ============================================================================== --- stable/9/lib/libc/stdlib/random.3 Thu May 30 21:59:29 2013 (r251167) +++ stable/9/lib/libc/stdlib/random.3 Thu May 30 22:01:06 2013 (r251168) @@ -28,7 +28,7 @@ .\" @(#)random.3 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd September 4, 2012 +.Dd April 2, 2013 .Dt RANDOM 3 .Os .Sh NAME @@ -106,8 +106,8 @@ as the seed. .Pp The .Fn srandomdev -routine initializes a state array using data from -.Xr random 4 . +routine initializes a state array using +pseudo-random numbers obtained from the kernel. Note that this particular seeding procedure can generate states which are impossible to reproduce by calling Modified: stable/9/lib/libc/stdlib/random.c ============================================================================== --- stable/9/lib/libc/stdlib/random.c Thu May 30 21:59:29 2013 (r251167) +++ stable/9/lib/libc/stdlib/random.c Thu May 30 22:01:06 2013 (r251168) @@ -34,12 +34,11 @@ static char sccsid[] = "@(#)random.c 8.2 __FBSDID("$FreeBSD$"); #include "namespace.h" -#include /* for srandomdev() */ -#include /* for srandomdev() */ +#include +#include #include #include #include -#include /* for srandomdev() */ #include "un-namespace.h" /* @@ -284,39 +283,28 @@ srandom(unsigned long x) * srandomdev: * * Many programs choose the seed value in a totally predictable manner. - * This often causes problems. We seed the generator using the much more - * secure random(4) interface. Note that this particular seeding - * procedure can generate states which are impossible to reproduce by - * calling srandom() with any value, since the succeeding terms in the - * state buffer are no longer derived from the LC algorithm applied to - * a fixed seed. + * This often causes problems. We seed the generator using pseudo-random + * data from the kernel. + * + * Note that this particular seeding procedure can generate states + * which are impossible to reproduce by calling srandom() with any + * value, since the succeeding terms in the state buffer are no longer + * derived from the LC algorithm applied to a fixed seed. */ void srandomdev(void) { - int fd, done; + int mib[2]; size_t len; if (rand_type == TYPE_0) - len = sizeof state[0]; + len = sizeof(state[0]); else - len = rand_deg * sizeof state[0]; - - done = 0; - fd = _open("/dev/random", O_RDONLY, 0); - if (fd >= 0) { - if (_read(fd, (void *) state, len) == (ssize_t) len) - done = 1; - _close(fd); - } + len = rand_deg * sizeof(state[0]); - if (!done) { - struct timeval tv; - - gettimeofday(&tv, NULL); - srandom((getpid() << 16) ^ tv.tv_sec ^ tv.tv_usec); - return; - } + mib[0] = CTL_KERN; + mib[1] = KERN_ARND; + sysctl(mib, 2, state, &len, NULL, 0); if (rand_type != TYPE_0) { fptr = &state[rand_sep]; From owner-svn-src-stable@FreeBSD.ORG Fri May 31 01:55:37 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DAB67CA4; Fri, 31 May 2013 01:55:37 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from onyx.glenbarber.us (onyx.glenbarber.us [IPv6:2607:fc50:1000:c200::face]) by mx1.freebsd.org (Postfix) with ESMTP id AD7F4EFF; Fri, 31 May 2013 01:55:37 +0000 (UTC) Received: from glenbarber.us (kaos.glenbarber.us [71.224.221.174]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: gjb) by onyx.glenbarber.us (Postfix) with ESMTPSA id 4454323F804; Thu, 30 May 2013 21:55:35 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.8.3 onyx.glenbarber.us 4454323F804 Authentication-Results: onyx.glenbarber.us; dkim=none reason="no signature"; dkim-adsp=none Date: Thu, 30 May 2013 21:55:33 -0400 From: Glen Barber To: Scott Long Subject: Re: svn commit: r251164 - in stable/9/sys/dev: advansys aha ahb buslogic dpt Message-ID: <20130531015533.GD1619@glenbarber.us> References: <201305302154.r4ULsmZJ074053@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="BI5RvnYi6R4T2M87" Content-Disposition: inline In-Reply-To: <201305302154.r4ULsmZJ074053@svn.freebsd.org> X-Operating-System: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 01:55:37 -0000 --BI5RvnYi6R4T2M87 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 30, 2013 at 09:54:48PM +0000, Scott Long wrote: > Author: scottl > Date: Thu May 30 21:54:48 2013 > New Revision: 251164 > URL: http://svnweb.freebsd.org/changeset/base/251164 >=20 > Log: > MFC 241492, 241588, 241589, 241590, 241592, 241593, 241603, 241605 > =20 > Modernize and lock the aha, ahb, adv, adw, bt, and dpt drivers. > =20 I think this breaks stable/9. /src/sys/dev/aha/ahareg.h:300: error: field 'timer' has incomplete type /src/sys/dev/aha/aha_mca.c: In function 'aha_mca_attach': /src/sys/dev/aha/aha_mca.c:194: error: 'aha' undeclared (first use in this function) /src/sys/dev/aha/aha_mca.c:194: error: (Each undeclared identifier is reported only once /src/sys/dev/aha/aha_mca.c:194: error: for each function it appears in.) *** Error code 1 Stop in /obj/i386.i386/src/sys/LINT. *** Error code 1 Stop in /src. *** Error code 1 Stop in /src. TB --- 2013-05-31 01:51:07 - WARNING: /usr/bin/make returned exit code 1 TB --- 2013-05-31 01:51:07 - ERROR: failed to build LINT kernel TB --- 2013-05-31 01:51:07 - 8352.52 user 914.26 system 10844.89 real http://tinderbox.freebsd.org/tinderbox-freebsd9-build-RELENG_9-i386-i386.fu= ll Glen --BI5RvnYi6R4T2M87 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (FreeBSD) iQEcBAEBCAAGBQJRqAMVAAoJEFJPDDeguUajLtMH/35tMunPjJSfrG3Q5re4zJiZ 78btz/alxdC35JfEFj7QreNhLB9ROCIXZyIOossSjP2dRAcgw2jC2QLbTORSijgY FW3owaHRA0iC6aCgHfz57CJkLFpLCov79fszX7ig+vT4a+oxmsYXClAFIpMAvLlb i9ayAQiHgZhuUM9BQHUScuGaDzFzOBC/QaT683Mgd6vpRFP8cKEB4TcyEgbG1ZWw O3rZPb2HeolUTOZgxi2kKBYu1BwJqYjMYN6LVhEXap+PWAWpHKgKg2PbCK6/kLGH vGdZQ7BG16ee2w7dgw3sHr9nIFYofOmymdxnZsUVeTFE8DLU8nDZFaAjtB5yhE4= =DgLP -----END PGP SIGNATURE----- --BI5RvnYi6R4T2M87-- From owner-svn-src-stable@FreeBSD.ORG Fri May 31 11:41:02 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C70FFA1D; Fri, 31 May 2013 11:41:02 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B9091995; Fri, 31 May 2013 11:41:02 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VBf23O064182; Fri, 31 May 2013 11:41:02 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VBf2uL064180; Fri, 31 May 2013 11:41:02 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201305311141.r4VBf2uL064180@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 31 May 2013 11:41:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251178 - stable/9/sys/dev/md X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 11:41:02 -0000 Author: kib Date: Fri May 31 11:41:01 2013 New Revision: 251178 URL: http://svnweb.freebsd.org/changeset/base/251178 Log: MFC r250966: Fix the data corruption on the swap-backed md. Assign the rv variable a success code if the pager was not asked for the page. Modified: stable/9/sys/dev/md/md.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/md/md.c ============================================================================== --- stable/9/sys/dev/md/md.c Fri May 31 09:37:33 2013 (r251177) +++ stable/9/sys/dev/md/md.c Fri May 31 11:41:01 2013 (r251178) @@ -669,7 +669,9 @@ mdstart_swap(struct md_s *sc, struct bio sf = sf_buf_alloc(m, SFB_CPUPRIVATE); VM_OBJECT_LOCK(sc->object); if (bp->bio_cmd == BIO_READ) { - if (m->valid != VM_PAGE_BITS_ALL) + if (m->valid == VM_PAGE_BITS_ALL) + rv = VM_PAGER_OK; + else rv = vm_pager_get_pages(sc->object, &m, 1, 0); if (rv == VM_PAGER_ERROR) { sf_buf_free(sf); @@ -691,6 +693,8 @@ mdstart_swap(struct md_s *sc, struct bio } else if (bp->bio_cmd == BIO_WRITE) { if (len != PAGE_SIZE && m->valid != VM_PAGE_BITS_ALL) rv = vm_pager_get_pages(sc->object, &m, 1, 0); + else + rv = VM_PAGER_OK; if (rv == VM_PAGER_ERROR) { sf_buf_free(sf); sched_unpin(); @@ -702,6 +706,8 @@ mdstart_swap(struct md_s *sc, struct bio } else if (bp->bio_cmd == BIO_DELETE) { if (len != PAGE_SIZE && m->valid != VM_PAGE_BITS_ALL) rv = vm_pager_get_pages(sc->object, &m, 1, 0); + else + rv = VM_PAGER_OK; if (rv == VM_PAGER_ERROR) { sf_buf_free(sf); sched_unpin(); From owner-svn-src-stable@FreeBSD.ORG Fri May 31 13:27:44 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E0729943; Fri, 31 May 2013 13:27:44 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id BC95519E; Fri, 31 May 2013 13:27:44 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 1C1D2B943; Fri, 31 May 2013 09:27:44 -0400 (EDT) From: John Baldwin To: Glen Barber Subject: Re: svn commit: r251164 - in stable/9/sys/dev: advansys aha ahb buslogic dpt Date: Fri, 31 May 2013 08:44:35 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p25; KDE/4.5.5; amd64; ; ) References: <201305302154.r4ULsmZJ074053@svn.freebsd.org> <20130531015533.GD1619@glenbarber.us> In-Reply-To: <20130531015533.GD1619@glenbarber.us> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201305310844.35667.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Fri, 31 May 2013 09:27:44 -0400 (EDT) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Scott Long , svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 13:27:45 -0000 On Thursday, May 30, 2013 9:55:33 pm Glen Barber wrote: > On Thu, May 30, 2013 at 09:54:48PM +0000, Scott Long wrote: > > Author: scottl > > Date: Thu May 30 21:54:48 2013 > > New Revision: 251164 > > URL: http://svnweb.freebsd.org/changeset/base/251164 > > > > Log: > > MFC 241492, 241588, 241589, 241590, 241592, 241593, 241603, 241605 > > > > Modernize and lock the aha, ahb, adv, adw, bt, and dpt drivers. > > > > I think this breaks stable/9. > > /src/sys/dev/aha/ahareg.h:300: error: field 'timer' has incomplete type > /src/sys/dev/aha/aha_mca.c: In function 'aha_mca_attach': > /src/sys/dev/aha/aha_mca.c:194: error: 'aha' undeclared (first use in > this function) > /src/sys/dev/aha/aha_mca.c:194: error: (Each undeclared identifier is > reported only once > /src/sys/dev/aha/aha_mca.c:194: error: for each function it appears in.) > *** Error code 1 > > Stop in /obj/i386.i386/src/sys/LINT. Probably needs 214611 merged. I will test it once I finish an svn up of my tree and commit a different MFC I had running a universe last night (unless someone beats me to it). -- John Baldwin From owner-svn-src-stable@FreeBSD.ORG Fri May 31 14:36:09 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EB3E0F5A; Fri, 31 May 2013 14:36:09 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DD0AB804; Fri, 31 May 2013 14:36:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VEa9ak025063; Fri, 31 May 2013 14:36:09 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VEa99t025062; Fri, 31 May 2013 14:36:09 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305311436.r4VEa99t025062@svn.freebsd.org> From: John Baldwin Date: Fri, 31 May 2013 14:36:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251179 - stable/9/sys/vm X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 14:36:10 -0000 Author: jhb Date: Fri May 31 14:36:09 2013 New Revision: 251179 URL: http://svnweb.freebsd.org/changeset/base/251179 Log: MFC 250219: Fix two bugs in the current NUMA-aware allocation code: - vm_phys_alloc_freelist_pages() can be called by vm_page_alloc_freelist() to allocate a page from a specific freelist. In the NUMA case it did not properly map the public VM_FREELIST_* constants to the correct backing freelists, nor did it try all NUMA domains for allocations from VM_FREELIST_DEFAULT. - vm_phys_alloc_pages() did not pin the thread and each call to vm_phys_alloc_freelist_pages() fetched the current domain to choose which freelist to use. If a thread migrated domains during the loop in vm_phys_alloc_pages() it could skip one of the freelists. If the other freelists were out of memory then it is possible that vm_phys_alloc_pages() would fail to allocate a page even though pages were available resulting in a panic in vm_page_alloc(). Modified: stable/9/sys/vm/vm_phys.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/vm/vm_phys.c ============================================================================== --- stable/9/sys/vm/vm_phys.c Fri May 31 11:41:01 2013 (r251178) +++ stable/9/sys/vm/vm_phys.c Fri May 31 14:36:09 2013 (r251179) @@ -117,6 +117,8 @@ SYSCTL_OID(_vm, OID_AUTO, phys_lookup_li NULL, 0, sysctl_vm_phys_lookup_lists, "A", "Phys Lookup Lists"); #endif +static vm_page_t vm_phys_alloc_domain_pages(int domain, int flind, int pool, + int order); static void _vm_phys_create_seg(vm_paddr_t start, vm_paddr_t end, int flind, int domain); static void vm_phys_create_seg(vm_paddr_t start, vm_paddr_t end, int flind); @@ -430,10 +432,20 @@ vm_page_t vm_phys_alloc_pages(int pool, int order) { vm_page_t m; - int flind; + int domain, flind; + + KASSERT(pool < VM_NFREEPOOL, + ("vm_phys_alloc_pages: pool %d is out of range", pool)); + KASSERT(order < VM_NFREEORDER, + ("vm_phys_alloc_pages: order %d is out of range", order)); +#if VM_NDOMAIN > 1 + domain = PCPU_GET(domain); +#else + domain = 0; +#endif for (flind = 0; flind < vm_nfreelists; flind++) { - m = vm_phys_alloc_freelist_pages(flind, pool, order); + m = vm_phys_alloc_domain_pages(domain, flind, pool, order); if (m != NULL) return (m); } @@ -446,11 +458,12 @@ vm_phys_alloc_pages(int pool, int order) */ vm_page_t vm_phys_alloc_freelist_pages(int flind, int pool, int order) -{ - struct vm_freelist *fl; - struct vm_freelist *alt; - int domain, oind, pind; +{ +#if VM_NDOMAIN > 1 vm_page_t m; + int i, ndomains; +#endif + int domain; KASSERT(flind < VM_NFREELIST, ("vm_phys_alloc_freelist_pages: freelist %d is out of range", flind)); @@ -460,10 +473,39 @@ vm_phys_alloc_freelist_pages(int flind, ("vm_phys_alloc_freelist_pages: order %d is out of range", order)); #if VM_NDOMAIN > 1 + /* + * This routine expects to be called with a VM_FREELIST_* constant. + * On a system with multiple domains we need to adjust the flind + * appropriately. If it is for VM_FREELIST_DEFAULT we need to + * iterate over the per-domain lists. + */ domain = PCPU_GET(domain); + ndomains = vm_nfreelists - VM_NFREELIST + 1; + if (flind == VM_FREELIST_DEFAULT) { + m = NULL; + for (i = 0; i < ndomains; i++, flind++) { + m = vm_phys_alloc_domain_pages(domain, flind, pool, + order); + if (m != NULL) + break; + } + return (m); + } else if (flind > VM_FREELIST_DEFAULT) + flind += ndomains - 1; #else domain = 0; #endif + return (vm_phys_alloc_domain_pages(domain, flind, pool, order)); +} + +static vm_page_t +vm_phys_alloc_domain_pages(int domain, int flind, int pool, int order) +{ + struct vm_freelist *fl; + struct vm_freelist *alt; + int oind, pind; + vm_page_t m; + mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); fl = (*vm_phys_lookup_lists[domain][flind])[pool]; for (oind = order; oind < VM_NFREEORDER; oind++) { From owner-svn-src-stable@FreeBSD.ORG Fri May 31 15:19:01 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 30DAB53E; Fri, 31 May 2013 15:19:01 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 233C9A4B; Fri, 31 May 2013 15:19:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VFJ1fq042270; Fri, 31 May 2013 15:19:01 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VFJ1hq042269; Fri, 31 May 2013 15:19:01 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305311519.r4VFJ1hq042269@svn.freebsd.org> From: John Baldwin Date: Fri, 31 May 2013 15:19:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251182 - stable/9/sys/dev/aha X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 15:19:01 -0000 Author: jhb Date: Fri May 31 15:19:00 2013 New Revision: 251182 URL: http://svnweb.freebsd.org/changeset/base/251182 Log: MFC 241611: Fix aha(4) build with i386 LINT (which includes 'device mca'). Modified: stable/9/sys/dev/aha/aha_mca.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/aha/aha_mca.c ============================================================================== --- stable/9/sys/dev/aha/aha_mca.c Fri May 31 14:48:37 2013 (r251181) +++ stable/9/sys/dev/aha/aha_mca.c Fri May 31 15:19:00 2013 (r251182) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -191,7 +192,7 @@ aha_mca_attach (device_t dev) } error = bus_setup_intr(dev, sc->irq, INTR_TYPE_CAM | INTR_ENTROPY | - INTR_MPSAFE, NULL, aha_intr, sc, &aha->ih); + INTR_MPSAFE, NULL, aha_intr, sc, &sc->ih); if (error) { device_printf(dev, "Unable to register interrupt handler\n"); aha_detach(sc); From owner-svn-src-stable@FreeBSD.ORG Fri May 31 19:13:23 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 703669FF; Fri, 31 May 2013 19:13:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 6135A85C; Fri, 31 May 2013 19:13:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VJDNgC025748; Fri, 31 May 2013 19:13:23 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VJDNCx025746; Fri, 31 May 2013 19:13:23 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201305311913.r4VJDNCx025746@svn.freebsd.org> From: John Baldwin Date: Fri, 31 May 2013 19:13:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251191 - in stable/9/sys: conf x86/acpica X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 19:13:23 -0000 Author: jhb Date: Fri May 31 19:13:22 2013 New Revision: 251191 URL: http://svnweb.freebsd.org/changeset/base/251191 Log: MFC 246805: Make VM_NDOMAIN a kernel option so that it can be enabled from a kernel config file. Modified: stable/9/sys/conf/options stable/9/sys/x86/acpica/srat.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) Modified: stable/9/sys/conf/options ============================================================================== --- stable/9/sys/conf/options Fri May 31 19:07:17 2013 (r251190) +++ stable/9/sys/conf/options Fri May 31 19:13:22 2013 (r251191) @@ -594,6 +594,7 @@ VFS_BIO_DEBUG opt_global.h VM_KMEM_SIZE opt_vm.h VM_KMEM_SIZE_SCALE opt_vm.h VM_KMEM_SIZE_MAX opt_vm.h +VM_NDOMAIN opt_vm.h VM_NRESERVLEVEL opt_vm.h VM_LEVEL_0_ORDER opt_vm.h NO_SWAPPING opt_vm.h Modified: stable/9/sys/x86/acpica/srat.c ============================================================================== --- stable/9/sys/x86/acpica/srat.c Fri May 31 19:07:17 2013 (r251190) +++ stable/9/sys/x86/acpica/srat.c Fri May 31 19:13:22 2013 (r251191) @@ -28,6 +28,8 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_vm.h" + #include #include #include From owner-svn-src-stable@FreeBSD.ORG Fri May 31 19:20:20 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 07772C0D; Fri, 31 May 2013 19:20:20 +0000 (UTC) (envelope-from nparhar@gmail.com) Received: from mail-pd0-f175.google.com (mail-pd0-f175.google.com [209.85.192.175]) by mx1.freebsd.org (Postfix) with ESMTP id C200F898; Fri, 31 May 2013 19:20:19 +0000 (UTC) Received: by mail-pd0-f175.google.com with SMTP id 4so692180pdd.34 for ; Fri, 31 May 2013 12:20:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=IKadP4tM1Bs+v9Ac/aW4OmeA0lYB/cr3KKxYYhaO79k=; b=rJqdJGPFrUOUM9uE04SAsjerGx13G2XOwtdH0CaQksyv+vAkke6+748CfTx40ieb9+ FqPIprqtx4WxWZ0oTdYmyW7X7OZ18hAubAcMA6vtoGbjSsL4zjYDH7mJ6ycGm+gMWdCY xr/dIFiAGi1InxhSLMNa8Ao1LzpJY1LobR/t4GII3AjH0Gldmts5Kkf15j4TVDMb9Snu diKz0dPOsA2yqQxF85em5vgS5gM5Yp9EOpIPo0Srwo9MYOu6eL0TwCY0D+qcwsmfKdv0 FtvjM52Ovqi+pOOr3Kji8aJmK5rWSMuwcsdGDFdQ3WJMfuds8QS5ht57vbi+Zc4PilCy WJUQ== X-Received: by 10.66.163.5 with SMTP id ye5mr14871407pab.60.1370028019126; Fri, 31 May 2013 12:20:19 -0700 (PDT) Received: from [10.192.166.0] (stargate.chelsio.com. [67.207.112.58]) by mx.google.com with ESMTPSA id qh4sm51027592pac.8.2013.05.31.12.20.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 31 May 2013 12:20:18 -0700 (PDT) Sender: Navdeep Parhar Message-ID: <51A8F7EF.8030804@FreeBSD.org> Date: Fri, 31 May 2013 12:20:15 -0700 From: Navdeep Parhar User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130522 Thunderbird/17.0.6 MIME-Version: 1.0 To: John Baldwin Subject: Re: svn commit: r251191 - in stable/9/sys: conf x86/acpica References: <201305311913.r4VJDNCx025746@svn.freebsd.org> In-Reply-To: <201305311913.r4VJDNCx025746@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 19:20:20 -0000 On 05/31/13 12:13, John Baldwin wrote: > Author: jhb > Date: Fri May 31 19:13:22 2013 > New Revision: 251191 > URL: http://svnweb.freebsd.org/changeset/base/251191 > > Log: > MFC 246805: > Make VM_NDOMAIN a kernel option so that it can be enabled from a kernel > config file. Is this going to live long in 9? Or will be replaced with MAXMEMDOM like it was in head? Navdeep > > Modified: > stable/9/sys/conf/options > stable/9/sys/x86/acpica/srat.c > Directory Properties: > stable/9/sys/ (props changed) > stable/9/sys/conf/ (props changed) > > Modified: stable/9/sys/conf/options > ============================================================================== > --- stable/9/sys/conf/options Fri May 31 19:07:17 2013 (r251190) > +++ stable/9/sys/conf/options Fri May 31 19:13:22 2013 (r251191) > @@ -594,6 +594,7 @@ VFS_BIO_DEBUG opt_global.h > VM_KMEM_SIZE opt_vm.h > VM_KMEM_SIZE_SCALE opt_vm.h > VM_KMEM_SIZE_MAX opt_vm.h > +VM_NDOMAIN opt_vm.h > VM_NRESERVLEVEL opt_vm.h > VM_LEVEL_0_ORDER opt_vm.h > NO_SWAPPING opt_vm.h > > Modified: stable/9/sys/x86/acpica/srat.c > ============================================================================== > --- stable/9/sys/x86/acpica/srat.c Fri May 31 19:07:17 2013 (r251190) > +++ stable/9/sys/x86/acpica/srat.c Fri May 31 19:13:22 2013 (r251191) > @@ -28,6 +28,8 @@ > #include > __FBSDID("$FreeBSD$"); > > +#include "opt_vm.h" > + > #include > #include > #include > From owner-svn-src-stable@FreeBSD.ORG Fri May 31 20:11:08 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2998F859; Fri, 31 May 2013 20:11:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 01905A4C; Fri, 31 May 2013 20:11:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r4VKB7Tx046196; Fri, 31 May 2013 20:11:07 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r4VKB7ZN046195; Fri, 31 May 2013 20:11:07 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201305312011.r4VKB7ZN046195@svn.freebsd.org> From: Dimitry Andric Date: Fri, 31 May 2013 20:11:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251193 - stable/9/contrib/libc++/include X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 20:11:08 -0000 Author: dim Date: Fri May 31 20:11:07 2013 New Revision: 251193 URL: http://svnweb.freebsd.org/changeset/base/251193 Log: MFC r251066: Fix warnings from newer clang versions about constexpr member functions not being implicitly const in libc++'s header. The warnings have been introduced because of new language rules recently adopted by the C++ WG. More info: Modified: stable/9/contrib/libc++/include/chrono Directory Properties: stable/9/contrib/libc++/ (props changed) Modified: stable/9/contrib/libc++/include/chrono ============================================================================== --- stable/9/contrib/libc++/include/chrono Fri May 31 20:07:26 2013 (r251192) +++ stable/9/contrib/libc++/include/chrono Fri May 31 20:11:07 2013 (r251193) @@ -468,7 +468,7 @@ template ::type _Ct; return _Ct(__lhs).count() == _Ct(__rhs).count(); @@ -479,7 +479,7 @@ template struct __duration_eq<_LhsDuration, _LhsDuration> { _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR - bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs) + bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs) const {return __lhs.count() == __rhs.count();} }; @@ -509,7 +509,7 @@ template ::type _Ct; return _Ct(__lhs).count() < _Ct(__rhs).count(); @@ -520,7 +520,7 @@ template struct __duration_lt<_LhsDuration, _LhsDuration> { _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR - bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs) + bool operator()(const _LhsDuration& __lhs, const _LhsDuration& __rhs) const {return __lhs.count() < __rhs.count();} }; From owner-svn-src-stable@FreeBSD.ORG Fri May 31 22:08:55 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B333DA21 for ; Fri, 31 May 2013 22:08:55 +0000 (UTC) (envelope-from scott4long@yahoo.com) Received: from nm31-vm1.bullet.mail.ne1.yahoo.com (nm31-vm1.bullet.mail.ne1.yahoo.com [98.138.229.41]) by mx1.freebsd.org (Postfix) with ESMTP id 4D808EF3 for ; Fri, 31 May 2013 22:08:55 +0000 (UTC) Received: from [98.138.226.177] by nm31.bullet.mail.ne1.yahoo.com with NNFMP; 31 May 2013 22:02:20 -0000 Received: from [98.138.226.125] by tm12.bullet.mail.ne1.yahoo.com with NNFMP; 31 May 2013 22:02:20 -0000 Received: from [127.0.0.1] by smtp204.mail.ne1.yahoo.com with NNFMP; 31 May 2013 22:02:20 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1370037740; bh=HU2qbs4ZeyXJx6l5Ppa9YKmcPZoWBLxR5ptr8SL2nNo=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:X-Rocket-Received:Content-Type:Mime-Version:Subject:From:In-Reply-To:Date:Cc:Content-Transfer-Encoding:Message-Id:References:To:X-Mailer; b=i9eDkEfEZAGn/TahldlxF0et/KM+fspOKupgyrxx44o+XTeezFzR8CtnsCaABLBfcGXqbCB6DShjOZwRjnMHwuLhd9x41iiGMt4hT1eDmxk1x8vuaQYBwUV2syox6rJwkT4+dWhfCDj4nLMYi6Fatz1SGL9B4NzRlqrSf7e3/lc= X-Yahoo-Newman-Id: 631479.59786.bm@smtp204.mail.ne1.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: cX7SEhEVM1nhOtYc3o6DF40GFTAOs8Ir1KmqeTdextPR_qe 0.Jh..fI91m_4qC8nTFzWFMLvmgkNM4JUH4oSxPWP1NNtHbnVyZOckN6.aKi I_QwysycXn0QlPbyG1MfnC7WijcZvyommsIIOOS.tretuJ52dqijUHkHKXyl JgBSGwLOHAup6ZnGM5x55Nj2lD7mQdHui4VoMt0c8ZCQgWT1_UfkhtxUiZmy _qkkjit_axsFMSPtJY5Tp._dBtw6eLdd4vn1Fk_X9dGhcJvXR.5MA2B3EoRS 7KffO1FyYmEGRe8nd7DTpI8BKbFHtrzNg3K92Ggnje_BouQt5UOoGW_JqfE. LYhkJ7m2byg.WECXQx5kQW.6nX0GqsBuMU0cF1gfncTAIy469uAw4Nd1SVWU BWVtEP8ZFZJnSDGSt.Z23gpfS653mO0TdRuo2Z4GCsnvPQEZ1evYLmk4yhfm t5yWRo9kAHWqlE_la1jzJG4HXHcI9L1yDzwDdc.1wWlr2b.aGxz1iK70bXZb D X-Yahoo-SMTP: clhABp.swBB7fs.LwIJpv3jkWgo2NU8- X-Rocket-Received: from [192.168.254.206] (scott4long@168.103.85.57 with ) by smtp204.mail.ne1.yahoo.com with SMTP; 31 May 2013 15:02:20 -0700 PDT Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Subject: Re: svn commit: r251182 - stable/9/sys/dev/aha From: Scott Long In-Reply-To: <201305311519.r4VFJ1hq042269@svn.freebsd.org> Date: Fri, 31 May 2013 16:02:18 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201305311519.r4VFJ1hq042269@svn.freebsd.org> To: John Baldwin X-Mailer: Apple Mail (2.1503) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 May 2013 22:08:55 -0000 Thanks! Scott On May 31, 2013, at 9:19 AM, John Baldwin wrote: > Author: jhb > Date: Fri May 31 15:19:00 2013 > New Revision: 251182 > URL: http://svnweb.freebsd.org/changeset/base/251182 >=20 > Log: > MFC 241611: > Fix aha(4) build with i386 LINT (which includes 'device mca'). >=20 > Modified: > stable/9/sys/dev/aha/aha_mca.c > Directory Properties: > stable/9/sys/ (props changed) > stable/9/sys/dev/ (props changed) >=20 > Modified: stable/9/sys/dev/aha/aha_mca.c > = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D > --- stable/9/sys/dev/aha/aha_mca.c Fri May 31 14:48:37 2013 = (r251181) > +++ stable/9/sys/dev/aha/aha_mca.c Fri May 31 15:19:00 2013 = (r251182) > @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); >=20 > #include > #include > +#include > #include > #include > #include > @@ -191,7 +192,7 @@ aha_mca_attach (device_t dev) > } >=20 > error =3D bus_setup_intr(dev, sc->irq, INTR_TYPE_CAM | = INTR_ENTROPY | > - INTR_MPSAFE, NULL, aha_intr, sc, &aha->ih); > + INTR_MPSAFE, NULL, aha_intr, sc, &sc->ih); > if (error) { > device_printf(dev, "Unable to register interrupt = handler\n"); > aha_detach(sc); From owner-svn-src-stable@FreeBSD.ORG Sat Jun 1 11:27:56 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3ACD1500; Sat, 1 Jun 2013 11:27:56 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) by mx1.freebsd.org (Postfix) with ESMTP id 160B3BDA; Sat, 1 Jun 2013 11:27:56 +0000 (UTC) Received: from ralph.baldwin.cx (pool-173-70-85-244.nwrknj.fios.verizon.net [173.70.85.244]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0B43CB987; Sat, 1 Jun 2013 07:27:54 -0400 (EDT) From: John Baldwin To: Navdeep Parhar Subject: Re: svn commit: r251191 - in stable/9/sys: conf x86/acpica Date: Sat, 1 Jun 2013 07:26:40 -0400 User-Agent: KMail/1.13.7 (FreeBSD/9.1-STABLE; KDE/4.8.4; amd64; ; ) References: <201305311913.r4VJDNCx025746@svn.freebsd.org> <51A8F7EF.8030804@FreeBSD.org> In-Reply-To: <51A8F7EF.8030804@FreeBSD.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201306010726.41079.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Sat, 01 Jun 2013 07:27:54 -0400 (EDT) Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 11:27:56 -0000 On Friday, May 31, 2013 03:20:15 PM Navdeep Parhar wrote: > On 05/31/13 12:13, John Baldwin wrote: > > Author: jhb > > Date: Fri May 31 19:13:22 2013 > > New Revision: 251191 > > URL: http://svnweb.freebsd.org/changeset/base/251191 > > > > Log: > > MFC 246805: > > Make VM_NDOMAIN a kernel option so that it can be enabled from a kernel > > config file. > > Is this going to live long in 9? Or will be replaced with MAXMEMDOM > like it was in head? I do not expect the NUMA changes in 10 to be merged to 9. We could perhaps rename the option here to match, though they have different semantics (the old stuff is first-touch rather than round-robin). There are actually folks using the older stuff in production it turns out (not just my employer), so having it as an option still makes sense I think. If avoiding a future name change seems more important then I'm fine with merging the name change. -- John Baldwin From owner-svn-src-stable@FreeBSD.ORG Sat Jun 1 13:10:26 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 1C286DF1; Sat, 1 Jun 2013 13:10:26 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F2FDAF68; Sat, 1 Jun 2013 13:10:25 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r51DAPDf000729; Sat, 1 Jun 2013 13:10:25 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r51DAPc7000724; Sat, 1 Jun 2013 13:10:25 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201306011310.r51DAPc7000724@svn.freebsd.org> From: Marius Strobl Date: Sat, 1 Jun 2013 13:10:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r251224 - stable/9/sys/dev/ata X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 13:10:26 -0000 Author: marius Date: Sat Jun 1 13:10:24 2013 New Revision: 251224 URL: http://svnweb.freebsd.org/changeset/base/251224 Log: MFC: r249203 (partial) - Make ata_str2mode() static, it's not used outside of ata-all.c. - Move ata_timeout() to ata-all.c so we don't need to expose both this function and ata_cam_end_transaction() but only the former. - Move ata_cmd2str() from ata-queue.c to ata-all.c. - Add some missing prototypes. Modified: stable/9/sys/dev/ata/ata-all.c stable/9/sys/dev/ata/ata-all.h stable/9/sys/dev/ata/ata-lowlevel.c stable/9/sys/dev/ata/ata-queue.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/ata/ata-all.c ============================================================================== --- stable/9/sys/dev/ata/ata-all.c Sat Jun 1 12:27:48 2013 (r251223) +++ stable/9/sys/dev/ata/ata-all.c Sat Jun 1 13:10:24 2013 (r251224) @@ -72,22 +72,26 @@ static struct cdevsw ata_cdevsw = { /* prototypes */ #ifndef ATA_CAM +static void bswap(int8_t *, int); +static void btrim(int8_t *, int); +static void bpack(int8_t *, int8_t *, int); static void ata_boot_attach(void); static device_t ata_add_child(device_t, struct ata_device *, int); #else static void ataaction(struct cam_sim *sim, union ccb *ccb); static void atapoll(struct cam_sim *sim); +static void ata_cam_begin_transaction(device_t dev, union ccb *ccb); +static void ata_cam_end_transaction(device_t dev, struct ata_request *request); +static void ata_cam_request_sense(device_t dev, struct ata_request *request); +static int ata_check_ids(device_t dev, union ccb *ccb); +static void ata_periodic_poll(void *data); #endif static void ata_conn_event(void *, int); -#ifndef ATA_CAM -static void bswap(int8_t *, int); -static void btrim(int8_t *, int); -static void bpack(int8_t *, int8_t *, int); -#endif +static void ata_init(void); static void ata_interrupt_locked(void *data); -#ifdef ATA_CAM -static void ata_periodic_poll(void *data); -#endif +static int ata_module_event_handler(module_t mod, int what, void *arg); +static int ata_str2mode(const char *str); +static void ata_uninit(void); /* global vars */ MALLOC_DEFINE(M_ATA, "ata_generic", "ATA driver generic layer"); @@ -1246,6 +1250,120 @@ ata_unit2str(struct ata_device *atadev) #endif const char * +ata_cmd2str(struct ata_request *request) +{ + static char buffer[20]; + + if (request->flags & ATA_R_ATAPI) { + switch (request->u.atapi.sense.key ? + request->u.atapi.saved_cmd : request->u.atapi.ccb[0]) { + case 0x00: return ("TEST_UNIT_READY"); + case 0x01: return ("REZERO"); + case 0x03: return ("REQUEST_SENSE"); + case 0x04: return ("FORMAT"); + case 0x08: return ("READ"); + case 0x0a: return ("WRITE"); + case 0x10: return ("WEOF"); + case 0x11: return ("SPACE"); + case 0x12: return ("INQUIRY"); + case 0x15: return ("MODE_SELECT"); + case 0x19: return ("ERASE"); + case 0x1a: return ("MODE_SENSE"); + case 0x1b: return ("START_STOP"); + case 0x1e: return ("PREVENT_ALLOW"); + case 0x23: return ("ATAPI_READ_FORMAT_CAPACITIES"); + case 0x25: return ("READ_CAPACITY"); + case 0x28: return ("READ_BIG"); + case 0x2a: return ("WRITE_BIG"); + case 0x2b: return ("LOCATE"); + case 0x34: return ("READ_POSITION"); + case 0x35: return ("SYNCHRONIZE_CACHE"); + case 0x3b: return ("WRITE_BUFFER"); + case 0x3c: return ("READ_BUFFER"); + case 0x42: return ("READ_SUBCHANNEL"); + case 0x43: return ("READ_TOC"); + case 0x45: return ("PLAY_10"); + case 0x47: return ("PLAY_MSF"); + case 0x48: return ("PLAY_TRACK"); + case 0x4b: return ("PAUSE"); + case 0x51: return ("READ_DISK_INFO"); + case 0x52: return ("READ_TRACK_INFO"); + case 0x53: return ("RESERVE_TRACK"); + case 0x54: return ("SEND_OPC_INFO"); + case 0x55: return ("MODE_SELECT_BIG"); + case 0x58: return ("REPAIR_TRACK"); + case 0x59: return ("READ_MASTER_CUE"); + case 0x5a: return ("MODE_SENSE_BIG"); + case 0x5b: return ("CLOSE_TRACK/SESSION"); + case 0x5c: return ("READ_BUFFER_CAPACITY"); + case 0x5d: return ("SEND_CUE_SHEET"); + case 0x96: return ("SERVICE_ACTION_IN"); + case 0xa1: return ("BLANK_CMD"); + case 0xa3: return ("SEND_KEY"); + case 0xa4: return ("REPORT_KEY"); + case 0xa5: return ("PLAY_12"); + case 0xa6: return ("LOAD_UNLOAD"); + case 0xad: return ("READ_DVD_STRUCTURE"); + case 0xb4: return ("PLAY_CD"); + case 0xbb: return ("SET_SPEED"); + case 0xbd: return ("MECH_STATUS"); + case 0xbe: return ("READ_CD"); + case 0xff: return ("POLL_DSC"); + } + } else { + switch (request->u.ata.command) { + case 0x00: return ("NOP"); + case 0x08: return ("DEVICE_RESET"); + case 0x20: return ("READ"); + case 0x24: return ("READ48"); + case 0x25: return ("READ_DMA48"); + case 0x26: return ("READ_DMA_QUEUED48"); + case 0x27: return ("READ_NATIVE_MAX_ADDRESS48"); + case 0x29: return ("READ_MUL48"); + case 0x30: return ("WRITE"); + case 0x34: return ("WRITE48"); + case 0x35: return ("WRITE_DMA48"); + case 0x36: return ("WRITE_DMA_QUEUED48"); + case 0x37: return ("SET_MAX_ADDRESS48"); + case 0x39: return ("WRITE_MUL48"); + case 0x70: return ("SEEK"); + case 0xa0: return ("PACKET_CMD"); + case 0xa1: return ("ATAPI_IDENTIFY"); + case 0xa2: return ("SERVICE"); + case 0xb0: return ("SMART"); + case 0xc0: return ("CFA ERASE"); + case 0xc4: return ("READ_MUL"); + case 0xc5: return ("WRITE_MUL"); + case 0xc6: return ("SET_MULTI"); + case 0xc7: return ("READ_DMA_QUEUED"); + case 0xc8: return ("READ_DMA"); + case 0xca: return ("WRITE_DMA"); + case 0xcc: return ("WRITE_DMA_QUEUED"); + case 0xe6: return ("SLEEP"); + case 0xe7: return ("FLUSHCACHE"); + case 0xea: return ("FLUSHCACHE48"); + case 0xec: return ("ATA_IDENTIFY"); + case 0xef: + switch (request->u.ata.feature) { + case 0x03: return ("SETFEATURES SET TRANSFER MODE"); + case 0x02: return ("SETFEATURES ENABLE WCACHE"); + case 0x82: return ("SETFEATURES DISABLE WCACHE"); + case 0xaa: return ("SETFEATURES ENABLE RCACHE"); + case 0x55: return ("SETFEATURES DISABLE RCACHE"); + } + sprintf(buffer, "SETFEATURES 0x%02x", + request->u.ata.feature); + return (buffer); + case 0xf5: return ("SECURITY_FREE_LOCK"); + case 0xf8: return ("READ_NATIVE_MAX_ADDRESS"); + case 0xf9: return ("SET_MAX_ADDRESS"); + } + } + sprintf(buffer, "unknown CMD (0x%02x)", request->u.ata.command); + return (buffer); +} + +const char * ata_mode2str(int mode) { switch (mode) { @@ -1275,7 +1393,7 @@ ata_mode2str(int mode) } } -int +static int ata_str2mode(const char *str) { @@ -1463,6 +1581,40 @@ bpack(int8_t *src, int8_t *dst, int len) } #endif +void +ata_timeout(struct ata_request *request) +{ + struct ata_channel *ch; + + ch = device_get_softc(request->parent); + //request->flags |= ATA_R_DEBUG; + ATA_DEBUG_RQ(request, "timeout"); + + /* + * If we have an ATA_ACTIVE request running, we flag the request + * ATA_R_TIMEOUT so ata_cam_end_transaction()/ata_finish() will handle + * it correctly. + * Also, NULL out the running request so we wont loose the race with + * an eventual interrupt arriving late. + */ + if (ch->state == ATA_ACTIVE) { + request->flags |= ATA_R_TIMEOUT; + if (ch->dma.unload) + ch->dma.unload(request); + ch->running = NULL; + ch->state = ATA_IDLE; +#ifdef ATA_CAM + ata_cam_end_transaction(ch->dev, request); +#endif + mtx_unlock(&ch->state_mtx); +#ifndef ATA_CAM + ATA_LOCKING(ch->dev, ATA_LF_UNLOCK); + ata_finish(request); +#endif + } else + mtx_unlock(&ch->state_mtx); +} + #ifdef ATA_CAM static void ata_cam_begin_transaction(device_t dev, union ccb *ccb) @@ -1620,7 +1772,7 @@ ata_cam_process_sense(device_t dev, stru ata_reinit(dev); } -void +static void ata_cam_end_transaction(device_t dev, struct ata_request *request) { struct ata_channel *ch = device_get_softc(dev); Modified: stable/9/sys/dev/ata/ata-all.h ============================================================================== --- stable/9/sys/dev/ata/ata-all.h Sat Jun 1 12:27:48 2013 (r251223) +++ stable/9/sys/dev/ata/ata-all.h Sat Jun 1 13:10:24 2013 (r251224) @@ -625,12 +625,13 @@ int ata_getparam(struct ata_device *atad void ata_default_registers(device_t dev); void ata_udelay(int interval); const char *ata_unit2str(struct ata_device *atadev); +const char *ata_cmd2str(struct ata_request *request); const char *ata_mode2str(int mode); void ata_setmode(device_t dev); void ata_print_cable(device_t dev, u_int8_t *who); -int ata_str2mode(const char *str); const char *ata_satarev2str(int rev); int ata_atapi(device_t dev, int target); +void ata_timeout(struct ata_request *); #ifndef ATA_CAM int ata_identify(device_t dev); void ata_modify_if_48bit(struct ata_request *request); @@ -639,8 +640,6 @@ int ata_wmode(struct ata_params *ap); int ata_umode(struct ata_params *ap); int ata_limit_mode(device_t dev, int mode, int maxmode); int ata_check_80pin(device_t dev, int mode); -#else -void ata_cam_end_transaction(device_t dev, struct ata_request *request); #endif /* ata-queue.c: */ @@ -649,11 +648,9 @@ int ata_atapicmd(device_t dev, u_int8_t void ata_queue_request(struct ata_request *request); void ata_start(device_t dev); void ata_finish(struct ata_request *request); -void ata_timeout(struct ata_request *); void ata_catch_inflight(device_t dev); void ata_fail_requests(device_t dev); void ata_drop_requests(device_t dev); -const char *ata_cmd2str(struct ata_request *request); /* ata-lowlevel.c: */ void ata_generic_hw(device_t dev); Modified: stable/9/sys/dev/ata/ata-lowlevel.c ============================================================================== --- stable/9/sys/dev/ata/ata-lowlevel.c Sat Jun 1 12:27:48 2013 (r251223) +++ stable/9/sys/dev/ata/ata-lowlevel.c Sat Jun 1 13:10:24 2013 (r251224) @@ -605,7 +605,7 @@ ata_generic_reset(device_t dev) } /* must be called with ATA channel locked and state_mtx held */ -int +static int ata_generic_status(device_t dev) { struct ata_channel *ch = device_get_softc(dev); Modified: stable/9/sys/dev/ata/ata-queue.c ============================================================================== --- stable/9/sys/dev/ata/ata-queue.c Sat Jun 1 12:27:48 2013 (r251223) +++ stable/9/sys/dev/ata/ata-queue.c Sat Jun 1 13:10:24 2013 (r251224) @@ -510,40 +510,6 @@ ata_completed(void *context, int dummy) } #endif -void -ata_timeout(struct ata_request *request) -{ - struct ata_channel *ch = device_get_softc(request->parent); - - //request->flags |= ATA_R_DEBUG; - ATA_DEBUG_RQ(request, "timeout"); - - /* - * if we have an ATA_ACTIVE request running, we flag the request - * ATA_R_TIMEOUT so ata_finish will handle it correctly - * also NULL out the running request so we wont loose - * the race with an eventual interrupt arriving late - */ - if (ch->state == ATA_ACTIVE) { - request->flags |= ATA_R_TIMEOUT; - if (ch->dma.unload) - ch->dma.unload(request); - ch->running = NULL; - ch->state = ATA_IDLE; -#ifdef ATA_CAM - ata_cam_end_transaction(ch->dev, request); -#endif - mtx_unlock(&ch->state_mtx); -#ifndef ATA_CAM - ATA_LOCKING(ch->dev, ATA_LF_UNLOCK); - ata_finish(request); -#endif - } - else { - mtx_unlock(&ch->state_mtx); - } -} - #ifndef ATA_CAM void ata_fail_requests(device_t dev) @@ -684,120 +650,6 @@ ata_sort_queue(struct ata_channel *ch, s } #endif -const char * -ata_cmd2str(struct ata_request *request) -{ - static char buffer[20]; - - if (request->flags & ATA_R_ATAPI) { - switch (request->u.atapi.sense.key ? - request->u.atapi.saved_cmd : request->u.atapi.ccb[0]) { - case 0x00: return ("TEST_UNIT_READY"); - case 0x01: return ("REZERO"); - case 0x03: return ("REQUEST_SENSE"); - case 0x04: return ("FORMAT"); - case 0x08: return ("READ"); - case 0x0a: return ("WRITE"); - case 0x10: return ("WEOF"); - case 0x11: return ("SPACE"); - case 0x12: return ("INQUIRY"); - case 0x15: return ("MODE_SELECT"); - case 0x19: return ("ERASE"); - case 0x1a: return ("MODE_SENSE"); - case 0x1b: return ("START_STOP"); - case 0x1e: return ("PREVENT_ALLOW"); - case 0x23: return ("ATAPI_READ_FORMAT_CAPACITIES"); - case 0x25: return ("READ_CAPACITY"); - case 0x28: return ("READ_BIG"); - case 0x2a: return ("WRITE_BIG"); - case 0x2b: return ("LOCATE"); - case 0x34: return ("READ_POSITION"); - case 0x35: return ("SYNCHRONIZE_CACHE"); - case 0x3b: return ("WRITE_BUFFER"); - case 0x3c: return ("READ_BUFFER"); - case 0x42: return ("READ_SUBCHANNEL"); - case 0x43: return ("READ_TOC"); - case 0x45: return ("PLAY_10"); - case 0x47: return ("PLAY_MSF"); - case 0x48: return ("PLAY_TRACK"); - case 0x4b: return ("PAUSE"); - case 0x51: return ("READ_DISK_INFO"); - case 0x52: return ("READ_TRACK_INFO"); - case 0x53: return ("RESERVE_TRACK"); - case 0x54: return ("SEND_OPC_INFO"); - case 0x55: return ("MODE_SELECT_BIG"); - case 0x58: return ("REPAIR_TRACK"); - case 0x59: return ("READ_MASTER_CUE"); - case 0x5a: return ("MODE_SENSE_BIG"); - case 0x5b: return ("CLOSE_TRACK/SESSION"); - case 0x5c: return ("READ_BUFFER_CAPACITY"); - case 0x5d: return ("SEND_CUE_SHEET"); - case 0x96: return ("SERVICE_ACTION_IN"); - case 0xa1: return ("BLANK_CMD"); - case 0xa3: return ("SEND_KEY"); - case 0xa4: return ("REPORT_KEY"); - case 0xa5: return ("PLAY_12"); - case 0xa6: return ("LOAD_UNLOAD"); - case 0xad: return ("READ_DVD_STRUCTURE"); - case 0xb4: return ("PLAY_CD"); - case 0xbb: return ("SET_SPEED"); - case 0xbd: return ("MECH_STATUS"); - case 0xbe: return ("READ_CD"); - case 0xff: return ("POLL_DSC"); - } - } - else { - switch (request->u.ata.command) { - case 0x00: return ("NOP"); - case 0x08: return ("DEVICE_RESET"); - case 0x20: return ("READ"); - case 0x24: return ("READ48"); - case 0x25: return ("READ_DMA48"); - case 0x26: return ("READ_DMA_QUEUED48"); - case 0x27: return ("READ_NATIVE_MAX_ADDRESS48"); - case 0x29: return ("READ_MUL48"); - case 0x30: return ("WRITE"); - case 0x34: return ("WRITE48"); - case 0x35: return ("WRITE_DMA48"); - case 0x36: return ("WRITE_DMA_QUEUED48"); - case 0x37: return ("SET_MAX_ADDRESS48"); - case 0x39: return ("WRITE_MUL48"); - case 0x70: return ("SEEK"); - case 0xa0: return ("PACKET_CMD"); - case 0xa1: return ("ATAPI_IDENTIFY"); - case 0xa2: return ("SERVICE"); - case 0xb0: return ("SMART"); - case 0xc0: return ("CFA ERASE"); - case 0xc4: return ("READ_MUL"); - case 0xc5: return ("WRITE_MUL"); - case 0xc6: return ("SET_MULTI"); - case 0xc7: return ("READ_DMA_QUEUED"); - case 0xc8: return ("READ_DMA"); - case 0xca: return ("WRITE_DMA"); - case 0xcc: return ("WRITE_DMA_QUEUED"); - case 0xe6: return ("SLEEP"); - case 0xe7: return ("FLUSHCACHE"); - case 0xea: return ("FLUSHCACHE48"); - case 0xec: return ("ATA_IDENTIFY"); - case 0xef: - switch (request->u.ata.feature) { - case 0x03: return ("SETFEATURES SET TRANSFER MODE"); - case 0x02: return ("SETFEATURES ENABLE WCACHE"); - case 0x82: return ("SETFEATURES DISABLE WCACHE"); - case 0xaa: return ("SETFEATURES ENABLE RCACHE"); - case 0x55: return ("SETFEATURES DISABLE RCACHE"); - } - sprintf(buffer, "SETFEATURES 0x%02x", request->u.ata.feature); - return buffer; - case 0xf5: return ("SECURITY_FREE_LOCK"); - case 0xf8: return ("READ_NATIVE_MAX_ADDRESS"); - case 0xf9: return ("SET_MAX_ADDRESS"); - } - } - sprintf(buffer, "unknown CMD (0x%02x)", request->u.ata.command); - return buffer; -} - #ifndef ATA_CAM static const char * ata_skey2str(u_int8_t skey) From owner-svn-src-stable@FreeBSD.ORG Sat Jun 1 20:19:17 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0B0DC6FC; Sat, 1 Jun 2013 20:19:17 +0000 (UTC) (envelope-from sobomax@sippysoft.com) Received: from mail.sippysoft.com (hub.sippysoft.com [174.36.24.17]) by mx1.freebsd.org (Postfix) with ESMTP id BD090DC3; Sat, 1 Jun 2013 20:19:16 +0000 (UTC) Received: from s173-180-43-49.bc.hsia.telus.net ([173.180.43.49] helo=[192.168.22.32]) by mail.sippysoft.com with esmtpsa (TLSv1:DHE-RSA-CAMELLIA256-SHA:256) (Exim 4.80 (FreeBSD)) (envelope-from ) id 1Uirz9-0007EX-NO; Sat, 01 Jun 2013 13:01:08 -0700 Message-ID: <51AA52FD.9090303@FreeBSD.org> Date: Sat, 01 Jun 2013 13:01:01 -0700 From: Maxim Sobolev Organization: Sippy Software, Inc. User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: Brooks Davis Subject: Re: svn: stable/9: . usr.bin/xinstall References: <201303151519.r2FFJYjS060493@svn.freebsd.org> In-Reply-To: <201303151519.r2FFJYjS060493@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: sobomax@sippysoft.com X-ssp-trusted: yes Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Jun 2013 20:19:17 -0000 Hmm, I believe this breaks build for me. Any ideas why? ===> usr.bin/xinstall (all) cc -O2 -pipe -I/usr/src/usr.bin/xinstall/../../contrib/mtree -I/usr/src/usr.bin/xinstall/../../lib/libnetbsd -I/usr/src/usr.bin/xinstall/../../lib/libmd -std=gnu99 -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c /usr/src/usr.bin/xinstall/xinstall.c cc1: warnings being treated as errors /usr/src/usr.bin/xinstall/xinstall.c: In function 'metadata_log': /usr/src/usr.bin/xinstall/xinstall.c:1331: warning: implicit declaration of function 'strsvis' /usr/src/usr.bin/xinstall/xinstall.c:1331: warning: nested extern declaration of 'strsvis' *** [xinstall.o] Error code 1 Stop in /usr/src/usr.bin/xinstall. *** [all] Error code 1 uname -a FreeBSD dal09 9.1-RELEASE FreeBSD 9.1-RELEASE #2: Thu Dec 27 09:39:03 UTC 2012 root@pioneer:/usr/obj/usr/src91/sys/SSP-PRODUCTION9_X64 amd64 On 3/15/2013 8:19 AM, Brooks Davis wrote: > Author: brooks > Date: Fri Mar 15 15:19:33 2013 > New Revision: 248331 > URL: http://svnweb.freebsd.org/changeset/base/248331 > > Log: > MFC all changes to install(1) through r246784. Notable functional > changes are: > > r245617: > Introduce six new options from NetBSD: > * -M Log metadata in mtree format. > * -D Log paths relative to . > * -h Log digest of type . > * -T Specify which mtree tags to log. > * -l Create hard or symbolic links (allows logging). > * -U Install without root privileges (owner, group, mode, > and flags can be logged via -M > > NOTE: In the interest of compatibility with NetBSD and because it is the > obvious letter, the nearly useless -M option (disable mmap) has been > repurposed. > > Sponsored by: DARPA, AFRL > Obtained from: NetBSD > Reviewed by: bz > > r245312: > Implement the -N option which allows an alternate passwd and > group file to be used. This is useful for installing on systems where > a user or group does not currently exist. > > Sponsored by: DARPA, AFRL > Obtained from: NetBSD > > Modified: > stable/9/UPDATING (contents, props changed) > stable/9/usr.bin/xinstall/Makefile > stable/9/usr.bin/xinstall/install.1 > stable/9/usr.bin/xinstall/xinstall.c > Directory Properties: > stable/9/usr.bin/xinstall/ (props changed) > > Modified: stable/9/UPDATING > ============================================================================== > --- stable/9/UPDATING Fri Mar 15 14:53:29 2013 (r248330) > +++ stable/9/UPDATING Fri Mar 15 15:19:33 2013 (r248331) > @@ -11,6 +11,15 @@ handbook: > Items affecting the ports and packages system can be found in > /usr/ports/UPDATING. Please read that file before running portupgrade. > > +20130315: > + The install(1) option -M has changed meaning and now takes an > + argument that is a file or path to append logs to. In the > + unlikely event that -M was the last option on the command line > + and the command line contained at least two files and a target > + directory the first file will have logs appended to it. The -M > + option served little practical purpose in the last decade so it's > + used expected to be extremely rare. > + > 20130225: > A new compression method (lz4) has been merged to. Please refer to > zpool-features(7) for more information. > > Modified: stable/9/usr.bin/xinstall/Makefile > ============================================================================== > --- stable/9/usr.bin/xinstall/Makefile Fri Mar 15 14:53:29 2013 (r248330) > +++ stable/9/usr.bin/xinstall/Makefile Fri Mar 15 15:19:33 2013 (r248331) > @@ -3,6 +3,16 @@ > > PROG= xinstall > PROGNAME= install > +SRCS= xinstall.c getid.c > MAN= install.1 > > +.PATH: ${.CURDIR}/../../contrib/mtree > +.PATH: ${.CURDIR}/../../lib/libmd > +CFLAGS+= -I${.CURDIR}/../../contrib/mtree > +CFLAGS+= -I${.CURDIR}/../../lib/libnetbsd > +CFLAGS+= -I${.CURDIR}/../../lib/libmd > + > +DPADD+= ${LIBMD} > +LDADD+= -lmd > + > .include > > Modified: stable/9/usr.bin/xinstall/install.1 > ============================================================================== > --- stable/9/usr.bin/xinstall/install.1 Fri Mar 15 14:53:29 2013 (r248330) > +++ stable/9/usr.bin/xinstall/install.1 Fri Mar 15 15:19:33 2013 (r248331) > @@ -28,7 +28,7 @@ > .\" From: @(#)install.1 8.1 (Berkeley) 6/6/93 > .\" $FreeBSD$ > .\" > -.Dd March 6, 2006 > +.Dd January 18, 2013 > .Dt INSTALL 1 > .Os > .Sh NAME > @@ -36,31 +36,50 @@ > .Nd install binaries > .Sh SYNOPSIS > .Nm > -.Op Fl bCcMpSsv > +.Op Fl bCcpSsUv > .Op Fl B Ar suffix > +.Op Fl D Ar destdir > .Op Fl f Ar flags > .Op Fl g Ar group > +.Op Fl h Ar hash > +.Op Fl l Ar linkflags > +.Op Fl M Ar metalog > .Op Fl m Ar mode > +.Op Fl N Ar dbdir > .Op Fl o Ar owner > +.Op Fl T Ar tags > .Ar file1 file2 > .Nm > -.Op Fl bCcMpSsv > +.Op Fl bCcpSsUv > .Op Fl B Ar suffix > +.Op Fl D Ar destdir > .Op Fl f Ar flags > .Op Fl g Ar group > +.Op Fl h Ar hash > +.Op Fl l Ar linkflags > +.Op Fl M Ar metalog > .Op Fl m Ar mode > +.Op Fl N Ar dbdir > .Op Fl o Ar owner > +.Op Fl T Ar tags > .Ar file1 ... fileN directory > .Nm > .Fl d > -.Op Fl v > +.Op Fl Uv > +.Op Fl D Ar destdir > .Op Fl g Ar group > +.Op Fl h Ar hash > +.Op Fl M Ar metalog > .Op Fl m Ar mode > +.Op Fl N Ar dbdir > .Op Fl o Ar owner > +.Op Fl T Ar tags > .Ar directory ... > .Sh DESCRIPTION > The file(s) are copied > -to the target file or directory. > +(or linked if the > +.Fl l > +option is specified) to the target file or directory. > If the destination is a directory, then the > .Ar file > is copied into > @@ -105,6 +124,17 @@ This is actually the default. > The > .Fl c > option is only included for backwards compatibility. > +.It Fl D Ar destdir > +Specify the > +.Ev DESTDIR > +(top of the file hierarchy) that the items are installed in to. > +If > +.Fl M Ar metalog > +is in use, a leading string of > +.Dq Ar destdir > +will be removed from the file names logged to the > +.Ar metalog . > +This option does not affect where the actual files are installed. > .It Fl d > Create directories. > Missing parent directories are created as required. > @@ -115,15 +145,82 @@ for a list of possible flags and their m > .It Fl g > Specify a group. > A numeric GID is allowed. > -.It Fl M > -Disable all use of > -.Xr mmap 2 . > +.It Fl h Ar hash > +When copying, calculate the digest of the files with > +.Ar hash > +to store in the > +.Fl M Ar metalog . > +When > +.Fl d > +is given no hash is emitted. > +Supported digests: > +.Bl -tag -width rmd160 -offset indent > +.It Sy none > +No hash. > +This is the default. > +.It Sy md5 > +The MD5 cryptographic message digest. > +.It Sy rmd160 > +The RMD-160 cryptographic message digest. > +.It Sy sha1 > +The SHA-1 cryptographic message digest. > +.It Sy sha256 > +The 256-bits > +.Tn SHA-2 > +cryptographic message digest of the file. > +.It Sy sha512 > +The 512-bits > +.Tn SHA-2 > +cryptographic message digest of the file. > +.El > +.It Fl l Ar linkflags > +Instead of copying the file make a link to the source. > +The type of the link is determined by the > +.Ar linkflags > +argument. > +Valid > +.Ar linkflags > +are: > +.Ar a > +(absolute), > +.Ar r > +(relative), > +.Ar h > +(hard), > +.Ar s > +(symbolic), > +.Ar m > +(mixed). > +Absolute and relative have effect only for symbolic links. > +Mixed links > +are hard links for files on the same filesystem, symbolic otherwise. > +.It Fl M Ar metalog > +Write the metadata associated with each item installed to > +.Ar metalog > +in an > +.Xr mtree 8 > +.Dq full path > +specification line. > +The metadata includes: the file name and file type, and depending upon > +other options, the owner, group, file flags, modification time, and tags. > .It Fl m > Specify an alternate mode. > The default mode is set to rwxr-xr-x (0755). > The specified mode may be either an octal or symbolic value; see > .Xr chmod 1 > for a description of possible mode values. > +.It Fl N > +Use the user database text file > +.Pa master.passwd > +and group database text file > +.Pa group > +from > +.Ar dbdir , > +rather than using the results from the system's > +.Xr getpwnam 3 > +and > +.Xr getgrnam 3 > +(and related) library calls. > .It Fl o > Specify an owner. > A numeric UID is allowed. > @@ -156,6 +253,17 @@ number of systems and binary types. > See below for how > .Nm > can be instructed to use another program to strip binaries. > +.It Fl T Ar tags > +Specify the > +.Xr mtree 8 > +tags to write out for the file when using > +.Fl M Ar metalog . > +.It Fl U > +Indicate that install is running unprivileged, and that it should not > +try to change the owner, the group, or the file flags of the destination. > +The information that would have been updated can be stored in a log > +file with > +.Fl M Ar metalog . > .It Fl v > Cause > .Nm > @@ -231,6 +339,8 @@ The default was changed to copy in > .Xr mv 1 , > .Xr strip 1 , > .Xr mmap 2 , > +.Xr getgrnam 3 , > +.Xr getpwnam 3 , > .Xr chown 8 > .Sh HISTORY > The > @@ -238,6 +348,16 @@ The > utility appeared in > .Bx 4.2 . > .Sh BUGS > +The meaning of the > +.Fl M > +option has changed as of > +.Fx 10 > +and it now takes an argument. > +Command lines that used the old > +.Fl M > +will get an error or in rare cases will append logs to the first of > +multiple source files rather than installing it. > +.Pp > Temporary files may be left in the target directory if > .Nm > exits abnormally. > > Modified: stable/9/usr.bin/xinstall/xinstall.c > ============================================================================== > --- stable/9/usr.bin/xinstall/xinstall.c Fri Mar 15 14:53:29 2013 (r248330) > +++ stable/9/usr.bin/xinstall/xinstall.c Fri Mar 15 15:19:33 2013 (r248331) > @@ -1,4 +1,5 @@ > /* > + * Copyright (c) 2012, 2013 SRI International > * Copyright (c) 1987, 1993 > * The Regents of the University of California. All rights reserved. > * > @@ -53,14 +54,23 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > +#include > #include > #include > +#include > +#include > +#include > +#include > #include > #include > #include > #include > #include > #include > +#include > + > +#include "mtree.h" > > /* Bootstrap aid - this doesn't exist in most older releases */ > #ifndef MAP_FAILED > @@ -69,26 +79,63 @@ __FBSDID("$FreeBSD$"); > > #define MAX_CMP_SIZE (16 * 1024 * 1024) > > +#define LN_ABSOLUTE 0x01 > +#define LN_RELATIVE 0x02 > +#define LN_HARD 0x04 > +#define LN_SYMBOLIC 0x08 > +#define LN_MIXED 0x10 > + > #define DIRECTORY 0x01 /* Tell install it's a directory. */ > #define SETFLAGS 0x02 /* Tell install to set flags. */ > #define NOCHANGEBITS (UF_IMMUTABLE | UF_APPEND | SF_IMMUTABLE | SF_APPEND) > #define BACKUP_SUFFIX ".old" > > -struct passwd *pp; > -struct group *gp; > -gid_t gid; > -uid_t uid; > -int dobackup, docompare, dodir, dopreserve, dostrip, nommap, safecopy, verbose; > -mode_t mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; > -const char *suffix = BACKUP_SUFFIX; > - > -static int compare(int, const char *, size_t, int, const char *, size_t); > -static void copy(int, const char *, int, const char *, off_t); > +typedef union { > + MD5_CTX MD5; > + RIPEMD160_CTX RIPEMD160; > + SHA1_CTX SHA1; > + SHA256_CTX SHA256; > + SHA512_CTX SHA512; > +} DIGEST_CTX; > + > +static enum { > + DIGEST_NONE = 0, > + DIGEST_MD5, > + DIGEST_RIPEMD160, > + DIGEST_SHA1, > + DIGEST_SHA256, > + DIGEST_SHA512, > +} digesttype = DIGEST_NONE; > + > +static gid_t gid; > +static uid_t uid; > +static int dobackup, docompare, dodir, dolink, dopreserve, dostrip, dounpriv, > + safecopy, verbose; > +static int haveopt_f, haveopt_g, haveopt_m, haveopt_o; > +static mode_t mode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH; > +static FILE *metafp; > +static const char *group, *owner; > +static const char *suffix = BACKUP_SUFFIX; > +static char *destdir, *digest, *fflags, *metafile, *tags; > + > +static int compare(int, const char *, size_t, int, const char *, size_t, > + char **); > +static char *copy(int, const char *, int, const char *, off_t); > static int create_newfile(const char *, int, struct stat *); > static int create_tempfile(const char *, char *, size_t); > +static char *quiet_mktemp(char *template); > +static char *digest_file(const char *); > +static void digest_init(DIGEST_CTX *); > +static void digest_update(DIGEST_CTX *, const unsigned char *, size_t); > +static char *digest_end(DIGEST_CTX *, char *); > +static int do_link(const char *, const char *, const struct stat *); > +static void do_symlink(const char *, const char *, const struct stat *); > +static void makelink(const char *, const char *, const struct stat *); > static void install(const char *, const char *, u_long, u_int); > static void install_dir(char *); > -static u_long numeric_id(const char *, const char *); > +static void metadata_log(const char *, const char *, struct timeval *, > + const char *, const char *, off_t); > +static int parseid(const char *, id_t *); > static void strip(const char *); > static int trymmap(int); > static void usage(void); > @@ -101,12 +148,13 @@ main(int argc, char *argv[]) > u_long fset; > int ch, no_target; > u_int iflags; > - char *flags; > - const char *group, *owner, *to_name; > + char *p; > + const char *to_name; > > iflags = 0; > group = owner = NULL; > - while ((ch = getopt(argc, argv, "B:bCcdf:g:Mm:o:pSsv")) != -1) > + while ((ch = getopt(argc, argv, "B:bCcD:df:g:h:l:M:m:N:o:pSsT:Uv")) != > + -1) > switch((char)ch) { > case 'B': > suffix = optarg; > @@ -120,29 +168,69 @@ main(int argc, char *argv[]) > case 'c': > /* For backwards compatibility. */ > break; > + case 'D': > + destdir = optarg; > + break; > case 'd': > dodir = 1; > break; > case 'f': > - flags = optarg; > - if (strtofflags(&flags, &fset, NULL)) > - errx(EX_USAGE, "%s: invalid flag", flags); > - iflags |= SETFLAGS; > + haveopt_f = 1; > + fflags = optarg; > break; > case 'g': > + haveopt_g = 1; > group = optarg; > break; > + case 'h': > + digest = optarg; > + break; > + case 'l': > + for (p = optarg; *p != '\0'; p++) > + switch (*p) { > + case 's': > + dolink &= ~(LN_HARD|LN_MIXED); > + dolink |= LN_SYMBOLIC; > + break; > + case 'h': > + dolink &= ~(LN_SYMBOLIC|LN_MIXED); > + dolink |= LN_HARD; > + break; > + case 'm': > + dolink &= ~(LN_SYMBOLIC|LN_HARD); > + dolink |= LN_MIXED; > + break; > + case 'a': > + dolink &= ~LN_RELATIVE; > + dolink |= LN_ABSOLUTE; > + break; > + case 'r': > + dolink &= ~LN_ABSOLUTE; > + dolink |= LN_RELATIVE; > + break; > + default: > + errx(1, "%c: invalid link type", *p); > + /* NOTREACHED */ > + } > + break; > case 'M': > - nommap = 1; > + metafile = optarg; > break; > case 'm': > + haveopt_m = 1; > if (!(set = setmode(optarg))) > errx(EX_USAGE, "invalid file mode: %s", > optarg); > mode = getmode(set, 0); > free(set); > break; > + case 'N': > + if (!setup_getid(optarg)) > + err(EX_OSERR, "Unable to use user and group " > + "databases in `%s'", optarg); > + break; > case 'o': > + haveopt_o = 1; > owner = optarg; > break; > case 'p': > @@ -154,6 +242,12 @@ main(int argc, char *argv[]) > case 's': > dostrip = 1; > break; > + case 'T': > + tags = optarg; > + break; > + case 'U': > + dounpriv = 1; > + break; > case 'v': > verbose = 1; > break; > @@ -179,27 +273,62 @@ main(int argc, char *argv[]) > if (argc == 0 || (argc == 1 && !dodir)) > usage(); > > + if (digest != NULL) { > + if (strcmp(digest, "none") == 0) { > + digesttype = DIGEST_NONE; > + } else if (strcmp(digest, "md5") == 0) { > + digesttype = DIGEST_MD5; > + } else if (strcmp(digest, "rmd160") == 0) { > + digesttype = DIGEST_RIPEMD160; > + } else if (strcmp(digest, "sha1") == 0) { > + digesttype = DIGEST_SHA1; > + } else if (strcmp(digest, "sha256") == 0) { > + digesttype = DIGEST_SHA256; > + } else if (strcmp(digest, "sha512") == 0) { > + digesttype = DIGEST_SHA512; > + } else { > + warnx("unknown digest `%s'", digest); > + usage(); > + } > + } > + > /* need to make a temp copy so we can compare stripped version */ > if (docompare && dostrip) > safecopy = 1; > > /* get group and owner id's */ > - if (group != NULL) { > - if ((gp = getgrnam(group)) != NULL) > - gid = gp->gr_gid; > - else > - gid = (gid_t)numeric_id(group, "group"); > + if (group != NULL && !dounpriv) { > + if (gid_from_group(group, &gid) == -1) { > + id_t id; > + if (!parseid(group, &id)) > + errx(1, "unknown group %s", group); > + gid = id; > + } > } else > gid = (gid_t)-1; > > - if (owner != NULL) { > - if ((pp = getpwnam(owner)) != NULL) > - uid = pp->pw_uid; > - else > - uid = (uid_t)numeric_id(owner, "user"); > + if (owner != NULL && !dounpriv) { > + if (uid_from_user(owner, &uid) == -1) { > + id_t id; > + if (!parseid(owner, &id)) > + errx(1, "unknown user %s", owner); > + uid = id; > + } > } else > uid = (uid_t)-1; > > + if (fflags != NULL && !dounpriv) { > + if (strtofflags(&fflags, &fset, NULL)) > + errx(EX_USAGE, "%s: invalid flag", fflags); > + iflags |= SETFLAGS; > + } > + > + if (metafile != NULL) { > + if ((metafp = fopen(metafile, "a")) == NULL) > + warn("open %s", metafile); > + } else > + digesttype = DIGEST_NONE; > + > if (dodir) { > for (; *argv != NULL; ++argv) > install_dir(*argv); > @@ -207,8 +336,21 @@ main(int argc, char *argv[]) > /* NOTREACHED */ > } > > - no_target = stat(to_name = argv[argc - 1], &to_sb); > + to_name = argv[argc - 1]; > + no_target = stat(to_name, &to_sb); > if (!no_target && S_ISDIR(to_sb.st_mode)) { > + if (dolink & LN_SYMBOLIC) { > + if (lstat(to_name, &to_sb) != 0) > + err(EX_OSERR, "%s vanished", to_name); > + if (S_ISLNK(to_sb.st_mode)) { > + if (argc != 2) { > + errno = ENOTDIR; > + err(EX_USAGE, "%s", to_name); > + } > + install(*argv, to_name, fset, iflags); > + exit(EX_OK); > + } > + } > for (; *argv != to_name; ++argv) > install(*argv, to_name, fset, iflags | DIRECTORY); > exit(EX_OK); > @@ -226,7 +368,7 @@ main(int argc, char *argv[]) > usage(); > } > > - if (!no_target) { > + if (!no_target && !dolink) { > if (stat(*argv, &from_sb)) > err(EX_OSERR, "%s", *argv); > if (!S_ISREG(to_sb.st_mode)) { > @@ -243,23 +385,327 @@ main(int argc, char *argv[]) > /* NOTREACHED */ > } > > -static u_long > -numeric_id(const char *name, const char *type) > +static char * > +digest_file(const char *name) > +{ > + > + switch (digesttype) { > + case DIGEST_MD5: > + return (MD5File(name, NULL)); > + case DIGEST_RIPEMD160: > + return (RIPEMD160_File(name, NULL)); > + case DIGEST_SHA1: > + return (SHA1_File(name, NULL)); > + case DIGEST_SHA256: > + return (SHA256_File(name, NULL)); > + case DIGEST_SHA512: > + return (SHA512_File(name, NULL)); > + default: > + return (NULL); > + } > +} > + > +static void > +digest_init(DIGEST_CTX *c) > +{ > + > + switch (digesttype) { > + case DIGEST_NONE: > + break; > + case DIGEST_MD5: > + MD5Init(&(c->MD5)); > + break; > + case DIGEST_RIPEMD160: > + RIPEMD160_Init(&(c->RIPEMD160)); > + break; > + case DIGEST_SHA1: > + SHA1_Init(&(c->SHA1)); > + break; > + case DIGEST_SHA256: > + SHA256_Init(&(c->SHA256)); > + break; > + case DIGEST_SHA512: > + SHA512_Init(&(c->SHA512)); > + break; > + } > +} > + > +static void > +digest_update(DIGEST_CTX *c, const unsigned char *data, size_t len) > +{ > + > + switch (digesttype) { > + case DIGEST_NONE: > + break; > + case DIGEST_MD5: > + MD5Update(&(c->MD5), data, len); > + break; > + case DIGEST_RIPEMD160: > + RIPEMD160_Update(&(c->RIPEMD160), data, len); > + break; > + case DIGEST_SHA1: > + SHA1_Update(&(c->SHA1), data, len); > + break; > + case DIGEST_SHA256: > + SHA256_Update(&(c->SHA256), data, len); > + break; > + case DIGEST_SHA512: > + SHA512_Update(&(c->SHA512), data, len); > + break; > + } > +} > + > +static char * > +digest_end(DIGEST_CTX *c, char *buf) > +{ > + > + switch (digesttype) { > + case DIGEST_MD5: > + return (MD5End(&(c->MD5), buf)); > + case DIGEST_RIPEMD160: > + return (RIPEMD160_End(&(c->RIPEMD160), buf)); > + case DIGEST_SHA1: > + return (SHA1_End(&(c->SHA1), buf)); > + case DIGEST_SHA256: > + return (SHA256_End(&(c->SHA256), buf)); > + case DIGEST_SHA512: > + return (SHA512_End(&(c->SHA512), buf)); > + default: > + return (NULL); > + } > +} > + > +/* > + * parseid -- > + * parse uid or gid from arg into id, returning non-zero if successful > + */ > +static int > +parseid(const char *name, id_t *id) > +{ > + char *ep; > + errno = 0; > + *id = (id_t)strtoul(name, &ep, 10); > + if (errno || *ep != '\0') > + return (0); > + return (1); > +} > + > +/* > + * quiet_mktemp -- > + * mktemp implementation used mkstemp to avoid mktemp warnings. We > + * really do need mktemp semantics here as we will be creating a link. > + */ > +static char * > +quiet_mktemp(char *template) > +{ > + int fd; > + > + if ((fd = mkstemp(template)) == -1) > + return (NULL); > + close (fd); > + if (unlink(template) == -1) > + err(EX_OSERR, "unlink %s", template); > + return (template); > +} > + > +/* > + * do_link -- > + * make a hard link, obeying dorename if set > + * return -1 on failure > + */ > +static int > +do_link(const char *from_name, const char *to_name, > + const struct stat *target_sb) > +{ > + char tmpl[MAXPATHLEN]; > + int ret; > + > + if (safecopy && target_sb != NULL) { > + (void)snprintf(tmpl, sizeof(tmpl), "%s.inst.XXXXXX", to_name); > + /* This usage is safe. */ > + if (quiet_mktemp(tmpl) == NULL) > + err(EX_OSERR, "%s: mktemp", tmpl); > + ret = link(from_name, tmpl); > + if (ret == 0) { > + if (target_sb->st_mode & S_IFDIR && rmdir(to_name) == > + -1) { > + unlink(tmpl); > + err(EX_OSERR, "%s", to_name); > + } > + if (target_sb->st_flags & NOCHANGEBITS) > + (void)chflags(to_name, target_sb->st_flags & > + ~NOCHANGEBITS); > + unlink(to_name); > + ret = rename(tmpl, to_name); > + /* > + * If rename has posix semantics, then the temporary > + * file may still exist when from_name and to_name point > + * to the same file, so unlink it unconditionally. > + */ > + (void)unlink(tmpl); > + } > + return (ret); > + } else > + return (link(from_name, to_name)); > +} > + > +/* > + * do_symlink -- > + * Make a symbolic link, obeying dorename if set. Exit on failure. > + */ > +static void > +do_symlink(const char *from_name, const char *to_name, > + const struct stat *target_sb) > +{ > + char tmpl[MAXPATHLEN]; > + > + if (safecopy && target_sb != NULL) { > + (void)snprintf(tmpl, sizeof(tmpl), "%s.inst.XXXXXX", to_name); > + /* This usage is safe. */ > + if (quiet_mktemp(tmpl) == NULL) > + err(EX_OSERR, "%s: mktemp", tmpl); > + > + if (symlink(from_name, tmpl) == -1) > + err(EX_OSERR, "symlink %s -> %s", from_name, tmpl); > + > + if (target_sb->st_mode & S_IFDIR && rmdir(to_name) == -1) { > + (void)unlink(tmpl); > + err(EX_OSERR, "%s", to_name); > + } > + if (target_sb->st_flags & NOCHANGEBITS) > + (void)chflags(to_name, target_sb->st_flags & > + ~NOCHANGEBITS); > + unlink(to_name); > + > + if (rename(tmpl, to_name) == -1) { > + /* Remove temporary link before exiting. */ > + (void)unlink(tmpl); > + err(EX_OSERR, "%s: rename", to_name); > + } > + } else { > + if (symlink(from_name, to_name) == -1) > + err(EX_OSERR, "symlink %s -> %s", from_name, to_name); > + } > +} > + > +/* > + * makelink -- > + * make a link from source to destination > + */ > +static void > +makelink(const char *from_name, const char *to_name, > + const struct stat *target_sb) > { > - u_long val; > - char *ep; > + char src[MAXPATHLEN], dst[MAXPATHLEN], lnk[MAXPATHLEN]; > + struct stat to_sb; > + > + /* Try hard links first. */ > + if (dolink & (LN_HARD|LN_MIXED)) { > + if (do_link(from_name, to_name, target_sb) == -1) { > + if ((dolink & LN_HARD) || errno != EXDEV) > + err(EX_OSERR, "link %s -> %s", from_name, to_name); > + } else { > + if (stat(to_name, &to_sb)) > + err(EX_OSERR, "%s: stat", to_name); > + if (S_ISREG(to_sb.st_mode)) { > + /* > + * XXX: hard links to anything other than > + * plain files are not metalogged > + */ > + int omode; > + const char *oowner, *ogroup; > + char *offlags; > + char *dres; > + > + /* > + * XXX: use underlying perms, unless > + * overridden on command line. > + */ > + omode = mode; > + if (!haveopt_m) > + mode = (to_sb.st_mode & 0777); > + oowner = owner; > + if (!haveopt_o) > + owner = NULL; > + ogroup = group; > + if (!haveopt_g) > + group = NULL; > + offlags = fflags; > + if (!haveopt_f) > + fflags = NULL; > + dres = digest_file(from_name); > + metadata_log(to_name, "file", NULL, NULL, > + dres, to_sb.st_size); > + free(dres); > + mode = omode; > + owner = oowner; > + group = ogroup; > + fflags = offlags; > + } > + return; > + } > + } > + > + /* Symbolic links. */ > + if (dolink & LN_ABSOLUTE) { > + /* Convert source path to absolute. */ > + if (realpath(from_name, src) == NULL) > + err(EX_OSERR, "%s: realpath", from_name); > + do_symlink(src, to_name, target_sb); > + /* XXX: src may point outside of destdir */ > + metadata_log(to_name, "link", NULL, src, NULL, 0); > + return; > + } > + > + if (dolink & LN_RELATIVE) { > + char *cp, *d, *s; > + > + /* Resolve pathnames. */ > + if (realpath(from_name, src) == NULL) > + err(EX_OSERR, "%s: realpath", from_name); > + > + /* > + * The last component of to_name may be a symlink, > + * so use realpath to resolve only the directory. > + */ > + cp = dirname(to_name); > + if (realpath(cp, dst) == NULL) > + err(EX_OSERR, "%s: realpath", cp); > + /* .. and add the last component. */ > + if (strcmp(dst, "/") != 0) { > + if (strlcat(dst, "/", sizeof(dst)) > sizeof(dst)) > + errx(1, "resolved pathname too long"); > + } > + cp = basename(to_name); > + if (strlcat(dst, cp, sizeof(dst)) > sizeof(dst)) > + errx(1, "resolved pathname too long"); > + > + /* Trim common path components. */ > + for (s = src, d = dst; *s == *d; s++, d++) > + continue; > + while (*s != '/') > + s--, d--; > + > + /* Count the number of directories we need to backtrack. */ > + for (++d, lnk[0] = '\0'; *d; d++) > + if (*d == '/') > + (void)strlcat(lnk, "../", sizeof(lnk)); > + > + (void)strlcat(lnk, ++s, sizeof(lnk)); > + > + do_symlink(lnk, to_name, target_sb); > + /* XXX: Link may point outside of destdir. */ > + metadata_log(to_name, "link", NULL, lnk, NULL, 0); > + return; > + } > > /* > - * XXX > - * We know that uid_t's and gid_t's are unsigned longs. > + * If absolute or relative was not specified, try the names the > + * user provided. > */ > - errno = 0; > - val = strtoul(name, &ep, 10); > - if (errno) > - err(EX_NOUSER, "%s", name); > - if (*ep != '\0') > - errx(EX_NOUSER, "unknown %s %s", type, name); > - return (val); > + do_symlink(from_name, to_name, target_sb); > + /* XXX: from_name may point outside of destdir. */ > + metadata_log(to_name, "link", NULL, from_name, NULL, 0); > } > > /* > @@ -274,6 +720,7 @@ install(const char *from_name, const cha > int devnull, files_match, from_fd, serrno, target; > int tempcopy, temp_fd, to_fd; > char backup[MAXPATHLEN], *p, pathbuf[MAXPATHLEN], tempfile[MAXPATHLEN]; > + char *digestresult; > > files_match = 0; > from_fd = -1; > @@ -281,11 +728,13 @@ install(const char *from_name, const cha > > /* If try to install NULL file to a directory, fails. */ > if (flags & DIRECTORY || strcmp(from_name, _PATH_DEVNULL)) { > - if (stat(from_name, &from_sb)) > - err(EX_OSERR, "%s", from_name); > - if (!S_ISREG(from_sb.st_mode)) { > - errno = EFTYPE; > - err(EX_OSERR, "%s", from_name); > + if (!dolink) { > + if (stat(from_name, &from_sb)) > + err(EX_OSERR, "%s", from_name); > + if (!S_ISREG(from_sb.st_mode)) { > + errno = EFTYPE; > + err(EX_OSERR, "%s", from_name); > + } > } > /* Build the target path. */ > if (flags & DIRECTORY) { > @@ -299,7 +748,23 @@ install(const char *from_name, const cha > devnull = 1; > } > > - target = stat(to_name, &to_sb) == 0; > + if (!dolink) > + target = (stat(to_name, &to_sb) == 0); > + else > + target = (lstat(to_name, &to_sb) == 0); > + > + if (dolink) { > + if (target && !safecopy) { > + if (to_sb.st_mode & S_IFDIR && rmdir(to_name) == -1) > + err(EX_OSERR, "%s", to_name); > + if (to_sb.st_flags & NOCHANGEBITS) > + (void)chflags(to_name, > + to_sb.st_flags & ~NOCHANGEBITS); > + unlink(to_name); > + } > + makelink(from_name, to_name, target ? &to_sb : NULL); > + return; > + } > > /* Only install to regular files. */ > if (target && !S_ISREG(to_sb.st_mode)) { > @@ -323,7 +788,7 @@ install(const char *from_name, const cha > else > files_match = !(compare(from_fd, from_name, > (size_t)from_sb.st_size, to_fd, > - to_name, (size_t)to_sb.st_size)); > + to_name, (size_t)to_sb.st_size, &digestresult)); > > /* Close "to" file unless we match. */ > if (!files_match) > @@ -345,8 +810,10 @@ install(const char *from_name, const cha > from_name, to_name); > } > if (!devnull) > - copy(from_fd, from_name, to_fd, > + digestresult = copy(from_fd, from_name, to_fd, > tempcopy ? tempfile : to_name, from_sb.st_size); > + else > + digestresult = NULL; > } > > if (dostrip) { > @@ -380,7 +847,8 @@ install(const char *from_name, const cha > } > > if (compare(temp_fd, tempfile, (size_t)temp_sb.st_size, to_fd, > - to_name, (size_t)to_sb.st_size) == 0) { > + to_name, (size_t)to_sb.st_size, &digestresult) > + == 0) { > /* > * If target has more than one link we need to > * replace it in order to snap the extra links. > @@ -400,6 +868,9 @@ install(const char *from_name, const cha > } > } > > + if (dostrip && (!docompare || !target)) > + digestresult = digest_file(tempfile); > + > /* > > *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** > >