From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 00:52:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6AB91106566B; Sun, 5 Feb 2012 00:52:00 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3B2948FC15; Sun, 5 Feb 2012 00:52:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q150q0oL059307; Sun, 5 Feb 2012 00:52:00 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q150q0KL059305; Sun, 5 Feb 2012 00:52:00 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202050052.q150q0KL059305@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 5 Feb 2012 00:52:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231003 - head/sys/powerpc/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 00:52:00 -0000 Author: nwhitehorn Date: Sun Feb 5 00:51:59 2012 New Revision: 231003 URL: http://svn.freebsd.org/changeset/base/231003 Log: Add support for bus_adjust_resource() on all PowerPC/AIM PCI bridges. With this change, NEW_PCIB appears to work without incident at least on a G5 iMac. More testing will be required before it is turned on in GENERIC. Modified: head/sys/powerpc/ofw/ofw_pci.c Modified: head/sys/powerpc/ofw/ofw_pci.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pci.c Sun Feb 5 00:31:07 2012 (r231002) +++ head/sys/powerpc/ofw/ofw_pci.c Sun Feb 5 00:51:59 2012 (r231003) @@ -71,6 +71,9 @@ static int ofw_pci_activate_resource(de static int ofw_pci_deactivate_resource(device_t bus, device_t child, int type, int rid, struct resource *res); +static int ofw_pci_adjust_resource(device_t bus, device_t child, + int type, struct resource *res, u_long start, + u_long end); /* * pcib interface. @@ -106,6 +109,7 @@ static device_method_t ofw_pci_methods[] DEVMETHOD(bus_release_resource, ofw_pci_release_resource), DEVMETHOD(bus_activate_resource, ofw_pci_activate_resource), DEVMETHOD(bus_deactivate_resource, ofw_pci_deactivate_resource), + DEVMETHOD(bus_adjust_resource, ofw_pci_adjust_resource), /* pcib interface */ DEVMETHOD(pcib_maxslots, ofw_pci_maxslots), @@ -421,6 +425,30 @@ ofw_pci_deactivate_resource(device_t bus return (rman_deactivate_resource(res)); } +static int +ofw_pci_adjust_resource(device_t bus, device_t child, int type, + struct resource *res, u_long start, u_long end) +{ + struct rman *rm = NULL; + struct ofw_pci_softc *sc = device_get_softc(bus); + + switch (type) { + case SYS_RES_MEMORY: + rm = &sc->sc_mem_rman; + break; + case SYS_RES_IOPORT: + rm = &sc->sc_io_rman; + break; + default: + return (ENXIO); + } + + if (!rman_is_region_manager(res, rm)) + return (EINVAL); + return (rman_adjust_resource(res, start, end)); +} + + static phandle_t ofw_pci_get_node(device_t bus, device_t dev) { From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 04:49:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A854106566C; Sun, 5 Feb 2012 04:49:32 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 294098FC0C; Sun, 5 Feb 2012 04:49:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q154nWeJ067151; Sun, 5 Feb 2012 04:49:32 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q154nWHV067148; Sun, 5 Feb 2012 04:49:32 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201202050449.q154nWHV067148@svn.freebsd.org> From: David Xu Date: Sun, 5 Feb 2012 04:49:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231006 - in head/sys: compat/freebsd32 kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 04:49:32 -0000 Author: davidxu Date: Sun Feb 5 04:49:31 2012 New Revision: 231006 URL: http://svn.freebsd.org/changeset/base/231006 Log: Add 32-bit compat code for AIO kevent flags introduced in revision 230857. Modified: head/sys/compat/freebsd32/freebsd32_signal.h head/sys/kern/vfs_aio.c Modified: head/sys/compat/freebsd32/freebsd32_signal.h ============================================================================== --- head/sys/compat/freebsd32/freebsd32_signal.h Sun Feb 5 03:23:26 2012 (r231005) +++ head/sys/compat/freebsd32/freebsd32_signal.h Sun Feb 5 04:49:31 2012 (r231006) @@ -92,6 +92,7 @@ struct sigevent32 { uint32_t _function; uint32_t _attribute; } _sigev_thread; + unsigned short _kevent_flags; uint32_t __spare__[8]; } _sigev_un; }; Modified: head/sys/kern/vfs_aio.c ============================================================================== --- head/sys/kern/vfs_aio.c Sun Feb 5 03:23:26 2012 (r231005) +++ head/sys/kern/vfs_aio.c Sun Feb 5 04:49:31 2012 (r231006) @@ -2706,6 +2706,7 @@ convert_sigevent32(struct sigevent32 *si break; case SIGEV_KEVENT: CP(*sig32, *sig, sigev_notify_kqueue); + CP(*sig32, *sig, sigev_notify_kevent_flags); PTRIN_CP(*sig32, *sig, sigev_value.sival_ptr); break; default: From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 07:46:06 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2897A106564A; Sun, 5 Feb 2012 07:46:06 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id ACB6E8FC08; Sun, 5 Feb 2012 07:46:04 +0000 (UTC) Received: by lagz14 with SMTP id z14so3245496lag.13 for ; Sat, 04 Feb 2012 23:46:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=Zf+m5iA6U1+uSGhj63F3T+U7rlxNRsGekZU67WV+c6s=; b=E4yRLzbWJHVFvOZhwpU8870t8JFeSU6jbuAOIeYW5D7H9g4eIQmQBQ43jfb2Pc1z+/ vly6yPB6H3R/6gTQh5kntl+ElJdbLQqxMXYi1OKKpTPqAwagKkmL7k3ee9kDn96E/GGc 5tyU3zEPsQKHq5vifvy7p6uA4Ym+wi52tThJs= MIME-Version: 1.0 Received: by 10.152.133.229 with SMTP id pf5mr6968614lab.18.1328427963547; Sat, 04 Feb 2012 23:46:03 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.152.2.138 with HTTP; Sat, 4 Feb 2012 23:46:03 -0800 (PST) In-Reply-To: <201202041337.q14DbVTn037485@svn.freebsd.org> References: <201202041337.q14DbVTn037485@svn.freebsd.org> Date: Sun, 5 Feb 2012 10:46:03 +0300 X-Google-Sender-Auth: oCFXi5SYP0KzdDT7RF0RXgSS_Mg Message-ID: From: Sergey Kandaurov To: Jaakko Heinonen Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230979 - head/usr.bin/touch X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 07:46:06 -0000 On 4 February 2012 17:37, Jaakko Heinonen wrote: > Author: jh > Date: Sat Feb =A04 13:37:31 2012 > New Revision: 230979 > URL: http://svn.freebsd.org/changeset/base/230979 > > Log: > =A0Remove useless and potentially dangerous rw() function which tries to > =A0update access and modification times by reading and writing the file. > =A0chmod(2) in rw() doesn't help because utimes(2) allow owner and the > =A0super-user to change times. Using just utimes(2) should be sufficient. > > =A0The -f option becomes no-op. > > =A0Reviewed by: =A0jilles > > Modified: > =A0head/usr.bin/touch/touch.1 > =A0head/usr.bin/touch/touch.c Thank you. FYI, this code was written before utimes(2) was born (yes, before 4.2BSD), so it was technically correct to remove it for more than 20 years ago. > > Modified: head/usr.bin/touch/touch.1 > =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 > --- head/usr.bin/touch/touch.1 =A0Sat Feb =A04 13:12:52 2012 =A0 =A0 =A0 = =A0(r230978) > +++ head/usr.bin/touch/touch.1 =A0Sat Feb =A04 13:37:31 2012 =A0 =A0 =A0 = =A0(r230979) > @@ -31,7 +31,7 @@ > =A0.\" =A0 =A0 @(#)touch.1 =A0 =A08.3 (Berkeley) 4/28/95 > =A0.\" $FreeBSD$ > =A0.\" > -.Dd April 28, 1995 > +.Dd February 4, 2012 > =A0.Dt TOUCH 1 > =A0.Os > =A0.Sh NAME > @@ -40,7 +40,7 @@ > =A0.Sh SYNOPSIS > =A0.Nm > =A0.Op Fl A Ar [-][[hh]mm]SS > -.Op Fl acfhm > +.Op Fl achm > =A0.Op Fl r Ar file > =A0.Op Fl t Ar [[CC]YY]MMDDhhmm[.SS] > =A0.Ar > @@ -109,9 +109,6 @@ The > =A0.Nm > =A0utility does not treat this as an error. > =A0No error messages are displayed and the exit value is not affected. > -.It Fl f > -Attempt to force the update, even if the file permissions do not > -currently permit it. > =A0.It Fl h > =A0If the file is a symbolic link, change the times of the link > =A0itself rather than the file that the link points to. > > Modified: head/usr.bin/touch/touch.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 > --- head/usr.bin/touch/touch.c =A0Sat Feb =A04 13:12:52 2012 =A0 =A0 =A0 = =A0(r230978) > +++ head/usr.bin/touch/touch.c =A0Sat Feb =A04 13:37:31 2012 =A0 =A0 =A0 = =A0(r230979) > @@ -55,7 +55,6 @@ static const char sccsid[] =3D "@(#)touch. > =A0#include > =A0#include > > -int =A0 =A0rw(char *, struct stat *, int); > =A0void =A0 stime_arg1(char *, struct timeval *); > =A0void =A0 stime_arg2(char *, int, struct timeval *); > =A0void =A0 stime_file(char *, struct timeval *); > @@ -69,12 +68,12 @@ main(int argc, char *argv[]) > =A0 =A0 =A0 =A0struct timeval tv[2]; > =A0 =A0 =A0 =A0int (*stat_f)(const char *, struct stat *); > =A0 =A0 =A0 =A0int (*utimes_f)(const char *, const struct timeval *); > - =A0 =A0 =A0 int Aflag, aflag, cflag, fflag, mflag, ch, fd, len, rval, t= imeset; > + =A0 =A0 =A0 int Aflag, aflag, cflag, mflag, ch, fd, len, rval, timeset; > =A0 =A0 =A0 =A0char *p; > =A0 =A0 =A0 =A0char *myname; > > =A0 =A0 =A0 =A0myname =3D basename(argv[0]); > - =A0 =A0 =A0 Aflag =3D aflag =3D cflag =3D fflag =3D mflag =3D timeset = =3D 0; > + =A0 =A0 =A0 Aflag =3D aflag =3D cflag =3D mflag =3D timeset =3D 0; > =A0 =A0 =A0 =A0stat_f =3D stat; > =A0 =A0 =A0 =A0utimes_f =3D utimes; > =A0 =A0 =A0 =A0if (gettimeofday(&tv[0], NULL)) > @@ -92,7 +91,7 @@ main(int argc, char *argv[]) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cflag =3D 1; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 'f': > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 fflag =3D 1; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* No-op for compatibility.= */ > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0break; > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0case 'h': > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0cflag =3D 1; > @@ -222,14 +221,8 @@ main(int argc, char *argv[]) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!utimes_f(*argv, NULL)) > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0continue; > > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 /* Try reading/writing. */ > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!S_ISLNK(sb.st_mode) && !S_ISDIR(sb.st_= mode)) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (rw(*argv, &sb, fflag)) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rval =3D 1; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rval =3D 1; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 warn("%s", *argv); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 rval =3D 1; > + =A0 =A0 =A0 =A0 =A0 =A0 =A0 warn("%s", *argv); > =A0 =A0 =A0 =A0} > =A0 =A0 =A0 =A0exit(rval); > =A0} > @@ -368,59 +361,10 @@ stime_file(char *fname, struct timeval * > =A0 =A0 =A0 =A0TIMESPEC_TO_TIMEVAL(tvp + 1, &sb.st_mtim); > =A0} > > -int > -rw(char *fname, struct stat *sbp, int force) > -{ > - =A0 =A0 =A0 int fd, needed_chmod, rval; > - =A0 =A0 =A0 u_char byte; > - > - =A0 =A0 =A0 /* Try regular files. */ > - =A0 =A0 =A0 if (!S_ISREG(sbp->st_mode)) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 warnx("%s: %s", fname, strerror(EFTYPE)); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 return (1); > - =A0 =A0 =A0 } > - > - =A0 =A0 =A0 needed_chmod =3D rval =3D 0; > - =A0 =A0 =A0 if ((fd =3D open(fname, O_RDWR, 0)) =3D=3D -1) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (!force || chmod(fname, DEFFILEMODE)) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto err; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if ((fd =3D open(fname, O_RDWR, 0)) =3D=3D = -1) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto err; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 needed_chmod =3D 1; > - =A0 =A0 =A0 } > - > - =A0 =A0 =A0 if (sbp->st_size !=3D 0) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (read(fd, &byte, sizeof(byte)) !=3D size= of(byte)) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto err; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (lseek(fd, (off_t)0, SEEK_SET) =3D=3D -1= ) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto err; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (write(fd, &byte, sizeof(byte)) !=3D siz= eof(byte)) > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 goto err; > - =A0 =A0 =A0 } else { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 if (write(fd, &byte, sizeof(byte)) !=3D siz= eof(byte)) { > -err: =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rval =3D 1; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 warn("%s", fname); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 } else if (ftruncate(fd, (off_t)0)) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 rval =3D 1; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 warn("%s: file modified", f= name); > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 } > - =A0 =A0 =A0 } > - > - =A0 =A0 =A0 if (close(fd) && rval !=3D 1) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 rval =3D 1; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 warn("%s", fname); > - =A0 =A0 =A0 } > - =A0 =A0 =A0 if (needed_chmod && chmod(fname, sbp->st_mode) && rval !=3D= 1) { > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 rval =3D 1; > - =A0 =A0 =A0 =A0 =A0 =A0 =A0 warn("%s: permissions modified", fname); > - =A0 =A0 =A0 } > - =A0 =A0 =A0 return (rval); > -} > - > =A0void > =A0usage(char *myname) > =A0{ > - =A0 =A0 =A0 fprintf(stderr, "usage:\n" "%s [-A [-][[hh]mm]SS] [-acfhm] = [-r file] " > + =A0 =A0 =A0 fprintf(stderr, "usage:\n" "%s [-A [-][[hh]mm]SS] [-achm] [= -r file] " > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0"[-t [[CC]YY]MMDDhhmm[.SS]] file ...\n", m= yname); > =A0 =A0 =A0 =A0exit(1); > =A0} --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 08:17:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7E3A71065672; Sun, 5 Feb 2012 08:17:46 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 0B26E8FC13; Sun, 5 Feb 2012 08:17:46 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id D811325D37C0; Sun, 5 Feb 2012 08:17:44 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id D816ABDAB0E; Sun, 5 Feb 2012 08:17:43 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id 7WL5OAYT86mL; Sun, 5 Feb 2012 08:17:42 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 4A93DBDAB0D; Sun, 5 Feb 2012 08:17:42 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201202042300.q14N0SYD055615@svn.freebsd.org> Date: Sun, 5 Feb 2012 08:17:40 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: <5B5FCCB9-8BA0-4945-AA75-3E62ED5B3DFE@lists.zabbadoz.net> References: <201202042300.q14N0SYD055615@svn.freebsd.org> To: Nathan Whitehorn X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230997 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 08:17:46 -0000 On 4. Feb 2012, at 23:00 , Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Sat Feb 4 23:00:27 2012 > New Revision: 230997 > URL: http://svn.freebsd.org/changeset/base/230997 >=20 > Log: > Fix installation script after r230482 -- a missing character = apparently. > Now, back to convalescing. Cool. Thanks! I'll give it a try. > Modified: > head/release/rc.local >=20 > Modified: head/release/rc.local > = =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 > --- head/release/rc.local Sat Feb 4 20:17:07 2012 = (r230996) > +++ head/release/rc.local Sat Feb 4 23:00:27 2012 = (r230997) > @@ -18,7 +18,7 @@ if [ $? -eq 0 ]; then > # goes multiuser > touch /tmp/bsdinstall_log > tail -f /tmp/bsdinstall_log > /dev/ttyv2 & > - /usr/libexec/getty autologin ttyv3 > + /usr/libexec/getty autologin ttyv3 & > EXTERNAL_VTY_STARTED=3D1 > fi > else --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 08:31:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D0D7106564A; Sun, 5 Feb 2012 08:31:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5BF858FC19; Sun, 5 Feb 2012 08:31:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q158VF7K073864; Sun, 5 Feb 2012 08:31:15 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q158VFO7073862; Sun, 5 Feb 2012 08:31:15 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202050831.q158VFO7073862@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 5 Feb 2012 08:31:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231009 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 08:31:15 -0000 Author: glebius Date: Sun Feb 5 08:31:15 2012 New Revision: 231009 URL: http://svn.freebsd.org/changeset/base/231009 Log: In ifa_init() initialize if_data.ifi_datalen. This would be required after upcoming changes from bz@. Discussed with: bz Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun Feb 5 07:19:00 2012 (r231008) +++ head/sys/net/if.c Sun Feb 5 08:31:15 2012 (r231009) @@ -1416,6 +1416,7 @@ ifa_init(struct ifaddr *ifa) mtx_init(&ifa->ifa_mtx, "ifaddr", NULL, MTX_DEF); refcount_init(&ifa->ifa_refcnt, 1); + ifa->if_data.ifi_datalen = sizeof(ifa->if_data); } void From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 08:53:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4D4E106566B; Sun, 5 Feb 2012 08:53:05 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3A768FC08; Sun, 5 Feb 2012 08:53:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q158r5ci074553; Sun, 5 Feb 2012 08:53:05 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q158r5l5074551; Sun, 5 Feb 2012 08:53:05 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202050853.q158r5l5074551@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 5 Feb 2012 08:53:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231010 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 08:53:05 -0000 Author: glebius Date: Sun Feb 5 08:53:05 2012 New Revision: 231010 URL: http://svn.freebsd.org/changeset/base/231010 Log: Better comment for ifa_init(), ifa_ref(), ifa_free(). Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun Feb 5 08:31:15 2012 (r231009) +++ head/sys/net/if.c Sun Feb 5 08:53:05 2012 (r231010) @@ -1408,7 +1408,7 @@ if_maddr_runlock(struct ifnet *ifp) } /* - * Reference count functions for ifaddrs. + * Initialization, desctruction and refcounting functions for ifaddrs. */ void ifa_init(struct ifaddr *ifa) From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 09:17:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2325106564A; Sun, 5 Feb 2012 09:17:49 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B53E18FC0A; Sun, 5 Feb 2012 09:17:49 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q159HnWt075347; Sun, 5 Feb 2012 09:17:49 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q159Hnp9075338; Sun, 5 Feb 2012 09:17:49 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202050917.q159Hnp9075338@svn.freebsd.org> From: Ed Schouten Date: Sun, 5 Feb 2012 09:17:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231011 - head/usr.bin/systat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 09:17:50 -0000 Author: ed Date: Sun Feb 5 09:17:49 2012 New Revision: 231011 URL: http://svn.freebsd.org/changeset/base/231011 Log: Whitespace fixes. - Remove redundant empty lines. - Replace ^L by \014. This allows you to safely cat/grep/etc this file without causing confusion. Modified: head/usr.bin/systat/icmp.c head/usr.bin/systat/ifstat.c head/usr.bin/systat/iostat.c head/usr.bin/systat/ip.c head/usr.bin/systat/netcmds.c head/usr.bin/systat/netstat.c head/usr.bin/systat/pigs.c head/usr.bin/systat/tcp.c Modified: head/usr.bin/systat/icmp.c ============================================================================== --- head/usr.bin/systat/icmp.c Sun Feb 5 08:53:05 2012 (r231010) +++ head/usr.bin/systat/icmp.c Sun Feb 5 09:17:49 2012 (r231011) @@ -277,4 +277,3 @@ fetchicmp(void) if (sysctl(name, 4, &icmpstat, &len, 0, 0) < 0) return; } - Modified: head/usr.bin/systat/ifstat.c ============================================================================== --- head/usr.bin/systat/ifstat.c Sun Feb 5 08:53:05 2012 (r231010) +++ head/usr.bin/systat/ifstat.c Sun Feb 5 09:17:49 2012 (r231011) @@ -58,7 +58,6 @@ static const int col3 = C3; static const int col4 = C4; static const int col5 = C5; - SLIST_HEAD(, if_stat) curlist; SLIST_HEAD(, if_stat_disp) displist; @@ -85,7 +84,7 @@ static void sort_interface_list(void); static u_int getifnum(void); #define IFSTAT_ERR(n, s) do { \ - putchar(' '); \ + putchar('\014'); \ closeifstat(wnd); \ err((n), (s)); \ } while (0) @@ -143,7 +142,6 @@ static u_int getifnum(void); mvprintw(p->if_ypos+1, col2-3, "%s", (const char *)"out"); \ } while (0) - WINDOW * openifstat(void) { @@ -170,7 +168,6 @@ closeifstat(WINDOW *w) return; } - void labelifstat(void) { @@ -254,7 +251,6 @@ fetchifstat(void) IFSTAT_ERR(2, "error getting time of day"); (void)getifmibdata(ifp->if_row, &ifp->if_mib); - new_inb = ifp->if_mib.ifmd_data.ifi_ibytes; new_outb = ifp->if_mib.ifmd_data.ifi_obytes; Modified: head/usr.bin/systat/iostat.c ============================================================================== --- head/usr.bin/systat/iostat.c Sun Feb 5 08:53:05 2012 (r231010) +++ head/usr.bin/systat/iostat.c Sun Feb 5 09:17:49 2012 (r231011) @@ -254,7 +254,6 @@ barlabels(int row) return (row); } - void showiostat(void) { Modified: head/usr.bin/systat/ip.c ============================================================================== --- head/usr.bin/systat/ip.c Sun Feb 5 08:53:05 2012 (r231010) +++ head/usr.bin/systat/ip.c Sun Feb 5 09:17:49 2012 (r231011) @@ -337,4 +337,3 @@ fetchip(void) if (sysctl(name, 4, &curstat.u, &len, 0, 0) < 0) return; } - Modified: head/usr.bin/systat/netcmds.c ============================================================================== --- head/usr.bin/systat/netcmds.c Sun Feb 5 08:53:05 2012 (r231010) +++ head/usr.bin/systat/netcmds.c Sun Feb 5 09:17:49 2012 (r231011) @@ -121,7 +121,6 @@ netcmd(const char *cmd, const char *args return (0); } - static void changeitems(const char *args, int onoff) { Modified: head/usr.bin/systat/netstat.c ============================================================================== --- head/usr.bin/systat/netstat.c Sun Feb 5 08:53:05 2012 (r231010) +++ head/usr.bin/systat/netstat.c Sun Feb 5 09:17:49 2012 (r231011) @@ -349,7 +349,6 @@ enter_sysctl(struct inpcb *inp, struct x } } - static struct netinfo * enter(struct inpcb *inp, int state, const char *proto) { @@ -437,7 +436,6 @@ enter(struct inpcb *inp, int state, cons #define SNDCC RCVCC+7 #define STATE SNDCC+7 - void labelnetstat(void) { Modified: head/usr.bin/systat/pigs.c ============================================================================== --- head/usr.bin/systat/pigs.c Sun Feb 5 08:53:05 2012 (r231010) +++ head/usr.bin/systat/pigs.c Sun Feb 5 09:17:49 2012 (r231011) @@ -81,7 +81,6 @@ closepigs(WINDOW *w) delwin(w); } - void showpigs(void) { Modified: head/usr.bin/systat/tcp.c ============================================================================== --- head/usr.bin/systat/tcp.c Sun Feb 5 08:53:05 2012 (r231010) +++ head/usr.bin/systat/tcp.c Sun Feb 5 09:17:49 2012 (r231011) @@ -324,4 +324,3 @@ fetchtcp(void) if (sysctl(name, 4, &curstat, &len, 0, 0) < 0) return; } - From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 09:40:54 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CCBC1065673; Sun, 5 Feb 2012 09:40:54 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 07C788FC17; Sun, 5 Feb 2012 09:40:53 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 38121624; Sun, 5 Feb 2012 10:40:52 +0100 (CET) Date: Sun, 5 Feb 2012 10:39:38 +0100 From: Pawel Jakub Dawidek To: Mikolaj Golub Message-ID: <20120205093938.GC30033@garage.freebsd.pl> References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UPT3ojh+0CqEDtpF" Content-Disposition: inline In-Reply-To: <86zkcy5ur9.fsf@kopusha.home.net> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 09:40:54 -0000 --UPT3ojh+0CqEDtpF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 04, 2012 at 08:16:42PM +0200, Mikolaj Golub wrote: > ref8-amd64:/home/trociny% uname -r > 8.2-STABLE > ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 > ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 > daemon: process already running, pid: 19799 >=20 > kopusha:~% uname -r =20 > 10.0-CURRENT > kopusha:~% daemon -p /tmp/sleep.pid sleep 10 > kopusha:~% daemon -p /tmp/sleep.pid sleep 10 > kopusha:~%=20 Mikolaj, eventhough what we had in 8.2-STABLE looks correct, it also isn't correct. Passing open descriptor to a process that doesn't expect that is bad behaviour. If you pass, eg. open descriptor to a directory and the process is using chroot(2) or jail(2) to sandbox itself it will be able to escape from that sandbox. Passing descriptor to a file has smaller security implication, but it is still wrong. For example hastd, as you probably know, asserts, before sandboxing, that he knows about all open descriptors - if there are some unknown descriptors open it won't run. Also, daemon was passing open descriptor to a pidfile that the child process cannot clean up, because he doesn't know its name. This leaves pidfile with stale PID in it once the process exits, which is also bad. In my opinion, to make daemon(8) work with pidfiles, it cannot exit after executing the given command. It should stay around with pidfile open and just wait for the child to exit. Once the child exits, it should remove the pidfile and also exit. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --UPT3ojh+0CqEDtpF Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8uTloACgkQForvXbEpPzTCcACgqsmztAXiyZj/9qGD/Gs5FQix lV8Anj5C6M3S6VkO/I8cBwIh94U+hzrQ =Nzp3 -----END PGP SIGNATURE----- --UPT3ojh+0CqEDtpF-- From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 10:00:38 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A6D7A106566C; Sun, 5 Feb 2012 10:00:38 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 53DE38FC14; Sun, 5 Feb 2012 10:00:38 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id D0751635; Sun, 5 Feb 2012 11:00:36 +0100 (CET) Date: Sun, 5 Feb 2012 10:59:22 +0100 From: Pawel Jakub Dawidek To: Guy Helmer Message-ID: <20120205095922.GD30033@garage.freebsd.pl> References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <74AF334B-CD90-4A43-96C4-1CF69C8EA42B@palisadesystems.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="TybLhxa8M7aNoW+V" Content-Disposition: inline In-Reply-To: <74AF334B-CD90-4A43-96C4-1CF69C8EA42B@palisadesystems.com> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 10:00:38 -0000 --TybLhxa8M7aNoW+V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 04, 2012 at 10:32:56AM -0600, Guy Helmer wrote: >=20 > On Feb 4, 2012, at 1:42 AM, Pawel Jakub Dawidek wrote: >=20 > > On Wed, Feb 01, 2012 at 04:41:00PM +0000, Guy Helmer wrote: > >> Author: ghelmer > >> Date: Wed Feb 1 16:40:59 2012 > >> New Revision: 230869 > >> URL: http://svn.freebsd.org/changeset/base/230869 > >>=20 > >> Log: > >> Change the notes about the pidfile to include Doug's preference > >> for pre-creating the pidfile with appropriate owner and permissions. > >>=20 > >> Requested by dougb > >=20 > > Pre-creating pidfiles? That sounds weird. The common practise is to turn > > eg. /var/run/.pid into /var/run//pid where directory > > has appropriate permissions. Pre-creating pidfiles is simply wrong, > > because applications create pidfile on start and unlink it on exit. > > If application has no permission to remove files from /var/run/ it will > > leave pidfile with stale PID in it, which is bad. Changing application > > to truncate pidfile on exit instead of unlinking it also is a bad idea > > especially because there is working solution - pid directory. >=20 > I prefer this approach, but dougb prefers the other approach. Each has po= sitives and negatives. I tried to accommodate both approaches. I seem to miss positives of the other approach. Leaving stale PIDs in pidfile is something we should avoid at all costs, so recommending that in the manual page is not the best recommendation. I for one would prefer to recommend against it. Even if pidfile is truncated on exit it still leave a mess in /var/run/. But currently it is not truncated on exit (pidfile(3) just unlinks the file, without truncating it first), so we end up with stale PIDs. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --TybLhxa8M7aNoW+V Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8uUvoACgkQForvXbEpPzQgKwCfSTpBlcqXLjv04P0OEz3ylK8q Us4AoPG0JMJ/P88IbMb39P+d4Q/wj06z =aepb -----END PGP SIGNATURE----- --TybLhxa8M7aNoW+V-- From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 10:59:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E8E17106566B; Sun, 5 Feb 2012 10:59:50 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7F458FC0C; Sun, 5 Feb 2012 10:59:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15AxoWG079846; Sun, 5 Feb 2012 10:59:50 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15AxoaY079844; Sun, 5 Feb 2012 10:59:50 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202051059.q15AxoaY079844@svn.freebsd.org> From: Martin Matuska Date: Sun, 5 Feb 2012 10:59:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231012 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 10:59:51 -0000 Author: mm Date: Sun Feb 5 10:59:50 2012 New Revision: 231012 URL: http://svn.freebsd.org/changeset/base/231012 Log: Analogous to r230407 a separate path buffer in vfs_mount.c is required for r230129. Fixes a out of bounds write to fspath. MFC after: 10 days Modified: head/sys/kern/vfs_mount.c Modified: head/sys/kern/vfs_mount.c ============================================================================== --- head/sys/kern/vfs_mount.c Sun Feb 5 09:17:49 2012 (r231011) +++ head/sys/kern/vfs_mount.c Sun Feb 5 10:59:50 2012 (r231012) @@ -1039,6 +1039,7 @@ vfs_domount( struct vfsconf *vfsp; struct nameidata nd; struct vnode *vp; + char *pathbuf; int error; /* @@ -1102,12 +1103,15 @@ vfs_domount( NDFREE(&nd, NDF_ONLY_PNBUF); vp = nd.ni_vp; if ((fsflags & MNT_UPDATE) == 0) { - error = vn_path_to_global_path(td, vp, fspath, MNAMELEN); + pathbuf = malloc(MNAMELEN, M_TEMP, M_WAITOK); + strcpy(pathbuf, fspath); + error = vn_path_to_global_path(td, vp, pathbuf, MNAMELEN); /* debug.disablefullpath == 1 results in ENODEV */ if (error == 0 || error == ENODEV) { - error = vfs_domount_first(td, vfsp, fspath, vp, + error = vfs_domount_first(td, vfsp, pathbuf, vp, fsflags, optlist); } + free(pathbuf, M_TEMP); } else error = vfs_domount_update(td, vp, fsflags, optlist); mtx_unlock(&Giant); From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 12:46:58 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id CFCF21065670; Sun, 5 Feb 2012 12:46:58 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-150-251.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id CF259152746; Sun, 5 Feb 2012 12:46:54 +0000 (UTC) Message-ID: <4F2E7A3D.8080107@FreeBSD.org> Date: Sun, 05 Feb 2012 04:46:53 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:10.0) Gecko/20120201 Thunderbird/10.0 MIME-Version: 1.0 To: Pawel Jakub Dawidek References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <74AF334B-CD90-4A43-96C4-1CF69C8EA42B@palisadesystems.com> <20120205095922.GD30033@garage.freebsd.pl> In-Reply-To: <20120205095922.GD30033@garage.freebsd.pl> X-Enigmail-Version: 1.3.5 OpenPGP: id=1A1ABC84 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enigFF0521E5838021636E017BFA" Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 12:46:58 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigFF0521E5838021636E017BFA Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 02/05/2012 01:59, Pawel Jakub Dawidek wrote: > I seem to miss positives of the other approach. Leaving stale PIDs in > pidfile is something we should avoid at all costs, so recommending that= > in the manual page is not the best recommendation.=20 Which is worse ... potentially stale pidfiles that get cleaned up at every boot, or stale directories that never do? I'm also not sure why you think this method will leave behind a stale pidfile. The idea is that the pidfile is pre-created with the ownership that daemon is going to su to, for the express purpose of allowing it to delete the pidfile when the process exits. If you're saying that this method doesn't work then please point out the problem ASAP because numerous ports rc.d scripts do this now. Doug --=20 It's always a long day; 86400 doesn't fit into a short. Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ --------------enigFF0521E5838021636E017BFA Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iQEcBAEBCAAGBQJPLno+AAoJEFzGhvEaGryElFgH/RvHS89EyN3lc2pyWH+jnkCv +U8RI1um7BsZXLh5DpqtgawGzz13x5pd8dikDqmbAoqWQwCJfGWksywdiQP+z/KW 0EM/0YKYH09EdzzyI1Vl+gkajreHHLfUTse19vDubCsKuqje4AqmMEmU4fz1ry6z fNm/UNUG42gJCi0ytL1RlEHc810g+akYkGWknjDav/RDUFINjQxmrNUWOI0WgBUx OdTg7MhdXK6LWP6kjaB/j2Ur8B5wCrhfrqFQpStVqreVhxl3aOM13wNsEPGHrd2Z xgSlyMOW/mYHMGXKzccLdSGwEKipGJ+OFYCygSRgyHj4uXuykm2gZFBSFWIP8qo= =WPR0 -----END PGP SIGNATURE----- --------------enigFF0521E5838021636E017BFA-- From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 12:52:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C6896106566B; Sun, 5 Feb 2012 12:52:28 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B5AA28FC18; Sun, 5 Feb 2012 12:52:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15CqSfb083289; Sun, 5 Feb 2012 12:52:28 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15CqS91083287; Sun, 5 Feb 2012 12:52:28 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202051252.q15CqS91083287@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 5 Feb 2012 12:52:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231013 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 12:52:28 -0000 Author: glebius Date: Sun Feb 5 12:52:28 2012 New Revision: 231013 URL: http://svn.freebsd.org/changeset/base/231013 Log: Fix typo in r231010. Submitted by: linimon Modified: head/sys/net/if.c Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Sun Feb 5 10:59:50 2012 (r231012) +++ head/sys/net/if.c Sun Feb 5 12:52:28 2012 (r231013) @@ -1408,7 +1408,7 @@ if_maddr_runlock(struct ifnet *ifp) } /* - * Initialization, desctruction and refcounting functions for ifaddrs. + * Initialization, destruction and refcounting functions for ifaddrs. */ void ifa_init(struct ifaddr *ifa) From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 13:29:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8A26210656A5; Sun, 5 Feb 2012 13:29:02 +0000 (UTC) (envelope-from jhibbits@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5EF778FC1E; Sun, 5 Feb 2012 13:29:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15DT2Ff084402; Sun, 5 Feb 2012 13:29:02 GMT (envelope-from jhibbits@svn.freebsd.org) Received: (from jhibbits@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15DT1kB084400; Sun, 5 Feb 2012 13:29:01 GMT (envelope-from jhibbits@svn.freebsd.org) Message-Id: <201202051329.q15DT1kB084400@svn.freebsd.org> From: Justin Hibbits Date: Sun, 5 Feb 2012 13:29:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231014 - head/sys/modules X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 13:29:02 -0000 Author: jhibbits Date: Sun Feb 5 13:29:01 2012 New Revision: 231014 URL: http://svn.freebsd.org/changeset/base/231014 Log: Add exca to powerpc modules build as a dependency for cbb. Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile ============================================================================== --- head/sys/modules/Makefile Sun Feb 5 12:52:28 2012 (r231013) +++ head/sys/modules/Makefile Sun Feb 5 13:29:01 2012 (r231014) @@ -764,6 +764,7 @@ _cardbus= cardbus _cbb= cbb _cfi= cfi _cpufreq= cpufreq +_exca= exca _nvram= powermac_nvram _pccard= pccard _smbfs= smbfs From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 13:52:49 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AB87F1065670; Sun, 5 Feb 2012 13:52:49 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 577E88FC0A; Sun, 5 Feb 2012 13:52:49 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 547446D0; Sun, 5 Feb 2012 14:52:47 +0100 (CET) Date: Sun, 5 Feb 2012 14:51:33 +0100 From: Pawel Jakub Dawidek To: Doug Barton Message-ID: <20120205135131.GG30033@garage.freebsd.pl> References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <74AF334B-CD90-4A43-96C4-1CF69C8EA42B@palisadesystems.com> <20120205095922.GD30033@garage.freebsd.pl> <4F2E7A3D.8080107@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="m972NQjnE83KvVa/" Content-Disposition: inline In-Reply-To: <4F2E7A3D.8080107@FreeBSD.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 13:52:49 -0000 --m972NQjnE83KvVa/ Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 05, 2012 at 04:46:53AM -0800, Doug Barton wrote: > On 02/05/2012 01:59, Pawel Jakub Dawidek wrote: >=20 > > I seem to miss positives of the other approach. Leaving stale PIDs in > > pidfile is something we should avoid at all costs, so recommending that > > in the manual page is not the best recommendation.=20 >=20 > Which is worse ... potentially stale pidfiles that get cleaned up at > every boot, or stale directories that never do? Every boot might be very rare situation on servers. Those directories should be cleaned when application is deinstalled and not when process exits. > I'm also not sure why you think this method will leave behind a stale > pidfile. The idea is that the pidfile is pre-created with the ownership > that daemon is going to su to, for the express purpose of allowing it to > delete the pidfile when the process exits. If you're saying that this > method doesn't work then please point out the problem ASAP because > numerous ports rc.d scripts do this now. Great, but this is not how UNIX permissions work. To remove directory entry you have to have rights to modify the directory. Having write permission to file within the directory won't allow you to remove it. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --m972NQjnE83KvVa/ Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8uiWMACgkQForvXbEpPzTwVACfTREBUze/Wxv98p0JKuqZ6kQE RLgAnjQWJISuF1L4C5y97X/keDPGi+eX =ufav -----END PGP SIGNATURE----- --m972NQjnE83KvVa/-- From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 13:53:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EEFE21065672 for ; Sun, 5 Feb 2012 13:53:49 +0000 (UTC) (envelope-from chmeeedalf@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id B71478FC13 for ; Sun, 5 Feb 2012 13:53:49 +0000 (UTC) Received: by iaeo4 with SMTP id o4so10912819iae.13 for ; Sun, 05 Feb 2012 05:53:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=cc:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; bh=dxyW2yIiTe46XNOpNFyjHpUK0JTk1qayWvl1EEg/i2k=; b=kCmqy9UWyhv5GLxRIaImW1+nVPa4VE4Tiv/YLsjD3sRPPDNNn1GixlaNrtBZWIiTZk sJbWJdeUvM7J1HvteiybD71GhDWZzHE2Z6GV3UlS37bDA4n/7tkToqOQvcxlphwD2uup 2Oq5ko6CgzHgQQTXj84+P/SgiXsbO1sMwqSuk= Received: by 10.42.107.9 with SMTP id b9mr7896587icp.23.1328448661844; Sun, 05 Feb 2012 05:31:01 -0800 (PST) Received: from triad.knownspace (216-15-41-8.c3-0.gth-ubr1.lnh-gth.md.cable.rcn.com. [216.15.41.8]) by mx.google.com with ESMTPS id l28sm21085130ibc.3.2012.02.05.05.31.00 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 05 Feb 2012 05:31:00 -0800 (PST) Message-Id: <7D839B6E-E8CD-463B-B117-BCB07F07EF20@gmail.com> From: Justin Hibbits To: Justin Hibbits In-Reply-To: <201202051329.q15DT1kB084400@svn.freebsd.org> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Date: Sun, 5 Feb 2012 08:28:37 -0500 References: <201202051329.q15DT1kB084400@svn.freebsd.org> X-Mailer: Apple Mail (2.936) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231014 - head/sys/modules X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 13:53:50 -0000 On Feb 5, 2012, at 8:29 AM, Justin Hibbits wrote: > Author: jhibbits > Date: Sun Feb 5 13:29:01 2012 > New Revision: 231014 > URL: http://svn.freebsd.org/changeset/base/231014 > > Log: > Add exca to powerpc modules build as a dependency for cbb. Approved by: nwhitehorn (mentor) sigh. I really should stop committing first thing in the morning. From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 15:21:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DCA7D1065674; Sun, 5 Feb 2012 15:21:08 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CBBF68FC14; Sun, 5 Feb 2012 15:21:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15FL8lN088404; Sun, 5 Feb 2012 15:21:08 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15FL800088402; Sun, 5 Feb 2012 15:21:08 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201202051521.q15FL800088402@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 5 Feb 2012 15:21:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231015 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 15:21:09 -0000 Author: trociny Date: Sun Feb 5 15:21:08 2012 New Revision: 231015 URL: http://svn.freebsd.org/changeset/base/231015 Log: Fix the regression introduced in r226859: if the local component is out of date BIO_READ requests got lost instead of being sent to the remote component. Reviewed by: pjd MFC after: 1 week Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Sun Feb 5 13:29:01 2012 (r231014) +++ head/sbin/hastd/primary.c Sun Feb 5 15:21:08 2012 (r231015) @@ -1255,7 +1255,7 @@ ggate_recv_thread(void *arg) pjdlog_debug(2, "ggate_recv: (%p) Moving request to the send queues.", hio); refcount_init(&hio->hio_countdown, ncomps); - for (ii = ncomp; ii < ncomps; ii++) + for (ii = ncomp; ii < ncomp + ncomps; ii++) QUEUE_INSERT1(hio, send, ii); } /* NOTREACHED */ From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 15:23:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 20ABE106566C; Sun, 5 Feb 2012 15:23:33 +0000 (UTC) (envelope-from trociny@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0FE5C8FC0A; Sun, 5 Feb 2012 15:23:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15FNWsY088524; Sun, 5 Feb 2012 15:23:32 GMT (envelope-from trociny@svn.freebsd.org) Received: (from trociny@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15FNWUQ088522; Sun, 5 Feb 2012 15:23:32 GMT (envelope-from trociny@svn.freebsd.org) Message-Id: <201202051523.q15FNWUQ088522@svn.freebsd.org> From: Mikolaj Golub Date: Sun, 5 Feb 2012 15:23:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231016 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 15:23:33 -0000 Author: trociny Date: Sun Feb 5 15:23:32 2012 New Revision: 231016 URL: http://svn.freebsd.org/changeset/base/231016 Log: If a local write request is from the synchronization thread, when it is synchronizing data that is out of date on the local component, we should not send G_GATE_CMD_DONE acknowledge to the kernel. This fixes the issue, observed in async mode, when on synchronization from the remote component the worker terminated with "G_GATE_CMD_DONE failed" error. Reported by: Artem Kajalainen Reviewed by: pjd MFC after: 1 week Modified: head/sbin/hastd/primary.c Modified: head/sbin/hastd/primary.c ============================================================================== --- head/sbin/hastd/primary.c Sun Feb 5 15:21:08 2012 (r231015) +++ head/sbin/hastd/primary.c Sun Feb 5 15:23:32 2012 (r231016) @@ -1326,7 +1326,8 @@ local_send_thread(void *arg) } else { hio->hio_errors[ncomp] = 0; if (hio->hio_replication == - HAST_REPLICATION_ASYNC) { + HAST_REPLICATION_ASYNC && + !ISSYNCREQ(hio)) { ggio->gctl_error = 0; write_complete(res, hio); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 15:59:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 324071065672; Sun, 5 Feb 2012 15:59:19 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 210F88FC14; Sun, 5 Feb 2012 15:59:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15FxI7Y089922; Sun, 5 Feb 2012 15:59:18 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15FxIMQ089920; Sun, 5 Feb 2012 15:59:18 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201202051559.q15FxIMQ089920@svn.freebsd.org> From: Andreas Tobler Date: Sun, 5 Feb 2012 15:59:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231019 - head/sys/powerpc/aim X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 15:59:19 -0000 Author: andreast Date: Sun Feb 5 15:59:18 2012 New Revision: 231019 URL: http://svn.freebsd.org/changeset/base/231019 Log: Revert the _NOPROF entries on cpu_throw, cpu_switch and savectx. They can be profiled too now. MFC after: 2 weeks Modified: head/sys/powerpc/aim/swtch64.S Modified: head/sys/powerpc/aim/swtch64.S ============================================================================== --- head/sys/powerpc/aim/swtch64.S Sun Feb 5 15:54:32 2012 (r231018) +++ head/sys/powerpc/aim/swtch64.S Sun Feb 5 15:59:18 2012 (r231019) @@ -68,7 +68,7 @@ /* * void cpu_throw(struct thread *old, struct thread *new) */ -ENTRY_NOPROF(cpu_throw) +ENTRY(cpu_throw) mr %r13, %r4 b cpu_switchin @@ -79,7 +79,7 @@ ENTRY_NOPROF(cpu_throw) * * Switch to a new thread saving the current state in the old thread. */ -ENTRY_NOPROF(cpu_switch) +ENTRY(cpu_switch) ld %r6,TD_PCB(%r3) /* Get the old thread's PCB ptr */ std %r12,PCB_CONTEXT(%r6) /* Save the non-volatile GP regs. These can now be used for scratch */ @@ -237,7 +237,7 @@ blocked_loop: * savectx(pcb) * Update pcb, saving current processor state */ -ENTRY_NOPROF(savectx) +ENTRY(savectx) std %r12,PCB_CONTEXT(%r3) /* Save the non-volatile GP regs. */ std %r13,PCB_CONTEXT+1*8(%r3) std %r14,PCB_CONTEXT+2*8(%r3) From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 16:16:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9AD27106566C; Sun, 5 Feb 2012 16:16:24 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from mail.icecube.wisc.edu (trout.icecube.wisc.edu [128.104.255.119]) by mx1.freebsd.org (Postfix) with ESMTP id 6B08B8FC0A; Sun, 5 Feb 2012 16:16:24 +0000 (UTC) Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.icecube.wisc.edu (Postfix) with ESMTP id F12675824F; Sun, 5 Feb 2012 09:49:12 -0600 (CST) X-Virus-Scanned: amavisd-new at icecube.wisc.edu Received: from mail.icecube.wisc.edu ([127.0.0.1]) by localhost (trout.icecube.wisc.edu [127.0.0.1]) (amavisd-new, port 10030) with ESMTP id 5gpzRRBTdP2p; Sun, 5 Feb 2012 09:49:12 -0600 (CST) Received: from elpis.tachypleus.net (adsl-76-208-68-223.dsl.mdsnwi.sbcglobal.net [76.208.68.223]) by mail.icecube.wisc.edu (Postfix) with ESMTP id 4844F58141; Sun, 5 Feb 2012 09:49:12 -0600 (CST) Message-ID: <4F2EA4F7.9010204@freebsd.org> Date: Sun, 05 Feb 2012 09:49:11 -0600 From: Nathan Whitehorn User-Agent: Mozilla/5.0 (X11; U; FreeBSD powerpc; en-US; rv:1.9.2.13) Gecko/20110202 Thunderbird/3.1.7 MIME-Version: 1.0 To: TAKAHASHI Yoshihiro References: <201201231544.q0NFirMh032859@svn.freebsd.org> <20120123160340.GI95413@hoeg.nl> <1F971DB2-9CC6-41C9-9296-039D63E05FC2@FreeBSD.org> <20120128.193030.322386357550021613.nyan@FreeBSD.org> In-Reply-To: <20120128.193030.322386357550021613.nyan@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, ed@80386.nl, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230482 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 16:16:24 -0000 On 01/28/12 04:30, TAKAHASHI Yoshihiro wrote: > In article<1F971DB2-9CC6-41C9-9296-039D63E05FC2@FreeBSD.org> > Nathan Whitehorn writes: > >> I think we didn't make PC98 release media for 9.0, but that's a good >> point. I'm out of commission right now due to an injury, so patches >> would be welcome. >>>> TERM=xterm >>> This code is also used on pc98, right? I think on pc98 we still need >>> to >>> use TERM=cons25w, to support Japanese character sets and keyboard >>> input. > How about the attached patch? > > --- > TAKAHASHI Yoshihiro The top half looks OK. The bottom half (the menu) is relevant only for serial consoles. I guess people could be viewing a remote serial console on a PC-98 graphics console, but then it shouldn't be conditionalized on PC98 machines. -Nathan From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 16:41:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A5FD106566B; Sun, 5 Feb 2012 16:41:07 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ED8F98FC19; Sun, 5 Feb 2012 16:41:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15Gf60Q091588; Sun, 5 Feb 2012 16:41:06 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15Gf6vE091586; Sun, 5 Feb 2012 16:41:06 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201202051641.q15Gf6vE091586@svn.freebsd.org> From: Alexander Motin Date: Sun, 5 Feb 2012 16:41:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231024 - head/sys/dev/sound/pci/hda X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 16:41:07 -0000 Author: mav Date: Sun Feb 5 16:41:06 2012 New Revision: 231024 URL: http://svn.freebsd.org/changeset/base/231024 Log: Remove extra semicolon. Submitted by: emaste Modified: head/sys/dev/sound/pci/hda/hdacc.c Modified: head/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- head/sys/dev/sound/pci/hda/hdacc.c Sun Feb 5 16:23:55 2012 (r231023) +++ head/sys/dev/sound/pci/hda/hdacc.c Sun Feb 5 16:41:06 2012 (r231024) @@ -612,7 +612,7 @@ hdacc_stream_intr(device_t dev, int dir, struct hdacc_softc *codec = device_get_softc(dev); device_t child; - if ((child = codec->streams[dir][stream]) != NULL); + if ((child = codec->streams[dir][stream]) != NULL) HDAC_STREAM_INTR(child, dir, stream); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 16:53:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 69EFB106566B; Sun, 5 Feb 2012 16:53:03 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5746D8FC14; Sun, 5 Feb 2012 16:53:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15Gr3rx092066; Sun, 5 Feb 2012 16:53:03 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15Gr3AB092056; Sun, 5 Feb 2012 16:53:03 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202051653.q15Gr3AB092056@svn.freebsd.org> From: Gleb Smirnoff Date: Sun, 5 Feb 2012 16:53:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231025 - in head: share/man/man4 sys/netinet sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 16:53:03 -0000 Author: glebius Date: Sun Feb 5 16:53:02 2012 New Revision: 231025 URL: http://svn.freebsd.org/changeset/base/231025 Log: Add new socket options: TCP_KEEPINIT, TCP_KEEPIDLE, TCP_KEEPINTVL and TCP_KEEPCNT, that allow to control initial timeout, idle time, idle re-send interval and idle send count on a per-socket basis. Reviewed by: andre, bz, lstewart Modified: head/share/man/man4/tcp.4 head/sys/netinet/tcp.h head/sys/netinet/tcp_input.c head/sys/netinet/tcp_syncache.c head/sys/netinet/tcp_timer.c head/sys/netinet/tcp_timer.h head/sys/netinet/tcp_usrreq.c head/sys/netinet/tcp_var.h head/sys/sys/param.h Modified: head/share/man/man4/tcp.4 ============================================================================== --- head/share/man/man4/tcp.4 Sun Feb 5 16:41:06 2012 (r231024) +++ head/share/man/man4/tcp.4 Sun Feb 5 16:53:02 2012 (r231025) @@ -38,7 +38,7 @@ .\" From: @(#)tcp.4 8.1 (Berkeley) 6/5/93 .\" $FreeBSD$ .\" -.Dd November 14, 2011 +.Dd February 5, 2012 .Dt TCP 4 .Os .Sh NAME @@ -146,6 +146,65 @@ connection. See .Xr mod_cc 4 for details. +.It Dv TCP_KEEPINIT +This write-only +.Xr setsockopt 2 +option accepts a per-socket timeout argument of +.Vt "u_int" +in seconds, for new, non-established +.Tn TCP +connections. +For the global default in milliseconds see +.Va keepinit +in the +.Sx MIB Variables +section further down. +.It Dv TCP_KEEPIDLE +This write-only +.Xr setsockopt 2 +option accepts an argument of +.Vt "u_int" +for the amount of time, in seconds, that the connection must be idle +before keepalive probes (if enabled) are sent for the connection of this +socket. +If set on a listening socket, the value is inherited by the newly created +socket upon +.Xr accept 2 . +For the global default in milliseconds see +.Va keepidle +in the +.Sx MIB Variables +section further down. +.It Dv TCP_KEEPINTVL +This write-only +.Xr setsockopt 2 +option accepts an argument of +.Vt "u_int" +to set the per-socket interval, in seconds, between keepalive probes sent +to a peer. +If set on a listening socket, the value is inherited by the newly created +socket upon +.Xr accept 2 . +For the global default in milliseconds see +.Va keepintvl +in the +.Sx MIB Variables +section further down. +.It Dv TCP_KEEPCNT +This write-only +.Xr setsockopt 2 +option accepts an argument of +.Vt "u_int" +and allows a per-socket tuning of the number of probes sent, with no response, +before the connection will be dropped. +If set on a listening socket, the value is inherited by the newly created +socket upon +.Xr accept 2 . +For the global default see the +.Va keepcnt +in the +.Sx MIB Variables +section further down. .It Dv TCP_NODELAY Under most circumstances, .Tn TCP @@ -296,17 +355,21 @@ The Maximum Segment Lifetime, in millise Timeout, in milliseconds, for new, non-established .Tn TCP connections. +The default is 75000 msec. .It Va keepidle Amount of time, in milliseconds, that the connection must be idle before keepalive probes (if enabled) are sent. +The default is 7200000 msec (2 hours). .It Va keepintvl The interval, in milliseconds, between keepalive probes sent to remote machines, when no response is received on a .Va keepidle probe. -After -.Dv TCPTV_KEEPCNT -(default 8) probes are sent, with no response, the connection is dropped. +The default is 75000 msec. +.It Va keepcnt +Number of probes sent, with no response, before a connection +is dropped. +The default is 8 packets. .It Va always_keepalive Assume that .Dv SO_KEEPALIVE Modified: head/sys/netinet/tcp.h ============================================================================== --- head/sys/netinet/tcp.h Sun Feb 5 16:41:06 2012 (r231024) +++ head/sys/netinet/tcp.h Sun Feb 5 16:53:02 2012 (r231025) @@ -159,6 +159,10 @@ struct tcphdr { #define TCP_MD5SIG 0x10 /* use MD5 digests (RFC2385) */ #define TCP_INFO 0x20 /* retrieve tcp_info structure */ #define TCP_CONGESTION 0x40 /* get/set congestion control algorithm */ +#define TCP_KEEPINIT 0x80 /* N, time to establish connection */ +#define TCP_KEEPIDLE 0x100 /* L,N,X start keeplives after this period */ +#define TCP_KEEPINTVL 0x200 /* L,N interval between keepalives */ +#define TCP_KEEPCNT 0x400 /* L,N number of keepalives before close */ #define TCP_CA_NAME_MAX 16 /* max congestion control name length */ Modified: head/sys/netinet/tcp_input.c ============================================================================== --- head/sys/netinet/tcp_input.c Sun Feb 5 16:41:06 2012 (r231024) +++ head/sys/netinet/tcp_input.c Sun Feb 5 16:53:02 2012 (r231025) @@ -1446,7 +1446,7 @@ tcp_do_segment(struct mbuf *m, struct tc */ tp->t_rcvtime = ticks; if (TCPS_HAVEESTABLISHED(tp->t_state)) - tcp_timer_activate(tp, TT_KEEP, tcp_keepidle); + tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp)); /* * Unscale the window into a 32-bit value. @@ -1889,7 +1889,8 @@ tcp_do_segment(struct mbuf *m, struct tc } else { tp->t_state = TCPS_ESTABLISHED; cc_conn_init(tp); - tcp_timer_activate(tp, TT_KEEP, tcp_keepidle); + tcp_timer_activate(tp, TT_KEEP, + TP_KEEPIDLE(tp)); } } else { /* @@ -2293,7 +2294,7 @@ tcp_do_segment(struct mbuf *m, struct tc } else { tp->t_state = TCPS_ESTABLISHED; cc_conn_init(tp); - tcp_timer_activate(tp, TT_KEEP, tcp_keepidle); + tcp_timer_activate(tp, TT_KEEP, TP_KEEPIDLE(tp)); } /* * If segment contains data or ACK, will call tcp_reass() @@ -2630,12 +2631,11 @@ process_ACK: * compressed state. */ if (so->so_rcv.sb_state & SBS_CANTRCVMORE) { - int timeout; - soisdisconnected(so); - timeout = (tcp_fast_finwait2_recycle) ? - tcp_finwait2_timeout : tcp_maxidle; - tcp_timer_activate(tp, TT_2MSL, timeout); + tcp_timer_activate(tp, TT_2MSL, + (tcp_fast_finwait2_recycle ? + tcp_finwait2_timeout : + TP_MAXIDLE(tp))); } tp->t_state = TCPS_FIN_WAIT_2; } Modified: head/sys/netinet/tcp_syncache.c ============================================================================== --- head/sys/netinet/tcp_syncache.c Sun Feb 5 16:41:06 2012 (r231024) +++ head/sys/netinet/tcp_syncache.c Sun Feb 5 16:53:02 2012 (r231025) @@ -845,7 +845,15 @@ syncache_socket(struct syncache *sc, str */ if (sc->sc_rxmits > 1) tp->snd_cwnd = tp->t_maxseg; - tcp_timer_activate(tp, TT_KEEP, tcp_keepinit); + + /* + * Copy and activate timers. + */ + tp->t_keepinit = sototcpcb(lso)->t_keepinit; + tp->t_keepidle = sototcpcb(lso)->t_keepidle; + tp->t_keepintvl = sototcpcb(lso)->t_keepintvl; + tp->t_keepcnt = sototcpcb(lso)->t_keepcnt; + tcp_timer_activate(tp, TT_KEEP, TP_KEEPINIT(tp)); INP_WUNLOCK(inp); Modified: head/sys/netinet/tcp_timer.c ============================================================================== --- head/sys/netinet/tcp_timer.c Sun Feb 5 16:41:06 2012 (r231024) +++ head/sys/netinet/tcp_timer.c Sun Feb 5 16:53:02 2012 (r231025) @@ -111,12 +111,12 @@ int tcp_finwait2_timeout; SYSCTL_PROC(_net_inet_tcp, OID_AUTO, finwait2_timeout, CTLTYPE_INT|CTLFLAG_RW, &tcp_finwait2_timeout, 0, sysctl_msec_to_ticks, "I", "FIN-WAIT2 timeout"); +int tcp_keepcnt = TCPTV_KEEPCNT; +SYSCTL_INT(_net_inet_tcp, OID_AUTO, keepcnt, CTLFLAG_RW, &tcp_keepcnt, 0, + "Number of keepalive probes to send"); -static int tcp_keepcnt = TCPTV_KEEPCNT; /* max idle probes */ int tcp_maxpersistidle; - /* max idle time in persist */ -int tcp_maxidle; static int per_cpu_timers = 0; SYSCTL_INT(_net_inet_tcp, OID_AUTO, per_cpu_timers, CTLFLAG_RW, @@ -138,7 +138,6 @@ tcp_slowtimo(void) VNET_LIST_RLOCK_NOSLEEP(); VNET_FOREACH(vnet_iter) { CURVNET_SET(vnet_iter); - tcp_maxidle = tcp_keepcnt * tcp_keepintvl; INP_INFO_WLOCK(&V_tcbinfo); (void) tcp_tw_2msl_scan(0); INP_INFO_WUNLOCK(&V_tcbinfo); @@ -255,9 +254,9 @@ tcp_timer_2msl(void *xtp) tp = tcp_close(tp); } else { if (tp->t_state != TCPS_TIME_WAIT && - ticks - tp->t_rcvtime <= tcp_maxidle) - callout_reset_on(&tp->t_timers->tt_2msl, tcp_keepintvl, - tcp_timer_2msl, tp, INP_CPU(inp)); + ticks - tp->t_rcvtime <= TP_MAXIDLE(tp)) + callout_reset_on(&tp->t_timers->tt_2msl, + TP_KEEPINTVL(tp), tcp_timer_2msl, tp, INP_CPU(inp)); else tp = tcp_close(tp); } @@ -318,7 +317,7 @@ tcp_timer_keep(void *xtp) goto dropit; if ((always_keepalive || inp->inp_socket->so_options & SO_KEEPALIVE) && tp->t_state <= TCPS_CLOSING) { - if (ticks - tp->t_rcvtime >= tcp_keepidle + tcp_maxidle) + if (ticks - tp->t_rcvtime >= TP_KEEPIDLE(tp) + TP_MAXIDLE(tp)) goto dropit; /* * Send a packet designed to force a response @@ -340,9 +339,11 @@ tcp_timer_keep(void *xtp) tp->rcv_nxt, tp->snd_una - 1, 0); free(t_template, M_TEMP); } - callout_reset_on(&tp->t_timers->tt_keep, tcp_keepintvl, tcp_timer_keep, tp, INP_CPU(inp)); + callout_reset_on(&tp->t_timers->tt_keep, TP_KEEPINTVL(tp), + tcp_timer_keep, tp, INP_CPU(inp)); } else - callout_reset_on(&tp->t_timers->tt_keep, tcp_keepidle, tcp_timer_keep, tp, INP_CPU(inp)); + callout_reset_on(&tp->t_timers->tt_keep, TP_KEEPIDLE(tp), + tcp_timer_keep, tp, INP_CPU(inp)); #ifdef TCPDEBUG if (inp->inp_socket->so_options & SO_DEBUG) Modified: head/sys/netinet/tcp_timer.h ============================================================================== --- head/sys/netinet/tcp_timer.h Sun Feb 5 16:41:06 2012 (r231024) +++ head/sys/netinet/tcp_timer.h Sun Feb 5 16:53:02 2012 (r231025) @@ -153,10 +153,16 @@ struct tcp_timer { #define TT_KEEP 0x08 #define TT_2MSL 0x10 +#define TP_KEEPINIT(tp) ((tp)->t_keepinit ? (tp)->t_keepinit : tcp_keepinit) +#define TP_KEEPIDLE(tp) ((tp)->t_keepidle ? (tp)->t_keepidle : tcp_keepidle) +#define TP_KEEPINTVL(tp) ((tp)->t_keepintvl ? (tp)->t_keepintvl : tcp_keepintvl) +#define TP_KEEPCNT(tp) ((tp)->t_keepcnt ? (tp)->t_keepcnt : tcp_keepcnt) +#define TP_MAXIDLE(tp) (TP_KEEPCNT(tp) * TP_KEEPINTVL(tp)) + extern int tcp_keepinit; /* time to establish connection */ extern int tcp_keepidle; /* time before keepalive probes begin */ extern int tcp_keepintvl; /* time between keepalive probes */ -extern int tcp_maxidle; /* time to drop after starting probes */ +extern int tcp_keepcnt; /* number of keepalives */ extern int tcp_delacktime; /* time before sending a delayed ACK */ extern int tcp_maxpersistidle; extern int tcp_rexmit_min; Modified: head/sys/netinet/tcp_usrreq.c ============================================================================== --- head/sys/netinet/tcp_usrreq.c Sun Feb 5 16:41:06 2012 (r231024) +++ head/sys/netinet/tcp_usrreq.c Sun Feb 5 16:53:02 2012 (r231025) @@ -45,6 +45,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -1118,7 +1119,7 @@ tcp_connect(struct tcpcb *tp, struct soc soisconnecting(so); TCPSTAT_INC(tcps_connattempt); tp->t_state = TCPS_SYN_SENT; - tcp_timer_activate(tp, TT_KEEP, tcp_keepinit); + tcp_timer_activate(tp, TT_KEEP, TP_KEEPINIT(tp)); tp->iss = tcp_new_isn(tp); tcp_sendseqinit(tp); @@ -1191,7 +1192,7 @@ tcp6_connect(struct tcpcb *tp, struct so soisconnecting(so); TCPSTAT_INC(tcps_connattempt); tp->t_state = TCPS_SYN_SENT; - tcp_timer_activate(tp, TT_KEEP, tcp_keepinit); + tcp_timer_activate(tp, TT_KEEP, TP_KEEPINIT(tp)); tp->iss = tcp_new_isn(tp); tcp_sendseqinit(tp); @@ -1272,6 +1273,7 @@ int tcp_ctloutput(struct socket *so, struct sockopt *sopt) { int error, opt, optval; + u_int ui; struct inpcb *inp; struct tcpcb *tp; struct tcp_info ti; @@ -1439,6 +1441,59 @@ tcp_ctloutput(struct socket *so, struct INP_WUNLOCK(inp); break; + case TCP_KEEPIDLE: + case TCP_KEEPINTVL: + case TCP_KEEPCNT: + case TCP_KEEPINIT: + INP_WUNLOCK(inp); + error = sooptcopyin(sopt, &ui, sizeof(ui), sizeof(ui)); + if (error) + return (error); + + if (ui > (UINT_MAX / hz)) { + error = EINVAL; + break; + } + ui *= hz; + + INP_WLOCK_RECHECK(inp); + switch (sopt->sopt_name) { + case TCP_KEEPIDLE: + tp->t_keepidle = ui; + /* + * XXX: better check current remaining + * timeout and "merge" it with new value. + */ + if ((tp->t_state > TCPS_LISTEN) && + (tp->t_state <= TCPS_CLOSING)) + tcp_timer_activate(tp, TT_KEEP, + TP_KEEPIDLE(tp)); + break; + case TCP_KEEPINTVL: + tp->t_keepintvl = ui; + if ((tp->t_state == TCPS_FIN_WAIT_2) && + (TP_MAXIDLE(tp) > 0)) + tcp_timer_activate(tp, TT_2MSL, + TP_MAXIDLE(tp)); + break; + case TCP_KEEPCNT: + tp->t_keepcnt = ui; + if ((tp->t_state == TCPS_FIN_WAIT_2) && + (TP_MAXIDLE(tp) > 0)) + tcp_timer_activate(tp, TT_2MSL, + TP_MAXIDLE(tp)); + break; + case TCP_KEEPINIT: + tp->t_keepinit = ui; + if (tp->t_state == TCPS_SYN_RECEIVED || + tp->t_state == TCPS_SYN_SENT) + tcp_timer_activate(tp, TT_KEEP, + TP_KEEPINIT(tp)); + break; + } + INP_WUNLOCK(inp); + break; + default: INP_WUNLOCK(inp); error = ENOPROTOOPT; @@ -1636,7 +1691,7 @@ tcp_usrclosed(struct tcpcb *tp) int timeout; timeout = (tcp_fast_finwait2_recycle) ? - tcp_finwait2_timeout : tcp_maxidle; + tcp_finwait2_timeout : TP_MAXIDLE(tp); tcp_timer_activate(tp, TT_2MSL, timeout); } } Modified: head/sys/netinet/tcp_var.h ============================================================================== --- head/sys/netinet/tcp_var.h Sun Feb 5 16:41:06 2012 (r231024) +++ head/sys/netinet/tcp_var.h Sun Feb 5 16:53:02 2012 (r231025) @@ -203,7 +203,12 @@ struct tcpcb { struct cc_var *ccv; /* congestion control specific vars */ struct osd *osd; /* storage for Khelp module data */ - uint32_t t_ispare[12]; /* 4 keep timers, 5 UTO, 3 TBD */ + u_int t_keepinit; /* time to establish connection */ + u_int t_keepidle; /* time before keepalive probes begin */ + u_int t_keepintvl; /* interval between keepalives */ + u_int t_keepcnt; /* number of keepalives before close */ + + uint32_t t_ispare[8]; /* 5 UTO, 3 TBD */ void *t_pspare2[4]; /* 4 TBD */ uint64_t _pad[6]; /* 6 TBD (1-2 CC/RTT?) */ }; Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sun Feb 5 16:41:06 2012 (r231024) +++ head/sys/sys/param.h Sun Feb 5 16:53:02 2012 (r231025) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000006 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000007 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 16:54:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 19E76106566C; Sun, 5 Feb 2012 16:54:27 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 08B508FC1C; Sun, 5 Feb 2012 16:54:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15GsQ2m092139; Sun, 5 Feb 2012 16:54:26 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15GsQcc092137; Sun, 5 Feb 2012 16:54:26 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202051654.q15GsQcc092137@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 5 Feb 2012 16:54:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231026 - head/sys/powerpc/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 16:54:27 -0000 Author: nwhitehorn Date: Sun Feb 5 16:54:26 2012 New Revision: 231026 URL: http://svn.freebsd.org/changeset/base/231026 Log: Make sure to remap adjusted resources. Modified: head/sys/powerpc/ofw/ofw_pci.c Modified: head/sys/powerpc/ofw/ofw_pci.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pci.c Sun Feb 5 16:53:02 2012 (r231025) +++ head/sys/powerpc/ofw/ofw_pci.c Sun Feb 5 16:54:26 2012 (r231026) @@ -431,6 +431,7 @@ ofw_pci_adjust_resource(device_t bus, de { struct rman *rm = NULL; struct ofw_pci_softc *sc = device_get_softc(bus); + int error; switch (type) { case SYS_RES_MEMORY: @@ -445,7 +446,22 @@ ofw_pci_adjust_resource(device_t bus, de if (!rman_is_region_manager(res, rm)) return (EINVAL); - return (rman_adjust_resource(res, start, end)); + + error = rman_adjust_resource(res, start, end); + if (error) + return (error); + + if (rman_get_flags(res) & RF_ACTIVE) { + /* Remap memory resources */ + error = ofw_pci_deactivate_resource(bus, child, type, + rman_get_rid(res), res); + if (error) + return (error); + error = ofw_pci_activate_resource(bus, child, type, + rman_get_rid(res), res); + } + + return (error); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 20:00:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0122A106566B; Sun, 5 Feb 2012 20:00:40 +0000 (UTC) (envelope-from rpaulo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DECA58FC14; Sun, 5 Feb 2012 20:00:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15K0dCd098793; Sun, 5 Feb 2012 20:00:39 GMT (envelope-from rpaulo@svn.freebsd.org) Received: (from rpaulo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15K0d5g098790; Sun, 5 Feb 2012 20:00:39 GMT (envelope-from rpaulo@svn.freebsd.org) Message-Id: <201202052000.q15K0d5g098790@svn.freebsd.org> From: Rui Paulo Date: Sun, 5 Feb 2012 20:00:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231042 - in head/sys/boot/ficl: . i386 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:00:40 -0000 Author: rpaulo Date: Sun Feb 5 20:00:39 2012 New Revision: 231042 URL: http://svn.freebsd.org/changeset/base/231042 Log: Fix clang warnings. Modified: head/sys/boot/ficl/fileaccess.c head/sys/boot/ficl/i386/sysdep.h Modified: head/sys/boot/ficl/fileaccess.c ============================================================================== --- head/sys/boot/ficl/fileaccess.c Sun Feb 5 19:59:01 2012 (r231041) +++ head/sys/boot/ficl/fileaccess.c Sun Feb 5 20:00:39 2012 (r231042) @@ -420,6 +420,6 @@ void ficlCompileFile(FICL_SYSTEM *pSys) ficlSetEnv(pSys, "file-ext", FICL_TRUE); #endif /* FICL_HAVE_FTRUNCATE */ #else - &pSys; + (void)pSys; #endif /* FICL_WANT_FILE */ } Modified: head/sys/boot/ficl/i386/sysdep.h ============================================================================== --- head/sys/boot/ficl/i386/sysdep.h Sun Feb 5 19:59:01 2012 (r231041) +++ head/sys/boot/ficl/i386/sysdep.h Sun Feb 5 20:00:39 2012 (r231042) @@ -58,7 +58,7 @@ #include #if !defined IGNORE /* Macro to silence unused param warnings */ -#define IGNORE(x) &x +#define IGNORE(x) (void)x #endif /* @@ -405,7 +405,7 @@ void *ficlRealloc(void *p, size_t size); #if FICL_MULTITHREAD int ficlLockDictionary(short fLock); #else -#define ficlLockDictionary(x) 0 /* ignore */ +#define ficlLockDictionary(x) /* ignore */ #endif /* From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 20:04:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F3CB01065670; Sun, 5 Feb 2012 20:04:43 +0000 (UTC) (envelope-from andreast@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DC1DD8FC19; Sun, 5 Feb 2012 20:04:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15K4hId099037; Sun, 5 Feb 2012 20:04:43 GMT (envelope-from andreast@svn.freebsd.org) Received: (from andreast@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15K4hrC099031; Sun, 5 Feb 2012 20:04:43 GMT (envelope-from andreast@svn.freebsd.org) Message-Id: <201202052004.q15K4hrC099031@svn.freebsd.org> From: Andreas Tobler Date: Sun, 5 Feb 2012 20:04:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231044 - in head: lib/libc/powerpc lib/libc/powerpc/gen lib/libc/powerpc64 lib/libc/powerpc64/gen sys/powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:04:44 -0000 Author: andreast Date: Sun Feb 5 20:04:43 2012 New Revision: 231044 URL: http://svn.freebsd.org/changeset/base/231044 Log: Replace the assembler macro WEAK_ALIAS with a new macro WEAK_REFERENCE which has the same API as __weak_reference(). Give 'x' in SYS.h a more meaningful name. Tested on 32- and 64-bit PowerMac. Reviewed by: bde Modified: head/lib/libc/powerpc/SYS.h head/lib/libc/powerpc/gen/setjmp.S head/lib/libc/powerpc64/SYS.h head/lib/libc/powerpc64/gen/setjmp.S head/sys/powerpc/include/asm.h Modified: head/lib/libc/powerpc/SYS.h ============================================================================== --- head/lib/libc/powerpc/SYS.h Sun Feb 5 20:04:21 2012 (r231043) +++ head/lib/libc/powerpc/SYS.h Sun Feb 5 20:04:43 2012 (r231044) @@ -33,38 +33,38 @@ #include #include -#define _SYSCALL(x) \ +#define _SYSCALL(name) \ .text; \ .align 2; \ - li 0,(__CONCAT(SYS_,x)); \ + li 0,(__CONCAT(SYS_, name)); \ sc -#define SYSCALL(x) \ +#define SYSCALL(name) \ .text; \ .align 2; \ 2: b PIC_PLT(CNAME(HIDENAME(cerror))); \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ - _SYSCALL(x); \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), name); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\ + _SYSCALL(name); \ bso 2b -#define PSEUDO(x) \ +#define PSEUDO(name) \ .text; \ .align 2; \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ - _SYSCALL(x); \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\ + _SYSCALL(name); \ bnslr; \ b PIC_PLT(CNAME(HIDENAME(cerror))) -#define RSYSCALL(x) \ +#define RSYSCALL(name) \ .text; \ .align 2; \ 2: b PIC_PLT(CNAME(HIDENAME(cerror))); \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x), __CONCAT(__sys_,x)); \ - _SYSCALL(x); \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), name); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\ + _SYSCALL(name); \ bnslr; \ b PIC_PLT(CNAME(HIDENAME(cerror))) Modified: head/lib/libc/powerpc/gen/setjmp.S ============================================================================== --- head/lib/libc/powerpc/gen/setjmp.S Sun Feb 5 20:04:21 2012 (r231043) +++ head/lib/libc/powerpc/gen/setjmp.S Sun Feb 5 20:04:43 2012 (r231044) @@ -69,7 +69,7 @@ ENTRY(setjmp) li %r3,0 /* return (0) */ blr - WEAK_ALIAS(longjmp, __longjmp) + WEAK_REFERENCE(CNAME(__longjmp), longjmp) ENTRY(__longjmp) lmw %r9,20(%r3) /* restore regs */ mr %r6,%r4 /* save val param */ Modified: head/lib/libc/powerpc64/SYS.h ============================================================================== --- head/lib/libc/powerpc64/SYS.h Sun Feb 5 20:04:21 2012 (r231043) +++ head/lib/libc/powerpc64/SYS.h Sun Feb 5 20:04:43 2012 (r231044) @@ -33,13 +33,13 @@ #include #include -#define _SYSCALL(x) \ +#define _SYSCALL(name) \ .text; \ .align 2; \ - li 0,(__CONCAT(SYS_,x)); \ + li 0,(__CONCAT(SYS_, name)); \ sc -#define SYSCALL(x) \ +#define SYSCALL(name) \ .text; \ .align 2; \ 2: mflr %r0; \ @@ -51,18 +51,18 @@ ld %r0,16(%r1); \ mtlr %r0; \ blr; \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ - _SYSCALL(x); \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), name); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name)); \ + _SYSCALL(name); \ bso 2b -#define PSEUDO(x) \ +#define PSEUDO(name) \ .text; \ .align 2; \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x),__CONCAT(__sys_,x)); \ - _SYSCALL(x); \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name)); \ + _SYSCALL(name); \ bnslr; \ mflr %r0; \ std %r0,16(%r1); \ @@ -74,13 +74,13 @@ ENTRY(__CONCAT(__sys_,x)); \ mtlr %r0; \ blr; -#define RSYSCALL(x) \ +#define RSYSCALL(name) \ .text; \ .align 2; \ -ENTRY(__CONCAT(__sys_,x)); \ - WEAK_ALIAS(x,__CONCAT(__sys_,x)); \ - WEAK_ALIAS(__CONCAT(_,x), __CONCAT(__sys_,x)); \ - _SYSCALL(x); \ +ENTRY(__CONCAT(__sys_, name)); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), name); \ + WEAK_REFERENCE(__CONCAT(__sys_, name), __CONCAT(_, name));\ + _SYSCALL(name); \ bnslr; \ \ mflr %r0; \ Modified: head/lib/libc/powerpc64/gen/setjmp.S ============================================================================== --- head/lib/libc/powerpc64/gen/setjmp.S Sun Feb 5 20:04:21 2012 (r231043) +++ head/lib/libc/powerpc64/gen/setjmp.S Sun Feb 5 20:04:43 2012 (r231044) @@ -93,7 +93,7 @@ ENTRY(setjmp) li %r3,0 /* return (0) */ blr - WEAK_ALIAS(longjmp, __longjmp) + WEAK_REFERENCE(__longjmp, longjmp) ENTRY(__longjmp) ld %r9,40 + 0*8(%r3) ld %r10,40 + 1*8(%r3) Modified: head/sys/powerpc/include/asm.h ============================================================================== --- head/sys/powerpc/include/asm.h Sun Feb 5 20:04:21 2012 (r231043) +++ head/sys/powerpc/include/asm.h Sun Feb 5 20:04:43 2012 (r231044) @@ -116,9 +116,9 @@ #define __FBSDID(s) /* nothing */ #endif /* not lint and not STRIP_FBSDID */ -#define WEAK_ALIAS(alias,sym) \ +#define WEAK_REFERENCE(sym, alias) \ .weak alias; \ - alias = sym + .equ alias,sym #ifdef __STDC__ #define WARN_REFERENCES(_sym,_msg) \ From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 20:07:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFB77106564A; Sun, 5 Feb 2012 20:07:45 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C05218FC13; Sun, 5 Feb 2012 20:07:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15K7jjN099237; Sun, 5 Feb 2012 20:07:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15K7jQx099235; Sun, 5 Feb 2012 20:07:45 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202052007.q15K7jQx099235@svn.freebsd.org> From: Nathan Whitehorn Date: Sun, 5 Feb 2012 20:07:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231046 - head/sys/powerpc/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:07:46 -0000 Author: nwhitehorn Date: Sun Feb 5 20:07:45 2012 New Revision: 231046 URL: http://svn.freebsd.org/changeset/base/231046 Log: Inherit from PCI bridge driver instead of manually specifying all of its methods. Obtained from: sparc64 MFC after: 1 week Modified: head/sys/powerpc/ofw/ofw_pcib_pci.c Modified: head/sys/powerpc/ofw/ofw_pcib_pci.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pcib_pci.c Sun Feb 5 20:06:43 2012 (r231045) +++ head/sys/powerpc/ofw/ofw_pcib_pci.c Sun Feb 5 20:07:45 2012 (r231046) @@ -56,31 +56,10 @@ static int ofw_pcib_pci_route_interrupt( static device_method_t ofw_pcib_pci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, ofw_pcib_pci_probe), - DEVMETHOD(device_attach, ofw_pcib_pci_attach), - DEVMETHOD(device_shutdown, bus_generic_shutdown), - DEVMETHOD(device_suspend, bus_generic_suspend), - DEVMETHOD(device_resume, bus_generic_resume), - - /* Bus interface */ - DEVMETHOD(bus_read_ivar, pcib_read_ivar), - DEVMETHOD(bus_write_ivar, pcib_write_ivar), - DEVMETHOD(bus_alloc_resource, pcib_alloc_resource), - DEVMETHOD(bus_release_resource, bus_generic_release_resource), - DEVMETHOD(bus_activate_resource, bus_generic_activate_resource), - DEVMETHOD(bus_deactivate_resource, bus_generic_deactivate_resource), - DEVMETHOD(bus_setup_intr, bus_generic_setup_intr), - DEVMETHOD(bus_teardown_intr, bus_generic_teardown_intr), + DEVMETHOD(device_attach, ofw_pcib_pci_attach), /* pcib interface */ - DEVMETHOD(pcib_maxslots, pcib_maxslots), - DEVMETHOD(pcib_read_config, pcib_read_config), - DEVMETHOD(pcib_write_config, pcib_write_config), DEVMETHOD(pcib_route_interrupt, ofw_pcib_pci_route_interrupt), - DEVMETHOD(pcib_alloc_msi, pcib_alloc_msi), - DEVMETHOD(pcib_release_msi, pcib_release_msi), - DEVMETHOD(pcib_alloc_msix, pcib_alloc_msix), - DEVMETHOD(pcib_release_msix, pcib_release_msix), - DEVMETHOD(pcib_map_msi, pcib_map_msi), /* ofw_bus interface */ DEVMETHOD(ofw_bus_get_node, ofw_pcib_pci_get_node), @@ -101,8 +80,8 @@ struct ofw_pcib_softc { struct ofw_bus_iinfo ops_iinfo; }; -DEFINE_CLASS_0(pcib, ofw_pcib_pci_driver, ofw_pcib_pci_methods, - sizeof(struct ofw_pcib_softc)); +DEFINE_CLASS_1(pcib, ofw_pcib_pci_driver, ofw_pcib_pci_methods, + sizeof(struct ofw_pcib_softc), pcib_driver); DRIVER_MODULE(ofw_pcib, pci, ofw_pcib_pci_driver, pcib_devclass, 0, 0); static int From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 20:55:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9FA92106564A; Sun, 5 Feb 2012 20:55:38 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8ACB58FC0C; Sun, 5 Feb 2012 20:55:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15KtcV6001309; Sun, 5 Feb 2012 20:55:38 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15Ktcw4001307; Sun, 5 Feb 2012 20:55:38 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201202052055.q15Ktcw4001307@svn.freebsd.org> From: Dimitry Andric Date: Sun, 5 Feb 2012 20:55:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231054 - head/usr.bin/rpcgen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 20:55:38 -0000 Author: dim Date: Sun Feb 5 20:55:38 2012 New Revision: 231054 URL: http://svn.freebsd.org/changeset/base/231054 Log: In usr.bin/rpcgen/rpc_main.c, properly check the return value of strlcpy(), in addition to checking that of strlcat(). MFC after: 1 week Modified: head/usr.bin/rpcgen/rpc_main.c Modified: head/usr.bin/rpcgen/rpc_main.c ============================================================================== --- head/usr.bin/rpcgen/rpc_main.c Sun Feb 5 20:53:06 2012 (r231053) +++ head/usr.bin/rpcgen/rpc_main.c Sun Feb 5 20:55:38 2012 (r231054) @@ -1125,9 +1125,11 @@ parseargs(int argc, const char *argv[], if (++i == argc) { return (0); } - (void) strlcpy(pathbuf, argv[i], sizeof(pathbuf)); - if (strlcat(pathbuf, "/cpp", sizeof(pathbuf)) - >= sizeof(pathbuf)) { + if (strlcpy(pathbuf, argv[i], + sizeof(pathbuf)) >= sizeof(pathbuf) + || strlcat(pathbuf, "/cpp", + sizeof(pathbuf)) >= + sizeof(pathbuf)) { warnx("argument too long"); return (0); } From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 21:27:16 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACBBB106566B; Sun, 5 Feb 2012 21:27:16 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 5E51B8FC18; Sun, 5 Feb 2012 21:27:15 +0000 (UTC) Received: by bkbzx1 with SMTP id zx1so5877497bkb.13 for ; Sun, 05 Feb 2012 13:27:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=yyvWPrW2AY2nBUBHxvGc02Sw0GBokmc1Eux2SiP6Rrc=; b=hyz8sO2K72oJiCm/OAtJ2tYoSzcLwpkj88aNAriyol75oj0Bb0nmAEQX9ChCkrSaoN z3rUvBEZdwbktsx+Po7th/pbSJXY5415qAtxmxvYrQcdOH8w8fKKJXenVTw9d9m+Lw0d stdxB4UR2IUhDgxB/A+kQwM5ScxNQjoJMiBg0= Received: by 10.204.129.200 with SMTP id p8mr7322015bks.114.1328477234411; Sun, 05 Feb 2012 13:27:14 -0800 (PST) Received: from localhost ([95.69.173.122]) by mx.google.com with ESMTPS id t17sm38600935bke.6.2012.02.05.13.27.12 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 05 Feb 2012 13:27:13 -0800 (PST) From: Mikolaj Golub To: Pawel Jakub Dawidek References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> X-Comment-To: Pawel Jakub Dawidek Sender: Mikolaj Golub Date: Sun, 05 Feb 2012 23:27:10 +0200 In-Reply-To: <20120205093938.GC30033@garage.freebsd.pl> (Pawel Jakub Dawidek's message of "Sun, 5 Feb 2012 10:39:38 +0100") Message-ID: <86lioh7yz5.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 21:27:16 -0000 --=-=-= On Sun, 5 Feb 2012 10:39:38 +0100 Pawel Jakub Dawidek wrote: PJD> On Sat, Feb 04, 2012 at 08:16:42PM +0200, Mikolaj Golub wrote: >> ref8-amd64:/home/trociny% uname -r >> 8.2-STABLE >> ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 >> ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 >> daemon: process already running, pid: 19799 >> >> kopusha:~% uname -r >> 10.0-CURRENT >> kopusha:~% daemon -p /tmp/sleep.pid sleep 10 >> kopusha:~% daemon -p /tmp/sleep.pid sleep 10 >> kopusha:~% PJD> Mikolaj, eventhough what we had in 8.2-STABLE looks correct, it also PJD> isn't correct. PJD> Passing open descriptor to a process that doesn't expect that is bad PJD> behaviour. If you pass, eg. open descriptor to a directory and the PJD> process is using chroot(2) or jail(2) to sandbox itself it will be able PJD> to escape from that sandbox. Passing descriptor to a file has smaller PJD> security implication, but it is still wrong. For example hastd, as you PJD> probably know, asserts, before sandboxing, that he knows about all open PJD> descriptors - if there are some unknown descriptors open it won't run. PJD> Also, daemon was passing open descriptor to a pidfile that the child PJD> process cannot clean up, because he doesn't know its name. This leaves PJD> pidfile with stale PID in it once the process exits, which is also bad. PJD> In my opinion, to make daemon(8) work with pidfiles, it cannot exit PJD> after executing the given command. It should stay around with pidfile PJD> open and just wait for the child to exit. Once the child exits, it PJD> should remove the pidfile and also exit. Ok, using hastd code as a reference :-) here is my implementation. -- Mikolaj Golub --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=daemon.c.patch Index: usr.sbin/daemon/daemon.c =================================================================== --- usr.sbin/daemon/daemon.c (revision 231014) +++ usr.sbin/daemon/daemon.c (working copy) @@ -32,26 +32,31 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include -#include #include #include +#include +#include #include #include #include static void restrict_process(const char *); +static void wait_child(pid_t, sigset_t *); +static void dummy_sighandler(int); static void usage(void); int main(int argc, char *argv[]) { struct pidfh *pfh = NULL; - int ch, nochdir, noclose, errcode; + sigset_t mask, oldmask; + int ch, nochdir, noclose; const char *pidfile, *user; - pid_t otherpid; + pid_t otherpid, pid; nochdir = noclose = 1; pidfile = user = NULL; @@ -82,40 +87,96 @@ main(int argc, char *argv[]) if (user != NULL) restrict_process(user); + if (pidfile == NULL) { + /* + * This is a simple case. Daemonize and exec. + */ + if (daemon(nochdir, noclose) == -1) + err(1, NULL); + + execvp(argv[0], argv); + + /* + * execvp() failed -- report the error. The child is + * now running, so the exit status doesn't matter. + */ + err(1, "%s", argv[0]); + } + /* * Try to open the pidfile before calling daemon(3), - * to be able to report the error intelligently + * to be able to report the error intelligently. */ - if (pidfile) { - pfh = pidfile_open(pidfile, 0600, &otherpid); - if (pfh == NULL) { - if (errno == EEXIST) { - errx(3, "process already running, pid: %d", - otherpid); - } - err(2, "pidfile ``%s''", pidfile); + pfh = pidfile_open(pidfile, 0600, &otherpid); + if (pfh == NULL) { + if (errno == EEXIST) { + errx(3, "process already running, pid: %d", + otherpid); } + err(2, "pidfile ``%s''", pidfile); } - if (daemon(nochdir, noclose) == -1) err(1, NULL); + /* + * We want to keep pidfile open while the command is running + * and remove it on exit. So we execute the command in a + * forked process and wait for the child to exit. We don't + * want the waiting daemon to be killed leaving the running + * process and the stale pidfile, so we pass received SIGHUP, + * SIGINT and SIGTERM to the children expecting to get SIGCHLD + * eventually. + */ - /* Now that we are the child, write out the pid */ - if (pidfile) - pidfile_write(pfh); - - execvp(argv[0], argv); - /* - * execvp() failed -- unlink pidfile if any, and - * report the error + * Restore default actions for interesting signals in case + * the parent process decided to ignore some of them. */ - errcode = errno; /* Preserve errcode -- unlink may reset it */ - if (pidfile) + if (signal(SIGHUP, SIG_DFL) == SIG_ERR) + err(1, "signal"); + if (signal(SIGINT, SIG_DFL) == SIG_ERR) + err(1, "signal"); + if (signal(SIGTERM, SIG_DFL) == SIG_ERR) + err(1, "signal"); + /* + * Because SIGCHLD is ignored by default, setup dummy handler + * for it, so we can mask it. + */ + if (signal(SIGCHLD, dummy_sighandler) == SIG_ERR) + err(1, "signal"); + /* + * Block interesting signals. + */ + sigemptyset(&mask); + sigaddset(&mask, SIGHUP); + sigaddset(&mask, SIGINT); + sigaddset(&mask, SIGTERM); + sigaddset(&mask, SIGCHLD); + if (sigprocmask(SIG_SETMASK, &mask, &oldmask) == -1) + err(1, "sigprocmask"); + /* + * Fork a child to exec and wait until it exits to remove the + * pidfile. + */ + pid = fork(); + if (pid == -1) { pidfile_remove(pfh); + err(1, "fork"); + } + if (pid == 0) { + /* Restore old sigmask in the child. */ + if (sigprocmask(SIG_SETMASK, &oldmask, NULL) == -1) + err(1, "sigprocmask"); + /* Now that we are the child, write out the pid. */ + pidfile_write(pfh); - /* The child is now running, so the exit status doesn't matter. */ - errc(1, errcode, "%s", argv[0]); + execvp(argv[0], argv); + + /* execvp() failed. */ + err(1, "%s", argv[0]); + } + wait_child(pid, &mask); + pidfile_remove(pfh); + exit(0); } static void @@ -132,6 +193,30 @@ restrict_process(const char *user) } static void +wait_child(pid_t pid, sigset_t *mask) +{ + int signo; + + while ((signo = sigwaitinfo(mask, NULL)) != -1) { + switch (signo) { + case SIGCHLD: + return; + default: + if (kill(pid, signo) == -1) { + warn("kill"); + return; + } + } + } +} + +static void +dummy_sighandler(int sig __unused) +{ + /* Nothing to do. */ +} + +static void usage(void) { (void)fprintf(stderr, --=-=-=-- From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 21:48:05 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6E62106566C; Sun, 5 Feb 2012 21:48:05 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 5F19C8FC19; Sun, 5 Feb 2012 21:48:04 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id E59BB804; Sun, 5 Feb 2012 22:48:02 +0100 (CET) Date: Sun, 5 Feb 2012 22:46:48 +0100 From: Pawel Jakub Dawidek To: Mikolaj Golub Message-ID: <20120205214647.GI30033@garage.freebsd.pl> References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="STPqjqpCrtky8aYs" Content-Disposition: inline In-Reply-To: <86lioh7yz5.fsf@kopusha.home.net> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 21:48:05 -0000 --STPqjqpCrtky8aYs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, Feb 05, 2012 at 11:27:10PM +0200, Mikolaj Golub wrote: > Ok, using hastd code as a reference :-) here is my implementation. - I'd not pass selected signals to the child. The parent can still be killed with a whole bunch of different signals that are not passed or cannot be caught or the child process handle them gracefully. Signals should be send to the PID from the pidfile anyway. If someone is sending signals to the parent he has no right to expect well behaviour from the parent. - Now that we handle the pidfile fully in the parent, I'd move dropping provileges after fork(2) and pidfile_write(3). This way pidfiles will always be created with root privileges and we can forget about all the mess with pid directories, etc. - With the above you can wait for child to exit with simple wait(2). --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --STPqjqpCrtky8aYs Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8u+McACgkQForvXbEpPzSvqgCg9ndmZ+VXAVgb7SUXpHp7dGAJ 08cAniBzA5lGP0hWm5fFuMwN/cCqH+7n =eWsn -----END PGP SIGNATURE----- --STPqjqpCrtky8aYs-- From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 22:51:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC641106564A; Sun, 5 Feb 2012 22:51:53 +0000 (UTC) (envelope-from jos@catnook.com) Received: from mail-tul01m020-f182.google.com (mail-tul01m020-f182.google.com [209.85.214.182]) by mx1.freebsd.org (Postfix) with ESMTP id 660448FC13; Sun, 5 Feb 2012 22:51:53 +0000 (UTC) Received: by obcwo16 with SMTP id wo16so8756748obc.13 for ; Sun, 05 Feb 2012 14:51:52 -0800 (PST) MIME-Version: 1.0 Received: by 10.182.174.101 with SMTP id br5mr6888432obc.0.1328480789567; Sun, 05 Feb 2012 14:26:29 -0800 (PST) Received: by 10.60.0.170 with HTTP; Sun, 5 Feb 2012 14:26:29 -0800 (PST) Received: by 10.60.0.170 with HTTP; Sun, 5 Feb 2012 14:26:29 -0800 (PST) In-Reply-To: <20120205214647.GI30033@garage.freebsd.pl> References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> <20120205214647.GI30033@garage.freebsd.pl> Date: Sun, 5 Feb 2012 14:26:29 -0800 Message-ID: From: Jos Backus To: Pawel Jakub Dawidek Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Cc: src-committers@freebsd.org, Guy Helmer , svn-src-all@freebsd.org, Andrey Zonov , Mikolaj Golub , svn-src-head@freebsd.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 22:51:53 -0000 Hi Pawel, On Feb 5, 2012 1:48 PM, "Pawel Jakub Dawidek" wrote: > > On Sun, Feb 05, 2012 at 11:27:10PM +0200, Mikolaj Golub wrote: > > Ok, using hastd code as a reference :-) here is my implementation. > > - I'd not pass selected signals to the child. The parent can still be > killed with a whole bunch of different signals that are not passed or > cannot be caught or the child process handle them gracefully. > Signals should be send to the PID from the pidfile anyway. If someone > is sending signals to the parent he has no right to expect well > behaviour from the parent. > > - Now that we handle the pidfile fully in the parent, I'd move dropping > provileges after fork(2) and pidfile_write(3). This way pidfiles will > always be created with root privileges and we can forget about all the > mess with pid directories, etc. > > - With the above you can wait for child to exit with simple wait(2). If you are going to wait for the child anyway, you are doing almost everything supervise does. All you now need is a Unix domain socket interface so you can receive commands in daemon(1), and run daemon(1) at boot. AND you can remove all the pidfile code :) Jos From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 23:02:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 542FB1065679; Sun, 5 Feb 2012 23:02:15 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id F18968FC1A; Sun, 5 Feb 2012 23:02:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15N2Eu9005377; Sun, 5 Feb 2012 23:02:14 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15N2EMI005375; Sun, 5 Feb 2012 23:02:14 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201202052302.q15N2EMI005375@svn.freebsd.org> From: Dimitry Andric Date: Sun, 5 Feb 2012 23:02:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231055 - head/share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 23:02:15 -0000 Author: dim Date: Sun Feb 5 23:02:13 2012 New Revision: 231055 URL: http://svn.freebsd.org/changeset/base/231055 Log: Regenerate src.conf.5, after r230972 added the WITHOUT_SOURCELESS build options. MFC after: 2 weeks Modified: head/share/man/man5/src.conf.5 Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sun Feb 5 20:55:38 2012 (r231054) +++ head/share/man/man5/src.conf.5 Sun Feb 5 23:02:13 2012 (r231055) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 221733 2011-05-10 13:01:11Z ru .\" $FreeBSD$ -.Dd January 13, 2012 +.Dd February 5, 2012 .Dt SRC.CONF 5 .Os .Sh NAME @@ -869,6 +869,23 @@ as a set-user-ID root program. Set to not build the .Bx 4.4 legacy docs. +.It Va WITHOUT_SOURCELESS +.\" from FreeBSD: head/tools/build/options/WITHOUT_SOURCELESS 230972 2012-02-04 00:54:43Z rmh +Set to not build kernel modules that include sourceless code (either microcode or native code for host CPU). +When set, it also enforces the following options: +.Pp +.Bl -item -compact +.It +.Va WITHOUT_SOURCELESS_HOST +.It +.Va WITHOUT_SOURCELESS_UCODE +.El +.It Va WITHOUT_SOURCELESS_HOST +.\" from FreeBSD: head/tools/build/options/WITHOUT_SOURCELESS_HOST 230972 2012-02-04 00:54:43Z rmh +Set to not build kernel modules that include sourceless native code for host CPU. +.It Va WITHOUT_SOURCELESS_UCODE +.\" from FreeBSD: head/tools/build/options/WITHOUT_SOURCELESS_UCODE 230972 2012-02-04 00:54:43Z rmh +Set to not build kernel modules that include sourceless microcode. .It Va WITHOUT_SSP .\" from FreeBSD: head/tools/build/options/WITHOUT_SSP 180012 2008-06-25 21:33:28Z ru Set to not build world with propolice stack smashing protection. From owner-svn-src-head@FreeBSD.ORG Sun Feb 5 23:56:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ACA13106566B; Sun, 5 Feb 2012 23:56:23 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 928CF8FC08; Sun, 5 Feb 2012 23:56:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q15NuNJk007250; Sun, 5 Feb 2012 23:56:23 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q15NuNuh007220; Sun, 5 Feb 2012 23:56:23 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201202052356.q15NuNuh007220@svn.freebsd.org> From: Dimitry Andric Date: Sun, 5 Feb 2012 23:56:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231057 - in head: contrib/llvm/tools/bugpoint contrib/llvm/tools/llc contrib/llvm/tools/lli contrib/llvm/tools/llvm-ar contrib/llvm/tools/llvm-as contrib/llvm/tools/llvm-bcanalyzer con... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 Feb 2012 23:56:23 -0000 Author: dim Date: Sun Feb 5 23:56:22 2012 New Revision: 231057 URL: http://svn.freebsd.org/changeset/base/231057 Log: Add a WITH_CLANG_EXTRAS option for src.conf(5), disabled by default, that builds the following additional llvm/clang tools: - bugpoint - llc - lli - llvm-ar - llvm-as - llvm-bcanalyzer - llvm-diff - llvm-dis - llvm-extract - llvm-ld - llvm-link - llvm-mc - llvm-nm - llvm-objdump - llvm-prof - llvm-ranlib - llvm-rtdyld - llvm-stub - macho-dump - opt These tools are mainly useful for people that want to manipulate llvm bitcode (.bc) and llvm assembly language (.ll) files, or want to tinker with llvm and clang themselves. MFC after: 2 weeks Added: head/contrib/llvm/tools/bugpoint/ - copied from r230910, vendor/llvm/dist/tools/bugpoint/ head/contrib/llvm/tools/llc/ - copied from r230910, vendor/llvm/dist/tools/llc/ head/contrib/llvm/tools/lli/ - copied from r230910, vendor/llvm/dist/tools/lli/ head/contrib/llvm/tools/llvm-ar/ - copied from r230910, vendor/llvm/dist/tools/llvm-ar/ head/contrib/llvm/tools/llvm-as/ - copied from r230910, vendor/llvm/dist/tools/llvm-as/ head/contrib/llvm/tools/llvm-bcanalyzer/ - copied from r230910, vendor/llvm/dist/tools/llvm-bcanalyzer/ head/contrib/llvm/tools/llvm-diff/ - copied from r230910, vendor/llvm/dist/tools/llvm-diff/ head/contrib/llvm/tools/llvm-dis/ - copied from r230910, vendor/llvm/dist/tools/llvm-dis/ head/contrib/llvm/tools/llvm-extract/ - copied from r230910, vendor/llvm/dist/tools/llvm-extract/ head/contrib/llvm/tools/llvm-ld/ - copied from r230910, vendor/llvm/dist/tools/llvm-ld/ head/contrib/llvm/tools/llvm-link/ - copied from r230910, vendor/llvm/dist/tools/llvm-link/ head/contrib/llvm/tools/llvm-mc/ - copied from r230910, vendor/llvm/dist/tools/llvm-mc/ head/contrib/llvm/tools/llvm-nm/ - copied from r230910, vendor/llvm/dist/tools/llvm-nm/ head/contrib/llvm/tools/llvm-objdump/ - copied from r230910, vendor/llvm/dist/tools/llvm-objdump/ head/contrib/llvm/tools/llvm-prof/ - copied from r230910, vendor/llvm/dist/tools/llvm-prof/ head/contrib/llvm/tools/llvm-ranlib/ - copied from r230910, vendor/llvm/dist/tools/llvm-ranlib/ head/contrib/llvm/tools/llvm-rtdyld/ - copied from r230910, vendor/llvm/dist/tools/llvm-rtdyld/ head/contrib/llvm/tools/llvm-stub/ - copied from r230910, vendor/llvm/dist/tools/llvm-stub/ head/contrib/llvm/tools/macho-dump/ - copied from r230910, vendor/llvm/dist/tools/macho-dump/ head/contrib/llvm/tools/opt/ - copied from r230910, vendor/llvm/dist/tools/opt/ head/lib/clang/libllvmarchive/ head/lib/clang/libllvmarchive/Makefile (contents, props changed) head/lib/clang/libllvmdebuginfo/ head/lib/clang/libllvmdebuginfo/Makefile (contents, props changed) head/lib/clang/libllvmexecutionengine/ head/lib/clang/libllvmexecutionengine/Makefile (contents, props changed) head/lib/clang/libllvminterpreter/ head/lib/clang/libllvminterpreter/Makefile (contents, props changed) head/lib/clang/libllvmjit/ head/lib/clang/libllvmjit/Makefile (contents, props changed) head/lib/clang/libllvmlinker/ head/lib/clang/libllvmlinker/Makefile (contents, props changed) head/lib/clang/libllvmmcdisassembler/ head/lib/clang/libllvmmcdisassembler/Makefile (contents, props changed) head/lib/clang/libllvmmcjit/ head/lib/clang/libllvmmcjit/Makefile (contents, props changed) head/lib/clang/libllvmobject/ head/lib/clang/libllvmobject/Makefile (contents, props changed) head/lib/clang/libllvmruntimedyld/ head/lib/clang/libllvmruntimedyld/Makefile (contents, props changed) head/tools/build/options/WITH_CLANG_EXTRAS (contents, props changed) head/usr.bin/clang/bugpoint/ head/usr.bin/clang/bugpoint/Makefile (contents, props changed) head/usr.bin/clang/bugpoint/bugpoint.1 (contents, props changed) head/usr.bin/clang/llc/ head/usr.bin/clang/llc/Makefile (contents, props changed) head/usr.bin/clang/llc/llc.1 (contents, props changed) head/usr.bin/clang/lli/ head/usr.bin/clang/lli/Makefile (contents, props changed) head/usr.bin/clang/lli/lli.1 (contents, props changed) head/usr.bin/clang/llvm-ar/ head/usr.bin/clang/llvm-ar/Makefile (contents, props changed) head/usr.bin/clang/llvm-ar/llvm-ar.1 (contents, props changed) head/usr.bin/clang/llvm-as/ head/usr.bin/clang/llvm-as/Makefile (contents, props changed) head/usr.bin/clang/llvm-as/llvm-as.1 (contents, props changed) head/usr.bin/clang/llvm-bcanalyzer/ head/usr.bin/clang/llvm-bcanalyzer/Makefile (contents, props changed) head/usr.bin/clang/llvm-bcanalyzer/llvm-bcanalyzer.1 (contents, props changed) head/usr.bin/clang/llvm-diff/ head/usr.bin/clang/llvm-diff/Makefile (contents, props changed) head/usr.bin/clang/llvm-diff/llvm-diff.1 (contents, props changed) head/usr.bin/clang/llvm-dis/ head/usr.bin/clang/llvm-dis/Makefile (contents, props changed) head/usr.bin/clang/llvm-dis/llvm-dis.1 (contents, props changed) head/usr.bin/clang/llvm-extract/ head/usr.bin/clang/llvm-extract/Makefile (contents, props changed) head/usr.bin/clang/llvm-extract/llvm-extract.1 (contents, props changed) head/usr.bin/clang/llvm-ld/ head/usr.bin/clang/llvm-ld/Makefile (contents, props changed) head/usr.bin/clang/llvm-ld/llvm-ld.1 (contents, props changed) head/usr.bin/clang/llvm-link/ head/usr.bin/clang/llvm-link/Makefile (contents, props changed) head/usr.bin/clang/llvm-link/llvm-link.1 (contents, props changed) head/usr.bin/clang/llvm-mc/ head/usr.bin/clang/llvm-mc/Makefile (contents, props changed) head/usr.bin/clang/llvm-nm/ head/usr.bin/clang/llvm-nm/Makefile (contents, props changed) head/usr.bin/clang/llvm-nm/llvm-nm.1 (contents, props changed) head/usr.bin/clang/llvm-objdump/ head/usr.bin/clang/llvm-objdump/Makefile (contents, props changed) head/usr.bin/clang/llvm-prof/ head/usr.bin/clang/llvm-prof/Makefile (contents, props changed) head/usr.bin/clang/llvm-prof/llvm-prof.1 (contents, props changed) head/usr.bin/clang/llvm-ranlib/ head/usr.bin/clang/llvm-ranlib/Makefile (contents, props changed) head/usr.bin/clang/llvm-ranlib/llvm-ranlib.1 (contents, props changed) head/usr.bin/clang/llvm-rtdyld/ head/usr.bin/clang/llvm-rtdyld/Makefile (contents, props changed) head/usr.bin/clang/llvm-stub/ head/usr.bin/clang/llvm-stub/Makefile (contents, props changed) head/usr.bin/clang/macho-dump/ head/usr.bin/clang/macho-dump/Makefile (contents, props changed) head/usr.bin/clang/opt/ head/usr.bin/clang/opt/Makefile (contents, props changed) head/usr.bin/clang/opt/opt.1 (contents, props changed) Modified: head/lib/clang/Makefile head/lib/clang/libllvmanalysis/Makefile head/lib/clang/libllvmipa/Makefile head/lib/clang/libllvmipo/Makefile head/lib/clang/libllvmmc/Makefile head/lib/clang/libllvmscalaropts/Makefile head/lib/clang/libllvmsupport/Makefile head/lib/clang/libllvmtransformutils/Makefile head/lib/clang/libllvmx86disassembler/Makefile head/share/man/man5/src.conf.5 head/share/mk/bsd.own.mk head/tools/build/mk/OptionalObsoleteFiles.inc head/usr.bin/clang/Makefile Modified: head/lib/clang/Makefile ============================================================================== --- head/lib/clang/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/lib/clang/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + .if !make(install) SUBDIR= libclanganalysis \ libclangarcmigrate \ @@ -60,6 +62,19 @@ SUBDIR= libclanganalysis \ libllvmx86info \ libllvmx86instprinter \ libllvmx86utils + +.if ${MK_CLANG_EXTRAS} != "no" +SUBDIR+=libllvmarchive \ + libllvmdebuginfo \ + libllvmexecutionengine \ + libllvminterpreter \ + libllvmjit \ + libllvmlinker \ + libllvmmcdisassembler \ + libllvmmcjit \ + libllvmobject \ + libllvmruntimedyld +.endif .endif SUBDIR+= include Modified: head/lib/clang/libllvmanalysis/Makefile ============================================================================== --- head/lib/clang/libllvmanalysis/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/lib/clang/libllvmanalysis/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmanalysis SRCDIR= lib/Analysis @@ -55,6 +57,14 @@ SRCS= AliasAnalysis.cpp \ TypeBasedAliasAnalysis.cpp \ ValueTracking.cpp +.if ${MK_CLANG_EXTRAS} != "no" +SRCS+= BlockFrequencyInfo.cpp \ + LibCallSemantics.cpp \ + PathNumbering.cpp \ + PathProfileInfo.cpp \ + PathProfileVerifier.cpp +.endif + TGHDRS= Intrinsics .include "../clang.lib.mk" Added: head/lib/clang/libllvmarchive/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmarchive/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +LIB= llvmarchive + +SRCDIR= lib/Archive +SRCS= Archive.cpp \ + ArchiveReader.cpp \ + ArchiveWriter.cpp + +.include "../clang.lib.mk" Added: head/lib/clang/libllvmdebuginfo/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmdebuginfo/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,17 @@ +# $FreeBSD$ + +LIB= llvmdebuginfo + +SRCDIR= lib/DebugInfo +SRCS= DIContext.cpp \ + DWARFAbbreviationDeclaration.cpp \ + DWARFCompileUnit.cpp \ + DWARFContext.cpp \ + DWARFDebugAbbrev.cpp \ + DWARFDebugArangeSet.cpp \ + DWARFDebugAranges.cpp \ + DWARFDebugInfoEntry.cpp \ + DWARFDebugLine.cpp \ + DWARFFormValue.cpp + +.include "../clang.lib.mk" Added: head/lib/clang/libllvmexecutionengine/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmexecutionengine/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,10 @@ +# $FreeBSD$ + +LIB= llvmexecutionengine + +SRCDIR= lib/ExecutionEngine +SRCS= ExecutionEngine.cpp \ + ExecutionEngineBindings.cpp \ + TargetSelect.cpp + +.include "../clang.lib.mk" Added: head/lib/clang/libllvminterpreter/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvminterpreter/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +LIB= llvminterpreter + +SRCDIR= lib/ExecutionEngine/Interpreter +SRCS= Execution.cpp \ + ExternalFunctions.cpp \ + Interpreter.cpp \ + +TGHDRS= Intrinsics + +.include "../clang.lib.mk" Modified: head/lib/clang/libllvmipa/Makefile ============================================================================== --- head/lib/clang/libllvmipa/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/lib/clang/libllvmipa/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmipa SRCDIR= lib/Analysis/IPA @@ -8,6 +10,10 @@ SRCS= CallGraph.cpp \ FindUsedTypes.cpp \ GlobalsModRef.cpp +.if ${MK_CLANG_EXTRAS} != "no" +SRCS+= IPA.cpp +.endif + TGHDRS= Intrinsics .include "../clang.lib.mk" Modified: head/lib/clang/libllvmipo/Makefile ============================================================================== --- head/lib/clang/libllvmipo/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/lib/clang/libllvmipo/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmipo SRCDIR= lib/Transforms/IPO @@ -23,6 +25,10 @@ SRCS= ArgumentPromotion.cpp \ StripDeadPrototypes.cpp \ StripSymbols.cpp +.if ${MK_CLANG_EXTRAS} != "no" +SRCS+= IPO.cpp +.endif + TGHDRS= Intrinsics .include "../clang.lib.mk" Added: head/lib/clang/libllvmjit/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmjit/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,14 @@ +# $FreeBSD$ + +LIB= llvmjit + +SRCDIR= lib/ExecutionEngine/JIT +SRCS= Intercept.cpp \ + JIT.cpp \ + JITDebugRegisterer.cpp \ + JITDwarfEmitter.cpp \ + JITEmitter.cpp \ + JITMemoryManager.cpp \ + OProfileJITEventListener.cpp + +.include "../clang.lib.mk" Added: head/lib/clang/libllvmlinker/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmlinker/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,11 @@ +# $FreeBSD$ + +LIB= llvmlinker + +SRCDIR= lib/Linker +SRCS= LinkArchives.cpp \ + LinkItems.cpp \ + LinkModules.cpp \ + Linker.cpp + +.include "../clang.lib.mk" Modified: head/lib/clang/libllvmmc/Makefile ============================================================================== --- head/lib/clang/libllvmmc/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/lib/clang/libllvmmc/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmmc SRCDIR= lib/MC @@ -43,4 +45,8 @@ SRCS= ELFObjectWriter.cpp \ WinCOFFObjectWriter.cpp \ WinCOFFStreamer.cpp +.if ${MK_CLANG_EXTRAS} != "no" +SRCS+= MCDisassembler.cpp +.endif + .include "../clang.lib.mk" Added: head/lib/clang/libllvmmcdisassembler/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmmcdisassembler/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,12 @@ +# $FreeBSD$ + +LIB= llvmmcdisassembler + +SRCDIR= lib/MC/MCDisassembler +SRCS= Disassembler.cpp \ + EDDisassembler.cpp \ + EDInst.cpp \ + EDOperand.cpp \ + EDToken.cpp + +.include "../clang.lib.mk" Added: head/lib/clang/libllvmmcjit/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmmcjit/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +LIB= llvmmcjit + +SRCDIR= lib/ExecutionEngine/MCJIT +SRCS= Intercept.cpp \ + MCJIT.cpp + +.include "../clang.lib.mk" Added: head/lib/clang/libllvmobject/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmobject/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,16 @@ +# $FreeBSD$ + +LIB= llvmobject + +SRCDIR= lib/Object +SRCS= Archive.cpp \ + Binary.cpp \ + COFFObjectFile.cpp \ + ELFObjectFile.cpp \ + Error.cpp \ + MachOObject.cpp \ + MachOObjectFile.cpp \ + Object.cpp \ + ObjectFile.cpp + +.include "../clang.lib.mk" Added: head/lib/clang/libllvmruntimedyld/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lib/clang/libllvmruntimedyld/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,9 @@ +# $FreeBSD$ + +LIB= llvmruntimedyld + +SRCDIR= lib/ExecutionEngine/RuntimeDyld +SRCS= RuntimeDyld.cpp \ + RuntimeDyldMachO.cpp + +.include "../clang.lib.mk" Modified: head/lib/clang/libllvmscalaropts/Makefile ============================================================================== --- head/lib/clang/libllvmscalaropts/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/lib/clang/libllvmscalaropts/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmscalaropts SRCDIR= lib/Transforms/Scalar @@ -31,6 +33,13 @@ SRCS= ADCE.cpp \ Sink.cpp \ TailRecursionElimination.cpp +.if ${MK_CLANG_EXTRAS} != "no" +SRCS+= LoopInstSimplify.cpp \ + LowerAtomic.cpp \ + Reg2Mem.cpp \ + Scalar.cpp +.endif + TGHDRS= Intrinsics .include "../clang.lib.mk" Modified: head/lib/clang/libllvmsupport/Makefile ============================================================================== --- head/lib/clang/libllvmsupport/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/lib/clang/libllvmsupport/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmsupport SRCDIR= lib/Support @@ -67,4 +69,14 @@ SRCS= APFloat.cpp \ system_error.cpp LLVM_REQUIRES_RTTI= +.if ${MK_CLANG_EXTRAS} != "no" +SRCS+= BlockFrequency.cpp \ + BranchProbability.cpp \ + DataExtractor.cpp \ + Disassembler.cpp \ + FileUtilities.cpp \ + MemoryObject.cpp \ + SystemUtils.cpp +.endif + .include "../clang.lib.mk" Modified: head/lib/clang/libllvmtransformutils/Makefile ============================================================================== --- head/lib/clang/libllvmtransformutils/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/lib/clang/libllvmtransformutils/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,5 +1,7 @@ # $FreeBSD$ +.include + LIB= llvmtransformutils SRCDIR= lib/Transforms/Utils @@ -29,6 +31,11 @@ SRCS= AddrModeMatcher.cpp \ UnifyFunctionExitNodes.cpp \ ValueMapper.cpp +.if ${MK_CLANG_EXTRAS} != "no" +SRCS+= SimplifyInstructions.cpp \ + Utils.cpp +.endif + TGHDRS= Intrinsics .include "../clang.lib.mk" Modified: head/lib/clang/libllvmx86disassembler/Makefile ============================================================================== --- head/lib/clang/libllvmx86disassembler/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/lib/clang/libllvmx86disassembler/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,11 +1,17 @@ # $FreeBSD$ +.include + LIB= llvmx86disassembler SRCDIR= lib/Target/X86/Disassembler INCDIR= lib/Target/X86 SRCS= X86Disassembler.cpp +.if ${MK_CLANG_EXTRAS} != "no" +SRCS+= X86DisassemblerDecoder.c +.endif + TGHDRS= X86GenDisassemblerTables \ X86GenEDInfo \ X86GenInstrInfo \ Modified: head/share/man/man5/src.conf.5 ============================================================================== --- head/share/man/man5/src.conf.5 Sun Feb 5 23:02:41 2012 (r231056) +++ head/share/man/man5/src.conf.5 Sun Feb 5 23:56:22 2012 (r231057) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. .\" from FreeBSD: head/tools/build/options/makeman 221733 2011-05-10 13:01:11Z ru .\" $FreeBSD$ -.Dd February 5, 2012 +.Dd February 6, 2012 .Dt SRC.CONF 5 .Os .Sh NAME @@ -271,12 +271,21 @@ Set to not build the Clang C/C++ compile .Pp It is a default setting on arm/arm, arm/armeb, ia64/ia64, mips/mipsel, mips/mipseb, mips/mips64el, mips/mips64eb, mips/mipsn32eb and sparc64/sparc64. +When set, it also enforces the following options: +.Pp +.Bl -item -compact +.It +.Va WITHOUT_CLANG_EXTRAS +.El .It Va WITH_CLANG .\" from FreeBSD: head/tools/build/options/WITH_CLANG 221730 2011-05-10 11:14:40Z ru Set to build the Clang C/C++ compiler. .Pp It is a default setting on amd64/amd64, i386/i386, pc98/i386, powerpc/powerpc and powerpc/powerpc64. +.It Va WITH_CLANG_EXTRAS +.\" $FreeBSD$ +Set to build additional clang and llvm tools, such as bugpoint. .It Va WITHOUT_CPP .\" from FreeBSD: head/tools/build/options/WITHOUT_CPP 156932 2006-03-21 07:50:50Z ru Set to not build Modified: head/share/mk/bsd.own.mk ============================================================================== --- head/share/mk/bsd.own.mk Sun Feb 5 23:02:41 2012 (r231056) +++ head/share/mk/bsd.own.mk Sun Feb 5 23:56:22 2012 (r231057) @@ -418,6 +418,7 @@ __DEFAULT_NO_OPTIONS = \ BIND_LIBS \ BIND_SIGCHASE \ BIND_XML \ + CLANG_EXTRAS \ CTF \ HESIOD \ ICONV \ @@ -524,6 +525,10 @@ MK_ZFS:= no MK_CTF:= no .endif +.if ${MK_CLANG} == "no" +MK_CLANG_EXTRAS:= no +.endif + .if ${MK_CRYPT} == "no" MK_OPENSSL:= no MK_OPENSSH:= no Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sun Feb 5 23:02:41 2012 (r231056) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sun Feb 5 23:56:22 2012 (r231057) @@ -671,6 +671,44 @@ OLD_FILES+=usr/share/man/man1/clang-cpp. OLD_FILES+=usr/share/man/man1/tblgen.1.gz .endif +.if ${MK_CLANG_EXTRAS} == no +OLD_FILES+=usr/bin/bugpoint +OLD_FILES+=usr/bin/llc +OLD_FILES+=usr/bin/lli +OLD_FILES+=usr/bin/llvm-ar +OLD_FILES+=usr/bin/llvm-as +OLD_FILES+=usr/bin/llvm-bcanalyzer +OLD_FILES+=usr/bin/llvm-diff +OLD_FILES+=usr/bin/llvm-dis +OLD_FILES+=usr/bin/llvm-extract +OLD_FILES+=usr/bin/llvm-ld +OLD_FILES+=usr/bin/llvm-link +OLD_FILES+=usr/bin/llvm-mc +OLD_FILES+=usr/bin/llvm-nm +OLD_FILES+=usr/bin/llvm-objdump +OLD_FILES+=usr/bin/llvm-prof +OLD_FILES+=usr/bin/llvm-ranlib +OLD_FILES+=usr/bin/llvm-rtdyld +OLD_FILES+=usr/bin/llvm-stub +OLD_FILES+=usr/bin/macho-dump +OLD_FILES+=usr/bin/opt +OLD_FILES+=usr/share/man/man1/bugpoint.1.gz +OLD_FILES+=usr/share/man/man1/llc.1.gz +OLD_FILES+=usr/share/man/man1/lli.1.gz +OLD_FILES+=usr/share/man/man1/llvm-ar.1.gz +OLD_FILES+=usr/share/man/man1/llvm-as.1.gz +OLD_FILES+=usr/share/man/man1/llvm-bcanalyzer.1.gz +OLD_FILES+=usr/share/man/man1/llvm-diff.1.gz +OLD_FILES+=usr/share/man/man1/llvm-dis.1.gz +OLD_FILES+=usr/share/man/man1/llvm-extract.1.gz +OLD_FILES+=usr/share/man/man1/llvm-ld.1.gz +OLD_FILES+=usr/share/man/man1/llvm-link.1.gz +OLD_FILES+=usr/share/man/man1/llvm-nm.1.gz +OLD_FILES+=usr/share/man/man1/llvm-prof.1.gz +OLD_FILES+=usr/share/man/man1/llvm-ranlib.1.gz +OLD_FILES+=usr/share/man/man1/opt.1.gz +.endif + .if ${MK_CPP} == no OLD_FILES+=usr/bin/cpp OLD_FILES+=usr/share/man/man1/cpp.1.gz Added: head/tools/build/options/WITH_CLANG_EXTRAS ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/build/options/WITH_CLANG_EXTRAS Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build additional clang and llvm tools, such as bugpoint. Modified: head/usr.bin/clang/Makefile ============================================================================== --- head/usr.bin/clang/Makefile Sun Feb 5 23:02:41 2012 (r231056) +++ head/usr.bin/clang/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -1,5 +1,30 @@ # $FreeBSD$ +.include + SUBDIR= clang clang-tblgen tblgen +.if ${MK_CLANG_EXTRAS} != "no" +SUBDIR+=bugpoint \ + llc \ + lli \ + llvm-ar \ + llvm-as \ + llvm-bcanalyzer \ + llvm-diff \ + llvm-dis \ + llvm-extract \ + llvm-ld \ + llvm-link \ + llvm-mc \ + llvm-nm \ + llvm-objdump \ + llvm-prof \ + llvm-ranlib \ + llvm-rtdyld \ + llvm-stub \ + macho-dump \ + opt +.endif + .include Added: head/usr.bin/clang/bugpoint/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/bugpoint/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,34 @@ +# $FreeBSD$ + +PROG_CXX=bugpoint + +SRCDIR= tools/bugpoint +SRCS= BugDriver.cpp \ + CrashDebugger.cpp \ + ExecutionDriver.cpp \ + ExtractFunction.cpp \ + FindBugs.cpp \ + Miscompilation.cpp \ + OptimizerDriver.cpp \ + ToolRunner.cpp \ + bugpoint.cpp + +TGHDRS= Intrinsics +LIBDEPS=llvmbitwriter \ + llvmlinker \ + llvmarchive \ + llvmbitreader \ + llvmipo \ + llvmscalaropts \ + llvminstcombine \ + llvminstrumentation \ + llvmtransformutils \ + llvmipa \ + llvmanalysis \ + llvmtarget \ + llvmmc \ + llvmasmparser \ + llvmcore \ + llvmsupport + +.include "../clang.prog.mk" Added: head/usr.bin/clang/bugpoint/bugpoint.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/bugpoint/bugpoint.1 Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,291 @@ +.\" $FreeBSD$ +.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ======================================================================== +.\" +.IX Title "BUGPOINT 1" +.TH BUGPOINT 1 "2011-10-17" "LLVM 3.0" "LLVM Command Guide" +.\" For nroff, turn off justification. Always turn off hyphenation; it makes +.\" way too many mistakes in technical documents. +.if n .ad l +.nh +.SH "NAME" +bugpoint \- automatic test case reduction tool +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +\&\fBbugpoint\fR [\fIoptions\fR] [\fIinput \s-1LLVM\s0 ll/bc files\fR] [\fI\s-1LLVM\s0 passes\fR] \fB\-\-args\fR +\&\fIprogram arguments\fR +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +\&\fBbugpoint\fR narrows down the source of problems in \s-1LLVM\s0 tools and passes. It +can be used to debug three types of failures: optimizer crashes, miscompilations +by optimizers, or bad native code generation (including problems in the static +and \s-1JIT\s0 compilers). It aims to reduce large test cases to small, useful ones. +For more information on the design and inner workings of \fBbugpoint\fR, as well as +advice for using bugpoint, see \fIllvm/docs/Bugpoint.html\fR in the \s-1LLVM\s0 +distribution. +.SH "OPTIONS" +.IX Header "OPTIONS" +.IP "\fB\-\-additional\-so\fR \fIlibrary\fR" 4 +.IX Item "--additional-so library" +Load the dynamic shared object \fIlibrary\fR into the test program whenever it is +run. This is useful if you are debugging programs which depend on non-LLVM +libraries (such as the X or curses libraries) to run. +.IP "\fB\-\-append\-exit\-code\fR=\fI{true,false}\fR" 4 +.IX Item "--append-exit-code={true,false}" +Append the test programs exit code to the output file so that a change in exit +code is considered a test failure. Defaults to false. +.IP "\fB\-\-args\fR \fIprogram args\fR" 4 +.IX Item "--args program args" +Pass all arguments specified after \-args to the test program whenever it runs. +Note that if any of the \fIprogram args\fR start with a '\-', you should use: +.Sp +.Vb 1 +\& bugpoint [bugpoint args] \-\-args \-\- [program args] +.Ve +.Sp +The \*(L"\-\-\*(R" right after the \fB\-\-args\fR option tells \fBbugpoint\fR to consider any +options starting with \f(CW\*(C`\-\*(C'\fR to be part of the \fB\-\-args\fR option, not as options to +\&\fBbugpoint\fR itself. +.IP "\fB\-\-tool\-args\fR \fItool args\fR" 4 +.IX Item "--tool-args tool args" +Pass all arguments specified after \-\-tool\-args to the \s-1LLVM\s0 tool under test +(\fBllc\fR, \fBlli\fR, etc.) whenever it runs. You should use this option in the +following way: +.Sp +.Vb 1 +\& bugpoint [bugpoint args] \-\-tool\-args \-\- [tool args] +.Ve +.Sp +The \*(L"\-\-\*(R" right after the \fB\-\-tool\-args\fR option tells \fBbugpoint\fR to consider any +options starting with \f(CW\*(C`\-\*(C'\fR to be part of the \fB\-\-tool\-args\fR option, not as +options to \fBbugpoint\fR itself. (See \fB\-\-args\fR, above.) +.IP "\fB\-\-safe\-tool\-args\fR \fItool args\fR" 4 +.IX Item "--safe-tool-args tool args" +Pass all arguments specified after \fB\-\-safe\-tool\-args\fR to the \*(L"safe\*(R" execution +tool. +.IP "\fB\-\-gcc\-tool\-args\fR \fIgcc tool args\fR" 4 +.IX Item "--gcc-tool-args gcc tool args" +Pass all arguments specified after \fB\-\-gcc\-tool\-args\fR to the invocation of +\&\fBgcc\fR. +.IP "\fB\-\-opt\-args\fR \fIopt args\fR" 4 +.IX Item "--opt-args opt args" +Pass all arguments specified after \fB\-\-opt\-args\fR to the invocation of \fBopt\fR. +.IP "\fB\-\-disable\-{dce,simplifycfg}\fR" 4 +.IX Item "--disable-{dce,simplifycfg}" +Do not run the specified passes to clean up and reduce the size of the test +program. By default, \fBbugpoint\fR uses these passes internally when attempting to +reduce test programs. If you're trying to find a bug in one of these passes, +\&\fBbugpoint\fR may crash. +.IP "\fB\-\-enable\-valgrind\fR" 4 +.IX Item "--enable-valgrind" +Use valgrind to find faults in the optimization phase. This will allow +bugpoint to find otherwise asymptomatic problems caused by memory +mis-management. +.IP "\fB\-find\-bugs\fR" 4 +.IX Item "-find-bugs" +Continually randomize the specified passes and run them on the test program +until a bug is found or the user kills \fBbugpoint\fR. +.IP "\fB\-help\fR" 4 +.IX Item "-help" +Print a summary of command line options. +.IP "\fB\-\-input\fR \fIfilename\fR" 4 +.IX Item "--input filename" +Open \fIfilename\fR and redirect the standard input of the test program, whenever +it runs, to come from that file. +.IP "\fB\-\-load\fR \fIplugin\fR" 4 +.IX Item "--load plugin" +Load the dynamic object \fIplugin\fR into \fBbugpoint\fR itself. This object should +register new optimization passes. Once loaded, the object will add new command +line options to enable various optimizations. To see the new complete list of +optimizations, use the \fB\-help\fR and \fB\-\-load\fR options together; for example: +.Sp +.Vb 1 +\& bugpoint \-\-load myNewPass.so \-help +.Ve +.IP "\fB\-\-mlimit\fR \fImegabytes\fR" 4 +.IX Item "--mlimit megabytes" +Specifies an upper limit on memory usage of the optimization and codegen. Set +to zero to disable the limit. +.IP "\fB\-\-output\fR \fIfilename\fR" 4 +.IX Item "--output filename" +Whenever the test program produces output on its standard output stream, it +should match the contents of \fIfilename\fR (the \*(L"reference output\*(R"). If you +do not use this option, \fBbugpoint\fR will attempt to generate a reference output +by compiling the program with the \*(L"safe\*(R" backend and running it. +.IP "\fB\-\-profile\-info\-file\fR \fIfilename\fR" 4 +.IX Item "--profile-info-file filename" +Profile file loaded by \fB\-\-profile\-loader\fR. +.IP "\fB\-\-run\-{int,jit,llc,cbe,custom}\fR" 4 +.IX Item "--run-{int,jit,llc,cbe,custom}" +Whenever the test program is compiled, \fBbugpoint\fR should generate code for it +using the specified code generator. These options allow you to choose the +interpreter, the \s-1JIT\s0 compiler, the static native code compiler, the C +backend, or a custom command (see \fB\-\-exec\-command\fR) respectively. +.IP "\fB\-\-safe\-{llc,cbe,custom}\fR" 4 +.IX Item "--safe-{llc,cbe,custom}" +When debugging a code generator, \fBbugpoint\fR should use the specified code +generator as the \*(L"safe\*(R" code generator. This is a known-good code generator +used to generate the \*(L"reference output\*(R" if it has not been provided, and to +compile portions of the program that as they are excluded from the testcase. +These options allow you to choose the +static native code compiler, the C backend, or a custom command, +(see \fB\-\-exec\-command\fR) respectively. The interpreter and the \s-1JIT\s0 backends +cannot currently be used as the \*(L"safe\*(R" backends. +.IP "\fB\-\-exec\-command\fR \fIcommand\fR" 4 +.IX Item "--exec-command command" +This option defines the command to use with the \fB\-\-run\-custom\fR and +\&\fB\-\-safe\-custom\fR options to execute the bitcode testcase. This can +be useful for cross-compilation. +.IP "\fB\-\-compile\-command\fR \fIcommand\fR" 4 +.IX Item "--compile-command command" +This option defines the command to use with the \fB\-\-compile\-custom\fR +option to compile the bitcode testcase. This can be useful for +testing compiler output without running any link or execute stages. To +generate a reduced unit test, you may add \s-1CHECK\s0 directives to the +testcase and pass the name of an executable compile-command script in this form: +.Sp +.Vb 3 +\& #!/bin/sh +\& llc "$@" +\& not FileCheck [bugpoint input file].ll < bugpoint\-test\-program.s +.Ve +.Sp +This script will \*(L"fail\*(R" as long as FileCheck passes. So the result +will be the minimum bitcode that passes FileCheck. +.IP "\fB\-\-safe\-path\fR \fIpath\fR" 4 +.IX Item "--safe-path path" +This option defines the path to the command to execute with the +\&\fB\-\-safe\-{int,jit,llc,cbe,custom}\fR +option. +.SH "EXIT STATUS" +.IX Header "EXIT STATUS" +If \fBbugpoint\fR succeeds in finding a problem, it will exit with 0. Otherwise, +if an error occurs, it will exit with a non-zero value. +.SH "SEE ALSO" +.IX Header "SEE ALSO" +opt +.SH "AUTHOR" +.IX Header "AUTHOR" +Maintained by the \s-1LLVM\s0 Team (). Added: head/usr.bin/clang/llc/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/llc/Makefile Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,45 @@ +# $FreeBSD$ + +PROG_CXX=llc + +SRCDIR= tools/llc +SRCS= llc.cpp + +LIBDEPS=llvmasmparser \ + llvmbitreader \ + llvmarmdisassembler \ + llvmarmasmparser \ + llvmarmcodegen \ + llvmarmdesc \ + llvmarminstprinter \ + llvmarminfo \ + llvmmipscodegen \ + llvmmipsdesc \ + llvmmipsinstprinter \ + llvmmipsinfo \ + llvmpowerpccodegen \ + llvmpowerpcdesc \ + llvmpowerpcinstprinter \ + llvmpowerpcinfo \ + llvmx86disassembler \ + llvmx86asmparser \ + llvmx86codegen \ + llvmx86desc \ + llvmselectiondag \ + llvmasmprinter \ + llvmmcparser \ + llvmcodegen \ + llvmscalaropts \ + llvminstcombine \ + llvmtransformutils \ + llvmipa \ + llvmanalysis \ + llvmtarget \ + llvmx86instprinter \ + llvmx86utils \ + llvmcore \ + llvmx86info \ + llvmmc \ + llvmsupport + +.include "../clang.prog.mk" Added: head/usr.bin/clang/llc/llc.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/usr.bin/clang/llc/llc.1 Sun Feb 5 23:56:22 2012 (r231057) @@ -0,0 +1,285 @@ +.\" $FreeBSD$ +.\" Automatically generated by Pod::Man 2.23 (Pod::Simple 3.14) +.\" +.\" Standard preamble: +.\" ======================================================================== +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. \*(C+ will +.\" give a nicer C++. Capital omega is used to do unbreakable dashes and +.\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, +.\" nothing in troff, for use with C<>. +.tr \(*W- +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" Escape single quotes in literal strings from groff's Unicode transform. +.ie \n(.g .ds Aq \(aq +.el .ds Aq ' +.\" +.\" If the F register is turned on, we'll generate index entries on stderr for +.\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index +.\" entries marked with X<> in POD. Of course, you'll have to process the +.\" output yourself in some meaningful fashion. +.ie \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.el \{\ +. de IX +.. +.\} +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 00:26:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FD45106566C; Mon, 6 Feb 2012 00:26:30 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4F3998FC12; Mon, 6 Feb 2012 00:26:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q160QUiw008219; Mon, 6 Feb 2012 00:26:30 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q160QUkG008217; Mon, 6 Feb 2012 00:26:30 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202060026.q160QUkG008217@svn.freebsd.org> From: Adrian Chadd Date: Mon, 6 Feb 2012 00:26:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231058 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 00:26:30 -0000 Author: adrian Date: Mon Feb 6 00:26:29 2012 New Revision: 231058 URL: http://svn.freebsd.org/changeset/base/231058 Log: Update the mesh reason codes to match the latest 802.11s specification. Submitted by: Reviewed by: rpaulo Modified: head/sys/net80211/ieee80211.h Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Sun Feb 5 23:56:22 2012 (r231057) +++ head/sys/net80211/ieee80211.h Mon Feb 6 00:26:29 2012 (r231058) @@ -927,19 +927,21 @@ enum { IEEE80211_REASON_SETUP_NEEDED = 38, /* 11e */ IEEE80211_REASON_TIMEOUT = 39, /* 11e */ - /* values not yet allocated by ANA */ - IEEE80211_REASON_PEER_LINK_CANCELED = 2, /* 11s */ - IEEE80211_REASON_MESH_MAX_PEERS = 3, /* 11s */ - IEEE80211_REASON_MESH_CPVIOLATION = 4, /* 11s */ - IEEE80211_REASON_MESH_CLOSE_RCVD = 5, /* 11s */ - IEEE80211_REASON_MESH_MAX_RETRIES = 6, /* 11s */ - IEEE80211_REASON_MESH_CONFIRM_TIMEOUT = 7, /* 11s */ - IEEE80211_REASON_MESH_INVALID_GTK = 8, /* 11s */ - IEEE80211_REASON_MESH_INCONS_PARAMS = 9, /* 11s */ - IEEE80211_REASON_MESH_INVALID_SECURITY = 10, /* 11s */ - IEEE80211_REASON_MESH_PERR_UNSPEC = 11, /* 11s */ - IEEE80211_REASON_MESH_PERR_NO_FI = 12, /* 11s */ - IEEE80211_REASON_MESH_PERR_DEST_UNREACH = 13, /* 11s */ + IEEE80211_REASON_PEER_LINK_CANCELED = 52, /* 11s */ + IEEE80211_REASON_MESH_MAX_PEERS = 53, /* 11s */ + IEEE80211_REASON_MESH_CPVIOLATION = 54, /* 11s */ + IEEE80211_REASON_MESH_CLOSE_RCVD = 55, /* 11s */ + IEEE80211_REASON_MESH_MAX_RETRIES = 56, /* 11s */ + IEEE80211_REASON_MESH_CONFIRM_TIMEOUT = 57, /* 11s */ + IEEE80211_REASON_MESH_INVALID_GTK = 58, /* 11s */ + IEEE80211_REASON_MESH_INCONS_PARAMS = 59, /* 11s */ + IEEE80211_REASON_MESH_INVALID_SECURITY = 60, /* 11s */ + IEEE80211_REASON_MESH_PERR_NO_PROXY = 61, /* 11s */ + IEEE80211_REASON_MESH_PERR_NO_FI = 62, /* 11s */ + IEEE80211_REASON_MESH_PERR_DEST_UNREACH = 63, /* 11s */ + IEEE80211_REASON_MESH_MAC_ALRDY_EXISTS_MBSS = 64, /* 11s */ + IEEE80211_REASON_MESH_CHAN_SWITCH_REG = 65, /* 11s */ + IEEE80211_REASON_MESH_CHAN_SWITCH_UNSPEC = 66, /* 11s */ IEEE80211_STATUS_SUCCESS = 0, IEEE80211_STATUS_UNSPECIFIED = 1, From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 04:15:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 517E41065672; Mon, 6 Feb 2012 04:15:33 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail03.syd.optusnet.com.au (mail03.syd.optusnet.com.au [211.29.132.184]) by mx1.freebsd.org (Postfix) with ESMTP id C204B8FC0C; Mon, 6 Feb 2012 04:15:32 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail03.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q164FS13029085 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 6 Feb 2012 15:15:29 +1100 Date: Mon, 6 Feb 2012 15:15:28 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Andreas Tobler In-Reply-To: <201202052004.q15K4hrC099031@svn.freebsd.org> Message-ID: <20120206151515.W1346@besplex.bde.org> References: <201202052004.q15K4hrC099031@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231044 - in head: lib/libc/powerpc lib/libc/powerpc/gen lib/libc/powerpc64 lib/libc/powerpc64/gen sys/powerpc/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 04:15:33 -0000 On Sun, 5 Feb 2012, Andreas Tobler wrote: > Log: > Replace the assembler macro WEAK_ALIAS with a new macro WEAK_REFERENCE which > has the same API as __weak_reference(). Give 'x' in SYS.h a more meaningful > name. > > Tested on 32- and 64-bit PowerMac. > > Reviewed by: bde Thanks. Bruce From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 06:03:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 27375106564A; Mon, 6 Feb 2012 06:03:17 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 11B2E8FC14; Mon, 6 Feb 2012 06:03:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1663GRp019219; Mon, 6 Feb 2012 06:03:16 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1663GZR019217; Mon, 6 Feb 2012 06:03:16 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201202060603.q1663GZR019217@svn.freebsd.org> From: Kevin Lo Date: Mon, 6 Feb 2012 06:03:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231060 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 06:03:17 -0000 Author: kevlo Date: Mon Feb 6 06:03:16 2012 New Revision: 231060 URL: http://svn.freebsd.org/changeset/base/231060 Log: - Use uint8_t for the variable x and spell the size of the variable as sizeof(x) - Capitalized comment - Parentheses around return value Requested by: bde Modified: head/sys/kern/subr_mchain.c Modified: head/sys/kern/subr_mchain.c ============================================================================== --- head/sys/kern/subr_mchain.c Mon Feb 6 04:23:37 2012 (r231059) +++ head/sys/kern/subr_mchain.c Mon Feb 6 06:03:16 2012 (r231060) @@ -62,7 +62,7 @@ mb_init(struct mbchain *mbp) m = m_gethdr(M_WAIT, MT_DATA); m->m_len = 0; mb_initm(mbp, m); - return 0; + return (0); } void @@ -89,13 +89,13 @@ mb_detach(struct mbchain *mbp) m = mbp->mb_top; mbp->mb_top = NULL; - return m; + return (m); } int mb_fixhdr(struct mbchain *mbp) { - return mbp->mb_top->m_pkthdr.len = m_fixhdr(mbp->mb_top); + return (mbp->mb_top->m_pkthdr.len = m_fixhdr(mbp->mb_top)); } /* @@ -124,70 +124,70 @@ mb_reserve(struct mbchain *mbp, int size mbp->mb_count += size; bpos = mtod(m, caddr_t) + m->m_len; m->m_len += size; - return bpos; + return (bpos); } int mb_put_padbyte(struct mbchain *mbp) { caddr_t dst; - char x = 0; + uint8_t x = 0; dst = mtod(mbp->mb_cur, caddr_t) + mbp->mb_cur->m_len; - /* only add padding if address is odd */ + /* Only add padding if address is odd */ if ((unsigned long)dst & 1) - return mb_put_mem(mbp, (caddr_t)&x, 1, MB_MSYSTEM); + return (mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM)); else - return 0; + return (0); } int mb_put_uint8(struct mbchain *mbp, uint8_t x) { - return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); + return (mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM)); } int mb_put_uint16be(struct mbchain *mbp, uint16_t x) { x = htobe16(x); - return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); + return (mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM)); } int mb_put_uint16le(struct mbchain *mbp, uint16_t x) { x = htole16(x); - return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); + return (mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM)); } int mb_put_uint32be(struct mbchain *mbp, uint32_t x) { x = htobe32(x); - return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); + return (mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM)); } int mb_put_uint32le(struct mbchain *mbp, uint32_t x) { x = htole32(x); - return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); + return (mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM)); } int mb_put_int64be(struct mbchain *mbp, int64_t x) { x = htobe64(x); - return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); + return (mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM)); } int mb_put_int64le(struct mbchain *mbp, int64_t x) { x = htole64(x); - return mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM); + return (mb_put_mem(mbp, (caddr_t)&x, sizeof(x), MB_MSYSTEM)); } int @@ -220,7 +220,7 @@ mb_put_mem(struct mbchain *mbp, c_caddr_ dstlen = mleft; error = mbp->mb_copy(mbp, source, dst, &srclen, &dstlen); if (error) - return error; + return (error); break; case MB_MINLINE: for (src = source, count = cplen; count; count--) @@ -232,7 +232,7 @@ mb_put_mem(struct mbchain *mbp, c_caddr_ case MB_MUSER: error = copyin(source, dst, cplen); if (error) - return error; + return (error); break; case MB_MZERO: bzero(dst, cplen); @@ -246,7 +246,7 @@ mb_put_mem(struct mbchain *mbp, c_caddr_ } mbp->mb_cur = m; mbp->mb_mleft = mleft; - return 0; + return (0); } int @@ -261,7 +261,7 @@ mb_put_mbuf(struct mbchain *mbp, struct } mbp->mb_mleft = M_TRAILINGSPACE(m); mbp->mb_cur = m; - return 0; + return (0); } /* @@ -277,7 +277,7 @@ mb_put_uio(struct mbchain *mbp, struct u while (size > 0 && uiop->uio_resid) { if (uiop->uio_iovcnt <= 0 || uiop->uio_iov == NULL) - return EFBIG; + return (EFBIG); left = uiop->uio_iov->iov_len; if (left == 0) { uiop->uio_iov++; @@ -288,7 +288,7 @@ mb_put_uio(struct mbchain *mbp, struct u left = size; error = mb_put_mem(mbp, uiop->uio_iov->iov_base, left, mtype); if (error) - return error; + return (error); uiop->uio_offset += left; uiop->uio_resid -= left; uiop->uio_iov->iov_base = @@ -296,7 +296,7 @@ mb_put_uio(struct mbchain *mbp, struct u uiop->uio_iov->iov_len -= left; size -= left; } - return 0; + return (0); } /* @@ -310,7 +310,7 @@ md_init(struct mdchain *mdp) m = m_gethdr(M_WAIT, MT_DATA); m->m_len = 0; md_initm(mdp, m); - return 0; + return (0); } void @@ -360,25 +360,25 @@ md_next_record(struct mdchain *mdp) struct mbuf *m; if (mdp->md_top == NULL) - return ENOENT; + return (ENOENT); m = mdp->md_top->m_nextpkt; md_done(mdp); if (m == NULL) - return ENOENT; + return (ENOENT); md_initm(mdp, m); - return 0; + return (0); } int md_get_uint8(struct mdchain *mdp, uint8_t *x) { - return md_get_mem(mdp, x, 1, MB_MINLINE); + return (md_get_mem(mdp, x, 1, MB_MINLINE)); } int md_get_uint16(struct mdchain *mdp, uint16_t *x) { - return md_get_mem(mdp, (caddr_t)x, 2, MB_MINLINE); + return (md_get_mem(mdp, (caddr_t)x, 2, MB_MINLINE)); } int @@ -389,7 +389,7 @@ md_get_uint16le(struct mdchain *mdp, uin if (x != NULL) *x = le16toh(v); - return error; + return (error); } int @@ -400,13 +400,13 @@ md_get_uint16be(struct mdchain *mdp, uin if (x != NULL) *x = be16toh(v); - return error; + return (error); } int md_get_uint32(struct mdchain *mdp, uint32_t *x) { - return md_get_mem(mdp, (caddr_t)x, 4, MB_MINLINE); + return (md_get_mem(mdp, (caddr_t)x, 4, MB_MINLINE)); } int @@ -418,7 +418,7 @@ md_get_uint32be(struct mdchain *mdp, uin error = md_get_uint32(mdp, &v); if (x != NULL) *x = be32toh(v); - return error; + return (error); } int @@ -430,13 +430,13 @@ md_get_uint32le(struct mdchain *mdp, uin error = md_get_uint32(mdp, &v); if (x != NULL) *x = le32toh(v); - return error; + return (error); } int md_get_int64(struct mdchain *mdp, int64_t *x) { - return md_get_mem(mdp, (caddr_t)x, 8, MB_MINLINE); + return (md_get_mem(mdp, (caddr_t)x, 8, MB_MINLINE)); } int @@ -448,7 +448,7 @@ md_get_int64be(struct mdchain *mdp, int6 error = md_get_int64(mdp, &v); if (x != NULL) *x = be64toh(v); - return error; + return (error); } int @@ -460,7 +460,7 @@ md_get_int64le(struct mdchain *mdp, int6 error = md_get_int64(mdp, &v); if (x != NULL) *x = le64toh(v); - return error; + return (error); } int @@ -474,7 +474,7 @@ md_get_mem(struct mdchain *mdp, caddr_t while (size > 0) { if (m == NULL) { MBERROR("incomplete copy\n"); - return EBADRPC; + return (EBADRPC); } s = mdp->md_pos; count = mtod(m, u_char*) + m->m_len - s; @@ -506,7 +506,7 @@ md_get_mem(struct mdchain *mdp, caddr_t } target += count; } - return 0; + return (0); } int @@ -517,7 +517,7 @@ md_get_mbuf(struct mdchain *mdp, int siz rm = m_copym(m, mdp->md_pos - mtod(m, u_char*), size, M_WAIT); md_get_mem(mdp, NULL, size, MB_MZERO); *ret = rm; - return 0; + return (0); } int @@ -530,7 +530,7 @@ md_get_uio(struct mdchain *mdp, struct u mtype = (uiop->uio_segflg == UIO_SYSSPACE) ? MB_MSYSTEM : MB_MUSER; while (size > 0 && uiop->uio_resid) { if (uiop->uio_iovcnt <= 0 || uiop->uio_iov == NULL) - return EFBIG; + return (EFBIG); left = uiop->uio_iov->iov_len; if (left == 0) { uiop->uio_iov++; @@ -542,7 +542,7 @@ md_get_uio(struct mdchain *mdp, struct u left = size; error = md_get_mem(mdp, uiocp, left, mtype); if (error) - return error; + return (error); uiop->uio_offset += left; uiop->uio_resid -= left; uiop->uio_iov->iov_base = @@ -550,5 +550,5 @@ md_get_uio(struct mdchain *mdp, struct u uiop->uio_iov->iov_len -= left; size -= left; } - return 0; + return (0); } From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 07:39:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9B51106564A; Mon, 6 Feb 2012 07:39:54 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 6ED918FC15; Mon, 6 Feb 2012 07:39:53 +0000 (UTC) Received: by bkbzx1 with SMTP id zx1so6141252bkb.13 for ; Sun, 05 Feb 2012 23:39:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:organization:references:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=V9qFGYI00/KfxgwblkohphIHs3hT2fmugMeHB6NixuY=; b=BVvYVNqcUOGmraH1tiH6eWEOjp5vN3wXQ9K3wSzBfflqXoqpBL5UdjYse63wxb1kuF wmSEctwWmyoPe8c8xkC8yUfX3+l94EWWGDni3yE7EmV5Fz8j3ubEnTMQZee8NwZ5LwC9 X0B6oKyKg9OzgDXiqwTtNK491NegnfLWWh/ew= Received: by 10.204.173.11 with SMTP id n11mr7904131bkz.120.1328513992428; Sun, 05 Feb 2012 23:39:52 -0800 (PST) Received: from localhost ([94.27.39.186]) by mx.google.com with ESMTPS id sp6sm42640572bkb.2.2012.02.05.23.39.49 (version=TLSv1/SSLv3 cipher=OTHER); Sun, 05 Feb 2012 23:39:50 -0800 (PST) From: Mikolaj Golub To: Pawel Jakub Dawidek Organization: TOA Ukraine References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> <20120205214647.GI30033@garage.freebsd.pl> Sender: Mikolaj Golub Date: Mon, 06 Feb 2012 09:39:47 +0200 In-Reply-To: <20120205214647.GI30033@garage.freebsd.pl> (Pawel Jakub Dawidek's message of "Sun, 5 Feb 2012 22:46:48 +0100") Message-ID: <86sjiov29o.fsf@in138.ua3> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 07:39:54 -0000 --=-=-= On Sun, 5 Feb 2012 22:46:48 +0100 Pawel Jakub Dawidek wrote: PJD> On Sun, Feb 05, 2012 at 11:27:10PM +0200, Mikolaj Golub wrote: >> Ok, using hastd code as a reference :-) here is my implementation. PJD> - I'd not pass selected signals to the child. The parent can still be PJD> killed with a whole bunch of different signals that are not passed or PJD> cannot be caught or the child process handle them gracefully. PJD> Signals should be send to the PID from the pidfile anyway. If someone PJD> is sending signals to the parent he has no right to expect well PJD> behaviour from the parent. Well, sending a whole bunch of different signals to parent we might not expect right behavior, but why not to provide it for the "standard" ones? E.g. on shutdown init(8) will send SIGTERM and the daemon will gracefully exit terminating the child and cleaning up the pidfile. If the the child process does not handle SIGTERM gracefully I don't see much difference from having only this one process alive or two (with its monitoring daemon). The pidfile is seen in ps(1) output for the daemon process, which allows to identify the monitoring daemon with its child. Or we could change its proctitle to something like "daemon: cmdname[pid]", similar to what sshd does. So people would expect that terminating a daemon will terminate the process it monitors. PJD> - Now that we handle the pidfile fully in the parent, I'd move dropping PJD> provileges after fork(2) and pidfile_write(3). This way pidfiles will PJD> always be created with root privileges and we can forget about all the PJD> mess with pid directories, etc. PJD> - With the above you can wait for child to exit with simple wait(2). Yes, it looks like much simpler, see the attached patch. But I don't think I like it much as it still looks like a half measure to me. -- Mikolaj Golub --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=daemon.c.patch Index: usr.sbin/daemon/daemon.c =================================================================== --- usr.sbin/daemon/daemon.c (revision 231060) +++ usr.sbin/daemon/daemon.c (working copy) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -49,9 +50,9 @@ int main(int argc, char *argv[]) { struct pidfh *pfh = NULL; - int ch, nochdir, noclose, errcode; + int ch, nochdir, noclose, status; const char *pidfile, *user; - pid_t otherpid; + pid_t otherpid, pid; nochdir = noclose = 1; pidfile = user = NULL; @@ -79,43 +80,61 @@ main(int argc, char *argv[]) if (argc == 0) usage(); - if (user != NULL) - restrict_process(user); + if (pidfile == NULL) { + /* + * This is a simple case. Daemonize and exec. + */ + if (daemon(nochdir, noclose) == -1) + err(1, NULL); + if (user != NULL) + restrict_process(user); + + execvp(argv[0], argv); + + /* + * execvp() failed -- report the error. The child is + * now running, so the exit status doesn't matter. + */ + err(1, "%s", argv[0]); + } + /* * Try to open the pidfile before calling daemon(3), * to be able to report the error intelligently */ - if (pidfile) { - pfh = pidfile_open(pidfile, 0600, &otherpid); - if (pfh == NULL) { - if (errno == EEXIST) { - errx(3, "process already running, pid: %d", - otherpid); - } - err(2, "pidfile ``%s''", pidfile); + pfh = pidfile_open(pidfile, 0600, &otherpid); + if (pfh == NULL) { + if (errno == EEXIST) { + errx(3, "process already running, pid: %d", + otherpid); } + err(2, "pidfile ``%s''", pidfile); } if (daemon(nochdir, noclose) == -1) err(1, NULL); - /* Now that we are the child, write out the pid */ - if (pidfile) + pid = fork(); + if (pid == -1) { + pidfile_remove(pfh); + err(1, "fork"); + } + if (pid == 0) { + /* Now that we are the child, write out the pid. */ pidfile_write(pfh); - execvp(argv[0], argv); + if (user != NULL) + restrict_process(user); - /* - * execvp() failed -- unlink pidfile if any, and - * report the error - */ - errcode = errno; /* Preserve errcode -- unlink may reset it */ - if (pidfile) - pidfile_remove(pfh); + execvp(argv[0], argv); - /* The child is now running, so the exit status doesn't matter. */ - errc(1, errcode, "%s", argv[0]); + /* execvp() failed. */ + err(1, "%s", argv[0]); + } + (void)wait(&status); + pidfile_remove(pfh); + exit(0); } static void --=-=-=-- From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 08:28:21 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 36089106564A; Mon, 6 Feb 2012 08:28:21 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 9EC528FC14; Mon, 6 Feb 2012 08:28:20 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id DC39E924; Mon, 6 Feb 2012 09:28:18 +0100 (CET) Date: Mon, 6 Feb 2012 09:27:06 +0100 From: Pawel Jakub Dawidek To: Mikolaj Golub Message-ID: <20120206082706.GA1324@garage.freebsd.pl> References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0F1p//8PRICkK4MW" Content-Disposition: inline In-Reply-To: <86sjiov29o.fsf@in138.ua3> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 08:28:21 -0000 --0F1p//8PRICkK4MW Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 06, 2012 at 09:39:47AM +0200, Mikolaj Golub wrote: >=20 > On Sun, 5 Feb 2012 22:46:48 +0100 Pawel Jakub Dawidek wrote: >=20 > PJD> On Sun, Feb 05, 2012 at 11:27:10PM +0200, Mikolaj Golub wrote: > >> Ok, using hastd code as a reference :-) here is my implementation. >=20 > PJD> - I'd not pass selected signals to the child. The parent can still = be > PJD> killed with a whole bunch of different signals that are not passe= d or > PJD> cannot be caught or the child process handle them gracefully. > PJD> Signals should be send to the PID from the pidfile anyway. If som= eone > PJD> is sending signals to the parent he has no right to expect well > PJD> behaviour from the parent. >=20 > Well, sending a whole bunch of different signals to parent we might not e= xpect > right behavior, but why not to provide it for the "standard" ones? E.g. on > shutdown init(8) will send SIGTERM and the daemon will gracefully exit > terminating the child and cleaning up the pidfile. If the the child proce= ss > does not handle SIGTERM gracefully I don't see much difference from having > only this one process alive or two (with its monitoring daemon). >=20 > The pidfile is seen in ps(1) output for the daemon process, which allows = to > identify the monitoring daemon with its child. Or we could change its > proctitle to something like "daemon: cmdname[pid]", similar to what sshd = does. > So people would expect that terminating a daemon will terminate the proce= ss it > monitors. >=20 > PJD> - Now that we handle the pidfile fully in the parent, I'd move drop= ping > PJD> provileges after fork(2) and pidfile_write(3). This way pidfiles = will > PJD> always be created with root privileges and we can forget about al= l the > PJD> mess with pid directories, etc. >=20 > PJD> - With the above you can wait for child to exit with simple wait(2). >=20 > Yes, it looks like much simpler, see the attached patch. But I don't thin= k I > like it much as it still looks like a half measure to me. I like this approach much better, as it is just simpler, but it is your call, Mikolaj. For the patch itself. You don't have to have two separate cases depending on request for pidfile. You can specify NULL pfh to the pidfile functions. Even in example from the manual page when pfh is NULL there is a case where we warn, but continue execution and call pidfile functions. This should simplify the code. If you do that (actually even if you don't), remember to either use warn(3) before pidfile_remove(3) and exit(3) after or preserve errno before calling pidfile_remove(3), as pidfile_remove(3) can modify it if unlink(2) is unsuccessful or pfh is NULL. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --0F1p//8PRICkK4MW Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8vjtoACgkQForvXbEpPzRTWwCfUaxD+cpq07A2KXKLwmhUOe0L GaIAoI5fnVF3erG5aeJmPa8ROu46e464 =p6W1 -----END PGP SIGNATURE----- --0F1p//8PRICkK4MW-- From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 08:50:20 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2422E106566B; Mon, 6 Feb 2012 08:50:20 +0000 (UTC) (envelope-from maxim.konovalov@gmail.com) Received: from mp2.macomnet.net (ipv6.irc.int.ru [IPv6:2a02:28:1:2::1b:2]) by mx1.freebsd.org (Postfix) with ESMTP id 9F52B8FC15; Mon, 6 Feb 2012 08:50:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mp2.macomnet.net (8.14.5/8.14.5) with ESMTP id q168oHVs004274; Mon, 6 Feb 2012 12:50:17 +0400 (MSK) (envelope-from maxim.konovalov@gmail.com) Date: Mon, 6 Feb 2012 12:50:17 +0400 (MSK) From: Maxim Konovalov To: Gleb Smirnoff In-Reply-To: <201202051653.q15Gr3AB092056@svn.freebsd.org> Message-ID: References: <201202051653.q15Gr3AB092056@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r231025 - in head: share/man/man4 sys/netinet sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 08:50:20 -0000 On Sun, 5 Feb 2012, 16:53-0000, Gleb Smirnoff wrote: > Author: glebius > Date: Sun Feb 5 16:53:02 2012 > New Revision: 231025 > URL: http://svn.freebsd.org/changeset/base/231025 > > Log: > Add new socket options: TCP_KEEPINIT, TCP_KEEPIDLE, TCP_KEEPINTVL and > TCP_KEEPCNT, that allow to control initial timeout, idle time, idle > re-send interval and idle send count on a per-socket basis. > > Reviewed by: andre, bz, lstewart > Great, thanks! -- Maxim Konovalov From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 10:23:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2D986106564A; Mon, 6 Feb 2012 10:23:12 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1B6D68FC18; Mon, 6 Feb 2012 10:23:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q16ANBPE031501; Mon, 6 Feb 2012 10:23:11 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16ANBCW031498; Mon, 6 Feb 2012 10:23:11 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202061023.q16ANBCW031498@svn.freebsd.org> From: Ed Schouten Date: Mon, 6 Feb 2012 10:23:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231071 - head/tools/tools/fixwhite X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 10:23:12 -0000 Author: ed Date: Mon Feb 6 10:23:11 2012 New Revision: 231071 URL: http://svn.freebsd.org/changeset/base/231071 Log: Add fixwhite(1). This small utility can be used to `sanitize' the whitespace in source code. It does the following things: Global: - Remove empty lines at the beginning and the end of a file. - Merge successive empty lines into a single empty line. Per-line: - Remove trailing whitespace. - Merge spaces preceeding tabs into the tabs. It operated on stdin/stdout. This means that if you use vi(1), you can just run :%!fixwhite to reorganize the file. Added: head/tools/tools/fixwhite/ head/tools/tools/fixwhite/Makefile (contents, props changed) head/tools/tools/fixwhite/fixwhite.1 (contents, props changed) head/tools/tools/fixwhite/fixwhite.c (contents, props changed) Added: head/tools/tools/fixwhite/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/fixwhite/Makefile Mon Feb 6 10:23:11 2012 (r231071) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= fixwhite +BINDIR= /usr/bin +WARNS= 6 + +.include Added: head/tools/tools/fixwhite/fixwhite.1 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/fixwhite/fixwhite.1 Mon Feb 6 10:23:11 2012 (r231071) @@ -0,0 +1,46 @@ +.\" Copyright (c) 2012 Ed Schouten +.\" 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 AUTHOR 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 AUTHOR 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 February 6, 2012 +.Dt FIXWHITE 1 +.Os +.Sh NAME +.Nm fixwhite +.Nd remove unneeded whitespace from text files +.Sh SYNOPSIS +.Nm +.Sh DESCRIPTION +The +.Nm +utility removes unneeded whitespace from text passed to standard input +and prints the result to standard output. +.Pp +It removes leading and trailing empty lines from the input, as well as +trailing whitespace characters from ever line of text. +Multiple successive empty lines are merged together. +Also, spaces preceeding tabs will be merged into the tab character. +.Sh AUTHORS +.An Ed Schouten Aq ed@FreeBSD.org Added: head/tools/tools/fixwhite/fixwhite.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/tools/fixwhite/fixwhite.c Mon Feb 6 10:23:11 2012 (r231071) @@ -0,0 +1,167 @@ +/*- + * Copyright (c) 2012 Ed Schouten + * 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 AUTHOR 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 AUTHOR 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include + +static char *queue = NULL; +static size_t queuelen = 0, queuesize = 0; +static off_t column = 0; + +static void +savebyte(char c) +{ + + if (queuelen >= queuesize) { + queuesize += 128; + queue = realloc(queue, queuesize); + if (queue == NULL) { + perror("malloc"); + exit(1); + } + } + queue[queuelen++] = c; + + switch (c) { + case '\n': + column = 0; + break; + case ' ': + column++; + break; + case '\t': + column = (column / 8 + 1) * 8; + break; + } +} + +static bool +peekbyte(size_t back, char c) +{ + + return (queuelen >= back && queue[queuelen - back] == c); +} + +static void +savewhite(char c, bool leading) +{ + off_t ncolumn; + + switch (c) { + case '\n': + if (leading) { + /* Remove empty lines before input. */ + queuelen = 0; + column = 0; + } else { + /* Remove trailing whitespace. */ + while (peekbyte(1, ' ') || peekbyte(1, '\t')) + queuelen--; + /* Remove redundant empty lines. */ + if (peekbyte(2, '\n') && peekbyte(1, '\n')) + return; + savebyte('\n'); + } + break; + case ' ': + savebyte(' '); + break; + case '\t': + /* Convert preceeding spaces to tabs. */ + ncolumn = (column / 8 + 1) * 8; + while (peekbyte(1, ' ')) { + queuelen--; + column--; + } + while (column < ncolumn) + savebyte('\t'); + break; + } +} + +static void +printwhite(void) +{ + + if (fwrite(queue, 1, queuelen, stdout) != queuelen) { + perror("write"); + exit(1); + } + queuelen = 0; +} + +static char +readchar(void) +{ + int c; + + c = getchar(); + if (c == EOF && ferror(stdin)) { + perror("read"); + exit(1); + } + return (c); +} + +static void +writechar(char c) +{ + + if (putchar(c) == EOF) { + perror("write"); + exit(1); + } + /* XXX: Multi-byte characters. */ + column++; +} + +int +main(void) +{ + int c; + bool leading = true; + + while ((c = readchar()) != EOF) { + if (isspace(c)) + /* Save whitespace. */ + savewhite(c, leading); + else { + /* Reprint whitespace and print regular character. */ + printwhite(); + writechar(c); + leading = false; + } + } + /* Terminate non-empty files with a newline. */ + if (!leading) + writechar('\n'); + return (0); +} From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 10:47:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 68D98106564A; Mon, 6 Feb 2012 10:47:13 +0000 (UTC) (envelope-from tuexen@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 57CD68FC08; Mon, 6 Feb 2012 10:47:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q16AlDAb032399; Mon, 6 Feb 2012 10:47:13 GMT (envelope-from tuexen@svn.freebsd.org) Received: (from tuexen@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16AlD3Z032397; Mon, 6 Feb 2012 10:47:13 GMT (envelope-from tuexen@svn.freebsd.org) Message-Id: <201202061047.q16AlD3Z032397@svn.freebsd.org> From: Michael Tuexen Date: Mon, 6 Feb 2012 10:47:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231074 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 10:47:13 -0000 Author: tuexen Date: Mon Feb 6 10:47:12 2012 New Revision: 231074 URL: http://svn.freebsd.org/changeset/base/231074 Log: Fix a typo which was already fixed by eadler in r227489. We missed to integrate this fix in our code base, so it was removed in r227755. MFC after: 3 days. Modified: head/sys/netinet/sctp_structs.h Modified: head/sys/netinet/sctp_structs.h ============================================================================== --- head/sys/netinet/sctp_structs.h Mon Feb 6 10:38:20 2012 (r231073) +++ head/sys/netinet/sctp_structs.h Mon Feb 6 10:47:12 2012 (r231074) @@ -416,7 +416,7 @@ TAILQ_HEAD(sctpchunk_listhead, sctp_tmit #define CHUNK_FLAGS_PR_SCTP_BUF SCTP_PR_SCTP_BUF #define CHUNK_FLAGS_PR_SCTP_RTX SCTP_PR_SCTP_RTX -/* The upper byte is used a a bit mask */ +/* The upper byte is used as a bit mask */ #define CHUNK_FLAGS_FRAGMENT_OK 0x0100 struct chk_id { From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 11:04:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D978B1065670; Mon, 6 Feb 2012 11:04:36 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE6198FC0C; Mon, 6 Feb 2012 11:04:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q16B4aMX032963; Mon, 6 Feb 2012 11:04:36 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16B4aSp032953; Mon, 6 Feb 2012 11:04:36 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202061104.q16B4aSp032953@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 6 Feb 2012 11:04:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231075 - in head/sys: fs/ext2fs fs/nfsclient geom/journal kern nfsclient sys ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 11:04:36 -0000 Author: kib Date: Mon Feb 6 11:04:36 2012 New Revision: 231075 URL: http://svn.freebsd.org/changeset/base/231075 Log: Current implementations of sync(2) and syncer vnode fsync() VOP uses mnt_noasync counter to temporary remove MNTK_ASYNC mount option, which is needed to guarantee a synchronous completion of the initiated i/o before syscall or VOP return. Global removal of MNTK_ASYNC option is harmful because not only i/o started from corresponding thread becomes synchronous, but all i/o is synchronous on the filesystem which is initiated during sync(2) or syncer activity. Instead of removing MNTK_ASYNC from mnt_kern_flag, provide a local thread flag to disable async i/o for current thread only. Use the opportunity to move DOINGASYNC() macro into sys/vnode.h and consistently use it through places which tested for MNTK_ASYNC. Some testing demonstrated 60-70% improvements in run time for the metadata-intensive operations on async-mounted UFS volumes, but still with great deviation due to other reasons. Reviewed by: mckusick Tested by: scottl MFC after: 2 weeks Modified: head/sys/fs/ext2fs/inode.h head/sys/fs/nfsclient/nfs_clvnops.c head/sys/geom/journal/g_journal.c head/sys/kern/vfs_subr.c head/sys/kern/vfs_syscalls.c head/sys/nfsclient/nfs_vnops.c head/sys/sys/proc.h head/sys/sys/vnode.h head/sys/ufs/ufs/inode.h Modified: head/sys/fs/ext2fs/inode.h ============================================================================== --- head/sys/fs/ext2fs/inode.h Mon Feb 6 10:47:12 2012 (r231074) +++ head/sys/fs/ext2fs/inode.h Mon Feb 6 11:04:36 2012 (r231075) @@ -158,9 +158,6 @@ struct indir { #define VTOI(vp) ((struct inode *)(vp)->v_data) #define ITOV(ip) ((ip)->i_vnode) -/* Check whether the MNTK_ASYNC flag has been set for a mount point */ -#define DOINGASYNC(vp) ((vp)->v_mount->mnt_kern_flag & MNTK_ASYNC) - /* This overlays the fid structure (see mount.h). */ struct ufid { uint16_t ufid_len; /* Length of structure. */ Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Mon Feb 6 10:47:12 2012 (r231074) +++ head/sys/fs/nfsclient/nfs_clvnops.c Mon Feb 6 11:04:36 2012 (r231075) @@ -1376,7 +1376,7 @@ ncl_writerpc(struct vnode *vp, struct ui if (ret && !error) error = ret; } - if (vp->v_mount->mnt_kern_flag & MNTK_ASYNC) + if (DOINGASYNC(vp)) *iomode = NFSWRITE_FILESYNC; if (error && NFS_ISV4(vp)) error = nfscl_maperr(uiop->uio_td, error, (uid_t)0, (gid_t)0); Modified: head/sys/geom/journal/g_journal.c ============================================================================== --- head/sys/geom/journal/g_journal.c Mon Feb 6 10:47:12 2012 (r231074) +++ head/sys/geom/journal/g_journal.c Mon Feb 6 11:04:36 2012 (r231075) @@ -2870,7 +2870,7 @@ g_journal_do_switch(struct g_class *clas struct mount *mp; struct bintime bt; char *mountpoint; - int error, vfslocked; + int error, save, vfslocked; DROP_GIANT(); g_topology_lock(); @@ -2932,10 +2932,7 @@ g_journal_do_switch(struct g_class *clas goto next; } - MNT_ILOCK(mp); - mp->mnt_noasync++; - mp->mnt_kern_flag &= ~MNTK_ASYNC; - MNT_IUNLOCK(mp); + save = curthread_pflags_set(TDP_SYNCIO); GJ_TIMER_START(1, &bt); vfs_msync(mp, MNT_NOWAIT); @@ -2950,11 +2947,7 @@ g_journal_do_switch(struct g_class *clas mountpoint, error); } - MNT_ILOCK(mp); - mp->mnt_noasync--; - if ((mp->mnt_flag & MNT_ASYNC) != 0 && mp->mnt_noasync == 0) - mp->mnt_kern_flag |= MNTK_ASYNC; - MNT_IUNLOCK(mp); + curthread_pflags_restore(save); vn_finished_write(mp); Modified: head/sys/kern/vfs_subr.c ============================================================================== --- head/sys/kern/vfs_subr.c Mon Feb 6 10:47:12 2012 (r231074) +++ head/sys/kern/vfs_subr.c Mon Feb 6 11:04:36 2012 (r231075) @@ -3521,7 +3521,7 @@ sync_fsync(struct vop_fsync_args *ap) { struct vnode *syncvp = ap->a_vp; struct mount *mp = syncvp->v_mount; - int error; + int error, save; struct bufobj *bo; /* @@ -3551,17 +3551,10 @@ sync_fsync(struct vop_fsync_args *ap) vfs_unbusy(mp); return (0); } - MNT_ILOCK(mp); - mp->mnt_noasync++; - mp->mnt_kern_flag &= ~MNTK_ASYNC; - MNT_IUNLOCK(mp); + save = curthread_pflags_set(TDP_SYNCIO); vfs_msync(mp, MNT_NOWAIT); error = VFS_SYNC(mp, MNT_LAZY); - MNT_ILOCK(mp); - mp->mnt_noasync--; - if ((mp->mnt_flag & MNT_ASYNC) != 0 && mp->mnt_noasync == 0) - mp->mnt_kern_flag |= MNTK_ASYNC; - MNT_IUNLOCK(mp); + curthread_pflags_restore(save); vn_finished_write(mp); vfs_unbusy(mp); return (error); Modified: head/sys/kern/vfs_syscalls.c ============================================================================== --- head/sys/kern/vfs_syscalls.c Mon Feb 6 10:47:12 2012 (r231074) +++ head/sys/kern/vfs_syscalls.c Mon Feb 6 11:04:36 2012 (r231075) @@ -134,7 +134,7 @@ sys_sync(td, uap) struct sync_args *uap; { struct mount *mp, *nmp; - int vfslocked; + int save, vfslocked; mtx_lock(&mountlist_mtx); for (mp = TAILQ_FIRST(&mountlist); mp != NULL; mp = nmp) { @@ -145,18 +145,10 @@ sys_sync(td, uap) vfslocked = VFS_LOCK_GIANT(mp); if ((mp->mnt_flag & MNT_RDONLY) == 0 && vn_start_write(NULL, &mp, V_NOWAIT) == 0) { - MNT_ILOCK(mp); - mp->mnt_noasync++; - mp->mnt_kern_flag &= ~MNTK_ASYNC; - MNT_IUNLOCK(mp); + save = curthread_pflags_set(TDP_SYNCIO); vfs_msync(mp, MNT_NOWAIT); VFS_SYNC(mp, MNT_NOWAIT); - MNT_ILOCK(mp); - mp->mnt_noasync--; - if ((mp->mnt_flag & MNT_ASYNC) != 0 && - mp->mnt_noasync == 0) - mp->mnt_kern_flag |= MNTK_ASYNC; - MNT_IUNLOCK(mp); + curthread_pflags_restore(save); vn_finished_write(mp); } VFS_UNLOCK_GIANT(vfslocked); Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Mon Feb 6 10:47:12 2012 (r231074) +++ head/sys/nfsclient/nfs_vnops.c Mon Feb 6 11:04:36 2012 (r231075) @@ -1448,7 +1448,7 @@ nfs_writerpc(struct vnode *vp, struct ui tsiz -= len; } nfsmout: - if (vp->v_mount->mnt_kern_flag & MNTK_ASYNC) + if (DOINGASYNC(vp)) committed = NFSV3WRITE_FILESYNC; *iomode = committed; if (error) Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Mon Feb 6 10:47:12 2012 (r231074) +++ head/sys/sys/proc.h Mon Feb 6 11:04:36 2012 (r231075) @@ -400,7 +400,7 @@ do { \ #define TDP_NOSLEEPING 0x00000100 /* Thread is not allowed to sleep on a sq. */ #define TDP_OWEUPC 0x00000200 /* Call addupc() at next AST. */ #define TDP_ITHREAD 0x00000400 /* Thread is an interrupt thread. */ -#define TDP_UNUSED800 0x00000800 /* available. */ +#define TDP_SYNCIO 0x00000800 /* Local override, disable async i/o. */ #define TDP_SCHED1 0x00001000 /* Reserved for scheduler private use */ #define TDP_SCHED2 0x00002000 /* Reserved for scheduler private use */ #define TDP_SCHED3 0x00004000 /* Reserved for scheduler private use */ Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Mon Feb 6 10:47:12 2012 (r231074) +++ head/sys/sys/vnode.h Mon Feb 6 11:04:36 2012 (r231075) @@ -538,6 +538,10 @@ void assert_vop_unlocked(struct vnode *v */ #define VCALL(c) ((c)->a_desc->vdesc_call(c)) +#define DOINGASYNC(vp) \ + (((vp)->v_mount->mnt_kern_flag & MNTK_ASYNC) != 0 && \ + ((curthread->td_pflags & TDP_SYNCIO) == 0)) + /* * VMIO support inline */ Modified: head/sys/ufs/ufs/inode.h ============================================================================== --- head/sys/ufs/ufs/inode.h Mon Feb 6 10:47:12 2012 (r231074) +++ head/sys/ufs/ufs/inode.h Mon Feb 6 11:04:36 2012 (r231075) @@ -176,7 +176,6 @@ struct indir { /* Determine if soft dependencies are being done */ #define DOINGSOFTDEP(vp) ((vp)->v_mount->mnt_flag & (MNT_SOFTDEP | MNT_SUJ)) #define MOUNTEDSOFTDEP(mp) ((mp)->mnt_flag & (MNT_SOFTDEP | MNT_SUJ)) -#define DOINGASYNC(vp) ((vp)->v_mount->mnt_kern_flag & MNTK_ASYNC) #define DOINGSUJ(vp) ((vp)->v_mount->mnt_flag & MNT_SUJ) #define MOUNTEDSUJ(mp) ((mp)->mnt_flag & MNT_SUJ) From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 11:34:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 453101065672; Mon, 6 Feb 2012 11:34:48 +0000 (UTC) (envelope-from ivoras@gmail.com) Received: from mail-yw0-f54.google.com (mail-yw0-f54.google.com [209.85.213.54]) by mx1.freebsd.org (Postfix) with ESMTP id D369B8FC12; Mon, 6 Feb 2012 11:34:47 +0000 (UTC) Received: by yhfs35 with SMTP id s35so2932210yhf.13 for ; Mon, 06 Feb 2012 03:34:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=fm/jCDf52hOCIrOsVkq+EENPcSa3z2kMDK/YJr0GxVY=; b=PLyQbh6PmYsvxZMbU3uS4ewrIEO/fiXoUC878QgkD3r5YfIuhrIelu0RV3L/ZT/NzM uca6/SpFOlr8z5BdoDNLZ+hDtZr9tRMEbPP6Pz0SbE0In4Y4B8ToVeZC+4qJT8kW7d0s YbhtD2sf2QWN+1tEem3WqAitUmMhN1KEapTsc= Received: by 10.236.110.110 with SMTP id t74mr22122055yhg.121.1328528087129; Mon, 06 Feb 2012 03:34:47 -0800 (PST) MIME-Version: 1.0 Sender: ivoras@gmail.com Received: by 10.100.121.14 with HTTP; Mon, 6 Feb 2012 03:34:06 -0800 (PST) In-Reply-To: <201202041649.q14GnUnI043572@svn.freebsd.org> References: <201202041649.q14GnUnI043572@svn.freebsd.org> From: Ivan Voras Date: Mon, 6 Feb 2012 12:34:06 +0100 X-Google-Sender-Auth: 5OksnqpGFU87L49c6xU41Pm6dlU Message-ID: To: Ryan Stone Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230984 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 11:34:48 -0000 On 4 February 2012 17:49, Ryan Stone wrote: > Author: rstone > Date: Sat Feb =C2=A04 16:49:29 2012 > New Revision: 230984 > URL: http://svn.freebsd.org/changeset/base/230984 > > Log: > =C2=A0Whenever a new kernel thread is spawned, explicitly clear any CPU a= ffinity > =C2=A0set on the new thread. =C2=A0This prevents the thread from inadvert= ently > =C2=A0inheriting affinity from a random sibling. Shouldn't new threads inherit affinity from the threads which spawned them? From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 11:35:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2096106564A; Mon, 6 Feb 2012 11:35:30 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 85ACE8FC08; Mon, 6 Feb 2012 11:35:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q16BZUEq033927; Mon, 6 Feb 2012 11:35:30 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16BZUY6033922; Mon, 6 Feb 2012 11:35:30 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202061135.q16BZUY6033922@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 6 Feb 2012 11:35:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231076 - in head: sbin/ipfw sys/netinet/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 11:35:30 -0000 Author: glebius Date: Mon Feb 6 11:35:29 2012 New Revision: 231076 URL: http://svn.freebsd.org/changeset/base/231076 Log: Make the 'tcpwin' option of ipfw(8) accept ranges and lists. Submitted by: sem Modified: head/sbin/ipfw/ipfw.8 head/sbin/ipfw/ipfw2.c head/sys/netinet/ipfw/ip_fw2.c head/sys/netinet/ipfw/ip_fw_sockopt.c Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Mon Feb 6 11:04:36 2012 (r231075) +++ head/sbin/ipfw/ipfw.8 Mon Feb 6 11:35:29 2012 (r231076) @@ -1652,10 +1652,12 @@ option for details on matching fragmente TCP packets only. Match if the TCP header sequence number field is set to .Ar seq . -.It Cm tcpwin Ar win -TCP packets only. -Match if the TCP header window field is set to -.Ar win . +.It Cm tcpwin Ar tcpwin-list +Matches TCP packets whose header window field is set to +.Ar tcpwin-list , +which is either a single value or a list of values or ranges +specified in the same way as +.Ar ports . .It Cm tcpoptions Ar spec TCP packets only. Match if the TCP header contains the comma separated list of Modified: head/sbin/ipfw/ipfw2.c ============================================================================== --- head/sbin/ipfw/ipfw2.c Mon Feb 6 11:04:36 2012 (r231075) +++ head/sbin/ipfw/ipfw2.c Mon Feb 6 11:35:29 2012 (r231076) @@ -512,6 +512,7 @@ static struct _s_x _port_name[] = { {"ipttl", O_IPTTL}, {"mac-type", O_MAC_TYPE}, {"tcpdatalen", O_TCPDATALEN}, + {"tcpwin", O_TCPWIN}, {"tagged", O_TAGGED}, {NULL, 0} }; @@ -1480,7 +1481,11 @@ show_ipfw(struct ip_fw *rule, int pcwidt break; case O_TCPWIN: - printf(" tcpwin %d", ntohs(cmd->arg1)); + if (F_LEN(cmd) == 1) + printf(" tcpwin %u", cmd->arg1); + else + print_newports((ipfw_insn_u16 *)cmd, 0, + O_TCPWIN); break; case O_TCPACK: @@ -3447,8 +3452,12 @@ read_options: case TOK_TCPWIN: NEED1("tcpwin requires length"); - fill_cmd(cmd, O_TCPWIN, 0, - htons(strtoul(*av, NULL, 0))); + if (strpbrk(*av, "-,")) { + if (!add_ports(cmd, *av, 0, O_TCPWIN)) + errx(EX_DATAERR, "invalid tcpwin len %s", *av); + } else + fill_cmd(cmd, O_TCPWIN, 0, + strtoul(*av, NULL, 0)); av++; break; Modified: head/sys/netinet/ipfw/ip_fw2.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw2.c Mon Feb 6 11:04:36 2012 (r231075) +++ head/sys/netinet/ipfw/ip_fw2.c Mon Feb 6 11:35:29 2012 (r231076) @@ -1650,8 +1650,22 @@ do { \ break; case O_TCPWIN: - match = (proto == IPPROTO_TCP && offset == 0 && - cmd->arg1 == TCP(ulp)->th_win); + if (proto == IPPROTO_TCP && offset == 0) { + uint16_t x; + uint16_t *p; + int i; + + x = ntohs(TCP(ulp)->th_win); + if (cmdlen == 1) { + match = (cmd->arg1 == x); + break; + } + /* Otherwise we have ranges. */ + p = ((ipfw_insn_u16 *)cmd)->ports; + i = cmdlen - 1; + for (; !match && i > 0; i--, p += 2) + match = (x >= p[0] && x <= p[1]); + } break; case O_ESTAB: Modified: head/sys/netinet/ipfw/ip_fw_sockopt.c ============================================================================== --- head/sys/netinet/ipfw/ip_fw_sockopt.c Mon Feb 6 11:04:36 2012 (r231075) +++ head/sys/netinet/ipfw/ip_fw_sockopt.c Mon Feb 6 11:35:29 2012 (r231076) @@ -569,7 +569,6 @@ check_ipfw_struct(struct ip_fw *rule, in case O_IPPRECEDENCE: case O_IPVER: case O_SOCKARG: - case O_TCPWIN: case O_TCPFLAGS: case O_TCPOPTS: case O_ESTAB: @@ -679,6 +678,7 @@ check_ipfw_struct(struct ip_fw *rule, in case O_IPTTL: case O_IPLEN: case O_TCPDATALEN: + case O_TCPWIN: case O_TAGGED: if (cmdlen < 1 || cmdlen > 31) goto bad_size; From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 11:47:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DC862106566C; Mon, 6 Feb 2012 11:47:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CBB678FC16; Mon, 6 Feb 2012 11:47:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q16BlOQa034304; Mon, 6 Feb 2012 11:47:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16BlODi034302; Mon, 6 Feb 2012 11:47:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202061147.q16BlODi034302@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 6 Feb 2012 11:47:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231077 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 11:47:25 -0000 Author: kib Date: Mon Feb 6 11:47:24 2012 New Revision: 231077 URL: http://svn.freebsd.org/changeset/base/231077 Log: JNEWBLK dependency may legitimately appear on the buf dependency list. If softdep_sync_buf() discovers such dependency, it should do nothing, which is safe as it is only waiting on the parent buffer to be written, so it can be removed. Committed on behalf of: jeff MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Mon Feb 6 11:35:29 2012 (r231076) +++ head/sys/ufs/ffs/ffs_softdep.c Mon Feb 6 11:47:24 2012 (r231077) @@ -12112,6 +12112,7 @@ top: case D_FREEWORK: case D_FREEDEP: case D_JSEGDEP: + case D_JNEWBLK: continue; default: From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 11:51:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92A79106564A; Mon, 6 Feb 2012 11:51:05 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 67C488FC0C; Mon, 6 Feb 2012 11:51:05 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q16Bp5F5034465; Mon, 6 Feb 2012 11:51:05 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16Bp51j034462; Mon, 6 Feb 2012 11:51:05 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202061151.q16Bp51j034462@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 6 Feb 2012 11:51:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231078 - head/sbin/ipfw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 11:51:05 -0000 Author: glebius Date: Mon Feb 6 11:51:04 2012 New Revision: 231078 URL: http://svn.freebsd.org/changeset/base/231078 Log: Bump .Dd for r231076. Submitted by: bz Modified: head/sbin/ipfw/ipfw.8 Modified: head/sbin/ipfw/ipfw.8 ============================================================================== --- head/sbin/ipfw/ipfw.8 Mon Feb 6 11:47:24 2012 (r231077) +++ head/sbin/ipfw/ipfw.8 Mon Feb 6 11:51:04 2012 (r231078) @@ -1,7 +1,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 10, 2011 +.Dd February 6, 2012 .Dt IPFW 8 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 12:03:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99C921065710; Mon, 6 Feb 2012 12:03:21 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 884C58FC12; Mon, 6 Feb 2012 12:03:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q16C3L6p034873; Mon, 6 Feb 2012 12:03:21 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16C3LO3034869; Mon, 6 Feb 2012 12:03:21 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201202061203.q16C3LO3034869@svn.freebsd.org> From: Dimitry Andric Date: Mon, 6 Feb 2012 12:03:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231079 - head/usr.bin/rpcgen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 12:03:22 -0000 Author: dim Date: Mon Feb 6 12:03:21 2012 New Revision: 231079 URL: http://svn.freebsd.org/changeset/base/231079 Log: Let rpcgen(1) support an environment variable RPCGEN_CPP to find the C preprocessor to run. Previously, it always ran /usr/bin/cpp, unless you used the -Y option, and even then you could not set the basename. It also attempted to run /usr/ccs/lib/cpp for SVR4 compatibility, but this is obsolete, and has been removed. Note that setting RPCGEN_CPP to a command with arguments is supported, though the command line parsing is simplistic. However, setting it to e.g. "gcc46 -E" or "clang -E" will lead to problems, because both gcc and clang in -E mode will consider files with unknown extensions (such as .x) as object files, and attempt to link them. This could be worked around by also adding "-x c", but it is much safer to set RPCGEN_CPP to e.g. "cpp46" or "clang-cpp" instead. MFC after: 1 week Modified: head/usr.bin/rpcgen/rpc_main.c head/usr.bin/rpcgen/rpcgen.1 Modified: head/usr.bin/rpcgen/rpc_main.c ============================================================================== --- head/usr.bin/rpcgen/rpc_main.c Mon Feb 6 11:51:04 2012 (r231078) +++ head/usr.bin/rpcgen/rpc_main.c Mon Feb 6 12:03:21 2012 (r231079) @@ -75,13 +75,8 @@ static void s_output(int, const char **, #define EXTEND 1 /* alias for TRUE */ #define DONT_EXTEND 0 /* alias for FALSE */ -#define SVR4_CPP "/usr/ccs/lib/cpp" -#define SUNOS_CPP "/usr/bin/cpp" - -static int cppDefined = 0; /* explicit path for C preprocessor */ - static const char *svcclosetime = "120"; -static const char *CPP = SVR4_CPP; +static const char *CPP = NULL; static const char CPPFLAGS[] = "-C"; static char pathbuf[MAXPATHLEN + 1]; static const char *allv[] = { @@ -97,7 +92,7 @@ static int allnc = sizeof (allnv)/sizeof * machinations for handling expanding argument list */ static void addarg(const char *); /* add another argument to the list */ -static void putarg(int, const char *); /* put argument at specified location */ +static void insarg(int, const char *); /* insert arg at specified location */ static void clear_args(void); /* clear argument list */ static void checkfiles(const char *, const char *); /* check if out file already exists */ @@ -105,7 +100,7 @@ static void checkfiles(const char *, con #define ARGLISTLEN 20 -#define FIXEDARGS 2 +#define FIXEDARGS 0 static char *arglist[ARGLISTLEN]; static int argcount = FIXEDARGS; @@ -288,24 +283,35 @@ clear_args(void) argcount = FIXEDARGS; } -/* make sure that a CPP exists */ +/* prepend C-preprocessor and flags before arguments */ static void -find_cpp(void) +prepend_cpp(void) { + int idx = 1; + const char *var; + char *dupvar, *s, *t; struct stat buf; - if (stat(CPP, &buf) < 0) { /* SVR4 or explicit cpp does not exist */ - if (cppDefined) { - warnx("cannot find C preprocessor: %s", CPP); - crash(); - } else { /* try the other one */ - CPP = SUNOS_CPP; - if (stat(CPP, &buf) < 0) { /* can't find any cpp */ - warnx("cannot find C preprocessor: %s", CPP); - crash(); - } + if (CPP != NULL) + insarg(0, CPP); + else if ((var = getenv("RPCGEN_CPP")) == NULL) + insarg(0, "/usr/bin/cpp"); + else { + /* Parse command line in a rudimentary way */ + dupvar = xstrdup(var); + for (s = dupvar, idx = 0; (t = strsep(&s, " \t")) != NULL; ) { + if (t[0]) + insarg(idx++, t); } + free(dupvar); } + + if (stat(arglist[0], &buf) < 0) { + warnx("cannot find C preprocessor: %s", arglist[0]); + crash(); + } + + insarg(idx, CPPFLAGS); } /* @@ -320,9 +326,7 @@ open_input(const char *infile, const cha (void) pipe(pd); switch (childpid = fork()) { case 0: - find_cpp(); - putarg(0, CPP); - putarg(1, CPPFLAGS); + prepend_cpp(); addarg(define); if (infile) addarg(infile); @@ -934,18 +938,26 @@ addarg(const char *cp) } +/* + * Insert an argument at the specified location + */ static void -putarg(int place, const char *cp) +insarg(int place, const char *cp) { - if (place >= ARGLISTLEN) { - warnx("arglist coding error"); + int i; + + if (argcount >= ARGLISTLEN) { + warnx("too many defines"); crash(); /*NOTREACHED*/ } - if (cp != NULL) - arglist[place] = xstrdup(cp); - else - arglist[place] = NULL; + + /* Move up existing arguments */ + for (i = argcount - 1; i > place; i--) + arglist[i + 1] = arglist[i]; + + arglist[place] = xstrdup(cp); + argcount++; } /* @@ -1134,7 +1146,6 @@ parseargs(int argc, const char *argv[], return (0); } CPP = pathbuf; - cppDefined = 1; goto nextarg; Modified: head/usr.bin/rpcgen/rpcgen.1 ============================================================================== --- head/usr.bin/rpcgen/rpcgen.1 Mon Feb 6 11:51:04 2012 (r231078) +++ head/usr.bin/rpcgen/rpcgen.1 Mon Feb 6 12:03:21 2012 (r231079) @@ -490,6 +490,11 @@ Give the name of the directory where .Nm will start looking for the C-preprocessor. .El +.Sh ENVIRONMENT +If the +.Ev RPCGEN_CPP +environment variable is set, its value is used as the command line of the +C preprocessor to be run on the input file. .Sh EXAMPLES The following example: .Dl example% rpcgen -T prot.x From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 12:08:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04265106566C; Mon, 6 Feb 2012 12:08:42 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E780D8FC12; Mon, 6 Feb 2012 12:08:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q16C8fMJ035133; Mon, 6 Feb 2012 12:08:41 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16C8fnU035131; Mon, 6 Feb 2012 12:08:41 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201202061208.q16C8fnU035131@svn.freebsd.org> From: Dimitry Andric Date: Mon, 6 Feb 2012 12:08:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231080 - head/usr.bin/rpcgen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 12:08:42 -0000 Author: dim Date: Mon Feb 6 12:08:41 2012 New Revision: 231080 URL: http://svn.freebsd.org/changeset/base/231080 Log: Amend r231079 by properly shifting up the existing arguments in rpc_main.c's insarg() function. I had forgotten to put this in my patch queue, sorry. Pointy hat to: me MFC after: 1 week Modified: head/usr.bin/rpcgen/rpc_main.c Modified: head/usr.bin/rpcgen/rpc_main.c ============================================================================== --- head/usr.bin/rpcgen/rpc_main.c Mon Feb 6 12:03:21 2012 (r231079) +++ head/usr.bin/rpcgen/rpc_main.c Mon Feb 6 12:08:41 2012 (r231080) @@ -953,7 +953,7 @@ insarg(int place, const char *cp) } /* Move up existing arguments */ - for (i = argcount - 1; i > place; i--) + for (i = argcount - 1; i >= place; i--) arglist[i + 1] = arglist[i]; arglist[place] = xstrdup(cp); From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 13:08:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D6D7106564A; Mon, 6 Feb 2012 13:08:30 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from sakura.ccs.furiru.org (sakura.ccs.furiru.org [IPv6:2001:2f0:104:8060::1]) by mx1.freebsd.org (Postfix) with ESMTP id 084808FC1C; Mon, 6 Feb 2012 13:08:29 +0000 (UTC) Received: from localhost (authenticated bits=0) by sakura.ccs.furiru.org (unknown) with ESMTP id q16D8Hkw062672; Mon, 6 Feb 2012 22:08:20 +0900 (JST) (envelope-from nyan@FreeBSD.org) Date: Mon, 06 Feb 2012 22:07:21 +0900 (JST) Message-Id: <20120206.220721.343708041459090867.nyan@FreeBSD.org> To: nwhitehorn@freebsd.org From: TAKAHASHI Yoshihiro In-Reply-To: <4F2EA4F7.9010204@freebsd.org> References: <1F971DB2-9CC6-41C9-9296-039D63E05FC2@FreeBSD.org> <20120128.193030.322386357550021613.nyan@FreeBSD.org> <4F2EA4F7.9010204@freebsd.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Multipart/Mixed; boundary="--Next_Part(Mon_Feb__6_22_07_21_2012_754)--" Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, ed@80386.nl, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230482 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 13:08:30 -0000 ----Next_Part(Mon_Feb__6_22_07_21_2012_754)-- Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit In article <4F2EA4F7.9010204@freebsd.org> Nathan Whitehorn writes: >>>>> TERM=xterm >>>> This code is also used on pc98, right? I think on pc98 we still need >>>> to >>>> use TERM=cons25w, to support Japanese character sets and keyboard >>>> input. >> How about the attached patch? > > The top half looks OK. The bottom half (the menu) is relevant only for > serial consoles. I guess people could be viewing a remote serial > console on a PC-98 graphics console, but then it shouldn't be > conditionalized on PC98 machines. Ok. I update the patch. --- TAKAHASHI Yoshihiro ----Next_Part(Mon_Feb__6_22_07_21_2012_754)-- Content-Type: Text/X-Patch; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="a.diff" Index: src/release/rc.local =================================================================== RCS file: /home/ncvs/src/release/rc.local,v retrieving revision 1.6 diff -u -r1.6 rc.local --- src/release/rc.local 23 Jan 2012 16:17:54 -0000 1.6 +++ src/release/rc.local 6 Feb 2012 13:04:37 -0000 @@ -8,10 +8,16 @@ : ${DIALOG_ITEM_HELP=4} : ${DIALOG_ESC=255} +MACHINE=`uname -m` + kbdcontrol -d >/dev/null 2>&1 if [ $? -eq 0 ]; then # Syscons: use xterm, start interesting things on other VTYs - TERM=xterm + if [ ${MACHINE} = "pc98" ]; then + TERM=cons25w + else + TERM=xterm + fi if [ -z "$EXTERNAL_VTY_STARTED" ]; then # Init will clean these processes up if/when the system @@ -31,6 +37,7 @@ echo " ansi Standard ANSI terminal" echo " vt100 VT100 or compatible terminal" echo " xterm xterm terminal emulator (or compatible)" + echo " cons25w cons25w terminal" echo echo -n "Console type [vt100]: " read TERM ----Next_Part(Mon_Feb__6_22_07_21_2012_754)---- From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 14:11:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9F9D6106566B; Mon, 6 Feb 2012 14:11:24 +0000 (UTC) (envelope-from ghelmer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8E89C8FC08; Mon, 6 Feb 2012 14:11:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q16EBOx7039271; Mon, 6 Feb 2012 14:11:24 GMT (envelope-from ghelmer@svn.freebsd.org) Received: (from ghelmer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16EBOwt039268; Mon, 6 Feb 2012 14:11:24 GMT (envelope-from ghelmer@svn.freebsd.org) Message-Id: <201202061411.q16EBOwt039268@svn.freebsd.org> From: Guy Helmer Date: Mon, 6 Feb 2012 14:11:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231087 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 14:11:24 -0000 Author: ghelmer Date: Mon Feb 6 14:11:24 2012 New Revision: 231087 URL: http://svn.freebsd.org/changeset/base/231087 Log: Using the O_CLOEXEC flag on open(2) caused the pidfile lock to be lost when the child process execs daemon's target program thanks to flock(2) semantics. So, we apparently have to leak the open pidfile's file descriptor to keep the lock for the pidfile(3) functions to work properly. Test case demonstrated by trociny: ref8-amd64:/home/trociny% uname -r 8.2-STABLE ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 daemon: process already running, pid: 19799 kopusha:~% uname -r 10.0-CURRENT kopusha:~% daemon -p /tmp/sleep.pid sleep 10 kopusha:~% daemon -p /tmp/sleep.pid sleep 10 kopusha:~% Modified: head/lib/libutil/pidfile.c Modified: head/lib/libutil/pidfile.c ============================================================================== --- head/lib/libutil/pidfile.c Mon Feb 6 13:36:49 2012 (r231086) +++ head/lib/libutil/pidfile.c Mon Feb 6 14:11:24 2012 (r231087) @@ -124,7 +124,7 @@ pidfile_open(const char *path, mode_t mo * pidfile_write() can be called multiple times. */ fd = flopen(pfh->pf_path, - O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC | O_NONBLOCK, mode); + O_WRONLY | O_CREAT | O_TRUNC | O_NONBLOCK, mode); if (fd == -1) { if (errno == EWOULDBLOCK && pidptr != NULL) { count = 20; From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 14:25:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 576901065672; Mon, 6 Feb 2012 14:25:17 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 07EDC8FC08; Mon, 6 Feb 2012 14:25:15 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id C2541A2D; Mon, 6 Feb 2012 15:25:14 +0100 (CET) Date: Mon, 6 Feb 2012 15:24:02 +0100 From: Pawel Jakub Dawidek To: Guy Helmer Message-ID: <20120206142402.GG1324@garage.freebsd.pl> References: <201202061411.q16EBOwt039268@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="UTZ8bGhNySVQ9LYl" Content-Disposition: inline In-Reply-To: <201202061411.q16EBOwt039268@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231087 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 14:25:17 -0000 --UTZ8bGhNySVQ9LYl Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 06, 2012 at 02:11:24PM +0000, Guy Helmer wrote: > Author: ghelmer > Date: Mon Feb 6 14:11:24 2012 > New Revision: 231087 > URL: http://svn.freebsd.org/changeset/base/231087 >=20 > Log: > Using the O_CLOEXEC flag on open(2) caused the pidfile lock to be lost > when the child process execs daemon's target program thanks to flock(2) > semantics. So, we apparently have to leak the open pidfile's file > descriptor to keep the lock for the pidfile(3) functions to work proper= ly. > > Test case demonstrated by trociny: > =20 > ref8-amd64:/home/trociny% uname -r > 8.2-STABLE > ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 > ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 > daemon: process already running, pid: 19799 > =20 > kopusha:~% uname -r > 10.0-CURRENT > kopusha:~% daemon -p /tmp/sleep.pid sleep 10 > kopusha:~% daemon -p /tmp/sleep.pid sleep 10 > kopusha:~% Not sure if you saw the following discussion, but O_CLOEXEC is ok here. Mikolaj is working on improving daemon to handle it properly. What we had in 8.2-STABLE is also incorrect, but for other reasons. All in all, O_CLOEXEC should stay. What Mikolaj presented is a problem in daemon(8) and not pidfile(3). --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --UTZ8bGhNySVQ9LYl Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8v4oIACgkQForvXbEpPzSRMQCfc5oRcV8KhB8d2JJLul7mbJoG Zq8AoJ39wwZRPVWUydlDyiA1QC4QrBVX =No2B -----END PGP SIGNATURE----- --UTZ8bGhNySVQ9LYl-- From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 14:32:24 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 439D6106566C; Mon, 6 Feb 2012 14:32:24 +0000 (UTC) (envelope-from ghelmer@palisadesystems.com) Received: from ps-1-a.compliancesafe.com (ps-1-a.compliancesafe.com [216.81.161.161]) by mx1.freebsd.org (Postfix) with ESMTP id C9F858FC1A; Mon, 6 Feb 2012 14:32:22 +0000 (UTC) Received: from mail.palisadesystems.com (localhost [127.0.0.1]) by ps-1-a.compliancesafe.com (8.14.4/8.14.3) with ESMTP id q16EVvsO019560; Mon, 6 Feb 2012 08:32:04 -0600 (CST) (envelope-from ghelmer@palisadesystems.com) Received: from guysmbp.dyn.palisadesys.com (GuysMBP.dyn.palisadesys.com [172.16.2.90]) (authenticated bits=0) by mail.palisadesystems.com (8.14.3/8.14.3) with ESMTP id q16EVjIh074179 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 6 Feb 2012 08:31:45 -0600 (CST) (envelope-from ghelmer@palisadesystems.com) X-DKIM: Sendmail DKIM Filter v2.8.3 mail.palisadesystems.com q16EVjIh074179 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=palisadesystems.com; s=mail; t=1328538709; bh=5NUXxddw6KTLF7+CbMvI8/MHMcl9Hbna68P4/jL3n/g=; l=128; h=Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc: Content-Transfer-Encoding:Message-Id:References:To; b=iICw2fDoVVzgV4E/mrX7m/qwwpJxSiTfxdBYjBFJyL3XO0c2XGvue/o1KGe08Gw88 d3yZ6vtjQpQ3/ZcVGF2npKA1lmZxWnSqdQto1UhA4EBtEh3e/pXFR/80tjPLHprGMx iBUBOL+L6t9e5b3Ko5kR9ZNtxLfp/F0Ti8tFaJ7w= Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii From: Guy Helmer In-Reply-To: <20120205093938.GC30033@garage.freebsd.pl> Date: Mon, 6 Feb 2012 08:31:47 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: <1E1FA19C-7C4C-4288-B163-E33FC68D9837@palisadesystems.com> References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> To: Pawel Jakub Dawidek X-Mailer: Apple Mail (2.1257) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (mail.palisadesystems.com [172.16.1.5]); Mon, 06 Feb 2012 08:31:49 -0600 (CST) X-Palisade-MailScanner-Information: Please contact the ISP for more information X-Palisade-MailScanner-ID: q16EVjIh074179 X-Palisade-MailScanner: Found to be clean X-Palisade-MailScanner-SpamCheck: not spam (whitelisted), SpamAssassin (score=-1.406, required 5, ALL_TRUSTED -1.00, BAYES_00 -1.90, RP_8BIT 1.49) X-Palisade-MailScanner-From: ghelmer@palisadesystems.com X-Spam-Status: No X-PacketSure-Scanned: Yes Cc: Mikolaj Golub , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 14:32:24 -0000 On Feb 5, 2012, at 3:39 AM, Pawel Jakub Dawidek wrote: > On Sat, Feb 04, 2012 at 08:16:42PM +0200, Mikolaj Golub wrote: >> ref8-amd64:/home/trociny% uname -r >> 8.2-STABLE >> ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 >> ref8-amd64:/home/trociny% daemon -p /tmp/sleep.pid sleep 10 >> daemon: process already running, pid: 19799 >>=20 >> kopusha:~% uname -r =20 >> 10.0-CURRENT >> kopusha:~% daemon -p /tmp/sleep.pid sleep 10 >> kopusha:~% daemon -p /tmp/sleep.pid sleep 10 >> kopusha:~%=20 >=20 > Mikolaj, eventhough what we had in 8.2-STABLE looks correct, it also > isn't correct. >=20 > Passing open descriptor to a process that doesn't expect that is bad > behaviour. If you pass, eg. open descriptor to a directory and the > process is using chroot(2) or jail(2) to sandbox itself it will be = able > to escape from that sandbox. Passing descriptor to a file has smaller > security implication, but it is still wrong. For example hastd, as you > probably know, asserts, before sandboxing, that he knows about all = open > descriptors - if there are some unknown descriptors open it won't run. >=20 > Also, daemon was passing open descriptor to a pidfile that the child > process cannot clean up, because he doesn't know its name. This leaves > pidfile with stale PID in it once the process exits, which is also = bad. >=20 > In my opinion, to make daemon(8) work with pidfiles, it cannot exit > after executing the given command. It should stay around with pidfile > open and just wait for the child to exit. Once the child exits, it > should remove the pidfile and also exit. If my understanding of flock(2) semantics is correct, with open(2) = O_CLOEXEC or fcntl(2) FD_CLOEXEC set on the pidfile, the closing of the = pidfile file descriptor during an exec will result in loss of the lock = on the pidfile regardless of whether daemon(8) hangs around to wait for = the child exit. Guy -------- This message has been scanned by ComplianceSafe, powered by Palisade's PacketSure. From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 14:44:52 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F175A1065672; Mon, 6 Feb 2012 14:44:52 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 9DDB78FC14; Mon, 6 Feb 2012 14:44:52 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id 0ECF2A57; Mon, 6 Feb 2012 15:44:51 +0100 (CET) Date: Mon, 6 Feb 2012 15:43:39 +0100 From: Pawel Jakub Dawidek To: Guy Helmer Message-ID: <20120206144337.GH1324@garage.freebsd.pl> References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <1E1FA19C-7C4C-4288-B163-E33FC68D9837@palisadesystems.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="2xzXx3ruJf7hsAzo" Content-Disposition: inline In-Reply-To: <1E1FA19C-7C4C-4288-B163-E33FC68D9837@palisadesystems.com> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Mikolaj Golub , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 14:44:53 -0000 --2xzXx3ruJf7hsAzo Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 06, 2012 at 08:31:47AM -0600, Guy Helmer wrote: > If my understanding of flock(2) semantics is correct, with open(2) O_CLOE= XEC or fcntl(2) FD_CLOEXEC set on the pidfile, the closing of the pidfile f= ile descriptor during an exec will result in loss of the lock on the pidfil= e regardless of whether daemon(8) hangs around to wait for the child exit. My expectation is that as long as parent process holds pidfile descriptor open and locked, the pidfile should remain locked even after fork(2)/execve(2). Worth checking, though. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --2xzXx3ruJf7hsAzo Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8v5xkACgkQForvXbEpPzTI5wCgyTkHOoWHzU4WHjxsGjRJnkZ0 Vg8AoOBW/FOz8tg77nzE85rF3N2ZcISl =SJOw -----END PGP SIGNATURE----- --2xzXx3ruJf7hsAzo-- From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 15:21:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECD67106564A; Mon, 6 Feb 2012 15:21:55 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id C3F148FC1B; Mon, 6 Feb 2012 15:21:55 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 7BA1D46B17; Mon, 6 Feb 2012 10:21:55 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 0B7DEB95C; Mon, 6 Feb 2012 10:21:55 -0500 (EST) From: John Baldwin To: Nathan Whitehorn Date: Mon, 6 Feb 2012 07:53:43 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201202051654.q15GsQcc092137@svn.freebsd.org> In-Reply-To: <201202051654.q15GsQcc092137@svn.freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201202060753.43627.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 06 Feb 2012 10:21:55 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231026 - head/sys/powerpc/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 15:21:56 -0000 On Sunday, February 05, 2012 11:54:26 am Nathan Whitehorn wrote: > Author: nwhitehorn > Date: Sun Feb 5 16:54:26 2012 > New Revision: 231026 > URL: http://svn.freebsd.org/changeset/base/231026 > > Log: > Make sure to remap adjusted resources. Hmm, I had considered remapping adjusted resources an invalid operation (i.e. should fail with EINVAL). I believe that the NEW_PCIB code should only apply this API to resources backing the resource windows in PCI-PCI bridges and that those resources should never have RF_ACTIVE set. Are you seeing calls of it for active resources? -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 15:21:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 530D21065670; Mon, 6 Feb 2012 15:21:59 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 285B68FC1C; Mon, 6 Feb 2012 15:21:59 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id D59ED46B2A; Mon, 6 Feb 2012 10:21:58 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 45F7CB960; Mon, 6 Feb 2012 10:21:56 -0500 (EST) From: John Baldwin To: Ivan Voras Date: Mon, 6 Feb 2012 09:30:31 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201202041649.q14GnUnI043572@svn.freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201202060930.31511.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 06 Feb 2012 10:21:58 -0500 (EST) Cc: svn-src-head@freebsd.org, Ryan Stone , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r230984 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 15:21:59 -0000 On Monday, February 06, 2012 6:34:06 am Ivan Voras wrote: > On 4 February 2012 17:49, Ryan Stone wrote: > > Author: rstone > > Date: Sat Feb 4 16:49:29 2012 > > New Revision: 230984 > > URL: http://svn.freebsd.org/changeset/base/230984 > > > > Log: > > Whenever a new kernel thread is spawned, explicitly clear any CPU affinity > > set on the new thread. This prevents the thread from inadvertently > > inheriting affinity from a random sibling. > > Shouldn't new threads inherit affinity from the threads which spawned them? User threads still do, but kernel threads are a bit tricky since most of them get created during boot when everything is running on the BSP, so the affinity they would inherit is rather bogus. Even post-boot many of the cases I can think of when you would create kthreads (e.g. expanding a thread pool), you don't really want to inherit affinity. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 15:39:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 542781065675; Mon, 6 Feb 2012 15:39:59 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from adsum.doit.wisc.edu (adsum.doit.wisc.edu [144.92.197.210]) by mx1.freebsd.org (Postfix) with ESMTP id 229E68FC1B; Mon, 6 Feb 2012 15:39:58 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth1.wiscmail.wisc.edu by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0LYZ00C06A6HYT00@smtpauth1.wiscmail.wisc.edu>; Mon, 06 Feb 2012 09:39:53 -0600 (CST) Received: from comporellon.tachypleus.net (adsl-76-208-68-223.dsl.mdsnwi.sbcglobal.net [76.208.68.223]) by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0LYZ00CB9A6B6Y00@smtpauth1.wiscmail.wisc.edu>; Mon, 06 Feb 2012 09:39:48 -0600 (CST) Date: Mon, 06 Feb 2012 09:39:46 -0600 From: Nathan Whitehorn In-reply-to: <20120206.220721.343708041459090867.nyan@FreeBSD.org> To: TAKAHASHI Yoshihiro Message-id: <4F2FF442.2090102@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.208.68.223 X-Spam-PmxInfo: Server=avs-15, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.2.6.153022, SenderIP=76.208.68.223 References: <1F971DB2-9CC6-41C9-9296-039D63E05FC2@FreeBSD.org> <20120128.193030.322386357550021613.nyan@FreeBSD.org> <4F2EA4F7.9010204@freebsd.org> <20120206.220721.343708041459090867.nyan@FreeBSD.org> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120107 Thunderbird/9.0 Cc: svn-src-head@freebsd.org, ed@80386.nl, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r230482 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 15:39:59 -0000 On 02/06/12 07:07, TAKAHASHI Yoshihiro wrote: > In article<4F2EA4F7.9010204@freebsd.org> > Nathan Whitehorn writes: > >>>>>> TERM=xterm >>>>> This code is also used on pc98, right? I think on pc98 we still need >>>>> to >>>>> use TERM=cons25w, to support Japanese character sets and keyboard >>>>> input. >>> How about the attached patch? >> The top half looks OK. The bottom half (the menu) is relevant only for >> serial consoles. I guess people could be viewing a remote serial >> console on a PC-98 graphics console, but then it shouldn't be >> conditionalized on PC98 machines. > Ok. I update the patch. > > --- > TAKAHASHI Yoshihiro Looks good to me. -Nathan From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 15:40:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E22A41065676; Mon, 6 Feb 2012 15:40:56 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from agogare.doit.wisc.edu (agogare.doit.wisc.edu [144.92.197.211]) by mx1.freebsd.org (Postfix) with ESMTP id B357E8FC1C; Mon, 6 Feb 2012 15:40:56 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth2.wiscmail.wisc.edu by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0LYZ00800A889Y00@smtpauth2.wiscmail.wisc.edu>; Mon, 06 Feb 2012 09:40:56 -0600 (CST) Received: from comporellon.tachypleus.net (adsl-76-208-68-223.dsl.mdsnwi.sbcglobal.net [76.208.68.223]) by smtpauth2.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0LYZ007C7A862J00@smtpauth2.wiscmail.wisc.edu>; Mon, 06 Feb 2012 09:40:55 -0600 (CST) Date: Mon, 06 Feb 2012 09:40:54 -0600 From: Nathan Whitehorn In-reply-to: <201202060753.43627.jhb@freebsd.org> To: John Baldwin Message-id: <4F2FF486.5090507@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.208.68.223 X-Spam-PmxInfo: Server=avs-13, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.2.6.153022, SenderIP=76.208.68.223 References: <201202051654.q15GsQcc092137@svn.freebsd.org> <201202060753.43627.jhb@freebsd.org> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120107 Thunderbird/9.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231026 - head/sys/powerpc/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 15:40:57 -0000 On 02/06/12 06:53, John Baldwin wrote: > On Sunday, February 05, 2012 11:54:26 am Nathan Whitehorn wrote: >> Author: nwhitehorn >> Date: Sun Feb 5 16:54:26 2012 >> New Revision: 231026 >> URL: http://svn.freebsd.org/changeset/base/231026 >> >> Log: >> Make sure to remap adjusted resources. > Hmm, I had considered remapping adjusted resources an invalid operation (i.e. > should fail with EINVAL). I believe that the NEW_PCIB code should only apply > this API to resources backing the resource windows in PCI-PCI bridges and that > those resources should never have RF_ACTIVE set. Are you seeing calls of it > for active resources? > No, I was just trying to be safe here, since it wasn't clear that that was invalid. I'm happy to replace the contents of the if with return EINVAL or something. -Nathan From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 15:59:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 595BD106564A; Mon, 6 Feb 2012 15:59:58 +0000 (UTC) (envelope-from rysto32@gmail.com) Received: from mail-wi0-f182.google.com (mail-wi0-f182.google.com [209.85.212.182]) by mx1.freebsd.org (Postfix) with ESMTP id 3F3B38FC0A; Mon, 6 Feb 2012 15:59:57 +0000 (UTC) Received: by wibhn14 with SMTP id hn14so6877447wib.13 for ; Mon, 06 Feb 2012 07:59:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=sYU984wzktceO0eiD2yXGUPrgLkTvqE5a4jDvJXX6UU=; b=Wy8/fujzZ/hwaMyqDzVPa37kPPrlJ1p/rVTDi6cH7C6mJd9vElKBxDZmtlm2akMAMj pL8R6ThR7EIF11QTjDseNj9yTI1eEkPw4fOTF9OvqJX661Pp4M/cSubR48J2KZd/tKFe Ff2Y0lysFKFnq0szB6COtU7P6YTfdmnfKDNQU= MIME-Version: 1.0 Received: by 10.180.105.129 with SMTP id gm1mr15915045wib.1.1328542502025; Mon, 06 Feb 2012 07:35:02 -0800 (PST) Received: by 10.180.106.129 with HTTP; Mon, 6 Feb 2012 07:35:02 -0800 (PST) In-Reply-To: References: <201202041649.q14GnUnI043572@svn.freebsd.org> Date: Mon, 6 Feb 2012 10:35:02 -0500 Message-ID: From: Ryan Stone To: Ivan Voras Content-Type: text/plain; charset=ISO-8859-1 Cc: svn-src-head@freebsd.org, Ryan Stone , src-committers@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r230984 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 15:59:58 -0000 On Mon, Feb 6, 2012 at 6:34 AM, Ivan Voras wrote: > Shouldn't new threads inherit affinity from the threads which spawned them? Kernel threads were not inheriting affinity from the thread that spawned them. They were inheriting affinity from an arbitrary sibling thread in the same kernel process. For example, if you set net.isr.bindthreads=1, all threads in the intr process that don't set affinity(which is most of them) would end up bound to CPU 0, including every single softclock thread. From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 16:09:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE5F9106564A; Mon, 6 Feb 2012 16:09:10 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 91FAF8FC19; Mon, 6 Feb 2012 16:09:10 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 4938446B0C; Mon, 6 Feb 2012 11:09:10 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id D091EB91E; Mon, 6 Feb 2012 11:09:09 -0500 (EST) From: John Baldwin To: Pawel Jakub Dawidek Date: Mon, 6 Feb 2012 10:25:42 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <1E1FA19C-7C4C-4288-B163-E33FC68D9837@palisadesystems.com> <20120206144337.GH1324@garage.freebsd.pl> In-Reply-To: <20120206144337.GH1324@garage.freebsd.pl> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Message-Id: <201202061025.42239.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 06 Feb 2012 11:09:09 -0500 (EST) Cc: src-committers@freebsd.org, Guy Helmer , svn-src-all@freebsd.org, Andrey Zonov , Mikolaj Golub , svn-src-head@freebsd.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 16:09:10 -0000 On Monday, February 06, 2012 9:43:39 am Pawel Jakub Dawidek wrote: > On Mon, Feb 06, 2012 at 08:31:47AM -0600, Guy Helmer wrote: > > If my understanding of flock(2) semantics is correct, with open(2) O_CLOEXEC or fcntl(2) FD_CLOEXEC set on the pidfile, the closing of the pidfile file descriptor during an exec will result in loss of the lock on the pidfile regardless of whether daemon(8) hangs around to wait for the child exit. > > My expectation is that as long as parent process holds pidfile > descriptor open and locked, the pidfile should remain locked even after > fork(2)/execve(2). Worth checking, though. Yes, if the daemon process hung around that would work. Note that I think you would need to do a double-fork for that to work though since users expect daemon to return instantly and not need to be put in the background. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 16:09:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D555F1065672; Mon, 6 Feb 2012 16:09:11 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id AB6268FC12; Mon, 6 Feb 2012 16:09:11 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 6592646B23; Mon, 6 Feb 2012 11:09:11 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id CBD2FB925; Mon, 6 Feb 2012 11:09:10 -0500 (EST) From: John Baldwin To: Nathan Whitehorn Date: Mon, 6 Feb 2012 11:06:59 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201202051654.q15GsQcc092137@svn.freebsd.org> <201202060753.43627.jhb@freebsd.org> <4F2FF486.5090507@freebsd.org> In-Reply-To: <4F2FF486.5090507@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201202061106.59098.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Mon, 06 Feb 2012 11:09:10 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231026 - head/sys/powerpc/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 16:09:11 -0000 On Monday, February 06, 2012 10:40:54 am Nathan Whitehorn wrote: > On 02/06/12 06:53, John Baldwin wrote: > > On Sunday, February 05, 2012 11:54:26 am Nathan Whitehorn wrote: > >> Author: nwhitehorn > >> Date: Sun Feb 5 16:54:26 2012 > >> New Revision: 231026 > >> URL: http://svn.freebsd.org/changeset/base/231026 > >> > >> Log: > >> Make sure to remap adjusted resources. > > Hmm, I had considered remapping adjusted resources an invalid operation (i.e. > > should fail with EINVAL). I believe that the NEW_PCIB code should only apply > > this API to resources backing the resource windows in PCI-PCI bridges and that > > those resources should never have RF_ACTIVE set. Are you seeing calls of it > > for active resources? > > > No, I was just trying to be safe here, since it wasn't clear that that > was invalid. I'm happy to replace the contents of the if with return > EINVAL or something. Yeah, I would do that, perhaps with a KASSERT() as well so it panics in HEAD. -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 17:00:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A433D106566C; Mon, 6 Feb 2012 17:00:29 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91A528FC0C; Mon, 6 Feb 2012 17:00:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q16H0TMX044919; Mon, 6 Feb 2012 17:00:29 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16H0Tsc044911; Mon, 6 Feb 2012 17:00:29 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <201202061700.q16H0Tsc044911@svn.freebsd.org> From: John Baldwin Date: Mon, 6 Feb 2012 17:00:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231088 - in head/sys: fs/nfsclient fs/nwfs fs/smbfs kern nfsclient sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 17:00:29 -0000 Author: jhb Date: Mon Feb 6 17:00:28 2012 New Revision: 231088 URL: http://svn.freebsd.org/changeset/base/231088 Log: Rename cache_lookup_times() to cache_lookup() and retire the old API and ABI stub for cache_lookup(). Modified: head/sys/fs/nfsclient/nfs_clvnops.c head/sys/fs/nwfs/nwfs_vnops.c head/sys/fs/smbfs/smbfs_vnops.c head/sys/kern/vfs_cache.c head/sys/nfsclient/nfs_vnops.c head/sys/sys/vnode.h Modified: head/sys/fs/nfsclient/nfs_clvnops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvnops.c Mon Feb 6 14:11:24 2012 (r231087) +++ head/sys/fs/nfsclient/nfs_clvnops.c Mon Feb 6 17:00:28 2012 (r231088) @@ -1042,7 +1042,7 @@ nfs_lookup(struct vop_lookup_args *ap) if ((error = VOP_ACCESS(dvp, VEXEC, cnp->cn_cred, td)) != 0) return (error); - error = cache_lookup_times(dvp, vpp, cnp, &nctime, &ncticks); + error = cache_lookup(dvp, vpp, cnp, &nctime, &ncticks); if (error > 0 && error != ENOENT) return (error); if (error == -1) { Modified: head/sys/fs/nwfs/nwfs_vnops.c ============================================================================== --- head/sys/fs/nwfs/nwfs_vnops.c Mon Feb 6 14:11:24 2012 (r231087) +++ head/sys/fs/nwfs/nwfs_vnops.c Mon Feb 6 17:00:28 2012 (r231088) @@ -853,7 +853,7 @@ printf("dvp %d:%d:%d\n", (int)mp, (int)d if (error) return ENOENT; - error = cache_lookup(dvp, vpp, cnp); + error = cache_lookup(dvp, vpp, cnp, NULL, NULL); NCPVNDEBUG("cache_lookup returned %d\n", error); if (error > 0) return error; Modified: head/sys/fs/smbfs/smbfs_vnops.c ============================================================================== --- head/sys/fs/smbfs/smbfs_vnops.c Mon Feb 6 14:11:24 2012 (r231087) +++ head/sys/fs/smbfs/smbfs_vnops.c Mon Feb 6 17:00:28 2012 (r231088) @@ -1131,7 +1131,7 @@ smbfs_lookup(ap) if (error) return ENOENT; - error = cache_lookup(dvp, vpp, cnp); + error = cache_lookup(dvp, vpp, cnp, NULL, NULL); SMBVDEBUG("cache_lookup returned %d\n", error); if (error > 0) return error; Modified: head/sys/kern/vfs_cache.c ============================================================================== --- head/sys/kern/vfs_cache.c Mon Feb 6 14:11:24 2012 (r231087) +++ head/sys/kern/vfs_cache.c Mon Feb 6 17:00:28 2012 (r231088) @@ -456,7 +456,7 @@ cache_zap(ncp) */ int -cache_lookup_times(dvp, vpp, cnp, tsp, ticksp) +cache_lookup(dvp, vpp, cnp, tsp, ticksp) struct vnode *dvp; struct vnode **vpp; struct componentname *cnp; @@ -994,7 +994,7 @@ vfs_cache_lookup(ap) if (error) return (error); - error = cache_lookup(dvp, vpp, cnp); + error = cache_lookup(dvp, vpp, cnp, NULL, NULL); if (error == 0) return (VOP_CACHEDLOOKUP(dvp, vpp, cnp)); if (error == -1) @@ -1374,12 +1374,9 @@ vn_commname(struct vnode *vp, char *buf, /* ABI compat shims for old kernel modules. */ #undef cache_enter -#undef cache_lookup void cache_enter(struct vnode *dvp, struct vnode *vp, struct componentname *cnp); -int cache_lookup(struct vnode *dvp, struct vnode **vpp, - struct componentname *cnp); void cache_enter(struct vnode *dvp, struct vnode *vp, struct componentname *cnp) @@ -1388,13 +1385,6 @@ cache_enter(struct vnode *dvp, struct vn cache_enter_time(dvp, vp, cnp, NULL); } -int -cache_lookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp) -{ - - return (cache_lookup_times(dvp, vpp, cnp, NULL, NULL)); -} - /* * This function updates path string to vnode's full global path * and checks the size of the new path string against the pathlen argument. Modified: head/sys/nfsclient/nfs_vnops.c ============================================================================== --- head/sys/nfsclient/nfs_vnops.c Mon Feb 6 14:11:24 2012 (r231087) +++ head/sys/nfsclient/nfs_vnops.c Mon Feb 6 17:00:28 2012 (r231088) @@ -938,7 +938,7 @@ nfs_lookup(struct vop_lookup_args *ap) *vpp = NULLVP; return (error); } - error = cache_lookup_times(dvp, vpp, cnp, &nctime, &ncticks); + error = cache_lookup(dvp, vpp, cnp, &nctime, &ncticks); if (error > 0 && error != ENOENT) return (error); if (error == -1) { Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Mon Feb 6 14:11:24 2012 (r231087) +++ head/sys/sys/vnode.h Mon Feb 6 17:00:28 2012 (r231088) @@ -586,9 +586,7 @@ struct vnode; cache_enter_time(dvp, vp, cnp, NULL) void cache_enter_time(struct vnode *dvp, struct vnode *vp, struct componentname *cnp, struct timespec *tsp); -#define cache_lookup(dvp, vpp, cnp) \ - cache_lookup_times(dvp, vpp, cnp, NULL, NULL) -int cache_lookup_times(struct vnode *dvp, struct vnode **vpp, +int cache_lookup(struct vnode *dvp, struct vnode **vpp, struct componentname *cnp, struct timespec *tsp, int *ticksp); void cache_purge(struct vnode *vp); void cache_purge_negative(struct vnode *vp); From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 17:07:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C646E1065672; Mon, 6 Feb 2012 17:07:24 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from adsum.doit.wisc.edu (adsum.doit.wisc.edu [144.92.197.210]) by mx1.freebsd.org (Postfix) with ESMTP id 946638FC08; Mon, 6 Feb 2012 17:07:24 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth1.wiscmail.wisc.edu by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0LYZ0021SE8BI100@smtpauth1.wiscmail.wisc.edu>; Mon, 06 Feb 2012 11:07:24 -0600 (CST) Received: from comporellon.tachypleus.net (adsl-76-208-68-223.dsl.mdsnwi.sbcglobal.net [76.208.68.223]) by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0LYZ00C08E866Y30@smtpauth1.wiscmail.wisc.edu>; Mon, 06 Feb 2012 11:07:19 -0600 (CST) Date: Mon, 06 Feb 2012 11:07:17 -0600 From: Nathan Whitehorn In-reply-to: <201202061106.59098.jhb@freebsd.org> To: John Baldwin Message-id: <4F3008C5.8020104@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=76.208.68.223 X-Spam-PmxInfo: Server=avs-13, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.2.6.170027, SenderIP=76.208.68.223 References: <201202051654.q15GsQcc092137@svn.freebsd.org> <201202060753.43627.jhb@freebsd.org> <4F2FF486.5090507@freebsd.org> <201202061106.59098.jhb@freebsd.org> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20120107 Thunderbird/9.0 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231026 - head/sys/powerpc/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 17:07:25 -0000 On 02/06/12 10:06, John Baldwin wrote: > On Monday, February 06, 2012 10:40:54 am Nathan Whitehorn wrote: >> On 02/06/12 06:53, John Baldwin wrote: >>> On Sunday, February 05, 2012 11:54:26 am Nathan Whitehorn wrote: >>>> Author: nwhitehorn >>>> Date: Sun Feb 5 16:54:26 2012 >>>> New Revision: 231026 >>>> URL: http://svn.freebsd.org/changeset/base/231026 >>>> >>>> Log: >>>> Make sure to remap adjusted resources. >>> Hmm, I had considered remapping adjusted resources an invalid operation (i.e. >>> should fail with EINVAL). I believe that the NEW_PCIB code should only apply >>> this API to resources backing the resource windows in PCI-PCI bridges and that >>> those resources should never have RF_ACTIVE set. Are you seeing calls of it >>> for active resources? >>> >> No, I was just trying to be safe here, since it wasn't clear that that >> was invalid. I'm happy to replace the contents of the if with return >> EINVAL or something. > Yeah, I would do that, perhaps with a KASSERT() as well so it panics in HEAD. > How does this look? I've kept both the EINVAL and the KASSERT. -Nathan Index: ofw_pci.c =================================================================== --- ofw_pci.c (revision 231026) +++ ofw_pci.c (working copy) @@ -431,8 +431,12 @@ { struct rman *rm = NULL; struct ofw_pci_softc *sc = device_get_softc(bus); - int error; + KASSERT(!(rman_get_flags(res) & RF_ACTIVE), + ("active resources cannot be adjusted")); + if (rman_get_flags(res) & RF_ACTIVE) + return (EINVAL); + switch (type) { case SYS_RES_MEMORY: rm = &sc->sc_mem_rman; @@ -447,21 +451,7 @@ if (!rman_is_region_manager(res, rm)) return (EINVAL); - error = rman_adjust_resource(res, start, end); - if (error) - return (error); - - if (rman_get_flags(res) & RF_ACTIVE) { - /* Remap memory resources */ - error = ofw_pci_deactivate_resource(bus, child, type, - rman_get_rid(res), res); - if (error) - return (error); - error = ofw_pci_activate_resource(bus, child, type, - rman_get_rid(res), res); - } - - return (error); + return (rman_adjust_resource(res, start, end)); } From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 17:48:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 6F5FA106564A; Mon, 6 Feb 2012 17:48:56 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: src-committers@FreeBSD.org Date: Mon, 6 Feb 2012 12:48:37 -0500 User-Agent: KMail/1.6.2 References: <201202040054.q140siBP012241@svn.freebsd.org> In-Reply-To: <201202040054.q140siBP012241@svn.freebsd.org> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201202061248.43744.jkim@FreeBSD.org> Cc: "svn-src-head@freebsd.org" , "svn-src-all@freebsd.org" , "src-committers@freebsd.org" , Robert Millan Subject: Re: svn commit: r230972 - in head: share/mk sys/amd64/conf sys/i386/conf sys/modules sys/modules/drm sys/modules/sound/driver sys/modules/usb tools/build/options X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 17:48:57 -0000 On Friday 03 February 2012 07:54 pm, Robert Millan wrote: > +nodevice ti Tigon 1 and 2 had open-sourced firmware. In fact, I believe wpaul developed custom firmware for FreeBSD and the (early?) sources are still available here: http://people.freebsd.org/~wpaul/Alteon/ Jung-uk Kim From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 17:59:15 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7B6D0106566B; Mon, 6 Feb 2012 17:59:15 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6A6B88FC0A; Mon, 6 Feb 2012 17:59:15 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q16HxF6d047086; Mon, 6 Feb 2012 17:59:15 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16HxFKk047084; Mon, 6 Feb 2012 17:59:15 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202061759.q16HxFKk047084@svn.freebsd.org> From: Konstantin Belousov Date: Mon, 6 Feb 2012 17:59:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231091 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 17:59:15 -0000 Author: kib Date: Mon Feb 6 17:59:14 2012 New Revision: 231091 URL: http://svn.freebsd.org/changeset/base/231091 Log: Add missing opt_quota.h include to activate #ifdef QUOTA blocks, apparently a step in unbreaking QUOTA support. Reported and tested by: Adam Strohl MFC after: 1 week Modified: head/sys/ufs/ffs/ffs_softdep.c Modified: head/sys/ufs/ffs/ffs_softdep.c ============================================================================== --- head/sys/ufs/ffs/ffs_softdep.c Mon Feb 6 17:31:13 2012 (r231090) +++ head/sys/ufs/ffs/ffs_softdep.c Mon Feb 6 17:59:14 2012 (r231091) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); #include "opt_ffs.h" +#include "opt_quota.h" #include "opt_ddb.h" /* @@ -6428,7 +6429,7 @@ softdep_setup_freeblocks(ip, length, fla } #ifdef QUOTA /* Reference the quotas in case the block count is wrong in the end. */ - quotaref(vp, freeblks->fb_quota); + quotaref(ITOV(ip), freeblks->fb_quota); (void) chkdq(ip, -datablocks, NOCRED, 0); #endif freeblks->fb_chkcnt = -datablocks; From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 18:11:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D4FE61065673; Mon, 6 Feb 2012 18:11:00 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C38168FC1B; Mon, 6 Feb 2012 18:11:00 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q16IB0RS047525; Mon, 6 Feb 2012 18:11:00 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16IB0VF047522; Mon, 6 Feb 2012 18:11:00 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201202061811.q16IB0VF047522@svn.freebsd.org> From: Ed Maste Date: Mon, 6 Feb 2012 18:11:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231092 - head/sys/cam/ctl X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 18:11:00 -0000 Author: emaste Date: Mon Feb 6 18:11:00 2012 New Revision: 231092 URL: http://svn.freebsd.org/changeset/base/231092 Log: Avoid panic from unlocking a not locked mutex (in some error cases). Reviewed by: ken@ Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c Modified: head/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- head/sys/cam/ctl/ctl_frontend_cam_sim.c Mon Feb 6 17:59:14 2012 (r231091) +++ head/sys/cam/ctl/ctl_frontend_cam_sim.c Mon Feb 6 18:11:00 2012 (r231092) @@ -221,6 +221,7 @@ cfcs_init(void) mtx_lock(&softc->lock); if (xpt_bus_register(softc->sim, NULL, 0) != CAM_SUCCESS) { + mtx_unlock(&softc->lock); printf("%s: error registering SIM\n", __func__); retval = ENOMEM; goto bailout; @@ -230,6 +231,7 @@ cfcs_init(void) cam_sim_path(softc->sim), CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) { + mtx_unlock(&softc->lock); printf("%s: error creating path\n", __func__); xpt_bus_deregister(cam_sim_path(softc->sim)); retval = 1; @@ -253,8 +255,6 @@ bailout: else if (softc->devq) cam_simq_free(softc->devq); - mtx_unlock(&softc->lock); - return (retval); } From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 18:15:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D46E61065672; Mon, 6 Feb 2012 18:15:46 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7FD38FC0C; Mon, 6 Feb 2012 18:15:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q16IFkuZ047802; Mon, 6 Feb 2012 18:15:46 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16IFkd4047796; Mon, 6 Feb 2012 18:15:46 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202061815.q16IFkd4047796@svn.freebsd.org> From: Ed Schouten Date: Mon, 6 Feb 2012 18:15:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231095 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 18:15:47 -0000 Author: ed Date: Mon Feb 6 18:15:46 2012 New Revision: 231095 URL: http://svn.freebsd.org/changeset/base/231095 Log: Fix whitespace inconsistencies in TTY code. Modified: head/sys/kern/tty.c head/sys/kern/tty_info.c head/sys/kern/tty_ttydisc.c head/sys/sys/ttycom.h head/sys/sys/ttydefaults.h Modified: head/sys/kern/tty.c ============================================================================== --- head/sys/kern/tty.c Mon Feb 6 18:13:34 2012 (r231094) +++ head/sys/kern/tty.c Mon Feb 6 18:15:46 2012 (r231095) @@ -1229,7 +1229,7 @@ tty_makedev(struct tty *tp, struct ucred /* Slave call-out devices. */ if (tp->t_flags & TF_INITLOCK) { - dev = make_dev_cred(&ttyil_cdevsw, + dev = make_dev_cred(&ttyil_cdevsw, TTYUNIT_CALLOUT | TTYUNIT_INIT, cred, UID_UUCP, GID_DIALER, 0660, "cua%s.init", name); dev_depends(tp->t_dev, dev); Modified: head/sys/kern/tty_info.c ============================================================================== --- head/sys/kern/tty_info.c Mon Feb 6 18:13:34 2012 (r231094) +++ head/sys/kern/tty_info.c Mon Feb 6 18:15:46 2012 (r231095) @@ -109,7 +109,7 @@ thread_compare(struct thread *td, struct /* * Fetch running stats, pctcpu usage, and interruptable flag. - */ + */ thread_lock(td); runa = TD_IS_RUNNING(td) | TD_ON_RUNQ(td); slpa = td->td_flags & TDF_SINTR; @@ -173,7 +173,7 @@ proc_compare(struct proc *p1, struct pro PROC_LOCK(p2); runb = proc_sum(p2, &estb); PROC_UNLOCK(p2); - + /* * see if at least one of them is runnable */ Modified: head/sys/kern/tty_ttydisc.c ============================================================================== --- head/sys/kern/tty_ttydisc.c Mon Feb 6 18:13:34 2012 (r231094) +++ head/sys/kern/tty_ttydisc.c Mon Feb 6 18:15:46 2012 (r231095) @@ -661,7 +661,6 @@ ttydisc_echo(struct tty *tp, char c, int return ttydisc_echo_force(tp, c, quote); } - static void ttydisc_reprint_char(void *d, char c, int quote) { Modified: head/sys/sys/ttycom.h ============================================================================== --- head/sys/sys/ttycom.h Mon Feb 6 18:13:34 2012 (r231094) +++ head/sys/sys/ttycom.h Mon Feb 6 18:15:46 2012 (r231095) @@ -105,7 +105,7 @@ struct winsize { #define TIOCM_SR 0020 /* secondary receive */ #define TIOCM_CTS 0040 /* clear to send */ #define TIOCM_DCD 0100 /* data carrier detect */ -#define TIOCM_RI 0200 /* ring indicate */ +#define TIOCM_RI 0200 /* ring indicate */ #define TIOCM_DSR 0400 /* data set ready */ #define TIOCM_CD TIOCM_DCD #define TIOCM_CAR TIOCM_DCD Modified: head/sys/sys/ttydefaults.h ============================================================================== --- head/sys/sys/ttydefaults.h Mon Feb 6 18:13:34 2012 (r231094) +++ head/sys/sys/ttydefaults.h Mon Feb 6 18:15:46 2012 (r231095) @@ -79,9 +79,9 @@ #define CSTART CTRL('Q') #define CSTOP CTRL('S') #define CLNEXT CTRL('V') -#define CDISCARD CTRL('O') -#define CWERASE CTRL('W') -#define CREPRINT CTRL('R') +#define CDISCARD CTRL('O') +#define CWERASE CTRL('W') +#define CREPRINT CTRL('R') #define CEOT CEOF /* compat */ #define CBRK CEOL From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 18:44:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A54A106566C; Mon, 6 Feb 2012 18:44:27 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 6D15A8FC13; Mon, 6 Feb 2012 18:44:25 +0000 (UTC) Received: by bkbzx1 with SMTP id zx1so6808145bkb.13 for ; Mon, 06 Feb 2012 10:44:25 -0800 (PST) Received: by 10.204.156.23 with SMTP id u23mr9074765bkw.18.1328553864896; Mon, 06 Feb 2012 10:44:24 -0800 (PST) Received: from [10.254.254.77] (ppp95-165-139-144.pppoe.spdop.ru. [95.165.139.144]) by mx.google.com with ESMTPS id cz3sm48085090bkb.3.2012.02.06.10.44.23 (version=SSLv3 cipher=OTHER); Mon, 06 Feb 2012 10:44:24 -0800 (PST) Message-ID: <4F301F86.8070003@zonov.org> Date: Mon, 06 Feb 2012 22:44:22 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.24) Gecko/20100228 Thunderbird/2.0.0.24 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: Gleb Smirnoff References: <201202051653.q15Gr3AB092056@svn.freebsd.org> In-Reply-To: <201202051653.q15Gr3AB092056@svn.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231025 - in head: share/man/man4 sys/netinet sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 18:44:27 -0000 On 05.02.2012 20:53, Gleb Smirnoff wrote: > Author: glebius > Date: Sun Feb 5 16:53:02 2012 > New Revision: 231025 > URL: http://svn.freebsd.org/changeset/base/231025 > > Log: > Add new socket options: TCP_KEEPINIT, TCP_KEEPIDLE, TCP_KEEPINTVL and > TCP_KEEPCNT, that allow to control initial timeout, idle time, idle > re-send interval and idle send count on a per-socket basis. > > Reviewed by: andre, bz, lstewart > Hi Gleb, Maybe while you're here you can find solution for PR14400? -- Andrey Zonov From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 18:52:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 26951106566C; Mon, 6 Feb 2012 18:52:41 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 157C68FC16; Mon, 6 Feb 2012 18:52:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q16IqeJ3049113; Mon, 6 Feb 2012 18:52:40 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16IqeIx049110; Mon, 6 Feb 2012 18:52:40 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202061852.q16IqeIx049110@svn.freebsd.org> From: Ed Schouten Date: Mon, 6 Feb 2012 18:52:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231098 - head/tools/tools/fixwhite X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 18:52:41 -0000 Author: ed Date: Mon Feb 6 18:52:40 2012 New Revision: 231098 URL: http://svn.freebsd.org/changeset/base/231098 Log: Add a `fix' for another whitespace bug. If the sentence starts with a multiple of eight spaces, the sentence should in almost all practical cases have started with tabs instead. Replace these spaces by tabs. Modified: head/tools/tools/fixwhite/fixwhite.1 head/tools/tools/fixwhite/fixwhite.c Modified: head/tools/tools/fixwhite/fixwhite.1 ============================================================================== --- head/tools/tools/fixwhite/fixwhite.1 Mon Feb 6 18:47:07 2012 (r231097) +++ head/tools/tools/fixwhite/fixwhite.1 Mon Feb 6 18:52:40 2012 (r231098) @@ -41,6 +41,8 @@ and prints the result to standard output It removes leading and trailing empty lines from the input, as well as trailing whitespace characters from ever line of text. Multiple successive empty lines are merged together. +If the whitespace at the beginning of a sentence is exactly a multiple +of eight spaces, the whitespace is replaced by tabs. Also, spaces preceeding tabs will be merged into the tab character. .Sh AUTHORS .An Ed Schouten Aq ed@FreeBSD.org Modified: head/tools/tools/fixwhite/fixwhite.c ============================================================================== --- head/tools/tools/fixwhite/fixwhite.c Mon Feb 6 18:47:07 2012 (r231097) +++ head/tools/tools/fixwhite/fixwhite.c Mon Feb 6 18:52:40 2012 (r231098) @@ -110,6 +110,19 @@ savewhite(char c, bool leading) static void printwhite(void) { + off_t i; + + /* Merge spaces at the start of a sentence to tabs if possible. */ + if ((column % 8) == 0) { + for (i = 0; i < column; i++) + if (!peekbyte(i + 1, ' ')) + break; + if (i == column) { + queuelen -= column; + for (i = 0; i < column; i += 8) + queue[queuelen++] = '\t'; + } + } if (fwrite(queue, 1, queuelen, stdout) != queuelen) { perror("write"); From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 19:18:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B6A3106564A; Mon, 6 Feb 2012 19:18:54 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 659B18FC17; Mon, 6 Feb 2012 19:18:52 +0000 (UTC) Received: by bkbzx1 with SMTP id zx1so6840261bkb.13 for ; Mon, 06 Feb 2012 11:18:52 -0800 (PST) Received: by 10.205.137.14 with SMTP id im14mr8738883bkc.133.1328555931855; Mon, 06 Feb 2012 11:18:51 -0800 (PST) Received: from [10.254.254.77] (ppp95-165-139-144.pppoe.spdop.ru. [95.165.139.144]) by mx.google.com with ESMTPS id w15sm7348006bku.0.2012.02.06.11.18.50 (version=SSLv3 cipher=OTHER); Mon, 06 Feb 2012 11:18:51 -0800 (PST) Message-ID: <4F30279A.4010307@zonov.org> Date: Mon, 06 Feb 2012 23:18:50 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.24) Gecko/20100228 Thunderbird/2.0.0.24 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: John Baldwin References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <1E1FA19C-7C4C-4288-B163-E33FC68D9837@palisadesystems.com> <20120206144337.GH1324@garage.freebsd.pl> <201202061025.42239.jhb@freebsd.org> In-Reply-To: <201202061025.42239.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: src-committers@freebsd.org, Pawel Jakub Dawidek , Guy Helmer , svn-src-all@freebsd.org, Mikolaj Golub , svn-src-head@freebsd.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 19:18:54 -0000 On 06.02.2012 19:25, John Baldwin wrote: >> >> My expectation is that as long as parent process holds pidfile >> descriptor open and locked, the pidfile should remain locked even after >> fork(2)/execve(2). Worth checking, though. > > Yes, if the daemon process hung around that would work. Note that I think > you would need to do a double-fork for that to work though since users > expect daemon to return instantly and not need to be put in the background. > It would be also nice to have an option for automatically respawn the child. This option has GNU version of daemon. What do you think? -- Andrey Zonov From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 20:23:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0A151065672; Mon, 6 Feb 2012 20:23:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF1B38FC12; Mon, 6 Feb 2012 20:23:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q16KNLjO051999; Mon, 6 Feb 2012 20:23:21 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16KNLnI051997; Mon, 6 Feb 2012 20:23:21 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202062023.q16KNLnI051997@svn.freebsd.org> From: Adrian Chadd Date: Mon, 6 Feb 2012 20:23:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231099 - head/sys/dev/ath/ath_dfs/null X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 20:23:22 -0000 Author: adrian Date: Mon Feb 6 20:23:21 2012 New Revision: 231099 URL: http://svn.freebsd.org/changeset/base/231099 Log: Contribute some example code which demonstrates how to initialise the radar parameters for the AR5416 and later NICs. These parameters have been tested on the following NICs: * AR5416 * AR9160 * AR9220 * AR9280 And yes, these will return radar pulse parameters and (for AR9160 and later) radar FFT information as PHY errors. This is again not enough to do radar detection, it's just here to faciliate development and validation of radar detection algorithms. The (pulse, not FFT) decoding code for AR5212, AR5416 and later NICs exist in the HAL. This code is disabled for now as generating radar PHY errors can quickly cause issues in busy environment.s Some further debugging of the RX path is needed. Finally, these parameters are likely not useful for the AR5212 era NICs. The madwifi-dfs branch should have suitable example parameters for the 11a era NICs. Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c Modified: head/sys/dev/ath/ath_dfs/null/dfs_null.c ============================================================================== --- head/sys/dev/ath/ath_dfs/null/dfs_null.c Mon Feb 6 18:52:40 2012 (r231098) +++ head/sys/dev/ath/ath_dfs/null/dfs_null.c Mon Feb 6 20:23:21 2012 (r231099) @@ -71,6 +71,28 @@ __FBSDID("$FreeBSD$"); #include /* + * These are default parameters for the AR5416 and + * later 802.11n NICs. They simply enable some + * radar pulse event generation. + * + * These are very likely not valid for the AR5212 era + * NICs. + * + * Since these define signal sizing and threshold + * parameters, they may need changing based on the + * specific antenna and receive amplifier + * configuration. + */ +#define AR5416_DFS_FIRPWR -33 +#define AR5416_DFS_RRSSI 20 +#define AR5416_DFS_HEIGHT 10 +#define AR5416_DFS_PRSSI 15 +#define AR5416_DFS_INBAND 15 +#define AR5416_DFS_RELPWR 8 +#define AR5416_DFS_RELSTEP 12 +#define AR5416_DFS_MAXLEN 255 + +/* * Methods which are required */ @@ -98,16 +120,45 @@ ath_dfs_detach(struct ath_softc *sc) int ath_dfs_radar_enable(struct ath_softc *sc, struct ieee80211_channel *chan) { +#if 0 + HAL_PHYERR_PARAM pe; + /* Check if the current channel is radar-enabled */ if (! IEEE80211_IS_CHAN_DFS(chan)) return (0); + /* Enable radar PHY error reporting */ + sc->sc_dodfs = 1; + /* - * Enabling the radar parameters and setting sc->sc_dodfs = 1 - * would occur here. + * These are general examples of the parameter values + * to use when configuring radar pulse detection for + * the AR5416, AR91xx, AR92xx NICs. They are only + * for testing and do require tuning depending upon the + * hardware and deployment specifics. */ + pe.pe_firpwr = AR5416_DFS_FIRPWR; + pe.pe_rrssi = AR5416_DFS_RRSSI; + pe.pe_height = AR5416_DFS_HEIGHT; + pe.pe_prssi = AR5416_DFS_PRSSI; + pe.pe_inband = AR5416_DFS_INBAND; + pe.pe_relpwr = AR5416_DFS_RELPWR; + pe.pe_relstep = AR5416_DFS_RELSTEP; + pe.pe_maxlen = AR5416_DFS_MAXLEN; + pe.pe_enabled = 1; + + /* Flip on extension channel events only if doing HT40 */ + if (IEEE80211_IS_CHAN_HT40(chan)) + pe.pe_extchannel = 1; + else + pe.pe_extchannel = 0; + + ath_hal_enabledfs(sc->sc_ah, &pe); return (1); +#else + return (0); +#endif } /* From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 21:35:11 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AC97B1065673; Mon, 6 Feb 2012 21:35:11 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9B4048FC23; Mon, 6 Feb 2012 21:35:11 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q16LZBe3054645; Mon, 6 Feb 2012 21:35:11 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16LZBhS054643; Mon, 6 Feb 2012 21:35:11 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201202062135.q16LZBhS054643@svn.freebsd.org> From: Dimitry Andric Date: Mon, 6 Feb 2012 21:35:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231101 - head/usr.bin/rpcgen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 21:35:11 -0000 Author: dim Date: Mon Feb 6 21:35:11 2012 New Revision: 231101 URL: http://svn.freebsd.org/changeset/base/231101 Log: In usr.bin/rpcgen/rpc_main.c, use execvp(3) instead of execv(3), so rpcgen will search the current PATH for the preprocessor. This makes it possible to run a preprocessor built during the cross-tools stage of buildworld. MFC after: 1 week Modified: head/usr.bin/rpcgen/rpc_main.c Modified: head/usr.bin/rpcgen/rpc_main.c ============================================================================== --- head/usr.bin/rpcgen/rpc_main.c Mon Feb 6 21:23:12 2012 (r231100) +++ head/usr.bin/rpcgen/rpc_main.c Mon Feb 6 21:35:11 2012 (r231101) @@ -290,7 +290,6 @@ prepend_cpp(void) int idx = 1; const char *var; char *dupvar, *s, *t; - struct stat buf; if (CPP != NULL) insarg(0, CPP); @@ -306,11 +305,6 @@ prepend_cpp(void) free(dupvar); } - if (stat(arglist[0], &buf) < 0) { - warnx("cannot find C preprocessor: %s", arglist[0]); - crash(); - } - insarg(idx, CPPFLAGS); } @@ -334,8 +328,8 @@ open_input(const char *infile, const cha (void) close(1); (void) dup2(pd[1], 1); (void) close(pd[0]); - execv(arglist[0], arglist); - err(1, "execv"); + execvp(arglist[0], arglist); + err(1, "execvp %s", arglist[0]); case -1: err(1, "fork"); } From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 21:46:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAACC106564A; Mon, 6 Feb 2012 21:46:30 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8D2528FC08; Mon, 6 Feb 2012 21:46:29 +0000 (UTC) Received: by bkbzx1 with SMTP id zx1so6972502bkb.13 for ; Mon, 06 Feb 2012 13:46:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=/dzajcqNUoDpCICZErPnX9IbH1VrVyDp4My+97pQ+qM=; b=q7rDN8IlKZey5E+/AdNDlIbpdW2Tpy2Hx4UXZUYD9oW/kw4T+TPEOwgRqWmWB9afMr +Xx8ZRpz5yKNar/D/Yb74dc8rOCIZT11KLTKrZLnIBGKuR7AFaC1G9D/FkfWOi2yzdlU aPwa4AsUqWf66fSNHSWtl9rLYEqTfnfBJ7zyE= Received: by 10.204.154.86 with SMTP id n22mr8978731bkw.85.1328564788645; Mon, 06 Feb 2012 13:46:28 -0800 (PST) Received: from localhost ([95.69.173.122]) by mx.google.com with ESMTPS id cg2sm49215788bkb.12.2012.02.06.13.46.26 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 06 Feb 2012 13:46:27 -0800 (PST) From: Mikolaj Golub To: Pawel Jakub Dawidek References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> <20120206082706.GA1324@garage.freebsd.pl> X-Comment-To: Pawel Jakub Dawidek Sender: Mikolaj Golub Date: Mon, 06 Feb 2012 23:46:24 +0200 In-Reply-To: <20120206082706.GA1324@garage.freebsd.pl> (Pawel Jakub Dawidek's message of "Mon, 6 Feb 2012 09:27:06 +0100") Message-ID: <86wr7zmy8f.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 21:46:30 -0000 --=-=-= On Mon, 6 Feb 2012 09:27:06 +0100 Pawel Jakub Dawidek wrote: PJD> For the patch itself. PJD> You don't have to have two separate cases depending on request for PJD> pidfile. You can specify NULL pfh to the pidfile functions. PJD> Even in example from the manual page when pfh is NULL there is a case PJD> where we warn, but continue execution and call pidfile functions. PJD> This should simplify the code. PJD> If you do that (actually even if you don't), remember to either use PJD> warn(3) before pidfile_remove(3) and exit(3) after or preserve errno PJD> before calling pidfile_remove(3), as pidfile_remove(3) can modify it if PJD> unlink(2) is unsuccessful or pfh is NULL. Thanks. The updated version is attached. -- Mikolaj Golub --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=daemon.c.2.patch Index: usr.sbin/daemon/daemon.c =================================================================== --- usr.sbin/daemon/daemon.c (revision 231014) +++ usr.sbin/daemon/daemon.c (working copy) @@ -32,6 +32,7 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include @@ -43,15 +44,16 @@ __FBSDID("$FreeBSD$"); #include static void restrict_process(const char *); +static void wait_child(pid_t pid); static void usage(void); int main(int argc, char *argv[]) { struct pidfh *pfh = NULL; - int ch, nochdir, noclose, errcode; + int ch, nochdir, noclose; const char *pidfile, *user; - pid_t otherpid; + pid_t otherpid, pid; nochdir = noclose = 1; pidfile = user = NULL; @@ -79,9 +81,7 @@ main(int argc, char *argv[]) if (argc == 0) usage(); - if (user != NULL) - restrict_process(user); - + pfh = NULL; /* * Try to open the pidfile before calling daemon(3), * to be able to report the error intelligently @@ -100,22 +100,36 @@ main(int argc, char *argv[]) if (daemon(nochdir, noclose) == -1) err(1, NULL); - /* Now that we are the child, write out the pid */ - if (pidfile) + pid = 0; + if (pidfile) { + /* + * Spawn a child to exec the command, so in the parent + * we could wait for it to exit and remove pidfile. + */ + pid = fork(); + if (pid == -1) { + pidfile_remove(pfh); + err(1, "fork"); + } + } + if (pid == 0) { + /* Now that we are the child, write out the pid. */ pidfile_write(pfh); - execvp(argv[0], argv); + if (user != NULL) + restrict_process(user); - /* - * execvp() failed -- unlink pidfile if any, and - * report the error - */ - errcode = errno; /* Preserve errcode -- unlink may reset it */ - if (pidfile) - pidfile_remove(pfh); + execvp(argv[0], argv); - /* The child is now running, so the exit status doesn't matter. */ - errc(1, errcode, "%s", argv[0]); + /* + * execvp() failed -- report the error. The child is + * now running, so the exit status doesn't matter. + */ + err(1, "%s", argv[0]); + } + wait_child(pid); + pidfile_remove(pfh); + exit(0); /* Exit status does not metter. */ } static void @@ -132,6 +146,19 @@ restrict_process(const char *user) } static void +wait_child(pid_t pid) +{ + int status; + + while (waitpid(pid, &status, 0) == -1) { + if (errno != EINTR) { + warn("waitpid"); + break; + } + } +} + +static void usage(void) { (void)fprintf(stderr, --=-=-=-- From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 21:50:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0692B106564A; Mon, 6 Feb 2012 21:50:13 +0000 (UTC) (envelope-from truckman@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E5D348FC0A; Mon, 6 Feb 2012 21:50:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q16LoCuU055115; Mon, 6 Feb 2012 21:50:12 GMT (envelope-from truckman@svn.freebsd.org) Received: (from truckman@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q16LoCJd055113; Mon, 6 Feb 2012 21:50:12 GMT (envelope-from truckman@svn.freebsd.org) Message-Id: <201202062150.q16LoCJd055113@svn.freebsd.org> From: Don Lewis Date: Mon, 6 Feb 2012 21:50:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231102 - head/sbin/fsdb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 21:50:13 -0000 Author: truckman Date: Mon Feb 6 21:50:11 2012 New Revision: 231102 URL: http://svn.freebsd.org/changeset/base/231102 Log: Improve sparse file handling when printing the block list for an inode by not bailing out early when a hole is encountered in the direct block list. Print NULL block pointers in the direct block list. Simplify the code that prints the fragment count. Match the style of the existing code. Reviewed by: mckusick MFC after: 1 week Modified: head/sbin/fsdb/fsdbutil.c Modified: head/sbin/fsdb/fsdbutil.c ============================================================================== --- head/sbin/fsdb/fsdbutil.c Mon Feb 6 21:35:11 2012 (r231101) +++ head/sbin/fsdb/fsdbutil.c Mon Feb 6 21:50:11 2012 (r231102) @@ -293,22 +293,21 @@ printblocks(ino_t inum, union dinode *dp printf("Blocks for inode %d:\n", inum); printf("Direct blocks:\n"); ndb = howmany(DIP(dp, di_size), sblock.fs_bsize); - for (i = 0; i < NDADDR; i++) { - if (DIP(dp, di_db[i]) == 0) { - putchar('\n'); - return; - } + for (i = 0; i < NDADDR && i < ndb; i++) { if (i > 0) printf(", "); blkno = DIP(dp, di_db[i]); printf("%jd", (intmax_t)blkno); - if (--ndb == 0 && (offset = blkoff(&sblock, DIP(dp, di_size))) != 0) { + } + if (ndb <= NDADDR) { + offset = blkoff(&sblock, DIP(dp, di_size)); + if (offset != 0) { nfrags = numfrags(&sblock, fragroundup(&sblock, offset)); printf(" (%d frag%s)", nfrags, nfrags > 1? "s": ""); } } putchar('\n'); - if (ndb == 0) + if (ndb <= NDADDR) return; bufp = malloc((unsigned int)sblock.fs_bsize); From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 21:57:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E823B106564A; Mon, 6 Feb 2012 21:57:34 +0000 (UTC) (envelope-from ghelmer@palisadesystems.com) Received: from ps-1-a.compliancesafe.com (ps-1-a.compliancesafe.com [216.81.161.161]) by mx1.freebsd.org (Postfix) with ESMTP id 564D38FC0C; Mon, 6 Feb 2012 21:57:34 +0000 (UTC) Received: from mail.palisadesystems.com (localhost [127.0.0.1]) by ps-1-a.compliancesafe.com (8.14.4/8.14.3) with ESMTP id q16LvFZJ038565; Mon, 6 Feb 2012 15:57:16 -0600 (CST) (envelope-from ghelmer@palisadesystems.com) Received: from [192.168.221.90] ([192.168.221.90]) (authenticated bits=0) by mail.palisadesystems.com (8.14.3/8.14.3) with ESMTP id q16Lv0Uv087096 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Mon, 6 Feb 2012 15:57:03 -0600 (CST) (envelope-from ghelmer@palisadesystems.com) X-DKIM: Sendmail DKIM Filter v2.8.3 mail.palisadesystems.com q16Lv0Uv087096 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=palisadesystems.com; s=mail; t=1328565425; bh=2++lRsVqfKz9BBtMLY1lIDdQrLR7kn9EpbzGL/TpGDA=; l=128; h=Subject:Mime-Version:Content-Type:From:In-Reply-To:Date:Cc: Content-Transfer-Encoding:Message-Id:References:To; b=FrhSpdfxhsrBGMcoxfBi5Y0tj1R8kgfT9RKEIPVyMInXUHn8hnIDrpVDlWMKh9AvV eo8R2dZyOmkf05rXKbEf07WKlw9yDBsa9XYHZF60IreIzZsCZUqNRzlPbEB8eC7nje NE0p0sJijnpUkskyJu/oY+X0qYe3WgwgRezx3Dp8= Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii From: Guy Helmer In-Reply-To: <86wr7zmy8f.fsf@kopusha.home.net> Date: Mon, 6 Feb 2012 15:56:59 -0600 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201202011641.q11Gf0j6095461@svn.freebsd.org> <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> <20120206082706.GA1324@garage.freebsd.pl> <86wr7zmy8f.fsf@kopusha.home.net> To: Mikolaj Golub X-Mailer: Apple Mail (2.1257) X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.5 (mail.palisadesystems.com [172.16.1.5]); Mon, 06 Feb 2012 15:57:05 -0600 (CST) X-Palisade-MailScanner-Information: Please contact the ISP for more information X-Palisade-MailScanner-ID: q16Lv0Uv087096 X-Palisade-MailScanner: Found to be clean X-Palisade-MailScanner-SpamCheck: not spam, SpamAssassin (score=-0.806, required 5, ALL_TRUSTED -1.00, BAYES_00 -1.90, J_CHICKENPOX_43 0.60, RP_8BIT 1.49) X-Palisade-MailScanner-From: ghelmer@palisadesystems.com X-Spam-Status: No X-PacketSure-Scanned: Yes Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, Andrey Zonov , Pawel Jakub Dawidek , src-committers@freebsd.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 21:57:35 -0000 On Feb 6, 2012, at 3:46 PM, Mikolaj Golub wrote: >=20 > On Mon, 6 Feb 2012 09:27:06 +0100 Pawel Jakub Dawidek wrote: >=20 > PJD> For the patch itself. >=20 > PJD> You don't have to have two separate cases depending on request = for > PJD> pidfile. You can specify NULL pfh to the pidfile functions. > PJD> Even in example from the manual page when pfh is NULL there is a = case > PJD> where we warn, but continue execution and call pidfile functions. > PJD> This should simplify the code. >=20 > PJD> If you do that (actually even if you don't), remember to either = use > PJD> warn(3) before pidfile_remove(3) and exit(3) after or preserve = errno > PJD> before calling pidfile_remove(3), as pidfile_remove(3) can modify = it if > PJD> unlink(2) is unsuccessful or pfh is NULL. >=20 > Thanks. The updated version is attached. >=20 > --=20 > Mikolaj Golub >=20 > Index: usr.sbin/daemon/daemon.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 > --- usr.sbin/daemon/daemon.c (revision 231014) > +++ usr.sbin/daemon/daemon.c (working copy) > @@ -32,6 +32,7 @@ > __FBSDID("$FreeBSD$"); >=20 > #include > +#include >=20 > #include > #include > @@ -43,15 +44,16 @@ __FBSDID("$FreeBSD$"); > #include >=20 > static void restrict_process(const char *); > +static void wait_child(pid_t pid); > static void usage(void); >=20 > int > main(int argc, char *argv[]) > { > struct pidfh *pfh =3D NULL; > - int ch, nochdir, noclose, errcode; > + int ch, nochdir, noclose; > const char *pidfile, *user; > - pid_t otherpid; > + pid_t otherpid, pid; >=20 > nochdir =3D noclose =3D 1; > pidfile =3D user =3D NULL; > @@ -79,9 +81,7 @@ main(int argc, char *argv[]) > if (argc =3D=3D 0) > usage(); >=20 > - if (user !=3D NULL) > - restrict_process(user); > - > + pfh =3D NULL; > /* > * Try to open the pidfile before calling daemon(3), > * to be able to report the error intelligently > @@ -100,22 +100,36 @@ main(int argc, char *argv[]) > if (daemon(nochdir, noclose) =3D=3D -1) > err(1, NULL); >=20 > - /* Now that we are the child, write out the pid */ > - if (pidfile) > + pid =3D 0; > + if (pidfile) { > + /* > + * Spawn a child to exec the command, so in the parent > + * we could wait for it to exit and remove pidfile. > + */ > + pid =3D fork(); > + if (pid =3D=3D -1) { > + pidfile_remove(pfh); > + err(1, "fork"); > + } > + } > + if (pid =3D=3D 0) { > + /* Now that we are the child, write out the pid. */ > pidfile_write(pfh); >=20 > - execvp(argv[0], argv); > + if (user !=3D NULL) > + restrict_process(user); >=20 > - /* > - * execvp() failed -- unlink pidfile if any, and > - * report the error > - */ > - errcode =3D errno; /* Preserve errcode -- unlink may reset it */ > - if (pidfile) > - pidfile_remove(pfh); > + execvp(argv[0], argv); >=20 > - /* The child is now running, so the exit status doesn't matter. = */ > - errc(1, errcode, "%s", argv[0]); > + /* > + * execvp() failed -- report the error. The child is > + * now running, so the exit status doesn't matter. > + */ > + err(1, "%s", argv[0]); > + } > + wait_child(pid); > + pidfile_remove(pfh); > + exit(0); /* Exit status does not metter. */ > } >=20 > static void > @@ -132,6 +146,19 @@ restrict_process(const char *user) > } >=20 > static void > +wait_child(pid_t pid) > +{ > + int status; > + > + while (waitpid(pid, &status, 0) =3D=3D -1) { > + if (errno !=3D EINTR) { > + warn("waitpid"); > + break; > + } > + } > +} > + > +static void > usage(void) > { > (void)fprintf(stderr, Generally looks good to me -- I had patches to do a similar change but = yours looks better. When I get a chance, I will test your change with = the O_CLOEXEC flag added back to the open() call in pidfile_open() -- = I'm not sure how soon I will be able to do that, though. Guy= -------- This message has been scanned by ComplianceSafe, powered by Palisade's PacketSure. From owner-svn-src-head@FreeBSD.ORG Mon Feb 6 22:19:00 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0979A106566B; Mon, 6 Feb 2012 22:19:00 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 3F10F8FC1B; Mon, 6 Feb 2012 22:18:58 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 06FF9C04; Mon, 6 Feb 2012 23:18:56 +0100 (CET) Date: Mon, 6 Feb 2012 23:17:43 +0100 From: Pawel Jakub Dawidek To: Mikolaj Golub Message-ID: <20120206221742.GA1336@garage.freebsd.pl> References: <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> <20120206082706.GA1324@garage.freebsd.pl> <86wr7zmy8f.fsf@kopusha.home.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="k+w/mQv8wyuph6w0" Content-Disposition: inline In-Reply-To: <86wr7zmy8f.fsf@kopusha.home.net> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Feb 2012 22:19:00 -0000 --k+w/mQv8wyuph6w0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 06, 2012 at 11:46:24PM +0200, Mikolaj Golub wrote: >=20 > On Mon, 6 Feb 2012 09:27:06 +0100 Pawel Jakub Dawidek wrote: >=20 > PJD> For the patch itself. >=20 > PJD> You don't have to have two separate cases depending on request for > PJD> pidfile. You can specify NULL pfh to the pidfile functions. > PJD> Even in example from the manual page when pfh is NULL there is a ca= se > PJD> where we warn, but continue execution and call pidfile functions. > PJD> This should simplify the code. >=20 > PJD> If you do that (actually even if you don't), remember to either use > PJD> warn(3) before pidfile_remove(3) and exit(3) after or preserve errno > PJD> before calling pidfile_remove(3), as pidfile_remove(3) can modify i= t if > PJD> unlink(2) is unsuccessful or pfh is NULL. >=20 > Thanks. The updated version is attached. Looks good to me. > Index: usr.sbin/daemon/daemon.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 > --- usr.sbin/daemon/daemon.c (revision 231014) > +++ usr.sbin/daemon/daemon.c (working copy) > @@ -32,6 +32,7 @@ > __FBSDID("$FreeBSD$"); > =20 > #include > +#include > =20 > #include > #include > @@ -43,15 +44,16 @@ __FBSDID("$FreeBSD$"); > #include > =20 > static void restrict_process(const char *); > +static void wait_child(pid_t pid); > static void usage(void); > =20 > int > main(int argc, char *argv[]) > { > struct pidfh *pfh =3D NULL; > - int ch, nochdir, noclose, errcode; > + int ch, nochdir, noclose; > const char *pidfile, *user; > - pid_t otherpid; > + pid_t otherpid, pid; > =20 > nochdir =3D noclose =3D 1; > pidfile =3D user =3D NULL; > @@ -79,9 +81,7 @@ main(int argc, char *argv[]) > if (argc =3D=3D 0) > usage(); > =20 > - if (user !=3D NULL) > - restrict_process(user); > - > + pfh =3D NULL; > /* > * Try to open the pidfile before calling daemon(3), > * to be able to report the error intelligently > @@ -100,22 +100,36 @@ main(int argc, char *argv[]) > if (daemon(nochdir, noclose) =3D=3D -1) > err(1, NULL); > =20 > - /* Now that we are the child, write out the pid */ > - if (pidfile) > + pid =3D 0; > + if (pidfile) { > + /* > + * Spawn a child to exec the command, so in the parent > + * we could wait for it to exit and remove pidfile. > + */ > + pid =3D fork(); > + if (pid =3D=3D -1) { > + pidfile_remove(pfh); > + err(1, "fork"); > + } > + } > + if (pid =3D=3D 0) { > + /* Now that we are the child, write out the pid. */ > pidfile_write(pfh); > =20 > - execvp(argv[0], argv); > + if (user !=3D NULL) > + restrict_process(user); > =20 > - /* > - * execvp() failed -- unlink pidfile if any, and > - * report the error > - */ > - errcode =3D errno; /* Preserve errcode -- unlink may reset it */ > - if (pidfile) > - pidfile_remove(pfh); > + execvp(argv[0], argv); > =20 > - /* The child is now running, so the exit status doesn't matter. */ > - errc(1, errcode, "%s", argv[0]); > + /* > + * execvp() failed -- report the error. The child is > + * now running, so the exit status doesn't matter. > + */ > + err(1, "%s", argv[0]); > + } > + wait_child(pid); > + pidfile_remove(pfh); > + exit(0); /* Exit status does not metter. */ > } > =20 > static void > @@ -132,6 +146,19 @@ restrict_process(const char *user) > } > =20 > static void > +wait_child(pid_t pid) > +{ > + int status; > + > + while (waitpid(pid, &status, 0) =3D=3D -1) { > + if (errno !=3D EINTR) { > + warn("waitpid"); > + break; > + } > + } > +} > + > +static void > usage(void) > { > (void)fprintf(stderr, --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --k+w/mQv8wyuph6w0 Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8wUYYACgkQForvXbEpPzRWFACeLMppI61xkOQjJ2nLUfGW5lYq OvgAn1WBq/gfLvymZ3dfAehtk7OVhFjX =ffH+ -----END PGP SIGNATURE----- --k+w/mQv8wyuph6w0-- From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 02:57:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B3148106564A; Tue, 7 Feb 2012 02:57:36 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 93B598FC17; Tue, 7 Feb 2012 02:57:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q172vaKg065275; Tue, 7 Feb 2012 02:57:36 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q172vasA065272; Tue, 7 Feb 2012 02:57:36 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201202070257.q172vasA065272@svn.freebsd.org> From: David Xu Date: Tue, 7 Feb 2012 02:57:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231106 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 02:57:36 -0000 Author: davidxu Date: Tue Feb 7 02:57:36 2012 New Revision: 231106 URL: http://svn.freebsd.org/changeset/base/231106 Log: Plug a memory leak. When a cached thread is reused, don't clear sleep queue pointers, just reuse it. PR: 164828 MFC after: 1 week Modified: head/lib/libthr/thread/thr_list.c head/lib/libthr/thread/thr_private.h Modified: head/lib/libthr/thread/thr_list.c ============================================================================== --- head/lib/libthr/thread/thr_list.c Tue Feb 7 02:21:46 2012 (r231105) +++ head/lib/libthr/thread/thr_list.c Tue Feb 7 02:57:36 2012 (r231106) @@ -149,11 +149,16 @@ _thr_alloc(struct pthread *curthread) if (total_threads > MAX_THREADS) return (NULL); atomic_fetchadd_int(&total_threads, 1); - thread = malloc(sizeof(struct pthread)); + thread = calloc(1, sizeof(struct pthread)); if (thread == NULL) { atomic_fetchadd_int(&total_threads, -1); return (NULL); } + thread->sleepqueue = _sleepq_alloc(); + thread->wake_addr = _thr_alloc_wake_addr(); + } else { + bzero(&thread->_pthread_startzero, + __rangeof(struct pthread, _pthread_startzero, _pthread_endzero)); } if (curthread != NULL) { THR_LOCK_ACQUIRE(curthread, &tcb_lock); @@ -163,10 +168,7 @@ _thr_alloc(struct pthread *curthread) tcb = _tcb_ctor(thread, 1 /* initial tls */); } if (tcb != NULL) { - memset(thread, 0, sizeof(*thread)); thread->tcb = tcb; - thread->sleepqueue = _sleepq_alloc(); - thread->wake_addr = _thr_alloc_wake_addr(); } else { thr_destroy(curthread, thread); atomic_fetchadd_int(&total_threads, -1); @@ -194,8 +196,6 @@ _thr_free(struct pthread *curthread, str } thread->tcb = NULL; if ((curthread == NULL) || (free_thread_count >= MAX_CACHED_THREADS)) { - _sleepq_free(thread->sleepqueue); - _thr_release_wake_addr(thread->wake_addr); thr_destroy(curthread, thread); atomic_fetchadd_int(&total_threads, -1); } else { @@ -213,6 +213,10 @@ _thr_free(struct pthread *curthread, str static void thr_destroy(struct pthread *curthread __unused, struct pthread *thread) { + if (thread->sleepqueue != NULL) + _sleepq_free(thread->sleepqueue); + if (thread->wake_addr != NULL) + _thr_release_wake_addr(thread->wake_addr); free(thread); } Modified: head/lib/libthr/thread/thr_private.h ============================================================================== --- head/lib/libthr/thread/thr_private.h Tue Feb 7 02:21:46 2012 (r231105) +++ head/lib/libthr/thread/thr_private.h Tue Feb 7 02:57:36 2012 (r231106) @@ -343,6 +343,7 @@ struct pthread_key { * Thread structure. */ struct pthread { +#define _pthread_startzero tid /* Kernel thread id. */ long tid; #define TID_TERMINATED 1 @@ -506,12 +507,6 @@ struct pthread { /* Event */ td_event_msg_t event_buf; - struct wake_addr *wake_addr; -#define WAKE_ADDR(td) ((td)->wake_addr) - - /* Sleep queue */ - struct sleepqueue *sleepqueue; - /* Wait channel */ void *wchan; @@ -526,6 +521,14 @@ struct pthread { /* Deferred threads from pthread_cond_signal. */ unsigned int *defer_waiters[MAX_DEFER_WAITERS]; +#define _pthread_endzero wake_addr + + struct wake_addr *wake_addr; +#define WAKE_ADDR(td) ((td)->wake_addr) + + /* Sleep queue */ + struct sleepqueue *sleepqueue; + }; #define THR_SHOULD_GC(thrd) \ From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 04:00:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C48351065670; Tue, 7 Feb 2012 04:00:57 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B0E4A8FC0A; Tue, 7 Feb 2012 04:00:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1740v0m067737; Tue, 7 Feb 2012 04:00:57 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1740vaO067735; Tue, 7 Feb 2012 04:00:57 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201202070400.q1740vaO067735@svn.freebsd.org> From: Eitan Adler Date: Tue, 7 Feb 2012 04:00:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231111 - head/share/man/man7 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 04:00:58 -0000 Author: eadler Date: Tue Feb 7 04:00:57 2012 New Revision: 231111 URL: http://svn.freebsd.org/changeset/base/231111 Log: ports(7) currently makes no mention of LOCALBASE: fix that PR: docs/159551 Submitted by: Matthew Seaman Approved by: gjb MFC after: 3 days Modified: head/share/man/man7/ports.7 Modified: head/share/man/man7/ports.7 ============================================================================== --- head/share/man/man7/ports.7 Tue Feb 7 03:41:08 2012 (r231110) +++ head/share/man/man7/ports.7 Tue Feb 7 04:00:57 2012 (r231111) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 30, 2011 +.Dd Feb 06, 2012 .Dt PORTS 7 .Os .Sh NAME @@ -408,10 +408,13 @@ Directory to put the package in. .It Va PKGFILE The full path to the package. .El -.It Va PREFIX -Where to install things in general -(usually +.It Va LOCALBASE +Where existing things are installed and where to search for files when +resolving dependencies (usually .Pa /usr/local ) . +.It Va PREFIX +Where to install this port (usually set to the same as +.Va LOCALBASE ) . .It Va MASTER_SITES Primary sites for distribution files if not found locally. .It Va PATCH_SITES From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 06:22:00 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 06DD5106564A; Tue, 7 Feb 2012 06:22:00 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DB7A88FC12; Tue, 7 Feb 2012 06:21:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q176LxLP072248; Tue, 7 Feb 2012 06:21:59 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q176LxSh072243; Tue, 7 Feb 2012 06:21:59 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202070621.q176LxSh072243@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 7 Feb 2012 06:21:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231115 - head/sys/dev/cxgbe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 06:22:00 -0000 Author: np Date: Tue Feb 7 06:21:59 2012 New Revision: 231115 URL: http://svn.freebsd.org/changeset/base/231115 Log: cxgbe: reduce diffs with other branches. Will help future MFCs from HEAD. MFC after: 3 days Modified: head/sys/dev/cxgbe/adapter.h head/sys/dev/cxgbe/t4_l2t.c head/sys/dev/cxgbe/t4_l2t.h head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/adapter.h ============================================================================== --- head/sys/dev/cxgbe/adapter.h Tue Feb 7 04:38:43 2012 (r231114) +++ head/sys/dev/cxgbe/adapter.h Tue Feb 7 06:21:59 2012 (r231115) @@ -66,6 +66,17 @@ prefetch(void *x) #define prefetch(x) #endif +#ifndef SYSCTL_ADD_UQUAD +#define SYSCTL_ADD_UQUAD SYSCTL_ADD_QUAD +#define sysctl_handle_64 sysctl_handle_quad +#define CTLTYPE_U64 CTLTYPE_QUAD +#endif + +#if (__FreeBSD_version >= 900030) || \ + ((__FreeBSD_version >= 802507) && (__FreeBSD_version < 900000)) +#define SBUF_DRAIN 1 +#endif + #ifdef __amd64__ /* XXX: need systemwide bus_space_read_8/bus_space_write_8 */ static __inline uint64_t Modified: head/sys/dev/cxgbe/t4_l2t.c ============================================================================== --- head/sys/dev/cxgbe/t4_l2t.c Tue Feb 7 04:38:43 2012 (r231114) +++ head/sys/dev/cxgbe/t4_l2t.c Tue Feb 7 06:21:59 2012 (r231115) @@ -259,6 +259,7 @@ t4_free_l2t(struct l2t_data *d) return (0); } +#ifdef SBUF_DRAIN static inline unsigned int vlan_prio(const struct l2t_entry *e) { @@ -333,6 +334,7 @@ skip: return (rc); } +#endif #ifndef TCP_OFFLOAD_DISABLE static inline void @@ -652,6 +654,11 @@ t4_l2t_get(struct port_info *pi, struct } else return (NULL); +#ifndef VLAN_TAG + if (ifp->if_type == IFT_L2VLAN) + return (NULL); +#endif + hash = addr_hash(addr, addr_len, ifp->if_index); rw_wlock(&d->lock); @@ -678,10 +685,12 @@ t4_l2t_get(struct port_info *pi, struct e->v6 = (addr_len == 16); e->lle = NULL; atomic_store_rel_int(&e->refcnt, 1); +#ifdef VLAN_TAG if (ifp->if_type == IFT_L2VLAN) VLAN_TAG(ifp, &e->vlan); else e->vlan = VLAN_NONE; +#endif e->next = d->l2tab[hash].first; d->l2tab[hash].first = e; mtx_unlock(&e->lock); Modified: head/sys/dev/cxgbe/t4_l2t.h ============================================================================== --- head/sys/dev/cxgbe/t4_l2t.h Tue Feb 7 04:38:43 2012 (r231114) +++ head/sys/dev/cxgbe/t4_l2t.h Tue Feb 7 06:21:59 2012 (r231115) @@ -67,7 +67,9 @@ struct l2t_entry *t4_l2t_alloc_switching int t4_l2t_set_switching(struct adapter *, struct l2t_entry *, uint16_t, uint8_t, uint8_t *); void t4_l2t_release(struct l2t_entry *); +#ifdef SBUF_DRAIN int sysctl_l2t(SYSCTL_HANDLER_ARGS); +#endif #ifndef TCP_OFFLOAD_DISABLE struct l2t_entry *t4_l2t_get(struct port_info *, struct ifnet *, Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Feb 7 04:38:43 2012 (r231114) +++ head/sys/dev/cxgbe/t4_main.c Tue Feb 7 06:21:59 2012 (r231115) @@ -309,6 +309,7 @@ static int sysctl_holdoff_pktc_idx(SYSCT static int sysctl_qsize_rxq(SYSCTL_HANDLER_ARGS); static int sysctl_qsize_txq(SYSCTL_HANDLER_ARGS); static int sysctl_handle_t4_reg64(SYSCTL_HANDLER_ARGS); +#ifdef SBUF_DRAIN static int sysctl_cctrl(SYSCTL_HANDLER_ARGS); static int sysctl_cpl_stats(SYSCTL_HANDLER_ARGS); static int sysctl_ddp_stats(SYSCTL_HANDLER_ARGS); @@ -324,6 +325,7 @@ static int sysctl_tcp_stats(SYSCTL_HANDL static int sysctl_tids(SYSCTL_HANDLER_ARGS); static int sysctl_tp_err_stats(SYSCTL_HANDLER_ARGS); static int sysctl_tx_rate(SYSCTL_HANDLER_ARGS); +#endif static inline void txq_start(struct ifnet *, struct sge_txq *); static uint32_t fconf_to_mode(uint32_t); static uint32_t mode_to_fconf(uint32_t); @@ -2980,6 +2982,7 @@ t4_sysctls(struct adapter *sc) sizeof(sc->sge.counter_val), sysctl_int_array, "A", "interrupt holdoff packet counter values"); +#ifdef SBUF_DRAIN /* * dev.t4nex.X.misc. Marked CTLFLAG_SKIP to avoid information overload. */ @@ -3051,6 +3054,7 @@ t4_sysctls(struct adapter *sc) SYSCTL_ADD_PROC(ctx, children, OID_AUTO, "tx_rate", CTLTYPE_STRING | CTLFLAG_RD, sc, 0, sysctl_tx_rate, "A", "Tx rate"); +#endif #ifndef TCP_OFFLOAD_DISABLE if (is_offload(sc)) { @@ -3465,6 +3469,7 @@ sysctl_handle_t4_reg64(SYSCTL_HANDLER_AR return (sysctl_handle_64(oidp, &val, 0, req)); } +#ifdef SBUF_DRAIN static int sysctl_cctrl(SYSCTL_HANDLER_ARGS) { @@ -4297,6 +4302,7 @@ sysctl_tx_rate(SYSCTL_HANDLER_ARGS) return (rc); } +#endif static inline void txq_start(struct ifnet *ifp, struct sge_txq *txq) From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 07:32:40 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D4F61065670; Tue, 7 Feb 2012 07:32:40 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E07848FC13; Tue, 7 Feb 2012 07:32:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q177Wdcm074521; Tue, 7 Feb 2012 07:32:39 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q177Wdir074516; Tue, 7 Feb 2012 07:32:39 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202070732.q177Wdir074516@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 7 Feb 2012 07:32:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231116 - in head/sys/dev: cxgb cxgbe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 07:32:40 -0000 Author: np Date: Tue Feb 7 07:32:39 2012 New Revision: 231116 URL: http://svn.freebsd.org/changeset/base/231116 Log: Remove if_start from cxgb and cxgbe. Submitted by: jhb MFC after: 3 days Modified: head/sys/dev/cxgb/cxgb_adapter.h head/sys/dev/cxgb/cxgb_main.c head/sys/dev/cxgb/cxgb_sge.c head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgb/cxgb_adapter.h ============================================================================== --- head/sys/dev/cxgb/cxgb_adapter.h Tue Feb 7 06:21:59 2012 (r231115) +++ head/sys/dev/cxgb/cxgb_adapter.h Tue Feb 7 07:32:39 2012 (r231116) @@ -572,5 +572,4 @@ static inline int offload_running(adapte void cxgb_tx_watchdog(void *arg); int cxgb_transmit(struct ifnet *ifp, struct mbuf *m); void cxgb_qflush(struct ifnet *ifp); -void cxgb_start(struct ifnet *ifp); #endif Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Tue Feb 7 06:21:59 2012 (r231115) +++ head/sys/dev/cxgb/cxgb_main.c Tue Feb 7 07:32:39 2012 (r231116) @@ -227,14 +227,6 @@ TUNABLE_INT("hw.cxgb.use_16k_clusters", SYSCTL_INT(_hw_cxgb, OID_AUTO, use_16k_clusters, CTLFLAG_RDTUN, &cxgb_use_16k_clusters, 0, "use 16kB clusters for the jumbo queue "); -/* - * Tune the size of the output queue. - */ -int cxgb_snd_queue_len = IFQ_MAXLEN; -TUNABLE_INT("hw.cxgb.snd_queue_len", &cxgb_snd_queue_len); -SYSCTL_INT(_hw_cxgb, OID_AUTO, snd_queue_len, CTLFLAG_RDTUN, - &cxgb_snd_queue_len, 0, "send queue size "); - static int nfilters = -1; TUNABLE_INT("hw.cxgb.nfilters", &nfilters); SYSCTL_INT(_hw_cxgb, OID_AUTO, nfilters, CTLFLAG_RDTUN, @@ -1019,11 +1011,8 @@ cxgb_port_attach(device_t dev) ifp->if_softc = p; ifp->if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp->if_ioctl = cxgb_ioctl; - ifp->if_start = cxgb_start; - - ifp->if_snd.ifq_drv_maxlen = max(cxgb_snd_queue_len, ifqmaxlen); - IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); - IFQ_SET_READY(&ifp->if_snd); + ifp->if_transmit = cxgb_transmit; + ifp->if_qflush = cxgb_qflush; ifp->if_capabilities = CXGB_CAP; ifp->if_capenable = CXGB_CAP_ENABLE; @@ -1039,8 +1028,6 @@ cxgb_port_attach(device_t dev) } ether_ifattach(ifp, p->hw_addr); - ifp->if_transmit = cxgb_transmit; - ifp->if_qflush = cxgb_qflush; #ifdef DEFAULT_JUMBO if (sc->params.nports <= 2) Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Tue Feb 7 06:21:59 2012 (r231115) +++ head/sys/dev/cxgb/cxgb_sge.c Tue Feb 7 07:32:39 2012 (r231116) @@ -1767,19 +1767,6 @@ cxgb_transmit(struct ifnet *ifp, struct error = drbr_enqueue(ifp, qs->txq[TXQ_ETH].txq_mr, m); return (error); } -void -cxgb_start(struct ifnet *ifp) -{ - struct port_info *pi = ifp->if_softc; - struct sge_qset *qs = &pi->adapter->sge.qs[pi->first_qset]; - - if (!pi->link_config.link_ok) - return; - - TXQ_LOCK(qs); - cxgb_start_locked(qs); - TXQ_UNLOCK(qs); -} void cxgb_qflush(struct ifnet *ifp) Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Feb 7 06:21:59 2012 (r231115) +++ head/sys/dev/cxgbe/t4_main.c Tue Feb 7 07:32:39 2012 (r231116) @@ -112,7 +112,6 @@ static struct cdevsw t4_cdevsw = { /* ifnet + media interface */ static void cxgbe_init(void *); static int cxgbe_ioctl(struct ifnet *, unsigned long, caddr_t); -static void cxgbe_start(struct ifnet *); static int cxgbe_transmit(struct ifnet *, struct mbuf *); static void cxgbe_qflush(struct ifnet *); static int cxgbe_media_change(struct ifnet *); @@ -829,14 +828,9 @@ cxgbe_attach(device_t dev) ifp->if_init = cxgbe_init; ifp->if_ioctl = cxgbe_ioctl; - ifp->if_start = cxgbe_start; ifp->if_transmit = cxgbe_transmit; ifp->if_qflush = cxgbe_qflush; - ifp->if_snd.ifq_drv_maxlen = 1024; - IFQ_SET_MAXLEN(&ifp->if_snd, ifp->if_snd.ifq_drv_maxlen); - IFQ_SET_READY(&ifp->if_snd); - ifp->if_capabilities = T4_CAP; #ifndef TCP_OFFLOAD_DISABLE if (is_offload(pi->adapter)) @@ -1095,21 +1089,6 @@ fail: return (rc); } -static void -cxgbe_start(struct ifnet *ifp) -{ - struct port_info *pi = ifp->if_softc; - struct sge_txq *txq; - int i; - - for_each_txq(pi, i, txq) { - if (TXQ_TRYLOCK(txq)) { - txq_start(ifp, txq); - TXQ_UNLOCK(txq); - } - } -} - static int cxgbe_transmit(struct ifnet *ifp, struct mbuf *m) { From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 09:27:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D93991065687; Tue, 7 Feb 2012 09:27:08 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BFD348FC15; Tue, 7 Feb 2012 09:27:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q179R85j078242; Tue, 7 Feb 2012 09:27:08 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q179R81a078218; Tue, 7 Feb 2012 09:27:08 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201202070927.q179R81a078218@svn.freebsd.org> From: Dimitry Andric Date: Tue, 7 Feb 2012 09:27:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231118 - in head: include/rpc include/rpcsvc lib/libc/rpc lib/libc/yp lib/librpcsvc lib/libypclnt libexec/ypxfr release/picobsd/tinyware/passwd sys/conf sys/modules/kgssapi sys/modules... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 09:27:09 -0000 Author: dim Date: Tue Feb 7 09:27:07 2012 New Revision: 231118 URL: http://svn.freebsd.org/changeset/base/231118 Log: Consistently set RPCGEN_CPP when running rpcgen, so the C preprocessor set via ${CPP} is used, instead of always using hardcoded /usr/bin/cpp. MFC after: 1 week Modified: head/include/rpc/Makefile head/include/rpcsvc/Makefile head/lib/libc/rpc/Makefile.inc head/lib/libc/yp/Makefile.inc head/lib/librpcsvc/Makefile head/lib/libypclnt/Makefile head/libexec/ypxfr/Makefile head/release/picobsd/tinyware/passwd/Makefile head/sys/conf/files head/sys/modules/kgssapi/Makefile head/sys/modules/kgssapi_krb5/Makefile head/usr.sbin/amd/Makefile.inc head/usr.sbin/bootparamd/bootparamd/Makefile head/usr.sbin/bootparamd/callbootd/Makefile head/usr.sbin/gssd/Makefile head/usr.sbin/keyserv/Makefile head/usr.sbin/rpc.lockd/Makefile head/usr.sbin/rpc.statd/Makefile head/usr.sbin/rpc.yppasswdd/Makefile head/usr.sbin/rpc.ypupdated/Makefile head/usr.sbin/rpc.ypxfrd/Makefile head/usr.sbin/yppush/Makefile head/usr.sbin/ypserv/Makefile Modified: head/include/rpc/Makefile ============================================================================== --- head/include/rpc/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/include/rpc/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -3,7 +3,7 @@ .SUFFIXES: .x -RPCCOM = rpcgen -C +RPCCOM= RPCGEN_CPP=${CPP:Q} rpcgen -C HDRS= rpcb_prot.h Modified: head/include/rpcsvc/Makefile ============================================================================== --- head/include/rpcsvc/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/include/rpcsvc/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -3,7 +3,7 @@ .SUFFIXES: .x -RPCCOM = rpcgen -C +RPCCOM= RPCGEN_CPP=${CPP:Q} rpcgen -C HDRS= key_prot.h klm_prot.h mount.h nfs_prot.h nlm_prot.h rex.h rnusers.h \ rquota.h rstat.h rwall.h sm_inter.h spray.h yppasswd.h yp.h \ Modified: head/lib/libc/rpc/Makefile.inc ============================================================================== --- head/lib/libc/rpc/Makefile.inc Tue Feb 7 07:56:00 2012 (r231117) +++ head/lib/libc/rpc/Makefile.inc Tue Feb 7 09:27:07 2012 (r231118) @@ -34,7 +34,7 @@ CFLAGS+= -I${.CURDIR}/rpc CLEANFILES+= crypt_clnt.c crypt_xdr.c crypt.h RPCDIR= ${DESTDIR}/usr/include/rpcsvc -RPCGEN= rpcgen -C +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -C crypt_clnt.c: ${RPCDIR}/crypt.x crypt.h ${RPCGEN} -l -o ${.TARGET} ${RPCDIR}/crypt.x Modified: head/lib/libc/yp/Makefile.inc ============================================================================== --- head/lib/libc/yp/Makefile.inc Tue Feb 7 07:56:00 2012 (r231117) +++ head/lib/libc/yp/Makefile.inc Tue Feb 7 09:27:07 2012 (r231118) @@ -10,7 +10,7 @@ CLEANFILES+= yp.h yp_xdr.c SYM_MAPS+= ${.CURDIR}/yp/Symbol.map RPCSRC= ${DESTDIR}/usr/include/rpcsvc/yp.x -RPCGEN= rpcgen -C +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -C yp_xdr.c: ${RPCSRC} ${RPCGEN} -c -o ${.TARGET} ${RPCSRC} Modified: head/lib/librpcsvc/Makefile ============================================================================== --- head/lib/librpcsvc/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/lib/librpcsvc/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -18,7 +18,7 @@ SECRPCSRCS= secretkey.c xcrypt.c OTHERSRCS+= yp_passwd.c yp_update.c .endif -RPCCOM = rpcgen -C +RPCCOM= RPCGEN_CPP=${CPP:Q} rpcgen -C INCDIRS= -I${DESTDIR}/usr/include/rpcsvc Modified: head/lib/libypclnt/Makefile ============================================================================== --- head/lib/libypclnt/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/lib/libypclnt/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -22,7 +22,7 @@ GENSRCS=yp.h \ yppasswd_private_clnt.c \ yppasswd_private_xdr.c -RPCGEN= rpcgen -C +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -C RPCSRC= ${.CURDIR}/../../include/rpcsvc/yp.x RPCSRC_PW= ${.CURDIR}/../../include/rpcsvc/yppasswd.x RPCSRC_PRIV= ${.CURDIR}/../../usr.sbin/rpc.yppasswdd/yppasswd_private.x Modified: head/libexec/ypxfr/Makefile ============================================================================== --- head/libexec/ypxfr/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/libexec/ypxfr/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -22,7 +22,7 @@ LDADD= -lrpcsvc CLEANFILES= ${GENSRCS} RPCDIR= ${.CURDIR}/../../include/rpcsvc -RPCGEN= rpcgen -I -C +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -I -C ypxfr_clnt.c: ${RPCDIR}/yp.x rm -f ${.TARGET} Modified: head/release/picobsd/tinyware/passwd/Makefile ============================================================================== --- head/release/picobsd/tinyware/passwd/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/release/picobsd/tinyware/passwd/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -26,7 +26,7 @@ CFLAGS+= -DLOGIN_CAP -DCRYPT -I. -I${.CU CLEANFILES= ${GENSRCS} -RPCGEN= rpcgen -C +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -C RPCSRC= ${DESTDIR}/usr/include/rpcsvc/yp.x RPCSRC_PW= ${DESTDIR}/usr/include/rpcsvc/yppasswd.x RPCSRC_PRIV= ${.CURDIR}/../../usr.sbin/rpc.yppasswdd/yppasswd_private.x Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Tue Feb 7 07:56:00 2012 (r231117) +++ head/sys/conf/files Tue Feb 7 09:27:07 2012 (r231118) @@ -2499,17 +2499,17 @@ kern/vfs_vnops.c standard # gssd.h optional kgssapi \ dependency "$S/kgssapi/gssd.x" \ - compile-with "rpcgen -hM $S/kgssapi/gssd.x | grep -v pthread.h > gssd.h" \ + compile-with "RPCGEN_CPP='${CPP}' rpcgen -hM $S/kgssapi/gssd.x | grep -v pthread.h > gssd.h" \ no-obj no-implicit-rule before-depend local \ clean "gssd.h" gssd_xdr.c optional kgssapi \ dependency "$S/kgssapi/gssd.x gssd.h" \ - compile-with "rpcgen -c $S/kgssapi/gssd.x -o gssd_xdr.c" \ + compile-with "RPCGEN_CPP='${CPP}' rpcgen -c $S/kgssapi/gssd.x -o gssd_xdr.c" \ no-implicit-rule before-depend local \ clean "gssd_xdr.c" gssd_clnt.c optional kgssapi \ dependency "$S/kgssapi/gssd.x gssd.h" \ - compile-with "rpcgen -lM $S/kgssapi/gssd.x | grep -v string.h > gssd_clnt.c" \ + compile-with "RPCGEN_CPP='${CPP}' rpcgen -lM $S/kgssapi/gssd.x | grep -v string.h > gssd_clnt.c" \ no-implicit-rule before-depend local \ clean "gssd_clnt.c" kgssapi/gss_accept_sec_context.c optional kgssapi Modified: head/sys/modules/kgssapi/Makefile ============================================================================== --- head/sys/modules/kgssapi/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/sys/modules/kgssapi/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -44,12 +44,12 @@ CLEANFILES= gssd.h gssd_xdr.c gssd_clnt. S= ${.CURDIR}/../.. gssd.h: $S/kgssapi/gssd.x - rpcgen -hM $S/kgssapi/gssd.x | grep -v pthread.h > gssd.h + RPCGEN_CPP=${CPP:Q} rpcgen -hM $S/kgssapi/gssd.x | grep -v pthread.h > gssd.h gssd_xdr.c: $S/kgssapi/gssd.x - rpcgen -c $S/kgssapi/gssd.x -o gssd_xdr.c + RPCGEN_CPP=${CPP:Q} rpcgen -c $S/kgssapi/gssd.x -o gssd_xdr.c gssd_clnt.c: $S/kgssapi/gssd.x - rpcgen -lM $S/kgssapi/gssd.x | grep -v string.h > gssd_clnt.c + RPCGEN_CPP=${CPP:Q} rpcgen -lM $S/kgssapi/gssd.x | grep -v string.h > gssd_clnt.c .include Modified: head/sys/modules/kgssapi_krb5/Makefile ============================================================================== --- head/sys/modules/kgssapi_krb5/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/sys/modules/kgssapi_krb5/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -18,6 +18,6 @@ CLEANFILES= gssd.h S= ${.CURDIR}/../.. gssd.h: $S/kgssapi/gssd.x - rpcgen -hM $S/kgssapi/gssd.x | grep -v pthread.h > gssd.h + RPCGEN_CPP=${CPP:Q} rpcgen -hM $S/kgssapi/gssd.x | grep -v pthread.h > gssd.h .include Modified: head/usr.sbin/amd/Makefile.inc ============================================================================== --- head/usr.sbin/amd/Makefile.inc Tue Feb 7 07:56:00 2012 (r231117) +++ head/usr.sbin/amd/Makefile.inc Tue Feb 7 09:27:07 2012 (r231118) @@ -36,7 +36,7 @@ LIBAMUDIR= ${.CURDIR}/../libamu .endif LIBAMU= ${LIBAMUDIR}/libamu.a -RPCCOM= rpcgen +RPCCOM= RPCGEN_CPP=${CPP:Q} rpcgen MOUNT_X= ${DESTDIR}/usr/include/rpcsvc/mount.x NFS_PROT_X= ${DESTDIR}/usr/include/rpcsvc/nfs_prot.x Modified: head/usr.sbin/bootparamd/bootparamd/Makefile ============================================================================== --- head/usr.sbin/bootparamd/bootparamd/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/usr.sbin/bootparamd/bootparamd/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -18,12 +18,12 @@ CLEANFILES= ${GENSRCS} RPCSRC= ${DESTDIR}/usr/include/rpcsvc/bootparam_prot.x bootparam_prot_svc.c: ${RPCSRC} - rpcgen -C -m -o ${.TARGET} ${RPCSRC} + RPCGEN_CPP=${CPP:Q} rpcgen -C -m -o ${.TARGET} ${RPCSRC} bootparam_prot_xdr.c: ${RPCSRC} - rpcgen -C -c -o ${.TARGET} ${RPCSRC} + RPCGEN_CPP=${CPP:Q} rpcgen -C -c -o ${.TARGET} ${RPCSRC} bootparam_prot.h: ${RPCSRC} - rpcgen -C -h -o ${.TARGET} ${RPCSRC} + RPCGEN_CPP=${CPP:Q} rpcgen -C -h -o ${.TARGET} ${RPCSRC} .include Modified: head/usr.sbin/bootparamd/callbootd/Makefile ============================================================================== --- head/usr.sbin/bootparamd/callbootd/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/usr.sbin/bootparamd/callbootd/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -13,12 +13,12 @@ CLEANFILES= ${GENSRCS} RPCSRC= ${DESTDIR}/usr/include/rpcsvc/bootparam_prot.x bootparam_prot_clnt.c: ${RPCSRC} - rpcgen -C -l -o ${.TARGET} ${RPCSRC} + RPCGEN_CPP=${CPP:Q} rpcgen -C -l -o ${.TARGET} ${RPCSRC} bootparam_prot_xdr.c: ${RPCSRC} - rpcgen -C -c -o ${.TARGET} ${RPCSRC} + RPCGEN_CPP=${CPP:Q} rpcgen -C -c -o ${.TARGET} ${RPCSRC} bootparam_prot.h: ${RPCSRC} - rpcgen -C -h -o ${.TARGET} ${RPCSRC} + RPCGEN_CPP=${CPP:Q} rpcgen -C -h -o ${.TARGET} ${RPCSRC} .include Modified: head/usr.sbin/gssd/Makefile ============================================================================== --- head/usr.sbin/gssd/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/usr.sbin/gssd/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -13,7 +13,7 @@ LDADD= -lgssapi CLEANFILES= gssd_svc.c gssd.h RPCSRC= ${.CURDIR}/../../sys/kgssapi/gssd.x -RPCGEN= rpcgen -L -C -M +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -L -C -M gssd_svc.c: ${RPCSRC} gssd.h ${RPCGEN} -m -o ${.TARGET} ${RPCSRC} Modified: head/usr.sbin/keyserv/Makefile ============================================================================== --- head/usr.sbin/keyserv/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/usr.sbin/keyserv/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -15,7 +15,7 @@ RPCDIR= ${DESTDIR}/usr/include/rpcsvc CLEANFILES= crypt_svc.c crypt.h -RPCGEN= rpcgen -C +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -C crypt_svc.c: ${RPCDIR}/crypt.x ${RPCGEN} -m -o ${.TARGET} ${RPCDIR}/crypt.x Modified: head/usr.sbin/rpc.lockd/Makefile ============================================================================== --- head/usr.sbin/rpc.lockd/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/usr.sbin/rpc.lockd/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -15,7 +15,7 @@ LDADD= -lrpcsvc -lutil CLEANFILES= nlm_prot_svc.c nlm_prot.h test RPCSRC= ${DESTDIR}/usr/include/rpcsvc/nlm_prot.x -RPCGEN= rpcgen -L -C +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -L -C nlm_prot_svc.c: ${RPCSRC} ${RPCGEN} -m -o ${.TARGET} ${RPCSRC} Modified: head/usr.sbin/rpc.statd/Makefile ============================================================================== --- head/usr.sbin/rpc.statd/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/usr.sbin/rpc.statd/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -13,7 +13,7 @@ LDADD= -lrpcsvc CLEANFILES= sm_inter_svc.c sm_inter.h RPCSRC= ${DESTDIR}/usr/include/rpcsvc/sm_inter.x -RPCGEN= rpcgen -L -C +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -L -C sm_inter_svc.c: ${RPCSRC} ${RPCGEN} -m -o ${.TARGET} ${RPCSRC} Modified: head/usr.sbin/rpc.yppasswdd/Makefile ============================================================================== --- head/usr.sbin/rpc.yppasswdd/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/usr.sbin/rpc.yppasswdd/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -25,7 +25,7 @@ LDADD= -lrpcsvc -lcrypt -lutil CLEANFILES= ${GENSRCS} -RPCGEN= rpcgen -I -C +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -I -C # We need to remove the 'static' keyword from _rpcsvcstate so that # yppasswdd_main.c can see it. Modified: head/usr.sbin/rpc.ypupdated/Makefile ============================================================================== --- head/usr.sbin/rpc.ypupdated/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/usr.sbin/rpc.ypupdated/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -19,7 +19,7 @@ LDADD= -lrpcsvc CLEANFILES= ypupdate_prot_svc.c ypupdate_prot.h RPCDIR= ${DESTDIR}/usr/include/rpcsvc -RPCGEN= rpcgen -I -C +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -I -C # We need to remove the 'static' keyword from _rpcsvcstate so that # ypupdated_main.c can see it. Modified: head/usr.sbin/rpc.ypxfrd/Makefile ============================================================================== --- head/usr.sbin/rpc.ypxfrd/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/usr.sbin/rpc.ypxfrd/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -17,7 +17,7 @@ LDADD= -lrpcsvc CLEANFILES= ypxfrd_svc.c ypxfrd.h RPCDIR= ${.CURDIR}/../../include/rpcsvc -RPCGEN= rpcgen -I -C +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -I -C # We need to remove the 'static' keyword from _rpcsvcstate so that # ypxfrd_main.c can see it. Modified: head/usr.sbin/yppush/Makefile ============================================================================== --- head/usr.sbin/yppush/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/usr.sbin/yppush/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -14,7 +14,7 @@ CFLAGS+= -I. -I${.CURDIR}/../../libexec/ WARNS?= 2 -RPCGEN= rpcgen -C +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -C CLEANFILES= ${GENSRCS} Modified: head/usr.sbin/ypserv/Makefile ============================================================================== --- head/usr.sbin/ypserv/Makefile Tue Feb 7 07:56:00 2012 (r231117) +++ head/usr.sbin/ypserv/Makefile Tue Feb 7 09:27:07 2012 (r231118) @@ -17,7 +17,7 @@ LDADD= -lwrap CLEANFILES= yp_svc.c ypxfr_clnt.c yp.h -RPCGEN= rpcgen -I -C +RPCGEN= RPCGEN_CPP=${CPP:Q} rpcgen -I -C # We need to remove the 'static' keyword from _rpcsvcstate so that # yp_main.c can see it. From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 09:39:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C8B04106566B; Tue, 7 Feb 2012 09:39:46 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B29408FC18; Tue, 7 Feb 2012 09:39:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q179dkxS078719; Tue, 7 Feb 2012 09:39:46 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q179dkNk078717; Tue, 7 Feb 2012 09:39:46 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202070939.q179dkNk078717@svn.freebsd.org> From: Navdeep Parhar Date: Tue, 7 Feb 2012 09:39:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231120 - head/sys/dev/cxgbe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 09:39:46 -0000 Author: np Date: Tue Feb 7 09:39:46 2012 New Revision: 231120 URL: http://svn.freebsd.org/changeset/base/231120 Log: Acquire the adapter lock before updating fields of the filter structure. Submitted by: gnn (different version) MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Tue Feb 7 09:37:30 2012 (r231119) +++ head/sys/dev/cxgbe/t4_main.c Tue Feb 7 09:39:46 2012 (r231120) @@ -4839,22 +4839,22 @@ filter_rpl(struct sge_iq *iq, const stru unsigned int rc = G_COOKIE(rpl->cookie); struct filter_entry *f = &sc->tids.ftid_tab[idx]; + ADAPTER_LOCK(sc); if (rc == FW_FILTER_WR_FLT_ADDED) { f->smtidx = (be64toh(rpl->oldval) >> 24) & 0xff; f->pending = 0; /* asynchronous setup completed */ f->valid = 1; - return (0); - } + } else { + if (rc != FW_FILTER_WR_FLT_DELETED) { + /* Add or delete failed, display an error */ + log(LOG_ERR, + "filter %u setup failed with error %u\n", + idx, rc); + } - if (rc != FW_FILTER_WR_FLT_DELETED) { - /* Add or delete failed, need to display an error */ - device_printf(sc->dev, - "filter %u setup failed with error %u\n", idx, rc); + clear_filter(f); + sc->tids.ftids_in_use--; } - - clear_filter(f); - ADAPTER_LOCK(sc); - sc->tids.ftids_in_use--; ADAPTER_UNLOCK(sc); } From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 09:51:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CDA18106564A; Tue, 7 Feb 2012 09:51:41 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9E3408FC08; Tue, 7 Feb 2012 09:51:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q179pfog079150; Tue, 7 Feb 2012 09:51:41 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q179pfM6079147; Tue, 7 Feb 2012 09:51:41 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202070951.q179pfM6079147@svn.freebsd.org> From: Konstantin Belousov Date: Tue, 7 Feb 2012 09:51:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231122 - head/sys/ufs/ufs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 09:51:41 -0000 Author: kib Date: Tue Feb 7 09:51:41 2012 New Revision: 231122 URL: http://svn.freebsd.org/changeset/base/231122 Log: Sprinkle missed calls to asynchronous UFS_UPDATE() in attempt to guarantee that all UFS inode metadata changes results in the dirtiness of the inodeblock. Due to missed inodeblock updates, syncer was required to fsync each mount point' vnode to guarantee periodic metadata flush. Reviewed by: mckusick Tested by: scottl MFC after: 2 weeks Modified: head/sys/ufs/ufs/ufs_acl.c head/sys/ufs/ufs/ufs_vnops.c Modified: head/sys/ufs/ufs/ufs_acl.c ============================================================================== --- head/sys/ufs/ufs/ufs_acl.c Tue Feb 7 09:40:22 2012 (r231121) +++ head/sys/ufs/ufs/ufs_acl.c Tue Feb 7 09:51:41 2012 (r231122) @@ -422,7 +422,8 @@ ufs_setacl_nfs4_internal(struct vnode *v VN_KNOTE_UNLOCKED(vp, NOTE_ATTRIB); - return (0); + error = UFS_UPDATE(vp, 0); + return (error); } static int @@ -591,10 +592,11 @@ ufs_setacl_posix1e(struct vop_setacl_arg */ ufs_sync_inode_from_acl(ap->a_aclp, ip); ip->i_flag |= IN_CHANGE; + error = UFS_UPDATE(ap->a_vp, 0); } VN_KNOTE_UNLOCKED(ap->a_vp, NOTE_ATTRIB); - return (0); + return (error); } int Modified: head/sys/ufs/ufs/ufs_vnops.c ============================================================================== --- head/sys/ufs/ufs/ufs_vnops.c Tue Feb 7 09:40:22 2012 (r231121) +++ head/sys/ufs/ufs/ufs_vnops.c Tue Feb 7 09:51:41 2012 (r231122) @@ -571,8 +571,9 @@ ufs_setattr(ap) DIP_SET(ip, i_flags, ip->i_flags); } ip->i_flag |= IN_CHANGE; + error = UFS_UPDATE(vp, 0); if (vap->va_flags & (IMMUTABLE | APPEND)) - return (0); + return (error); } if (ip->i_flags & (IMMUTABLE | APPEND)) return (EPERM); @@ -738,6 +739,9 @@ ufs_markatime(ap) VI_LOCK(vp); ip->i_flag |= IN_ACCESS; VI_UNLOCK(vp); + /* + * XXXKIB No UFS_UPDATE(ap->a_vp, 0) there. + */ return (0); } @@ -794,6 +798,9 @@ ufs_chmod(vp, mode, cred, td) if ((vp->v_mount->mnt_flag & MNT_NFS4ACLS) != 0) error = ufs_update_nfs4_acl_after_mode_change(vp, mode, ip->i_uid, cred, td); #endif + if (error == 0 && (ip->i_flag & IN_CHANGE) != 0) + error = UFS_UPDATE(vp, 0); + return (error); } @@ -912,7 +919,8 @@ good: DIP_SET(ip, i_mode, ip->i_mode); } } - return (0); + error = UFS_UPDATE(vp, 0); + return (error); } static int @@ -2079,6 +2087,7 @@ ufs_rmdir(ap) dp->i_nlink--; DIP_SET(dp, i_nlink, dp->i_nlink); dp->i_flag |= IN_CHANGE; + error = UFS_UPDATE(dvp, 0); ip->i_nlink--; DIP_SET(ip, i_nlink, ip->i_nlink); ip->i_flag |= IN_CHANGE; @@ -2122,6 +2131,7 @@ ufs_symlink(ap) ip->i_size = len; DIP_SET(ip, i_size, len); ip->i_flag |= IN_CHANGE | IN_UPDATE; + error = UFS_UPDATE(vp, 0); } else error = vn_rdwr(UIO_WRITE, vp, ap->a_target, len, (off_t)0, UIO_SYSSPACE, IO_NODELOCKED | IO_NOMACCHECK, From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 10:59:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F70C1065688; Tue, 7 Feb 2012 10:59:20 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1E85B8FC0C; Tue, 7 Feb 2012 10:59:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q17AxJTn086313; Tue, 7 Feb 2012 10:59:19 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17AxJNS086311; Tue, 7 Feb 2012 10:59:19 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201202071059.q17AxJNS086311@svn.freebsd.org> From: Takahashi Yoshihiro Date: Tue, 7 Feb 2012 10:59:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231123 - head/release X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 10:59:20 -0000 Author: nyan Date: Tue Feb 7 10:59:19 2012 New Revision: 231123 URL: http://svn.freebsd.org/changeset/base/231123 Log: - Set TERM to cons25w on pc98 because we still use old cons25w terminal to show Japanese. - Add cons25w to terminal lists. Reviewed by: nwhitehorn MFC after: 1 week Modified: head/release/rc.local Modified: head/release/rc.local ============================================================================== --- head/release/rc.local Tue Feb 7 09:51:41 2012 (r231122) +++ head/release/rc.local Tue Feb 7 10:59:19 2012 (r231123) @@ -8,10 +8,16 @@ : ${DIALOG_ITEM_HELP=4} : ${DIALOG_ESC=255} +MACHINE=`uname -m` + kbdcontrol -d >/dev/null 2>&1 if [ $? -eq 0 ]; then # Syscons: use xterm, start interesting things on other VTYs - TERM=xterm + if [ ${MACHINE} = "pc98" ]; then + TERM=cons25w + else + TERM=xterm + fi if [ -z "$EXTERNAL_VTY_STARTED" ]; then # Init will clean these processes up if/when the system @@ -31,6 +37,7 @@ else echo " ansi Standard ANSI terminal" echo " vt100 VT100 or compatible terminal" echo " xterm xterm terminal emulator (or compatible)" + echo " cons25w cons25w terminal" echo echo -n "Console type [vt100]: " read TERM From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 11:11:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C300106568A; Tue, 7 Feb 2012 11:11:33 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id DED0A8FC12; Tue, 7 Feb 2012 11:11:32 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q17B7T1K069510 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 7 Feb 2012 13:07:29 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q17B7TDG004337; Tue, 7 Feb 2012 13:07:29 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q17B7TPd004336; Tue, 7 Feb 2012 13:07:29 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 7 Feb 2012 13:07:29 +0200 From: Konstantin Belousov To: Dimitry Andric Message-ID: <20120207110729.GB3283@deviant.kiev.zoral.com.ua> References: <201202070927.q179R81a078218@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="lJ4sC/874/3I/gBU" Content-Disposition: inline In-Reply-To: <201202070927.q179R81a078218@svn.freebsd.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231118 - in head: include/rpc include/rpcsvc lib/libc/rpc lib/libc/yp lib/librpcsvc lib/libypclnt libexec/ypxfr release/picobsd/tinyware/passwd sys/conf sys/modules/kgssapi sys/modules... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 11:11:33 -0000 --lJ4sC/874/3I/gBU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 07, 2012 at 09:27:08AM +0000, Dimitry Andric wrote: > Author: dim > Date: Tue Feb 7 09:27:07 2012 > New Revision: 231118 > URL: http://svn.freebsd.org/changeset/base/231118 >=20 > Log: > Consistently set RPCGEN_CPP when running rpcgen, so the C preprocessor > set via ${CPP} is used, instead of always using hardcoded /usr/bin/cpp. > =20 > MFC after: 1 week Shouldn't RPCGEN move to share/mk ? --lJ4sC/874/3I/gBU Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk8xBfEACgkQC3+MBN1Mb4iRHgCeKiq+CAn8fXQ2Pu/jtGjWIOGJ CncAoNYwyvy3AJYkkP+MQj3M8uI71bNE =Lge7 -----END PGP SIGNATURE----- --lJ4sC/874/3I/gBU-- From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 11:53:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BBEC31065675; Tue, 7 Feb 2012 11:53:08 +0000 (UTC) (envelope-from uqs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB2658FC0A; Tue, 7 Feb 2012 11:53:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q17Br8mS088181; Tue, 7 Feb 2012 11:53:08 GMT (envelope-from uqs@svn.freebsd.org) Received: (from uqs@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17Br8tW088179; Tue, 7 Feb 2012 11:53:08 GMT (envelope-from uqs@svn.freebsd.org) Message-Id: <201202071153.q17Br8tW088179@svn.freebsd.org> From: Ulrich Spoerlein Date: Tue, 7 Feb 2012 11:53:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231128 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 11:53:08 -0000 Author: uqs Date: Tue Feb 7 11:53:08 2012 New Revision: 231128 URL: http://svn.freebsd.org/changeset/base/231128 Log: Record my ports mentor relationship. Approved by: beat (mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Tue Feb 7 11:40:38 2012 (r231127) +++ head/share/misc/committers-ports.dot Tue Feb 7 11:53:08 2012 (r231128) @@ -184,6 +184,7 @@ trasz [label="Edward Tomasz Napierala\nt trhodes [label="Tom Rhodes\ntrhodes@FreeBSD.org\n2004/07/06"] thierry [label="Thierry Thomas\nthierry@FreeBSD.org\n2004/03/15"] tmclaugh [label="Tom McLaughlin\ntmclaugh@FreeBSD.org\n2005/09/15"] +uqs [label="Ulrich Spoerlein\nuqs@FreeBSD.org\n2012/01/19"] vd [label="Vasil Dimov\nvd@FreeBSD.org\n2006/01/19"] wen [label="Wen Heping\nwen@FreeBSD.org\n2010/12/13"] wxs [label="Wesley Shields\nwxs@FreeBSD.org\n2008/01/03"] @@ -220,6 +221,7 @@ bapt -> eadler bapt -> jlaffaye beat -> decke +beat -> uqs beech -> glarkin beech -> mva From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 14:06:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A2B271065696; Tue, 7 Feb 2012 14:06:30 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 91F058FC0C; Tue, 7 Feb 2012 14:06:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q17E6UEl092327; Tue, 7 Feb 2012 14:06:30 GMT (envelope-from emaste@svn.freebsd.org) Received: (from emaste@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17E6U8X092325; Tue, 7 Feb 2012 14:06:30 GMT (envelope-from emaste@svn.freebsd.org) Message-Id: <201202071406.q17E6U8X092325@svn.freebsd.org> From: Ed Maste Date: Tue, 7 Feb 2012 14:06:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231129 - head/sbin/reboot X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 14:06:30 -0000 Author: emaste Date: Tue Feb 7 14:06:30 2012 New Revision: 231129 URL: http://svn.freebsd.org/changeset/base/231129 Log: Add BSD copyright notice. Approved by: gordon@ Modified: head/sbin/reboot/nextboot.sh Modified: head/sbin/reboot/nextboot.sh ============================================================================== --- head/sbin/reboot/nextboot.sh Tue Feb 7 11:53:08 2012 (r231128) +++ head/sbin/reboot/nextboot.sh Tue Feb 7 14:06:30 2012 (r231129) @@ -1,9 +1,29 @@ #! /bin/sh # -# Copyright 2002. Gordon Tetlow. -# gordon@FreeBSD.org +# Copyright (c) 2002 Gordon Tetlow. All rights reserved. # Copyright (c) 2012 Sandvine Incorporated. 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 AUTHOR 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 AUTHOR 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$ delete="NO" From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 14:50:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 477501065674; Tue, 7 Feb 2012 14:50:34 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C4C08FC08; Tue, 7 Feb 2012 14:50:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q17EoXom093756; Tue, 7 Feb 2012 14:50:33 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17EoXQm093754; Tue, 7 Feb 2012 14:50:33 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201202071450.q17EoXQm093754@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Tue, 7 Feb 2012 14:50:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231130 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 14:50:34 -0000 Author: pjd Date: Tue Feb 7 14:50:33 2012 New Revision: 231130 URL: http://svn.freebsd.org/changeset/base/231130 Log: Allow to set if_bridge(4) sysctls from /boot/loader.conf. MFC after: 3 days Modified: head/sys/net/if_bridge.c Modified: head/sys/net/if_bridge.c ============================================================================== --- head/sys/net/if_bridge.c Tue Feb 7 14:06:30 2012 (r231129) +++ head/sys/net/if_bridge.c Tue Feb 7 14:50:33 2012 (r231130) @@ -355,19 +355,26 @@ static int pfil_local_phys = 0; /* run p locally destined packets */ static int log_stp = 0; /* log STP state changes */ static int bridge_inherit_mac = 0; /* share MAC with first bridge member */ +TUNABLE_INT("net.link.bridge.pfil_onlyip", &pfil_onlyip); SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_onlyip, CTLFLAG_RW, &pfil_onlyip, 0, "Only pass IP packets when pfil is enabled"); +TUNABLE_INT("net.link.bridge.ipfw_arp", &pfil_ipfw_arp); SYSCTL_INT(_net_link_bridge, OID_AUTO, ipfw_arp, CTLFLAG_RW, &pfil_ipfw_arp, 0, "Filter ARP packets through IPFW layer2"); +TUNABLE_INT("net.link.bridge.pfil_bridge", &pfil_bridge); SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_bridge, CTLFLAG_RW, &pfil_bridge, 0, "Packet filter on the bridge interface"); +TUNABLE_INT("net.link.bridge.pfil_member", &pfil_member); SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_member, CTLFLAG_RW, &pfil_member, 0, "Packet filter on the member interface"); +TUNABLE_INT("net.link.bridge.pfil_local_phys", &pfil_local_phys); SYSCTL_INT(_net_link_bridge, OID_AUTO, pfil_local_phys, CTLFLAG_RW, &pfil_local_phys, 0, "Packet filter on the physical interface for locally destined packets"); +TUNABLE_INT("net.link.bridge.log_stp", &log_stp); SYSCTL_INT(_net_link_bridge, OID_AUTO, log_stp, CTLFLAG_RW, &log_stp, 0, "Log STP state changes"); +TUNABLE_INT("net.link.bridge.inherit_mac", &bridge_inherit_mac); SYSCTL_INT(_net_link_bridge, OID_AUTO, inherit_mac, CTLFLAG_RW, &bridge_inherit_mac, 0, "Inherit MAC address from the first bridge member"); From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 15:19:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E7208106564A; Tue, 7 Feb 2012 15:19:25 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id A1DA48FC14; Tue, 7 Feb 2012 15:19:25 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:a118:e66e:30ea:69c6] (unknown [IPv6:2001:7b8:3a7:0:a118:e66e:30ea:69c6]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id E224B5C59; Tue, 7 Feb 2012 16:19:23 +0100 (CET) Message-ID: <4F3140FA.6070702@FreeBSD.org> Date: Tue, 07 Feb 2012 16:19:22 +0100 From: Dimitry Andric Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20120129 Thunderbird/10.0 MIME-Version: 1.0 To: Konstantin Belousov References: <201202070927.q179R81a078218@svn.freebsd.org> <20120207110729.GB3283@deviant.kiev.zoral.com.ua> In-Reply-To: <20120207110729.GB3283@deviant.kiev.zoral.com.ua> X-Enigmail-Version: 1.3.5 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231118 - in head: include/rpc include/rpcsvc lib/libc/rpc lib/libc/yp lib/librpcsvc lib/libypclnt libexec/ypxfr release/picobsd/tinyware/passwd sys/conf sys/modules/kgssapi sys/modules... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 15:19:26 -0000 On 2012-02-07 12:07, Konstantin Belousov wrote: > On Tue, Feb 07, 2012 at 09:27:08AM +0000, Dimitry Andric wrote: >> Author: dim >> Date: Tue Feb 7 09:27:07 2012 >> New Revision: 231118 >> URL: http://svn.freebsd.org/changeset/base/231118 >> >> Log: >> Consistently set RPCGEN_CPP when running rpcgen, so the C preprocessor >> set via ${CPP} is used, instead of always using hardcoded /usr/bin/cpp. >> >> MFC after: 1 week > Shouldn't RPCGEN move to share/mk ? Yes, it should probably go in bsd.own.mk, similar to what NetBSD does. The only question is in which section, because unlike NetBSD, we do not really have a separate area for general build tools. I suggest that we put it between the COMPRESS_CMD?= and .if !defined(_WITHOUT_SRCCONF) lines. From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 15:59:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DC871065673; Tue, 7 Feb 2012 15:59:52 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id E9A0F8FC13; Tue, 7 Feb 2012 15:59:51 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q17FxipM038424 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Tue, 7 Feb 2012 17:59:44 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q17Fxijn041325; Tue, 7 Feb 2012 17:59:44 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q17Fxio3041324; Tue, 7 Feb 2012 17:59:44 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 7 Feb 2012 17:59:44 +0200 From: Konstantin Belousov To: Dimitry Andric Message-ID: <20120207155944.GE3283@deviant.kiev.zoral.com.ua> References: <201202070927.q179R81a078218@svn.freebsd.org> <20120207110729.GB3283@deviant.kiev.zoral.com.ua> <4F3140FA.6070702@FreeBSD.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="k+1XiaZWzQ61FkPh" Content-Disposition: inline In-Reply-To: <4F3140FA.6070702@FreeBSD.org> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231118 - in head: include/rpc include/rpcsvc lib/libc/rpc lib/libc/yp lib/librpcsvc lib/libypclnt libexec/ypxfr release/picobsd/tinyware/passwd sys/conf sys/modules/kgssapi sys/modules... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 15:59:52 -0000 --k+1XiaZWzQ61FkPh Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 07, 2012 at 04:19:22PM +0100, Dimitry Andric wrote: > On 2012-02-07 12:07, Konstantin Belousov wrote: > > On Tue, Feb 07, 2012 at 09:27:08AM +0000, Dimitry Andric wrote: > >> Author: dim > >> Date: Tue Feb 7 09:27:07 2012 > >> New Revision: 231118 > >> URL: http://svn.freebsd.org/changeset/base/231118 > >> > >> Log: > >> Consistently set RPCGEN_CPP when running rpcgen, so the C preprocess= or > >> set via ${CPP} is used, instead of always using hardcoded /usr/bin/c= pp. > >> =20 > >> MFC after: 1 week > > Shouldn't RPCGEN move to share/mk ? >=20 > Yes, it should probably go in bsd.own.mk, similar to what NetBSD does. > The only question is in which section, because unlike NetBSD, we do not > really have a separate area for general build tools. I suggest that we > put it between the COMPRESS_CMD?=3D and .if !defined(_WITHOUT_SRCCONF) > lines. I cannot answer your question. Does sys.mk has some restrictions on what should be put there ? --k+1XiaZWzQ61FkPh Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk8xSm8ACgkQC3+MBN1Mb4iXCwCeII3L0ffRcwYSLuu+T4lDPE+n oB4AoJmeaBL93iPBxldL4n5hBxNxp9ax =Jo6j -----END PGP SIGNATURE----- --k+1XiaZWzQ61FkPh-- From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 16:32:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F1FEF1065686; Tue, 7 Feb 2012 16:32:43 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E07CE8FC1D; Tue, 7 Feb 2012 16:32:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q17GWhhm097456; Tue, 7 Feb 2012 16:32:43 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17GWhZW097454; Tue, 7 Feb 2012 16:32:43 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201202071632.q17GWhZW097454@svn.freebsd.org> From: Rick Macklem Date: Tue, 7 Feb 2012 16:32:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231133 - head/sys/fs/nfsclient X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 16:32:44 -0000 Author: rmacklem Date: Tue Feb 7 16:32:43 2012 New Revision: 231133 URL: http://svn.freebsd.org/changeset/base/231133 Log: r228827 fixed a problem where copying of NFSv4 open credentials into a credential structure would corrupt it. This happened when the p argument was != NULL. However, I now realize that the copying of open credentials should only happen for p == NULL, since that indicates that it is a read-ahead or write-behind. This patch fixes this. After this commit, r228827 could be reverted, but I think the code is clearer and safer with the patch, so I am going to leave it in. Without this patch, it was possible that a NFSv4 VOP_SETATTR() could have changed the credentials of the caller. This would have happened if the process doing the VOP_SETATTR() did not have the file open, but some other process running as a different uid had the file open for writing at the same time. MFC after: 5 days Modified: head/sys/fs/nfsclient/nfs_clstate.c Modified: head/sys/fs/nfsclient/nfs_clstate.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clstate.c Tue Feb 7 16:07:29 2012 (r231132) +++ head/sys/fs/nfsclient/nfs_clstate.c Tue Feb 7 16:32:43 2012 (r231133) @@ -559,8 +559,12 @@ nfscl_getstateid(vnode_t vp, u_int8_t *n NFSUNLOCKCLSTATE(); return (ENOENT); } - /* for read aheads or write behinds, use the open cred */ - newnfs_copycred(&op->nfso_cred, cred); + /* + * For read aheads or write behinds, use the open cred. + * A read ahead or write behind is indicated by p == NULL. + */ + if (p == NULL) + newnfs_copycred(&op->nfso_cred, cred); } /* From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 17:21:54 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DB5EE1065670; Tue, 7 Feb 2012 17:21:54 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C7BD18FC17; Tue, 7 Feb 2012 17:21:54 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q17HLs7I099032; Tue, 7 Feb 2012 17:21:54 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17HLshm099031; Tue, 7 Feb 2012 17:21:54 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201202071721.q17HLshm099031@svn.freebsd.org> From: Jim Harris Date: Tue, 7 Feb 2012 17:21:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231134 - in head/sys: dev/isci dev/isci/scil modules/isci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 17:21:55 -0000 Author: jimharris Date: Tue Feb 7 17:21:54 2012 New Revision: 231134 URL: http://svn.freebsd.org/changeset/base/231134 Log: Add svn:keywords for isci driver files. Sponsored by: Intel Approved by: scottl Modified: Directory Properties: head/sys/dev/isci/README (props changed) head/sys/dev/isci/environment.h (props changed) head/sys/dev/isci/isci.c (props changed) head/sys/dev/isci/isci.h (props changed) head/sys/dev/isci/isci_controller.c (props changed) head/sys/dev/isci/isci_domain.c (props changed) head/sys/dev/isci/isci_interrupt.c (props changed) head/sys/dev/isci/isci_io_request.c (props changed) head/sys/dev/isci/isci_logger.c (props changed) head/sys/dev/isci/isci_oem_parameters.c (props changed) head/sys/dev/isci/isci_remote_device.c (props changed) head/sys/dev/isci/isci_sysctl.c (props changed) head/sys/dev/isci/isci_task_request.c (props changed) head/sys/dev/isci/isci_timer.c (props changed) head/sys/dev/isci/sci_environment.h (props changed) head/sys/dev/isci/scil/intel_ata.h (props changed) head/sys/dev/isci/scil/intel_pci.h (props changed) head/sys/dev/isci/scil/intel_sas.h (props changed) head/sys/dev/isci/scil/intel_sat.h (props changed) head/sys/dev/isci/scil/intel_sata.h (props changed) head/sys/dev/isci/scil/intel_scsi.h (props changed) head/sys/dev/isci/scil/sati.c (props changed) head/sys/dev/isci/scil/sati.h (props changed) head/sys/dev/isci/scil/sati_abort_task_set.c (props changed) head/sys/dev/isci/scil/sati_abort_task_set.h (props changed) head/sys/dev/isci/scil/sati_atapi.c (props changed) head/sys/dev/isci/scil/sati_atapi.h (props changed) head/sys/dev/isci/scil/sati_callbacks.h (props changed) head/sys/dev/isci/scil/sati_design.h (props changed) head/sys/dev/isci/scil/sati_device.c (props changed) head/sys/dev/isci/scil/sati_device.h (props changed) head/sys/dev/isci/scil/sati_inquiry.c (props changed) head/sys/dev/isci/scil/sati_inquiry.h (props changed) head/sys/dev/isci/scil/sati_log_sense.c (props changed) head/sys/dev/isci/scil/sati_log_sense.h (props changed) head/sys/dev/isci/scil/sati_lun_reset.c (props changed) head/sys/dev/isci/scil/sati_lun_reset.h (props changed) head/sys/dev/isci/scil/sati_mode_pages.c (props changed) head/sys/dev/isci/scil/sati_mode_pages.h (props changed) head/sys/dev/isci/scil/sati_mode_select.c (props changed) head/sys/dev/isci/scil/sati_mode_select.h (props changed) head/sys/dev/isci/scil/sati_mode_sense.c (props changed) head/sys/dev/isci/scil/sati_mode_sense.h (props changed) head/sys/dev/isci/scil/sati_mode_sense_10.c (props changed) head/sys/dev/isci/scil/sati_mode_sense_10.h (props changed) head/sys/dev/isci/scil/sati_mode_sense_6.c (props changed) head/sys/dev/isci/scil/sati_mode_sense_6.h (props changed) head/sys/dev/isci/scil/sati_move.c (props changed) head/sys/dev/isci/scil/sati_move.h (props changed) head/sys/dev/isci/scil/sati_passthrough.c (props changed) head/sys/dev/isci/scil/sati_passthrough.h (props changed) head/sys/dev/isci/scil/sati_read.c (props changed) head/sys/dev/isci/scil/sati_read.h (props changed) head/sys/dev/isci/scil/sati_read_buffer.c (props changed) head/sys/dev/isci/scil/sati_read_buffer.h (props changed) head/sys/dev/isci/scil/sati_read_capacity.c (props changed) head/sys/dev/isci/scil/sati_read_capacity.h (props changed) head/sys/dev/isci/scil/sati_reassign_blocks.c (props changed) head/sys/dev/isci/scil/sati_reassign_blocks.h (props changed) head/sys/dev/isci/scil/sati_report_luns.c (props changed) head/sys/dev/isci/scil/sati_report_luns.h (props changed) head/sys/dev/isci/scil/sati_request_sense.c (props changed) head/sys/dev/isci/scil/sati_request_sense.h (props changed) head/sys/dev/isci/scil/sati_start_stop_unit.c (props changed) head/sys/dev/isci/scil/sati_start_stop_unit.h (props changed) head/sys/dev/isci/scil/sati_synchronize_cache.c (props changed) head/sys/dev/isci/scil/sati_synchronize_cache.h (props changed) head/sys/dev/isci/scil/sati_test_unit_ready.c (props changed) head/sys/dev/isci/scil/sati_test_unit_ready.h (props changed) head/sys/dev/isci/scil/sati_translator_sequence.h (props changed) head/sys/dev/isci/scil/sati_types.h (props changed) head/sys/dev/isci/scil/sati_unmap.c (props changed) head/sys/dev/isci/scil/sati_unmap.h (props changed) head/sys/dev/isci/scil/sati_util.c (props changed) head/sys/dev/isci/scil/sati_util.h (props changed) head/sys/dev/isci/scil/sati_verify.c (props changed) head/sys/dev/isci/scil/sati_verify.h (props changed) head/sys/dev/isci/scil/sati_write.c (props changed) head/sys/dev/isci/scil/sati_write.h (props changed) head/sys/dev/isci/scil/sati_write_and_verify.c (props changed) head/sys/dev/isci/scil/sati_write_and_verify.h (props changed) head/sys/dev/isci/scil/sati_write_buffer.c (props changed) head/sys/dev/isci/scil/sati_write_buffer.h (props changed) head/sys/dev/isci/scil/sati_write_long.c (props changed) head/sys/dev/isci/scil/sati_write_long.h (props changed) head/sys/dev/isci/scil/sci_abstract_list.c (props changed) head/sys/dev/isci/scil/sci_abstract_list.h (props changed) head/sys/dev/isci/scil/sci_base_controller.c (props changed) head/sys/dev/isci/scil/sci_base_controller.h (props changed) head/sys/dev/isci/scil/sci_base_domain.c (props changed) head/sys/dev/isci/scil/sci_base_domain.h (props changed) head/sys/dev/isci/scil/sci_base_iterator.c (props changed) head/sys/dev/isci/scil/sci_base_iterator.h (props changed) head/sys/dev/isci/scil/sci_base_library.c (props changed) head/sys/dev/isci/scil/sci_base_library.h (props changed) head/sys/dev/isci/scil/sci_base_logger.c (props changed) head/sys/dev/isci/scil/sci_base_logger.h (props changed) head/sys/dev/isci/scil/sci_base_memory_descriptor_list.c (props changed) head/sys/dev/isci/scil/sci_base_memory_descriptor_list.h (props changed) head/sys/dev/isci/scil/sci_base_memory_descriptor_list_decorator.c (props changed) head/sys/dev/isci/scil/sci_base_object.c (props changed) head/sys/dev/isci/scil/sci_base_object.h (props changed) head/sys/dev/isci/scil/sci_base_observer.c (props changed) head/sys/dev/isci/scil/sci_base_observer.h (props changed) head/sys/dev/isci/scil/sci_base_phy.c (props changed) head/sys/dev/isci/scil/sci_base_phy.h (props changed) head/sys/dev/isci/scil/sci_base_port.c (props changed) head/sys/dev/isci/scil/sci_base_port.h (props changed) head/sys/dev/isci/scil/sci_base_remote_device.c (props changed) head/sys/dev/isci/scil/sci_base_remote_device.h (props changed) head/sys/dev/isci/scil/sci_base_request.c (props changed) head/sys/dev/isci/scil/sci_base_request.h (props changed) head/sys/dev/isci/scil/sci_base_state.h (props changed) head/sys/dev/isci/scil/sci_base_state_machine.c (props changed) head/sys/dev/isci/scil/sci_base_state_machine.h (props changed) head/sys/dev/isci/scil/sci_base_state_machine_logger.c (props changed) head/sys/dev/isci/scil/sci_base_state_machine_logger.h (props changed) head/sys/dev/isci/scil/sci_base_state_machine_observer.c (props changed) head/sys/dev/isci/scil/sci_base_state_machine_observer.h (props changed) head/sys/dev/isci/scil/sci_base_subject.c (props changed) head/sys/dev/isci/scil/sci_base_subject.h (props changed) head/sys/dev/isci/scil/sci_controller.h (props changed) head/sys/dev/isci/scil/sci_controller_constants.h (props changed) head/sys/dev/isci/scil/sci_fast_list.h (props changed) head/sys/dev/isci/scil/sci_iterator.h (props changed) head/sys/dev/isci/scil/sci_library.h (props changed) head/sys/dev/isci/scil/sci_logger.h (props changed) head/sys/dev/isci/scil/sci_memory_descriptor_list.h (props changed) head/sys/dev/isci/scil/sci_memory_descriptor_list_decorator.h (props changed) head/sys/dev/isci/scil/sci_object.h (props changed) head/sys/dev/isci/scil/sci_overview.h (props changed) head/sys/dev/isci/scil/sci_pool.h (props changed) head/sys/dev/isci/scil/sci_simple_list.h (props changed) head/sys/dev/isci/scil/sci_status.h (props changed) head/sys/dev/isci/scil/sci_types.h (props changed) head/sys/dev/isci/scil/sci_util.c (props changed) head/sys/dev/isci/scil/sci_util.h (props changed) head/sys/dev/isci/scil/scic_config_parameters.h (props changed) head/sys/dev/isci/scil/scic_controller.h (props changed) head/sys/dev/isci/scil/scic_io_request.h (props changed) head/sys/dev/isci/scil/scic_library.h (props changed) head/sys/dev/isci/scil/scic_logger.h (props changed) head/sys/dev/isci/scil/scic_overview.h (props changed) head/sys/dev/isci/scil/scic_phy.h (props changed) head/sys/dev/isci/scil/scic_port.h (props changed) head/sys/dev/isci/scil/scic_remote_device.h (props changed) head/sys/dev/isci/scil/scic_sds_controller.c (props changed) head/sys/dev/isci/scil/scic_sds_controller.h (props changed) head/sys/dev/isci/scil/scic_sds_controller_registers.h (props changed) head/sys/dev/isci/scil/scic_sds_library.c (props changed) head/sys/dev/isci/scil/scic_sds_library.h (props changed) head/sys/dev/isci/scil/scic_sds_logger.h (props changed) head/sys/dev/isci/scil/scic_sds_pci.c (props changed) head/sys/dev/isci/scil/scic_sds_pci.h (props changed) head/sys/dev/isci/scil/scic_sds_phy.c (props changed) head/sys/dev/isci/scil/scic_sds_phy.h (props changed) head/sys/dev/isci/scil/scic_sds_phy_registers.h (props changed) head/sys/dev/isci/scil/scic_sds_port.c (props changed) head/sys/dev/isci/scil/scic_sds_port.h (props changed) head/sys/dev/isci/scil/scic_sds_port_configuration_agent.c (props changed) head/sys/dev/isci/scil/scic_sds_port_configuration_agent.h (props changed) head/sys/dev/isci/scil/scic_sds_port_registers.h (props changed) head/sys/dev/isci/scil/scic_sds_remote_device.c (props changed) head/sys/dev/isci/scil/scic_sds_remote_device.h (props changed) head/sys/dev/isci/scil/scic_sds_remote_node_context.c (props changed) head/sys/dev/isci/scil/scic_sds_remote_node_context.h (props changed) head/sys/dev/isci/scil/scic_sds_remote_node_table.c (props changed) head/sys/dev/isci/scil/scic_sds_remote_node_table.h (props changed) head/sys/dev/isci/scil/scic_sds_request.c (props changed) head/sys/dev/isci/scil/scic_sds_request.h (props changed) head/sys/dev/isci/scil/scic_sds_sgpio.c (props changed) head/sys/dev/isci/scil/scic_sds_smp_remote_device.c (props changed) head/sys/dev/isci/scil/scic_sds_smp_request.c (props changed) head/sys/dev/isci/scil/scic_sds_smp_request.h (props changed) head/sys/dev/isci/scil/scic_sds_ssp_request.c (props changed) head/sys/dev/isci/scil/scic_sds_stp_packet_request.c (props changed) head/sys/dev/isci/scil/scic_sds_stp_packet_request.h (props changed) head/sys/dev/isci/scil/scic_sds_stp_pio_request.h (props changed) head/sys/dev/isci/scil/scic_sds_stp_remote_device.c (props changed) head/sys/dev/isci/scil/scic_sds_stp_request.c (props changed) head/sys/dev/isci/scil/scic_sds_stp_request.h (props changed) head/sys/dev/isci/scil/scic_sds_unsolicited_frame_control.c (props changed) head/sys/dev/isci/scil/scic_sds_unsolicited_frame_control.h (props changed) head/sys/dev/isci/scil/scic_sgpio.h (props changed) head/sys/dev/isci/scil/scic_task_request.h (props changed) head/sys/dev/isci/scil/scic_user_callback.h (props changed) head/sys/dev/isci/scil/scif_config_parameters.h (props changed) head/sys/dev/isci/scil/scif_controller.h (props changed) head/sys/dev/isci/scil/scif_domain.h (props changed) head/sys/dev/isci/scil/scif_io_request.h (props changed) head/sys/dev/isci/scil/scif_library.h (props changed) head/sys/dev/isci/scil/scif_logger.h (props changed) head/sys/dev/isci/scil/scif_overview.h (props changed) head/sys/dev/isci/scil/scif_remote_device.h (props changed) head/sys/dev/isci/scil/scif_sas_constants.h (props changed) head/sys/dev/isci/scil/scif_sas_controller.c (props changed) head/sys/dev/isci/scil/scif_sas_controller.h (props changed) head/sys/dev/isci/scil/scif_sas_controller_state_handlers.c (props changed) head/sys/dev/isci/scil/scif_sas_controller_states.c (props changed) head/sys/dev/isci/scil/scif_sas_design.h (props changed) head/sys/dev/isci/scil/scif_sas_domain.c (props changed) head/sys/dev/isci/scil/scif_sas_domain.h (props changed) head/sys/dev/isci/scil/scif_sas_domain_state_handlers.c (props changed) head/sys/dev/isci/scil/scif_sas_domain_states.c (props changed) head/sys/dev/isci/scil/scif_sas_high_priority_request_queue.c (props changed) head/sys/dev/isci/scil/scif_sas_high_priority_request_queue.h (props changed) head/sys/dev/isci/scil/scif_sas_internal_io_request.c (props changed) head/sys/dev/isci/scil/scif_sas_internal_io_request.h (props changed) head/sys/dev/isci/scil/scif_sas_io_request.c (props changed) head/sys/dev/isci/scil/scif_sas_io_request.h (props changed) head/sys/dev/isci/scil/scif_sas_io_request_state_handlers.c (props changed) head/sys/dev/isci/scil/scif_sas_io_request_states.c (props changed) head/sys/dev/isci/scil/scif_sas_library.c (props changed) head/sys/dev/isci/scil/scif_sas_library.h (props changed) head/sys/dev/isci/scil/scif_sas_logger.h (props changed) head/sys/dev/isci/scil/scif_sas_remote_device.c (props changed) head/sys/dev/isci/scil/scif_sas_remote_device.h (props changed) head/sys/dev/isci/scil/scif_sas_remote_device_ready_substate_handlers.c (props changed) head/sys/dev/isci/scil/scif_sas_remote_device_ready_substates.c (props changed) head/sys/dev/isci/scil/scif_sas_remote_device_starting_substate_handlers.c (props changed) head/sys/dev/isci/scil/scif_sas_remote_device_starting_substates.c (props changed) head/sys/dev/isci/scil/scif_sas_remote_device_state_handlers.c (props changed) head/sys/dev/isci/scil/scif_sas_remote_device_states.c (props changed) head/sys/dev/isci/scil/scif_sas_request.c (props changed) head/sys/dev/isci/scil/scif_sas_request.h (props changed) head/sys/dev/isci/scil/scif_sas_sati_binding.h (props changed) head/sys/dev/isci/scil/scif_sas_smp_activity_clear_affiliation.c (props changed) head/sys/dev/isci/scil/scif_sas_smp_io_request.c (props changed) head/sys/dev/isci/scil/scif_sas_smp_io_request.h (props changed) head/sys/dev/isci/scil/scif_sas_smp_phy.c (props changed) head/sys/dev/isci/scil/scif_sas_smp_phy.h (props changed) head/sys/dev/isci/scil/scif_sas_smp_remote_device.c (props changed) head/sys/dev/isci/scil/scif_sas_smp_remote_device.h (props changed) head/sys/dev/isci/scil/scif_sas_stp_io_request.c (props changed) head/sys/dev/isci/scil/scif_sas_stp_io_request.h (props changed) head/sys/dev/isci/scil/scif_sas_stp_remote_device.c (props changed) head/sys/dev/isci/scil/scif_sas_stp_remote_device.h (props changed) head/sys/dev/isci/scil/scif_sas_stp_task_request.c (props changed) head/sys/dev/isci/scil/scif_sas_stp_task_request.h (props changed) head/sys/dev/isci/scil/scif_sas_task_request.c (props changed) head/sys/dev/isci/scil/scif_sas_task_request.h (props changed) head/sys/dev/isci/scil/scif_sas_task_request_state_handlers.c (props changed) head/sys/dev/isci/scil/scif_sas_task_request_states.c (props changed) head/sys/dev/isci/scil/scif_sas_timer.c (props changed) head/sys/dev/isci/scil/scif_task_request.h (props changed) head/sys/dev/isci/scil/scif_user_callback.h (props changed) head/sys/dev/isci/scil/scu_bios_definitions.h (props changed) head/sys/dev/isci/scil/scu_completion_codes.h (props changed) head/sys/dev/isci/scil/scu_constants.h (props changed) head/sys/dev/isci/scil/scu_event_codes.h (props changed) head/sys/dev/isci/scil/scu_registers.h (props changed) head/sys/dev/isci/scil/scu_remote_node_context.h (props changed) head/sys/dev/isci/scil/scu_task_context.h (props changed) head/sys/dev/isci/scil/scu_unsolicited_frame.h (props changed) head/sys/dev/isci/scil/scu_viit_data.h (props changed) head/sys/dev/isci/types.h (props changed) head/sys/modules/isci/Makefile (props changed) From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 17:43:59 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3AEAC106564A; Tue, 7 Feb 2012 17:43:59 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 272BF8FC1B; Tue, 7 Feb 2012 17:43:59 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q17HhxnG099869; Tue, 7 Feb 2012 17:43:59 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17HhxZF099866; Tue, 7 Feb 2012 17:43:59 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201202071743.q17HhxZF099866@svn.freebsd.org> From: Jim Harris Date: Tue, 7 Feb 2012 17:43:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231136 - in head/sys: dev/isci dev/isci/scil modules/isci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 17:43:59 -0000 Author: jimharris Date: Tue Feb 7 17:43:58 2012 New Revision: 231136 URL: http://svn.freebsd.org/changeset/base/231136 Log: Fix r231134. svn:keywords needs to be 'FreeBSD=%H', not 'FreeBSD:%H'. Approved by: scottl Modified: Directory Properties: head/sys/dev/isci/README (props changed) head/sys/dev/isci/environment.h (props changed) head/sys/dev/isci/isci.c (props changed) head/sys/dev/isci/isci.h (props changed) head/sys/dev/isci/isci_controller.c (props changed) head/sys/dev/isci/isci_domain.c (props changed) head/sys/dev/isci/isci_interrupt.c (props changed) head/sys/dev/isci/isci_io_request.c (props changed) head/sys/dev/isci/isci_logger.c (props changed) head/sys/dev/isci/isci_oem_parameters.c (props changed) head/sys/dev/isci/isci_remote_device.c (props changed) head/sys/dev/isci/isci_sysctl.c (props changed) head/sys/dev/isci/isci_task_request.c (props changed) head/sys/dev/isci/isci_timer.c (props changed) head/sys/dev/isci/sci_environment.h (props changed) head/sys/dev/isci/scil/intel_ata.h (props changed) head/sys/dev/isci/scil/intel_pci.h (props changed) head/sys/dev/isci/scil/intel_sas.h (props changed) head/sys/dev/isci/scil/intel_sat.h (props changed) head/sys/dev/isci/scil/intel_sata.h (props changed) head/sys/dev/isci/scil/intel_scsi.h (props changed) head/sys/dev/isci/scil/sati.c (props changed) head/sys/dev/isci/scil/sati.h (props changed) head/sys/dev/isci/scil/sati_abort_task_set.c (props changed) head/sys/dev/isci/scil/sati_abort_task_set.h (props changed) head/sys/dev/isci/scil/sati_atapi.c (props changed) head/sys/dev/isci/scil/sati_atapi.h (props changed) head/sys/dev/isci/scil/sati_callbacks.h (props changed) head/sys/dev/isci/scil/sati_design.h (props changed) head/sys/dev/isci/scil/sati_device.c (props changed) head/sys/dev/isci/scil/sati_device.h (props changed) head/sys/dev/isci/scil/sati_inquiry.c (props changed) head/sys/dev/isci/scil/sati_inquiry.h (props changed) head/sys/dev/isci/scil/sati_log_sense.c (props changed) head/sys/dev/isci/scil/sati_log_sense.h (props changed) head/sys/dev/isci/scil/sati_lun_reset.c (props changed) head/sys/dev/isci/scil/sati_lun_reset.h (props changed) head/sys/dev/isci/scil/sati_mode_pages.c (props changed) head/sys/dev/isci/scil/sati_mode_pages.h (props changed) head/sys/dev/isci/scil/sati_mode_select.c (props changed) head/sys/dev/isci/scil/sati_mode_select.h (props changed) head/sys/dev/isci/scil/sati_mode_sense.c (props changed) head/sys/dev/isci/scil/sati_mode_sense.h (props changed) head/sys/dev/isci/scil/sati_mode_sense_10.c (props changed) head/sys/dev/isci/scil/sati_mode_sense_10.h (props changed) head/sys/dev/isci/scil/sati_mode_sense_6.c (props changed) head/sys/dev/isci/scil/sati_mode_sense_6.h (props changed) head/sys/dev/isci/scil/sati_move.c (props changed) head/sys/dev/isci/scil/sati_move.h (props changed) head/sys/dev/isci/scil/sati_passthrough.c (props changed) head/sys/dev/isci/scil/sati_passthrough.h (props changed) head/sys/dev/isci/scil/sati_read.c (props changed) head/sys/dev/isci/scil/sati_read.h (props changed) head/sys/dev/isci/scil/sati_read_buffer.c (props changed) head/sys/dev/isci/scil/sati_read_buffer.h (props changed) head/sys/dev/isci/scil/sati_read_capacity.c (props changed) head/sys/dev/isci/scil/sati_read_capacity.h (props changed) head/sys/dev/isci/scil/sati_reassign_blocks.c (props changed) head/sys/dev/isci/scil/sati_reassign_blocks.h (props changed) head/sys/dev/isci/scil/sati_report_luns.c (props changed) head/sys/dev/isci/scil/sati_report_luns.h (props changed) head/sys/dev/isci/scil/sati_request_sense.c (props changed) head/sys/dev/isci/scil/sati_request_sense.h (props changed) head/sys/dev/isci/scil/sati_start_stop_unit.c (props changed) head/sys/dev/isci/scil/sati_start_stop_unit.h (props changed) head/sys/dev/isci/scil/sati_synchronize_cache.c (props changed) head/sys/dev/isci/scil/sati_synchronize_cache.h (props changed) head/sys/dev/isci/scil/sati_test_unit_ready.c (props changed) head/sys/dev/isci/scil/sati_test_unit_ready.h (props changed) head/sys/dev/isci/scil/sati_translator_sequence.h (props changed) head/sys/dev/isci/scil/sati_types.h (props changed) head/sys/dev/isci/scil/sati_unmap.c (props changed) head/sys/dev/isci/scil/sati_unmap.h (props changed) head/sys/dev/isci/scil/sati_util.c (props changed) head/sys/dev/isci/scil/sati_util.h (props changed) head/sys/dev/isci/scil/sati_verify.c (props changed) head/sys/dev/isci/scil/sati_verify.h (props changed) head/sys/dev/isci/scil/sati_write.c (props changed) head/sys/dev/isci/scil/sati_write.h (props changed) head/sys/dev/isci/scil/sati_write_and_verify.c (props changed) head/sys/dev/isci/scil/sati_write_and_verify.h (props changed) head/sys/dev/isci/scil/sati_write_buffer.c (props changed) head/sys/dev/isci/scil/sati_write_buffer.h (props changed) head/sys/dev/isci/scil/sati_write_long.c (props changed) head/sys/dev/isci/scil/sati_write_long.h (props changed) head/sys/dev/isci/scil/sci_abstract_list.c (props changed) head/sys/dev/isci/scil/sci_abstract_list.h (props changed) head/sys/dev/isci/scil/sci_base_controller.c (props changed) head/sys/dev/isci/scil/sci_base_controller.h (props changed) head/sys/dev/isci/scil/sci_base_domain.c (props changed) head/sys/dev/isci/scil/sci_base_domain.h (props changed) head/sys/dev/isci/scil/sci_base_iterator.c (props changed) head/sys/dev/isci/scil/sci_base_iterator.h (props changed) head/sys/dev/isci/scil/sci_base_library.c (props changed) head/sys/dev/isci/scil/sci_base_library.h (props changed) head/sys/dev/isci/scil/sci_base_logger.c (props changed) head/sys/dev/isci/scil/sci_base_logger.h (props changed) head/sys/dev/isci/scil/sci_base_memory_descriptor_list.c (props changed) head/sys/dev/isci/scil/sci_base_memory_descriptor_list.h (props changed) head/sys/dev/isci/scil/sci_base_memory_descriptor_list_decorator.c (props changed) head/sys/dev/isci/scil/sci_base_object.c (props changed) head/sys/dev/isci/scil/sci_base_object.h (props changed) head/sys/dev/isci/scil/sci_base_observer.c (props changed) head/sys/dev/isci/scil/sci_base_observer.h (props changed) head/sys/dev/isci/scil/sci_base_phy.c (props changed) head/sys/dev/isci/scil/sci_base_phy.h (props changed) head/sys/dev/isci/scil/sci_base_port.c (props changed) head/sys/dev/isci/scil/sci_base_port.h (props changed) head/sys/dev/isci/scil/sci_base_remote_device.c (props changed) head/sys/dev/isci/scil/sci_base_remote_device.h (props changed) head/sys/dev/isci/scil/sci_base_request.c (props changed) head/sys/dev/isci/scil/sci_base_request.h (props changed) head/sys/dev/isci/scil/sci_base_state.h (props changed) head/sys/dev/isci/scil/sci_base_state_machine.c (props changed) head/sys/dev/isci/scil/sci_base_state_machine.h (props changed) head/sys/dev/isci/scil/sci_base_state_machine_logger.c (props changed) head/sys/dev/isci/scil/sci_base_state_machine_logger.h (props changed) head/sys/dev/isci/scil/sci_base_state_machine_observer.c (props changed) head/sys/dev/isci/scil/sci_base_state_machine_observer.h (props changed) head/sys/dev/isci/scil/sci_base_subject.c (props changed) head/sys/dev/isci/scil/sci_base_subject.h (props changed) head/sys/dev/isci/scil/sci_controller.h (props changed) head/sys/dev/isci/scil/sci_controller_constants.h (props changed) head/sys/dev/isci/scil/sci_fast_list.h (props changed) head/sys/dev/isci/scil/sci_iterator.h (props changed) head/sys/dev/isci/scil/sci_library.h (props changed) head/sys/dev/isci/scil/sci_logger.h (props changed) head/sys/dev/isci/scil/sci_memory_descriptor_list.h (props changed) head/sys/dev/isci/scil/sci_memory_descriptor_list_decorator.h (props changed) head/sys/dev/isci/scil/sci_object.h (props changed) head/sys/dev/isci/scil/sci_overview.h (props changed) head/sys/dev/isci/scil/sci_pool.h (props changed) head/sys/dev/isci/scil/sci_simple_list.h (props changed) head/sys/dev/isci/scil/sci_status.h (props changed) head/sys/dev/isci/scil/sci_types.h (props changed) head/sys/dev/isci/scil/sci_util.c (props changed) head/sys/dev/isci/scil/sci_util.h (props changed) head/sys/dev/isci/scil/scic_config_parameters.h (props changed) head/sys/dev/isci/scil/scic_controller.h (props changed) head/sys/dev/isci/scil/scic_io_request.h (props changed) head/sys/dev/isci/scil/scic_library.h (props changed) head/sys/dev/isci/scil/scic_logger.h (props changed) head/sys/dev/isci/scil/scic_overview.h (props changed) head/sys/dev/isci/scil/scic_phy.h (props changed) head/sys/dev/isci/scil/scic_port.h (props changed) head/sys/dev/isci/scil/scic_remote_device.h (props changed) head/sys/dev/isci/scil/scic_sds_controller.c (props changed) head/sys/dev/isci/scil/scic_sds_controller.h (props changed) head/sys/dev/isci/scil/scic_sds_controller_registers.h (props changed) head/sys/dev/isci/scil/scic_sds_library.c (props changed) head/sys/dev/isci/scil/scic_sds_library.h (props changed) head/sys/dev/isci/scil/scic_sds_logger.h (props changed) head/sys/dev/isci/scil/scic_sds_pci.c (props changed) head/sys/dev/isci/scil/scic_sds_pci.h (props changed) head/sys/dev/isci/scil/scic_sds_phy.c (props changed) head/sys/dev/isci/scil/scic_sds_phy.h (props changed) head/sys/dev/isci/scil/scic_sds_phy_registers.h (props changed) head/sys/dev/isci/scil/scic_sds_port.c (props changed) head/sys/dev/isci/scil/scic_sds_port.h (props changed) head/sys/dev/isci/scil/scic_sds_port_configuration_agent.c (props changed) head/sys/dev/isci/scil/scic_sds_port_configuration_agent.h (props changed) head/sys/dev/isci/scil/scic_sds_port_registers.h (props changed) head/sys/dev/isci/scil/scic_sds_remote_device.c (props changed) head/sys/dev/isci/scil/scic_sds_remote_device.h (props changed) head/sys/dev/isci/scil/scic_sds_remote_node_context.c (props changed) head/sys/dev/isci/scil/scic_sds_remote_node_context.h (props changed) head/sys/dev/isci/scil/scic_sds_remote_node_table.c (props changed) head/sys/dev/isci/scil/scic_sds_remote_node_table.h (props changed) head/sys/dev/isci/scil/scic_sds_request.c (props changed) head/sys/dev/isci/scil/scic_sds_request.h (props changed) head/sys/dev/isci/scil/scic_sds_sgpio.c (props changed) head/sys/dev/isci/scil/scic_sds_smp_remote_device.c (props changed) head/sys/dev/isci/scil/scic_sds_smp_request.c (props changed) head/sys/dev/isci/scil/scic_sds_smp_request.h (props changed) head/sys/dev/isci/scil/scic_sds_ssp_request.c (props changed) head/sys/dev/isci/scil/scic_sds_stp_packet_request.c (props changed) head/sys/dev/isci/scil/scic_sds_stp_packet_request.h (props changed) head/sys/dev/isci/scil/scic_sds_stp_pio_request.h (props changed) head/sys/dev/isci/scil/scic_sds_stp_remote_device.c (props changed) head/sys/dev/isci/scil/scic_sds_stp_request.c (props changed) head/sys/dev/isci/scil/scic_sds_stp_request.h (props changed) head/sys/dev/isci/scil/scic_sds_unsolicited_frame_control.c (props changed) head/sys/dev/isci/scil/scic_sds_unsolicited_frame_control.h (props changed) head/sys/dev/isci/scil/scic_sgpio.h (props changed) head/sys/dev/isci/scil/scic_task_request.h (props changed) head/sys/dev/isci/scil/scic_user_callback.h (props changed) head/sys/dev/isci/scil/scif_config_parameters.h (props changed) head/sys/dev/isci/scil/scif_controller.h (props changed) head/sys/dev/isci/scil/scif_domain.h (props changed) head/sys/dev/isci/scil/scif_io_request.h (props changed) head/sys/dev/isci/scil/scif_library.h (props changed) head/sys/dev/isci/scil/scif_logger.h (props changed) head/sys/dev/isci/scil/scif_overview.h (props changed) head/sys/dev/isci/scil/scif_remote_device.h (props changed) head/sys/dev/isci/scil/scif_sas_constants.h (props changed) head/sys/dev/isci/scil/scif_sas_controller.c (props changed) head/sys/dev/isci/scil/scif_sas_controller.h (props changed) head/sys/dev/isci/scil/scif_sas_controller_state_handlers.c (props changed) head/sys/dev/isci/scil/scif_sas_controller_states.c (props changed) head/sys/dev/isci/scil/scif_sas_design.h (props changed) head/sys/dev/isci/scil/scif_sas_domain.c (props changed) head/sys/dev/isci/scil/scif_sas_domain.h (props changed) head/sys/dev/isci/scil/scif_sas_domain_state_handlers.c (props changed) head/sys/dev/isci/scil/scif_sas_domain_states.c (props changed) head/sys/dev/isci/scil/scif_sas_high_priority_request_queue.c (props changed) head/sys/dev/isci/scil/scif_sas_high_priority_request_queue.h (props changed) head/sys/dev/isci/scil/scif_sas_internal_io_request.c (props changed) head/sys/dev/isci/scil/scif_sas_internal_io_request.h (props changed) head/sys/dev/isci/scil/scif_sas_io_request.c (props changed) head/sys/dev/isci/scil/scif_sas_io_request.h (props changed) head/sys/dev/isci/scil/scif_sas_io_request_state_handlers.c (props changed) head/sys/dev/isci/scil/scif_sas_io_request_states.c (props changed) head/sys/dev/isci/scil/scif_sas_library.c (props changed) head/sys/dev/isci/scil/scif_sas_library.h (props changed) head/sys/dev/isci/scil/scif_sas_logger.h (props changed) head/sys/dev/isci/scil/scif_sas_remote_device.c (props changed) head/sys/dev/isci/scil/scif_sas_remote_device.h (props changed) head/sys/dev/isci/scil/scif_sas_remote_device_ready_substate_handlers.c (props changed) head/sys/dev/isci/scil/scif_sas_remote_device_ready_substates.c (props changed) head/sys/dev/isci/scil/scif_sas_remote_device_starting_substate_handlers.c (props changed) head/sys/dev/isci/scil/scif_sas_remote_device_starting_substates.c (props changed) head/sys/dev/isci/scil/scif_sas_remote_device_state_handlers.c (props changed) head/sys/dev/isci/scil/scif_sas_remote_device_states.c (props changed) head/sys/dev/isci/scil/scif_sas_request.c (props changed) head/sys/dev/isci/scil/scif_sas_request.h (props changed) head/sys/dev/isci/scil/scif_sas_sati_binding.h (props changed) head/sys/dev/isci/scil/scif_sas_smp_activity_clear_affiliation.c (props changed) head/sys/dev/isci/scil/scif_sas_smp_io_request.c (props changed) head/sys/dev/isci/scil/scif_sas_smp_io_request.h (props changed) head/sys/dev/isci/scil/scif_sas_smp_phy.c (props changed) head/sys/dev/isci/scil/scif_sas_smp_phy.h (props changed) head/sys/dev/isci/scil/scif_sas_smp_remote_device.c (props changed) head/sys/dev/isci/scil/scif_sas_smp_remote_device.h (props changed) head/sys/dev/isci/scil/scif_sas_stp_io_request.c (props changed) head/sys/dev/isci/scil/scif_sas_stp_io_request.h (props changed) head/sys/dev/isci/scil/scif_sas_stp_remote_device.c (props changed) head/sys/dev/isci/scil/scif_sas_stp_remote_device.h (props changed) head/sys/dev/isci/scil/scif_sas_stp_task_request.c (props changed) head/sys/dev/isci/scil/scif_sas_stp_task_request.h (props changed) head/sys/dev/isci/scil/scif_sas_task_request.c (props changed) head/sys/dev/isci/scil/scif_sas_task_request.h (props changed) head/sys/dev/isci/scil/scif_sas_task_request_state_handlers.c (props changed) head/sys/dev/isci/scil/scif_sas_task_request_states.c (props changed) head/sys/dev/isci/scil/scif_sas_timer.c (props changed) head/sys/dev/isci/scil/scif_task_request.h (props changed) head/sys/dev/isci/scil/scif_user_callback.h (props changed) head/sys/dev/isci/scil/scu_bios_definitions.h (props changed) head/sys/dev/isci/scil/scu_completion_codes.h (props changed) head/sys/dev/isci/scil/scu_constants.h (props changed) head/sys/dev/isci/scil/scu_event_codes.h (props changed) head/sys/dev/isci/scil/scu_registers.h (props changed) head/sys/dev/isci/scil/scu_remote_node_context.h (props changed) head/sys/dev/isci/scil/scu_task_context.h (props changed) head/sys/dev/isci/scil/scu_unsolicited_frame.h (props changed) head/sys/dev/isci/scil/scu_viit_data.h (props changed) head/sys/dev/isci/types.h (props changed) head/sys/modules/isci/Makefile (props changed) From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 17:45:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2CF3B106564A; Tue, 7 Feb 2012 17:45:12 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1AD448FC0A; Tue, 7 Feb 2012 17:45:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q17HjBh6099976; Tue, 7 Feb 2012 17:45:11 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17HjB3s099969; Tue, 7 Feb 2012 17:45:11 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201202071745.q17HjB3s099969@svn.freebsd.org> From: Jim Harris Date: Tue, 7 Feb 2012 17:45:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231137 - head/sys/dev/isci/scil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 17:45:12 -0000 Author: jimharris Date: Tue Feb 7 17:45:11 2012 New Revision: 231137 URL: http://svn.freebsd.org/changeset/base/231137 Log: Fix Coverity defects in isci(4) driver. Sponsored by: Intel Approved by: scottl Modified: head/sys/dev/isci/scil/scic_sds_stp_request.c head/sys/dev/isci/scil/scif_sas_controller.c head/sys/dev/isci/scil/scif_sas_domain.c head/sys/dev/isci/scil/scif_sas_remote_device.c head/sys/dev/isci/scil/scif_sas_smp_io_request.c head/sys/dev/isci/scil/scif_sas_smp_remote_device.c Modified: head/sys/dev/isci/scil/scic_sds_stp_request.c ============================================================================== --- head/sys/dev/isci/scil/scic_sds_stp_request.c Tue Feb 7 17:43:58 2012 (r231136) +++ head/sys/dev/isci/scil/scic_sds_stp_request.c Tue Feb 7 17:45:11 2012 (r231137) @@ -1124,9 +1124,6 @@ SCI_STATUS scic_sds_stp_request_pio_data if (status == SCI_SUCCESS) { this_sds_stp_request->type.pio.pio_transfer_bytes -= remaining_bytes_in_current_sgl; - - //update the current sgl, sgl_offset and save for future - current_sgl = scic_sds_stp_request_pio_get_next_sgl(this_sds_stp_request); sgl_offset = 0; } } Modified: head/sys/dev/isci/scil/scif_sas_controller.c ============================================================================== --- head/sys/dev/isci/scil/scif_sas_controller.c Tue Feb 7 17:43:58 2012 (r231136) +++ head/sys/dev/isci/scil/scif_sas_controller.c Tue Feb 7 17:45:11 2012 (r231137) @@ -87,6 +87,10 @@ SCI_STATUS scif_controller_construct( SCIF_SAS_LIBRARY_T * fw_library = (SCIF_SAS_LIBRARY_T*) library; SCIF_SAS_CONTROLLER_T * fw_controller = (SCIF_SAS_CONTROLLER_T*) controller; + // Validate the user supplied parameters. + if ((library == SCI_INVALID_HANDLE) || (controller == SCI_INVALID_HANDLE)) + return SCI_FAILURE_INVALID_PARAMETER_VALUE; + SCIF_LOG_TRACE(( sci_base_object_get_logger(library), SCIF_LOG_OBJECT_CONTROLLER | SCIF_LOG_OBJECT_INITIALIZATION, @@ -94,10 +98,6 @@ SCI_STATUS scif_controller_construct( library, controller )); - // Validate the user supplied parameters. - if ((library == SCI_INVALID_HANDLE) || (controller == SCI_INVALID_HANDLE)) - return SCI_FAILURE_INVALID_PARAMETER_VALUE; - // Construct the base controller. As part of constructing the base // controller we ask it to also manage the MDL iteration for the Core. sci_base_controller_construct( @@ -144,6 +144,10 @@ SCI_STATUS scif_controller_initialize( { SCIF_SAS_CONTROLLER_T * fw_controller = (SCIF_SAS_CONTROLLER_T*) controller; + // Validate the user supplied parameters. + if (controller == SCI_INVALID_HANDLE) + return SCI_FAILURE_INVALID_PARAMETER_VALUE; + SCIF_LOG_TRACE(( sci_base_object_get_logger(controller), SCIF_LOG_OBJECT_CONTROLLER | SCIF_LOG_OBJECT_INITIALIZATION, @@ -151,10 +155,6 @@ SCI_STATUS scif_controller_initialize( controller )); - // Validate the user supplied parameters. - if (controller == SCI_INVALID_HANDLE) - return SCI_FAILURE_INVALID_PARAMETER_VALUE; - return fw_controller->state_handlers->initialize_handler( &fw_controller->parent ); @@ -187,6 +187,10 @@ SCI_STATUS scif_controller_start( { SCIF_SAS_CONTROLLER_T * fw_controller = (SCIF_SAS_CONTROLLER_T*) controller; + // Validate the user supplied parameters. + if (controller == SCI_INVALID_HANDLE) + return SCI_FAILURE_INVALID_PARAMETER_VALUE; + SCIF_LOG_TRACE(( sci_base_object_get_logger(controller), SCIF_LOG_OBJECT_CONTROLLER | SCIF_LOG_OBJECT_INITIALIZATION, @@ -194,10 +198,6 @@ SCI_STATUS scif_controller_start( controller, timeout )); - // Validate the user supplied parameters. - if (controller == SCI_INVALID_HANDLE) - return SCI_FAILURE_INVALID_PARAMETER_VALUE; - return fw_controller->state_handlers-> start_handler(&fw_controller->parent, timeout); } @@ -211,6 +211,10 @@ SCI_STATUS scif_controller_stop( { SCIF_SAS_CONTROLLER_T * fw_controller = (SCIF_SAS_CONTROLLER_T*) controller; + // Validate the user supplied parameters. + if (controller == SCI_INVALID_HANDLE) + return SCI_FAILURE_INVALID_PARAMETER_VALUE; + SCIF_LOG_TRACE(( sci_base_object_get_logger(controller), SCIF_LOG_OBJECT_CONTROLLER | SCIF_LOG_OBJECT_SHUTDOWN, @@ -218,10 +222,6 @@ SCI_STATUS scif_controller_stop( controller, timeout )); - // Validate the user supplied parameters. - if (controller == SCI_INVALID_HANDLE) - return SCI_FAILURE_INVALID_PARAMETER_VALUE; - return fw_controller->state_handlers-> stop_handler(&fw_controller->parent, timeout); @@ -235,6 +235,10 @@ SCI_STATUS scif_controller_reset( { SCIF_SAS_CONTROLLER_T * fw_controller = (SCIF_SAS_CONTROLLER_T*) controller; + // Validate the user supplied parameters. + if (controller == SCI_INVALID_HANDLE) + return SCI_FAILURE_INVALID_PARAMETER_VALUE; + SCIF_LOG_TRACE(( sci_base_object_get_logger(controller), SCIF_LOG_OBJECT_CONTROLLER | SCIF_LOG_OBJECT_CONTROLLER_RESET, @@ -242,10 +246,6 @@ SCI_STATUS scif_controller_reset( controller )); - // Validate the user supplied parameters. - if (controller == SCI_INVALID_HANDLE) - return SCI_FAILURE_INVALID_PARAMETER_VALUE; - return fw_controller->state_handlers-> reset_handler(&fw_controller->parent); } @@ -306,13 +306,6 @@ SCI_TASK_STATUS scif_controller_start_ta { SCIF_SAS_CONTROLLER_T * fw_controller = (SCIF_SAS_CONTROLLER_T*) controller; - SCIF_LOG_TRACE(( - sci_base_object_get_logger(controller), - SCIF_LOG_OBJECT_CONTROLLER | SCIF_LOG_OBJECT_TASK_MANAGEMENT, - "scif_controller_start_task(0x%x, 0x%x, 0x%x, 0x%x) enter\n", - controller, remote_device, task_request, io_tag - )); - // Validate the user supplied parameters. if ( (controller == SCI_INVALID_HANDLE) || (remote_device == SCI_INVALID_HANDLE) @@ -321,6 +314,13 @@ SCI_TASK_STATUS scif_controller_start_ta return SCI_FAILURE_INVALID_PARAMETER_VALUE; } + SCIF_LOG_TRACE(( + sci_base_object_get_logger(controller), + SCIF_LOG_OBJECT_CONTROLLER | SCIF_LOG_OBJECT_TASK_MANAGEMENT, + "scif_controller_start_task(0x%x, 0x%x, 0x%x, 0x%x) enter\n", + controller, remote_device, task_request, io_tag + )); + if (scif_sas_controller_sufficient_resource(controller)) { return fw_controller->state_handlers->start_task_handler( @@ -368,13 +368,6 @@ SCI_STATUS scif_controller_complete_task { SCIF_SAS_CONTROLLER_T * fw_controller = (SCIF_SAS_CONTROLLER_T*) controller; - SCIF_LOG_TRACE(( - sci_base_object_get_logger(controller), - SCIF_LOG_OBJECT_CONTROLLER | SCIF_LOG_OBJECT_TASK_MANAGEMENT, - "scif_controller_complete_task(0x%x, 0x%x, 0x%x) enter\n", - controller, remote_device, task_request - )); - // Validate the user supplied parameters. if ( (controller == SCI_INVALID_HANDLE) || (remote_device == SCI_INVALID_HANDLE) @@ -383,6 +376,13 @@ SCI_STATUS scif_controller_complete_task return SCI_FAILURE_INVALID_PARAMETER_VALUE; } + SCIF_LOG_TRACE(( + sci_base_object_get_logger(controller), + SCIF_LOG_OBJECT_CONTROLLER | SCIF_LOG_OBJECT_TASK_MANAGEMENT, + "scif_controller_complete_task(0x%x, 0x%x, 0x%x) enter\n", + controller, remote_device, task_request + )); + return fw_controller->state_handlers->complete_task_handler( (SCI_BASE_CONTROLLER_T*) controller, (SCI_BASE_REMOTE_DEVICE_T*) remote_device, Modified: head/sys/dev/isci/scil/scif_sas_domain.c ============================================================================== --- head/sys/dev/isci/scil/scif_sas_domain.c Tue Feb 7 17:43:58 2012 (r231136) +++ head/sys/dev/isci/scil/scif_sas_domain.c Tue Feb 7 17:45:11 2012 (r231137) @@ -142,8 +142,8 @@ SCI_PORT_HANDLE_T scif_domain_get_scic_p { SCIF_SAS_DOMAIN_T * fw_domain = (SCIF_SAS_DOMAIN_T*) domain; - if ( (fw_domain != NULL) && (fw_domain->core_object != SCI_INVALID_HANDLE) ) - return fw_domain->core_object; + if ( (fw_domain == NULL) || (fw_domain->core_object == SCI_INVALID_HANDLE) ) + return SCI_INVALID_HANDLE; SCIF_LOG_WARNING(( sci_base_object_get_logger(fw_domain), @@ -152,7 +152,7 @@ SCI_PORT_HANDLE_T scif_domain_get_scic_p fw_domain )); - return SCI_INVALID_HANDLE; + return fw_domain->core_object; } // --------------------------------------------------------------------------- Modified: head/sys/dev/isci/scil/scif_sas_remote_device.c ============================================================================== --- head/sys/dev/isci/scil/scif_sas_remote_device.c Tue Feb 7 17:43:58 2012 (r231136) +++ head/sys/dev/isci/scil/scif_sas_remote_device.c Tue Feb 7 17:45:11 2012 (r231137) @@ -362,8 +362,8 @@ SCI_REMOTE_DEVICE_HANDLE_T scif_remote_d SCIF_SAS_REMOTE_DEVICE_T * fw_device = (SCIF_SAS_REMOTE_DEVICE_T*) scif_remote_device; - if ( (fw_device != NULL) && (fw_device->core_object != SCI_INVALID_HANDLE) ) - return fw_device->core_object; + if ( (fw_device == NULL) || (fw_device->core_object == SCI_INVALID_HANDLE) ) + return SCI_INVALID_HANDLE; SCIF_LOG_WARNING(( sci_base_object_get_logger(fw_device), @@ -372,7 +372,7 @@ SCI_REMOTE_DEVICE_HANDLE_T scif_remote_d fw_device )); - return SCI_INVALID_HANDLE; + return fw_device->core_object; } // --------------------------------------------------------------------------- Modified: head/sys/dev/isci/scil/scif_sas_smp_io_request.c ============================================================================== --- head/sys/dev/isci/scil/scif_sas_smp_io_request.c Tue Feb 7 17:43:58 2012 (r231136) +++ head/sys/dev/isci/scil/scif_sas_smp_io_request.c Tue Feb 7 17:45:11 2012 (r231137) @@ -580,7 +580,7 @@ SCI_STATUS scif_sas_smp_external_request default: //unsupported case, TBD - break; + return SCI_FAILURE; } //end of switch //set the retry count to new built smp request. Modified: head/sys/dev/isci/scil/scif_sas_smp_remote_device.c ============================================================================== --- head/sys/dev/isci/scil/scif_sas_smp_remote_device.c Tue Feb 7 17:43:58 2012 (r231136) +++ head/sys/dev/isci/scil/scif_sas_smp_remote_device.c Tue Feb 7 17:45:11 2012 (r231137) @@ -748,7 +748,6 @@ SCI_STATUS scif_sas_smp_remote_device_de { SCIF_SAS_DOMAIN_T * fw_domain; SCI_SAS_ADDRESS_T attached_device_address; - SCIF_SAS_REMOTE_DEVICE_T * attached_remote_device; SMP_RESPONSE_DISCOVER_T * discover_response = &smp_response->response.discover; @@ -782,13 +781,11 @@ SCI_STATUS scif_sas_smp_remote_device_de fw_domain = fw_device->domain; attached_device_address = discover_response->attached_sas_address; - attached_remote_device = (SCIF_SAS_REMOTE_DEVICE_T *) - scif_domain_get_device_by_sas_address( - fw_domain, &attached_device_address - ); - // the device should have already existed in the domian. - ASSERT (attached_remote_device != SCI_INVALID_HANDLE); + ASSERT(scif_domain_get_device_by_sas_address( + fw_domain, + &attached_device_address + ) != SCI_INVALID_HANDLE); return SCI_SUCCESS; } else @@ -1774,6 +1771,8 @@ SCIF_SAS_SMP_PHY_T * scif_sas_smp_remote SCI_FAST_LIST_ELEMENT_T * element = smp_remote_device->smp_phy_list.list_head; SCIF_SAS_SMP_PHY_T * curr_smp_phy = NULL; + ASSERT(phy_identifier < smp_remote_device->smp_phy_list.number_of_phys); + while (element != NULL) { curr_smp_phy = (SCIF_SAS_SMP_PHY_T*) sci_fast_list_get_object(element); @@ -1934,11 +1933,8 @@ SCI_STATUS scif_sas_smp_remote_device_sa scif_domain_get_device_by_sas_address( fw_device->domain, &discover_response->attached_sas_address); - if (smp_phy != NULL) - { - scif_sas_smp_phy_save_information( - smp_phy, attached_device, discover_response); - } + scif_sas_smp_phy_save_information( + smp_phy, attached_device, discover_response); //handle the special case of smp phys between expanders. if ( discover_response->protocols.u.bits.attached_smp_target ) @@ -2372,11 +2368,7 @@ void scif_sas_smp_remote_device_clean_ro SCIF_SAS_REMOTE_DEVICE_T * fw_device ) { - SCIF_SAS_SMP_PHY_T * smp_phy_being_config = - scif_sas_smp_remote_device_find_smp_phy_by_id( - fw_device->protocol_device.smp_device.current_activity_phy_index, - &(fw_device->protocol_device.smp_device) - ); + SCIF_SAS_SMP_PHY_T * smp_phy_being_config; SCIF_LOG_TRACE(( sci_base_object_get_logger(fw_device), From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 18:35:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D068C106566B; Tue, 7 Feb 2012 18:35:18 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BE7D78FC0A; Tue, 7 Feb 2012 18:35:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q17IZI8B002065; Tue, 7 Feb 2012 18:35:18 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17IZIQe002063; Tue, 7 Feb 2012 18:35:18 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202071835.q17IZIQe002063@svn.freebsd.org> From: Martin Matuska Date: Tue, 7 Feb 2012 18:35:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231144 - head/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 18:35:18 -0000 Author: mm Date: Tue Feb 7 18:35:18 2012 New Revision: 231144 URL: http://svn.freebsd.org/changeset/base/231144 Log: Merge illumos revision 13594: uninitialized variables in zfs(8) may make snapshots undestroyable [1] References: https://www.illumos.org/issues/2067 [1] Obtained from: illumos (issue #2067) MFC after: 3 days Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c ============================================================================== --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Feb 7 18:05:10 2012 (r231143) +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Feb 7 18:35:18 2012 (r231144) @@ -590,7 +590,7 @@ zfs_do_clone(int argc, char **argv) zfs_handle_t *zhp = NULL; boolean_t parents = B_FALSE; nvlist_t *props; - int ret; + int ret = 0; int c; if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) @@ -1052,7 +1052,7 @@ destroy_print_cb(zfs_handle_t *zhp, void static int destroy_print_snapshots(zfs_handle_t *fs_zhp, destroy_cbdata_t *cb) { - int err; + int err = 0; assert(cb->cb_firstsnap == NULL); assert(cb->cb_prevsnap == NULL); err = zfs_iter_snapshots_sorted(fs_zhp, destroy_print_cb, cb); @@ -1130,7 +1130,7 @@ destroy_clones(destroy_cbdata_t *cb) ZFS_TYPE_SNAPSHOT); if (zhp != NULL) { boolean_t defer = cb->cb_defer_destroy; - int err; + int err = 0; /* * We can't defer destroy non-snapshots, so set it to @@ -1207,7 +1207,7 @@ zfs_do_destroy(int argc, char **argv) at = strchr(argv[0], '@'); if (at != NULL) { - int err; + int err = 0; /* Build the list of snaps to destroy in cb_nvl. */ if (nvlist_alloc(&cb.cb_nvl, NV_UNIQUE_NAME, 0) != 0) @@ -1474,7 +1474,7 @@ zfs_do_get(int argc, char **argv) zprop_get_cbdata_t cb = { 0 }; int i, c, flags = ZFS_ITER_ARGS_CAN_BE_PATHS; char *value, *fields; - int ret; + int ret = 0; int limit = 0; zprop_list_t fake_name = { 0 }; @@ -1711,7 +1711,7 @@ zfs_do_inherit(int argc, char **argv) zfs_prop_t prop; inherit_cbdata_t cb = { 0 }; char *propname; - int ret; + int ret = 0; int flags = 0; boolean_t received = B_FALSE; @@ -1917,7 +1917,7 @@ zfs_do_upgrade(int argc, char **argv) { boolean_t all = B_FALSE; boolean_t showversions = B_FALSE; - int ret; + int ret = 0; upgrade_cbdata_t cb = { 0 }; char c; int flags = ZFS_ITER_ARGS_CAN_BE_PATHS; @@ -2206,7 +2206,7 @@ userspace_cb(void *arg, const char *doma uid_t id; uint64_t classes; #ifdef sun - int err; + int err = 0; directory_error_t e; #endif @@ -2562,7 +2562,7 @@ zfs_do_userspace(int argc, char **argv) boolean_t prtnum = B_FALSE; boolean_t parseable = B_FALSE; boolean_t sid2posix = B_FALSE; - int error; + int error = 0; int c; zfs_sort_column_t *default_sortcol = NULL; zfs_sort_column_t *sortcol = NULL; @@ -2925,7 +2925,7 @@ zfs_do_list(int argc, char **argv) list_cbdata_t cb = { 0 }; char *value; int limit = 0; - int ret; + int ret = 0; zfs_sort_column_t *sortcol = NULL; int flags = ZFS_ITER_PROP_LISTSNAPS | ZFS_ITER_ARGS_CAN_BE_PATHS; @@ -3062,7 +3062,9 @@ zfs_do_rename(int argc, char **argv) { zfs_handle_t *zhp; renameflags_t flags = { 0 }; - int c, ret, types; + int c; + int ret = 0; + int types; boolean_t parents = B_FALSE; /* check options */ @@ -3155,7 +3157,7 @@ static int zfs_do_promote(int argc, char **argv) { zfs_handle_t *zhp; - int ret; + int ret = 0; /* check options */ if (argc > 1 && argv[1][0] == '-') { @@ -3276,7 +3278,7 @@ rollback_check(zfs_handle_t *zhp, void * static int zfs_do_rollback(int argc, char **argv) { - int ret; + int ret = 0; int c; boolean_t force = B_FALSE; rollback_cbdata_t cb = { 0 }; @@ -3394,7 +3396,7 @@ static int zfs_do_set(int argc, char **argv) { set_cbdata_t cb; - int ret; + int ret = 0; /* check for options */ if (argc > 1 && argv[1][0] == '-') { @@ -3448,7 +3450,7 @@ static int zfs_do_snapshot(int argc, char **argv) { boolean_t recursive = B_FALSE; - int ret; + int ret = 0; char c; nvlist_t *props; @@ -5286,7 +5288,7 @@ zfs_do_holds(int argc, char **argv) holds_cbdata_t cb = { 0 }; int limit = 0; - int ret; + int ret = 0; int flags = 0; /* check options */ @@ -5863,7 +5865,7 @@ static int unshare_unmount_path(int op, char *path, int flags, boolean_t is_manual) { zfs_handle_t *zhp; - int ret; + int ret = 0; struct stat64 statbuf; struct extmnttab entry; const char *cmdname = (op == OP_SHARE) ? "unshare" : "unmount"; @@ -6331,7 +6333,7 @@ manual_mount(int argc, char **argv) zfs_handle_t *zhp; char mountpoint[ZFS_MAXPROPLEN]; char mntopts[MNT_LINE_MAX] = { '\0' }; - int ret; + int ret = 0; int c; int flags = 0; char *dataset, *path; @@ -6481,7 +6483,7 @@ zfs_do_diff(int argc, char **argv) char *tosnap = NULL; char *fromsnap = NULL; char *atp, *copy; - int err; + int err = 0; int c; while ((c = getopt(argc, argv, "FHt")) != -1) { @@ -6551,7 +6553,7 @@ zfs_do_diff(int argc, char **argv) int main(int argc, char **argv) { - int ret; + int ret = 0; int i; char *progname; char *cmdname; From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 19:03:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 97FA8106566B; Tue, 7 Feb 2012 19:03:48 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 6DE3E8FC1A; Tue, 7 Feb 2012 19:03:48 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [96.47.65.170]) by cyrus.watson.org (Postfix) with ESMTPSA id 2717546B0A; Tue, 7 Feb 2012 14:03:48 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 85331B924; Tue, 7 Feb 2012 14:03:47 -0500 (EST) From: John Baldwin To: Nathan Whitehorn Date: Tue, 7 Feb 2012 14:00:17 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p10; KDE/4.5.5; amd64; ; ) References: <201202051654.q15GsQcc092137@svn.freebsd.org> <201202061106.59098.jhb@freebsd.org> <4F3008C5.8020104@freebsd.org> In-Reply-To: <4F3008C5.8020104@freebsd.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201202071400.17798.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Tue, 07 Feb 2012 14:03:47 -0500 (EST) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231026 - head/sys/powerpc/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:03:48 -0000 On Monday, February 06, 2012 12:07:17 pm Nathan Whitehorn wrote: > On 02/06/12 10:06, John Baldwin wrote: > > On Monday, February 06, 2012 10:40:54 am Nathan Whitehorn wrote: > >> On 02/06/12 06:53, John Baldwin wrote: > >>> On Sunday, February 05, 2012 11:54:26 am Nathan Whitehorn wrote: > >>>> Author: nwhitehorn > >>>> Date: Sun Feb 5 16:54:26 2012 > >>>> New Revision: 231026 > >>>> URL: http://svn.freebsd.org/changeset/base/231026 > >>>> > >>>> Log: > >>>> Make sure to remap adjusted resources. > >>> Hmm, I had considered remapping adjusted resources an invalid operation (i.e. > >>> should fail with EINVAL). I believe that the NEW_PCIB code should only apply > >>> this API to resources backing the resource windows in PCI-PCI bridges and that > >>> those resources should never have RF_ACTIVE set. Are you seeing calls of it > >>> for active resources? > >>> > >> No, I was just trying to be safe here, since it wasn't clear that that > >> was invalid. I'm happy to replace the contents of the if with return > >> EINVAL or something. > > Yeah, I would do that, perhaps with a KASSERT() as well so it panics in HEAD. > > > > How does this look? I've kept both the EINVAL and the KASSERT. > -Nathan Looks good to me, thanks! -- John Baldwin From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 19:14:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 25DA71065686; Tue, 7 Feb 2012 19:14:14 +0000 (UTC) (envelope-from nwhitehorn@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 145F68FC08; Tue, 7 Feb 2012 19:14:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q17JEDNC003451; Tue, 7 Feb 2012 19:14:13 GMT (envelope-from nwhitehorn@svn.freebsd.org) Received: (from nwhitehorn@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17JEDBK003449; Tue, 7 Feb 2012 19:14:13 GMT (envelope-from nwhitehorn@svn.freebsd.org) Message-Id: <201202071914.q17JEDBK003449@svn.freebsd.org> From: Nathan Whitehorn Date: Tue, 7 Feb 2012 19:14:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231149 - head/sys/powerpc/ofw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 19:14:14 -0000 Author: nwhitehorn Date: Tue Feb 7 19:14:13 2012 New Revision: 231149 URL: http://svn.freebsd.org/changeset/base/231149 Log: The bus resource adjustment API is not meant to work on active resources. Return an error if a driver attempts this, and, if INVARIANTS is on, panic. Reviewed by: jhb Modified: head/sys/powerpc/ofw/ofw_pci.c Modified: head/sys/powerpc/ofw/ofw_pci.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pci.c Tue Feb 7 19:13:47 2012 (r231148) +++ head/sys/powerpc/ofw/ofw_pci.c Tue Feb 7 19:14:13 2012 (r231149) @@ -431,7 +431,11 @@ ofw_pci_adjust_resource(device_t bus, de { struct rman *rm = NULL; struct ofw_pci_softc *sc = device_get_softc(bus); - int error; + + KASSERT(!(rman_get_flags(res) & RF_ACTIVE), + ("active resources cannot be adjusted")); + if (rman_get_flags(res) & RF_ACTIVE) + return (EINVAL); switch (type) { case SYS_RES_MEMORY: @@ -447,21 +451,7 @@ ofw_pci_adjust_resource(device_t bus, de if (!rman_is_region_manager(res, rm)) return (EINVAL); - error = rman_adjust_resource(res, start, end); - if (error) - return (error); - - if (rman_get_flags(res) & RF_ACTIVE) { - /* Remap memory resources */ - error = ofw_pci_deactivate_resource(bus, child, type, - rman_get_rid(res), res); - if (error) - return (error); - error = ofw_pci_activate_resource(bus, child, type, - rman_get_rid(res), res); - } - - return (error); + return (rman_adjust_resource(res, start, end)); } From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 20:03:01 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BB7701065672; Tue, 7 Feb 2012 20:03:01 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 8671A8FC13; Tue, 7 Feb 2012 20:03:00 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id WAA25630; Tue, 07 Feb 2012 22:02:58 +0200 (EET) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1RurFi-000OdD-Aw; Tue, 07 Feb 2012 22:02:58 +0200 Message-ID: <4F318370.4060500@FreeBSD.org> Date: Tue, 07 Feb 2012 22:02:56 +0200 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:10.0) Gecko/20120202 Thunderbird/10.0 MIME-Version: 1.0 To: Martin Matuska References: <201202071835.q17IZIQe002063@svn.freebsd.org> In-Reply-To: <201202071835.q17IZIQe002063@svn.freebsd.org> X-Enigmail-Version: 1.3.5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r231144 - head/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 20:03:01 -0000 on 07/02/2012 20:35 Martin Matuska said the following: > Author: mm > Date: Tue Feb 7 18:35:18 2012 > New Revision: 231144 > URL: http://svn.freebsd.org/changeset/base/231144 > > Log: > Merge illumos revision 13594: > > uninitialized variables in zfs(8) may make snapshots undestroyable [1] > > References: > https://www.illumos.org/issues/2067 [1] > > Obtained from: illumos (issue #2067) > MFC after: 3 days PR 164802 seems to be related. Could you please take over it? > Modified: > head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c > > Modified: head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c > ============================================================================== > --- head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Feb 7 18:05:10 2012 (r231143) > +++ head/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c Tue Feb 7 18:35:18 2012 (r231144) > @@ -590,7 +590,7 @@ zfs_do_clone(int argc, char **argv) > zfs_handle_t *zhp = NULL; > boolean_t parents = B_FALSE; > nvlist_t *props; > - int ret; > + int ret = 0; > int c; > > if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) > @@ -1052,7 +1052,7 @@ destroy_print_cb(zfs_handle_t *zhp, void > static int > destroy_print_snapshots(zfs_handle_t *fs_zhp, destroy_cbdata_t *cb) > { > - int err; > + int err = 0; > assert(cb->cb_firstsnap == NULL); > assert(cb->cb_prevsnap == NULL); > err = zfs_iter_snapshots_sorted(fs_zhp, destroy_print_cb, cb); > @@ -1130,7 +1130,7 @@ destroy_clones(destroy_cbdata_t *cb) > ZFS_TYPE_SNAPSHOT); > if (zhp != NULL) { > boolean_t defer = cb->cb_defer_destroy; > - int err; > + int err = 0; > > /* > * We can't defer destroy non-snapshots, so set it to > @@ -1207,7 +1207,7 @@ zfs_do_destroy(int argc, char **argv) > > at = strchr(argv[0], '@'); > if (at != NULL) { > - int err; > + int err = 0; > > /* Build the list of snaps to destroy in cb_nvl. */ > if (nvlist_alloc(&cb.cb_nvl, NV_UNIQUE_NAME, 0) != 0) > @@ -1474,7 +1474,7 @@ zfs_do_get(int argc, char **argv) > zprop_get_cbdata_t cb = { 0 }; > int i, c, flags = ZFS_ITER_ARGS_CAN_BE_PATHS; > char *value, *fields; > - int ret; > + int ret = 0; > int limit = 0; > zprop_list_t fake_name = { 0 }; > > @@ -1711,7 +1711,7 @@ zfs_do_inherit(int argc, char **argv) > zfs_prop_t prop; > inherit_cbdata_t cb = { 0 }; > char *propname; > - int ret; > + int ret = 0; > int flags = 0; > boolean_t received = B_FALSE; > > @@ -1917,7 +1917,7 @@ zfs_do_upgrade(int argc, char **argv) > { > boolean_t all = B_FALSE; > boolean_t showversions = B_FALSE; > - int ret; > + int ret = 0; > upgrade_cbdata_t cb = { 0 }; > char c; > int flags = ZFS_ITER_ARGS_CAN_BE_PATHS; > @@ -2206,7 +2206,7 @@ userspace_cb(void *arg, const char *doma > uid_t id; > uint64_t classes; > #ifdef sun > - int err; > + int err = 0; > directory_error_t e; > #endif > > @@ -2562,7 +2562,7 @@ zfs_do_userspace(int argc, char **argv) > boolean_t prtnum = B_FALSE; > boolean_t parseable = B_FALSE; > boolean_t sid2posix = B_FALSE; > - int error; > + int error = 0; > int c; > zfs_sort_column_t *default_sortcol = NULL; > zfs_sort_column_t *sortcol = NULL; > @@ -2925,7 +2925,7 @@ zfs_do_list(int argc, char **argv) > list_cbdata_t cb = { 0 }; > char *value; > int limit = 0; > - int ret; > + int ret = 0; > zfs_sort_column_t *sortcol = NULL; > int flags = ZFS_ITER_PROP_LISTSNAPS | ZFS_ITER_ARGS_CAN_BE_PATHS; > > @@ -3062,7 +3062,9 @@ zfs_do_rename(int argc, char **argv) > { > zfs_handle_t *zhp; > renameflags_t flags = { 0 }; > - int c, ret, types; > + int c; > + int ret = 0; > + int types; > boolean_t parents = B_FALSE; > > /* check options */ > @@ -3155,7 +3157,7 @@ static int > zfs_do_promote(int argc, char **argv) > { > zfs_handle_t *zhp; > - int ret; > + int ret = 0; > > /* check options */ > if (argc > 1 && argv[1][0] == '-') { > @@ -3276,7 +3278,7 @@ rollback_check(zfs_handle_t *zhp, void * > static int > zfs_do_rollback(int argc, char **argv) > { > - int ret; > + int ret = 0; > int c; > boolean_t force = B_FALSE; > rollback_cbdata_t cb = { 0 }; > @@ -3394,7 +3396,7 @@ static int > zfs_do_set(int argc, char **argv) > { > set_cbdata_t cb; > - int ret; > + int ret = 0; > > /* check for options */ > if (argc > 1 && argv[1][0] == '-') { > @@ -3448,7 +3450,7 @@ static int > zfs_do_snapshot(int argc, char **argv) > { > boolean_t recursive = B_FALSE; > - int ret; > + int ret = 0; > char c; > nvlist_t *props; > > @@ -5286,7 +5288,7 @@ zfs_do_holds(int argc, char **argv) > holds_cbdata_t cb = { 0 }; > > int limit = 0; > - int ret; > + int ret = 0; > int flags = 0; > > /* check options */ > @@ -5863,7 +5865,7 @@ static int > unshare_unmount_path(int op, char *path, int flags, boolean_t is_manual) > { > zfs_handle_t *zhp; > - int ret; > + int ret = 0; > struct stat64 statbuf; > struct extmnttab entry; > const char *cmdname = (op == OP_SHARE) ? "unshare" : "unmount"; > @@ -6331,7 +6333,7 @@ manual_mount(int argc, char **argv) > zfs_handle_t *zhp; > char mountpoint[ZFS_MAXPROPLEN]; > char mntopts[MNT_LINE_MAX] = { '\0' }; > - int ret; > + int ret = 0; > int c; > int flags = 0; > char *dataset, *path; > @@ -6481,7 +6483,7 @@ zfs_do_diff(int argc, char **argv) > char *tosnap = NULL; > char *fromsnap = NULL; > char *atp, *copy; > - int err; > + int err = 0; > int c; > > while ((c = getopt(argc, argv, "FHt")) != -1) { > @@ -6551,7 +6553,7 @@ zfs_do_diff(int argc, char **argv) > int > main(int argc, char **argv) > { > - int ret; > + int ret = 0; > int i; > char *progname; > char *cmdname; -- Andriy Gapon From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 20:24:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A9B96106566B; Tue, 7 Feb 2012 20:24:53 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 988408FC13; Tue, 7 Feb 2012 20:24:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q17KOr4G006174; Tue, 7 Feb 2012 20:24:53 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17KOrLx006172; Tue, 7 Feb 2012 20:24:53 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202072024.q17KOrLx006172@svn.freebsd.org> From: Marius Strobl Date: Tue, 7 Feb 2012 20:24:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231159 - head/sys/dev/bge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 20:24:53 -0000 Author: marius Date: Tue Feb 7 20:24:52 2012 New Revision: 231159 URL: http://svn.freebsd.org/changeset/base/231159 Log: Call bge_add_sysctls() early and especially before bge_can_use_msi() so r230337 actually has a chance of working and doesn't always unconditionally disable the use of MSIs. Modified: head/sys/dev/bge/if_bge.c Modified: head/sys/dev/bge/if_bge.c ============================================================================== --- head/sys/dev/bge/if_bge.c Tue Feb 7 19:56:22 2012 (r231158) +++ head/sys/dev/bge/if_bge.c Tue Feb 7 20:24:52 2012 (r231159) @@ -2786,6 +2786,8 @@ bge_attach(device_t dev) sc = device_get_softc(dev); sc->bge_dev = dev; + bge_add_sysctls(sc); + TASK_INIT(&sc->bge_intr_task, 0, bge_intr_task, sc); /* @@ -3198,8 +3200,6 @@ bge_attach(device_t dev) goto fail; } - bge_add_sysctls(sc); - /* Set default tuneable values. */ sc->bge_stat_ticks = BGE_TICKS_PER_SEC; sc->bge_rx_coal_ticks = 150; From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 20:43:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B9AEF1065680; Tue, 7 Feb 2012 20:43:28 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A815D8FC1C; Tue, 7 Feb 2012 20:43:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q17KhSQV006767; Tue, 7 Feb 2012 20:43:28 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17KhSJx006765; Tue, 7 Feb 2012 20:43:28 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201202072043.q17KhSJx006765@svn.freebsd.org> From: Kirk McKusick Date: Tue, 7 Feb 2012 20:43:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231160 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 20:43:28 -0000 Author: mckusick Date: Tue Feb 7 20:43:28 2012 New Revision: 231160 URL: http://svn.freebsd.org/changeset/base/231160 Log: In the original days of BSD, a sync was issued on every filesystem every 30 seconds. This spike in I/O caused the system to pause every 30 seconds which was quite annoying. So, the way that sync worked was changed so that when a vnode was first dirtied, it was put on a 30-second cleaning queue (see the syncer_workitem_pending queues in kern/vfs_subr.c). If the file has not been written or deleted after 30 seconds, the syncer pushes it out. As the syncer runs once per second, dirty files are trickled out slowly over the 30-second period instead of all at once by a call to sync(2). The one drawback to this is that it does not cover the filesystem metadata. To handle the metadata, vfs_allocate_syncvnode() is called to create a "filesystem syncer vnode" at mount time which cycles around the cleaning queue being sync'ed every 30 seconds. In the original design, the only things it would sync for UFS were the filesystem metadata: inode blocks, cylinder group bitmaps, and the superblock (e.g., by VOP_FSYNC'ing devvp, the device vnode from which the filesystem is mounted). Somewhere in its path to integration with FreeBSD the flushing of the filesystem syncer vnode got changed to sync every vnode associated with the filesystem. The result of this change is to return to the old filesystem-wide flush every 30-seconds behavior and makes the whole 30-second delay per vnode useless. This change goes back to the originally intended trickle out sync behavior. Key to ensuring that all the intended semantics are preserved (e.g., that all inode updates get flushed within a bounded period of time) is that all inode modifications get pushed to their corresponding inode blocks so that the metadata flush by the filesystem syncer vnode gets them to the disk in a timely way. Thanks to Konstantin Belousov (kib@) for doing the audit and commit -r231122 which ensures that all of these updates are being made. Reviewed by: kib Tested by: scottl MFC after: 2 weeks Modified: head/sys/ufs/ffs/ffs_vfsops.c Modified: head/sys/ufs/ffs/ffs_vfsops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vfsops.c Tue Feb 7 20:24:52 2012 (r231159) +++ head/sys/ufs/ffs/ffs_vfsops.c Tue Feb 7 20:43:28 2012 (r231160) @@ -1436,17 +1436,26 @@ ffs_sync(mp, waitfor) int softdep_accdeps; struct bufobj *bo; + wait = 0; + suspend = 0; + suspended = 0; td = curthread; fs = ump->um_fs; if (fs->fs_fmod != 0 && fs->fs_ronly != 0 && ump->um_fsckpid == 0) panic("%s: ffs_sync: modification on read-only filesystem", fs->fs_fsmnt); /* + * For a lazy sync, we just care about the filesystem metadata. + */ + if (waitfor == MNT_LAZY) { + secondary_accwrites = 0; + secondary_writes = 0; + lockreq = 0; + goto metasync; + } + /* * Write back each (modified) inode. */ - wait = 0; - suspend = 0; - suspended = 0; lockreq = LK_EXCLUSIVE | LK_NOWAIT; if (waitfor == MNT_SUSPEND) { suspend = 1; @@ -1517,11 +1526,12 @@ loop: #ifdef QUOTA qsync(mp); #endif + +metasync: devvp = ump->um_devvp; bo = &devvp->v_bufobj; BO_LOCK(bo); - if (waitfor != MNT_LAZY && - (bo->bo_numoutput > 0 || bo->bo_dirty.bv_cnt > 0)) { + if (bo->bo_numoutput > 0 || bo->bo_dirty.bv_cnt > 0) { BO_UNLOCK(bo); vn_lock(devvp, LK_EXCLUSIVE | LK_RETRY); if ((error = VOP_FSYNC(devvp, waitfor, td)) != 0) From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 20:54:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 84967106564A; Tue, 7 Feb 2012 20:54:45 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 72D958FC16; Tue, 7 Feb 2012 20:54:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q17KsjPT007155; Tue, 7 Feb 2012 20:54:45 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17KsjCT007149; Tue, 7 Feb 2012 20:54:45 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202072054.q17KsjCT007149@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 7 Feb 2012 20:54:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231161 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 20:54:45 -0000 Author: jkim Date: Tue Feb 7 20:54:44 2012 New Revision: 231161 URL: http://svn.freebsd.org/changeset/base/231161 Log: - Give all clocks and timers on acpi0 the equal probing order. - Increase probing order for ECDT table to match HID-based probing. - Decrease probing order for HPET table to match HID-based probing. - Decrease probing order for CPUs and system resources. - Fix ACPI_DEV_BASE_ORDER to reflect the reality. Modified: head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpi_ec.c head/sys/dev/acpica/acpi_hpet.c head/sys/dev/acpica/acpi_timer.c head/sys/dev/acpica/acpivar.h Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Tue Feb 7 20:43:28 2012 (r231160) +++ head/sys/dev/acpica/acpi.c Tue Feb 7 20:54:44 2012 (r231161) @@ -1812,23 +1812,29 @@ acpi_probe_children(device_t bus) static void acpi_probe_order(ACPI_HANDLE handle, int *order) { - ACPI_OBJECT_TYPE type; + ACPI_OBJECT_TYPE type; - /* - * 1. CPUs - * 2. I/O port and memory system resource holders - * 3. Embedded controllers (to handle early accesses) - * 4. PCI Link Devices - */ - AcpiGetType(handle, &type); - if (type == ACPI_TYPE_PROCESSOR) - *order = 1; - else if (acpi_MatchHid(handle, "PNP0C01") || acpi_MatchHid(handle, "PNP0C02")) - *order = 2; - else if (acpi_MatchHid(handle, "PNP0C09")) - *order = 3; - else if (acpi_MatchHid(handle, "PNP0C0F")) - *order = 4; + /* + * 0. CPUs + * 1. I/O port and memory system resource holders + * 2. Clocks and timers (to handle early accesses) + * 3. Embedded controllers (to handle early accesses) + * 4. PCI Link Devices + */ + AcpiGetType(handle, &type); + if (type == ACPI_TYPE_PROCESSOR) + *order = 0; + else if (acpi_MatchHid(handle, "PNP0C01") || + acpi_MatchHid(handle, "PNP0C02")) + *order = 1; + else if (acpi_MatchHid(handle, "PNP0100") || + acpi_MatchHid(handle, "PNP0103") || + acpi_MatchHid(handle, "PNP0B00")) + *order = 2; + else if (acpi_MatchHid(handle, "PNP0C09")) + *order = 3; + else if (acpi_MatchHid(handle, "PNP0C0F")) + *order = 4; } /* @@ -1889,7 +1895,7 @@ acpi_probe_child(ACPI_HANDLE handle, UIN * resources). */ ACPI_DEBUG_PRINT((ACPI_DB_OBJECTS, "scanning '%s'\n", handle_str)); - order = level * 10 + 100; + order = level * 10 + ACPI_DEV_BASE_ORDER; acpi_probe_order(handle, &order); child = BUS_ADD_CHILD(bus, order, NULL, -1); if (child == NULL) Modified: head/sys/dev/acpica/acpi_ec.c ============================================================================== --- head/sys/dev/acpica/acpi_ec.c Tue Feb 7 20:43:28 2012 (r231160) +++ head/sys/dev/acpica/acpi_ec.c Tue Feb 7 20:54:44 2012 (r231161) @@ -295,7 +295,7 @@ acpi_ec_ecdt_probe(device_t parent) } /* Create the child device with the given unit number. */ - child = BUS_ADD_CHILD(parent, 0, "acpi_ec", ecdt->Uid); + child = BUS_ADD_CHILD(parent, 3, "acpi_ec", ecdt->Uid); if (child == NULL) { printf("%s: can't add child\n", __func__); return; Modified: head/sys/dev/acpica/acpi_hpet.c ============================================================================== --- head/sys/dev/acpica/acpi_hpet.c Tue Feb 7 20:43:28 2012 (r231160) +++ head/sys/dev/acpica/acpi_hpet.c Tue Feb 7 20:54:44 2012 (r231161) @@ -342,7 +342,7 @@ hpet_identify(driver_t *driver, device_t if (found) continue; /* If not - create it from table info. */ - child = BUS_ADD_CHILD(parent, ACPI_DEV_BASE_ORDER, "hpet", 0); + child = BUS_ADD_CHILD(parent, 2, "hpet", 0); if (child == NULL) { printf("%s: can't add child\n", __func__); continue; Modified: head/sys/dev/acpica/acpi_timer.c ============================================================================== --- head/sys/dev/acpica/acpi_timer.c Tue Feb 7 20:43:28 2012 (r231160) +++ head/sys/dev/acpica/acpi_timer.c Tue Feb 7 20:54:44 2012 (r231161) @@ -124,7 +124,7 @@ acpi_timer_identify(driver_t *driver, de acpi_timer_dev) return_VOID; - if ((dev = BUS_ADD_CHILD(parent, 0, "acpi_timer", 0)) == NULL) { + if ((dev = BUS_ADD_CHILD(parent, 2, "acpi_timer", 0)) == NULL) { device_printf(parent, "could not add acpi_timer0\n"); return_VOID; } Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Tue Feb 7 20:43:28 2012 (r231160) +++ head/sys/dev/acpica/acpivar.h Tue Feb 7 20:54:44 2012 (r231161) @@ -473,7 +473,7 @@ ACPI_HANDLE acpi_GetReference(ACPI_HANDL * probe order sorted so that things like sysresource are available before * their children need them. */ -#define ACPI_DEV_BASE_ORDER 10 +#define ACPI_DEV_BASE_ORDER 100 /* Default maximum number of tasks to enqueue. */ #ifndef ACPI_MAX_TASKS From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 21:46:24 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D6B81065674; Tue, 7 Feb 2012 21:46:24 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mail.vx.sk (mail.vx.sk [IPv6:2a01:4f8:150:6101::4]) by mx1.freebsd.org (Postfix) with ESMTP id C94528FC17; Tue, 7 Feb 2012 21:46:23 +0000 (UTC) Received: from core2.vx.sk (localhost [127.0.0.2]) by mail.vx.sk (Postfix) with ESMTP id 013412115F; Tue, 7 Feb 2012 22:46:23 +0100 (CET) X-Virus-Scanned: amavisd-new at mail.vx.sk Received: from mail.vx.sk by core2.vx.sk (amavisd-new, unix socket) with LMTP id m8vzJsWmxzWT; Tue, 7 Feb 2012 22:46:20 +0100 (CET) Received: from [10.9.8.1] (188-167-78-15.dynamic.chello.sk [188.167.78.15]) by mail.vx.sk (Postfix) with ESMTPSA id 416ED21159; Tue, 7 Feb 2012 22:46:20 +0100 (CET) Message-ID: <4F319BAB.30802@FreeBSD.org> Date: Tue, 07 Feb 2012 22:46:19 +0100 From: Martin Matuska User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20120130 Thunderbird/10.0 MIME-Version: 1.0 To: Andriy Gapon References: <201202071835.q17IZIQe002063@svn.freebsd.org> <4F318370.4060500@FreeBSD.org> In-Reply-To: <4F318370.4060500@FreeBSD.org> X-Enigmail-Version: 1.3.5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r231144 - head/cddl/contrib/opensolaris/cmd/zfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 21:46:24 -0000 Dňa 7.2.2012 21:02, Andriy Gapon wrote / napísal(a): > on 07/02/2012 20:35 Martin Matuska said the following: >> Author: mm >> Date: Tue Feb 7 18:35:18 2012 >> New Revision: 231144 >> URL: http://svn.freebsd.org/changeset/base/231144 >> >> Log: >> Merge illumos revision 13594: >> >> uninitialized variables in zfs(8) may make snapshots undestroyable [1] >> >> References: >> https://www.illumos.org/issues/2067 [1] >> >> Obtained from: illumos (issue #2067) >> MFC after: 3 days > > PR 164802 seems to be related. Could you please take over it? PR taken over, state changed to patched. Thanks. From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 22:31:29 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 048C9106564A; Tue, 7 Feb 2012 22:31:29 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E79DC8FC1A; Tue, 7 Feb 2012 22:31:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q17MVSlK010459; Tue, 7 Feb 2012 22:31:28 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17MVSc6010455; Tue, 7 Feb 2012 22:31:28 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201202072231.q17MVSc6010455@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Tue, 7 Feb 2012 22:31:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231168 - head/sys/fs/ext2fs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 22:31:29 -0000 Author: pfg Date: Tue Feb 7 22:31:28 2012 New Revision: 231168 URL: http://svn.freebsd.org/changeset/base/231168 Log: Update the data structures with some fields reserved for ext4 but that can be used in ext3 mode. Also adjust the internal inode to carry the birthtime, like in UFS, which is starting to get some use when big inodes are available. Right now these are just placeholders for features to come. Approved by: jhb (mentor) MFC after: 2 weeks Modified: head/sys/fs/ext2fs/ext2_dinode.h head/sys/fs/ext2fs/ext2fs.h head/sys/fs/ext2fs/inode.h Modified: head/sys/fs/ext2fs/ext2_dinode.h ============================================================================== --- head/sys/fs/ext2fs/ext2_dinode.h Tue Feb 7 22:31:16 2012 (r231167) +++ head/sys/fs/ext2fs/ext2_dinode.h Tue Feb 7 22:31:28 2012 (r231168) @@ -70,7 +70,7 @@ struct ext2fs_dinode { uint16_t e2di_uid; /* 2: Owner UID */ uint32_t e2di_size; /* 4: Size (in bytes) */ uint32_t e2di_atime; /* 8: Access time */ - uint32_t e2di_ctime; /* 12: Create time */ + uint32_t e2di_ctime; /* 12: Change time */ uint32_t e2di_mtime; /* 16: Modification time */ uint32_t e2di_dtime; /* 20: Deletion time */ uint16_t e2di_gid; /* 24: Owner GID */ @@ -89,6 +89,8 @@ struct ext2fs_dinode { uint16_t e2di_uid_high; /* 120: Owner UID top 16 bits */ uint16_t e2di_gid_high; /* 122: Owner GID top 16 bits */ uint32_t e2di_linux_reserved3; /* 124 */ + uint16_t e2di_extra_isize; + uint16_t e2di_pad1; }; #endif /* !_FS_EXT2FS_EXT2_DINODE_H_ */ Modified: head/sys/fs/ext2fs/ext2fs.h ============================================================================== --- head/sys/fs/ext2fs/ext2fs.h Tue Feb 7 22:31:16 2012 (r231167) +++ head/sys/fs/ext2fs/ext2fs.h Tue Feb 7 22:31:28 2012 (r231168) @@ -123,7 +123,22 @@ struct ext2fs { char e3fs_reserved_char_pad; uint32_t e3fs_default_mount_opts; uint32_t e3fs_first_meta_bg; /* First metablock block group */ - uint32_t reserved2[190]; /* Padding to the end of the block */ + uint32_t e3fs_mkfs_time; /* when the fs was created */ + uint32_t e3fs_jnl_blks[17]; /* backup of the journal inode */ + uint32_t e4fs_bcount_hi; /* block count */ + uint32_t e4fs_rbcount_hi; /* reserved blocks count */ + uint32_t e4fs_fbcount_hi; /* free blocks count */ + uint16_t e4fs_min_extra_isize;/* all inodes have at least some bytes */ + uint16_t e4fs_want_extra_isize; /* new inodes should reserve some bytes */ + uint32_t e4fs_flags; /* miscellaneous flags */ + uint16_t e4fs_raid_stride; /* RAID stride */ + uint16_t e4fs_mmpintv; /* number of seconds to wait in MMP checking */ + uint64_t e4fs_mmpblk; /* block for multi-mount protection */ + uint32_t e4fs_raid_stripe_wid;/* blocks on all data disks (N * stride) */ + uint8_t e4fs_log_gpf; /* FLEX_BG group size */ + uint8_t e4fs_char_pad2; + uint16_t e4fs_pad; + uint32_t reserved2[162]; /* Padding to the end of the block */ }; @@ -139,15 +154,15 @@ struct m_ext2fs { uint32_t e2fs_bsize; /* Block size */ uint32_t e2fs_bshift; /* calc of logical block no */ int32_t e2fs_bmask; /* calc of block offset */ - int32_t e2fs_bpg; /* Number of blocks per group */ + int32_t e2fs_bpg; /* Number of blocks per group */ int64_t e2fs_qbmask; /* = s_blocksize -1 */ uint32_t e2fs_fsbtodb; /* Shift to get disk block */ - uint32_t e2fs_ipg; /* Number of inodes per group */ - uint32_t e2fs_ipb; /* Number of inodes per block */ + uint32_t e2fs_ipg; /* Number of inodes per group */ + uint32_t e2fs_ipb; /* Number of inodes per block */ uint32_t e2fs_itpg; /* Number of inode table per group */ uint32_t e2fs_fsize; /* Size of fragments per block */ - uint32_t e2fs_fpb; /* Number of fragments per block */ - uint32_t e2fs_fpg; /* Number of fragments per group */ + uint32_t e2fs_fpb; /* Number of fragments per block */ + uint32_t e2fs_fpg; /* Number of fragments per group */ uint32_t e2fs_dbpg; /* Number of descriptor blocks per group */ uint32_t e2fs_descpb; /* Number of group descriptors per block */ uint32_t e2fs_gdbcount; /* Number of group descriptors */ @@ -161,7 +176,7 @@ struct m_ext2fs { char e2fs_wasvalid; /* valid at mount time */ off_t e2fs_maxfilesize; struct ext2_gd *e2fs_gd; /* Group Descriptors */ - int32_t e2fs_maxcontig; /* max number of contiguous blks */ + int32_t e2fs_maxcontig; /* max number of contiguous blks */ int32_t e2fs_contigsumsize; /* size of cluster summary array */ int32_t *e2fs_maxcluster; /* max cluster in each cyl group */ struct csum *e2fs_clustersum; /* cluster summary in each cyl group */ Modified: head/sys/fs/ext2fs/inode.h ============================================================================== --- head/sys/fs/ext2fs/inode.h Tue Feb 7 22:31:16 2012 (r231167) +++ head/sys/fs/ext2fs/inode.h Tue Feb 7 22:31:28 2012 (r231168) @@ -85,11 +85,13 @@ struct inode { int16_t i_nlink; /* File link count. */ uint64_t i_size; /* File byte count. */ int32_t i_atime; /* Last access time. */ - int32_t i_atimensec; /* Last access time. */ int32_t i_mtime; /* Last modified time. */ - int32_t i_mtimensec; /* Last modified time. */ int32_t i_ctime; /* Last inode change time. */ + int32_t i_birthtime; /* Inode creation time. */ + int32_t i_mtimensec; /* Last modified time. */ + int32_t i_atimensec; /* Last access time. */ int32_t i_ctimensec; /* Last inode change time. */ + int32_t i_birthnsec; /* Inode creation time. */ int32_t i_db[NDADDR]; /* Direct disk blocks. */ int32_t i_ib[NIADDR]; /* Indirect disk blocks. */ uint32_t i_flags; /* Status flags (chflags). */ From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 23:24:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4200A1065687; Tue, 7 Feb 2012 23:24:30 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3151E8FC0C; Tue, 7 Feb 2012 23:24:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q17NOUeE012128; Tue, 7 Feb 2012 23:24:30 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17NOT0i012126; Tue, 7 Feb 2012 23:24:29 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202072324.q17NOT0i012126@svn.freebsd.org> From: Jung-uk Kim Date: Tue, 7 Feb 2012 23:24:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231169 - head/sys/amd64/amd64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 23:24:30 -0000 Author: jkim Date: Tue Feb 7 23:24:29 2012 New Revision: 231169 URL: http://svn.freebsd.org/changeset/base/231169 Log: Do not EOI local APIC too early. Just do doreti normally after resuming. Modified: head/sys/amd64/amd64/apic_vector.S Modified: head/sys/amd64/amd64/apic_vector.S ============================================================================== --- head/sys/amd64/amd64/apic_vector.S Tue Feb 7 22:31:28 2012 (r231168) +++ head/sys/amd64/amd64/apic_vector.S Tue Feb 7 23:24:29 2012 (r231169) @@ -300,13 +300,10 @@ IDTVEC(cpustop) IDTVEC(cpususpend) PUSH_FRAME + call cpususpend_handler movq lapic, %rax movl $0, LA_EOI(%rax) /* End Of Interrupt to APIC */ - - call cpususpend_handler - - POP_FRAME - jmp doreti_iret + jmp doreti /* * Executed by a CPU when it receives a RENDEZVOUS IPI from another CPU. From owner-svn-src-head@FreeBSD.ORG Tue Feb 7 23:43:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9A0551065672; Tue, 7 Feb 2012 23:43:30 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D9788FC0A; Tue, 7 Feb 2012 23:43:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q17NhUvd012705; Tue, 7 Feb 2012 23:43:30 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q17NhUpY012703; Tue, 7 Feb 2012 23:43:30 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201202072343.q17NhUpY012703@svn.freebsd.org> From: "Kenneth D. Merry" Date: Tue, 7 Feb 2012 23:43:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231170 - head/share/man/man4 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Feb 2012 23:43:30 -0000 Author: ken Date: Tue Feb 7 23:43:29 2012 New Revision: 231170 URL: http://svn.freebsd.org/changeset/base/231170 Log: Update the mps(4) man page for the changes in the new LSI-supported driver. This should have been included in change 230592. The supported hardware section still needs some updating to reflect the current reality. MFC after: 3 days Modified: head/share/man/man4/mps.4 Modified: head/share/man/man4/mps.4 ============================================================================== --- head/share/man/man4/mps.4 Tue Feb 7 23:24:29 2012 (r231169) +++ head/share/man/man4/mps.4 Tue Feb 7 23:43:29 2012 (r231170) @@ -31,10 +31,10 @@ .\" .\" Author: Ken Merry .\" -.\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#4 $ +.\" $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#6 $ .\" $FreeBSD$ .\" -.Dd September 13, 2010 +.Dd February 7, 2012 .Dt MPS 4 .Os .Sh NAME @@ -58,7 +58,7 @@ The .Nm driver provides support for LSI Logic Fusion-MPT 2 .Tn SAS -controllers. +controllers and WarpDrive solid state storage cards. .Sh HARDWARE The .Nm @@ -90,6 +90,16 @@ driver instances, set the following tuna hw.mps.disable_msi=1 .Ed .Pp +To disable MSI interrupts for a specific +.Nm +driver instance, set the following tunable value in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dev.mps.X.disable_msi=1 +.Ed +.Pp +where X is the adapter number. +.Pp To disable MSI-X interrupts for all .Nm driver instances, set the following tunable value in @@ -98,19 +108,51 @@ driver instances, set the following tuna hw.mps.disable_msix=1 .Ed .Pp -To allow the driver to send multiple task management commands (like abort, -LUN reset, etc.), set the following variable: +To disable MSI-X interrupts for a specific +.Nm +driver instance, set the following tunable value in +.Xr loader.conf 5 : .Bd -literal -offset indent -hw.mps.X.allow_multiple_tm_cmds=1 +dev.mps.X.disable_msix=1 .Ed .Pp -via -.Xr loader.conf 5 -or -.Xr sysctl 8 , -where X is the adapter number. -By default the driver only sends one task management command at a time, to -avoid causing a potential controller lock-up. +To set the maximum number of DMA chains allocated for all adapters, +set the following variable in +.Xr loader.conf 5 : +.Bd -literal -offset indent +hw.mps.max_chains=NNNN +.Ed +.Pp +To set the maximum number of DMA chains allocated for a specific adapter, +set the following variable in +.Xr loader.conf 5 : +.Bd -literal -offset indent +dev.mps.X.max_chains=NNNN +.Ed +.Pp +This variable may also be viewed via +.Xr sysctl 8 +to see the maximum set for a given adapter. +.Pp +The current number of free chain frames may be seen via the +dev.mps.X.chain_free +.Xr sysctl 8 +variable. +.Pp +The lowest number of free chain frames may be seen via the +dev.mps.X.chain_free_lowwater +.Xr sysctl 8 +variable. +.Pp +The current number of active I/O commands is shown in the +dev.mps.X.io_cmds_active +.Xr sysctl 8 +variable. +.Pp +The maximum number of active I/O command seen since boot is shown in the +dev.mps.X.io_cmds_highwater +.Xr sysctl 8 +variable. .Sh DEBUGGING To enable debugging prints from the .Nm @@ -142,7 +184,9 @@ Enable prints for controller events. .Xr pci 4 , .Xr sa 4 , .Xr scsi 4 , -.Xr targ 4 +.Xr targ 4 , +.Xr loader.conf 5 , +.Xr sysctl 8 .Sh HISTORY The .Nm @@ -154,20 +198,19 @@ The .Nm driver was originally written by .An Scott Long Aq scottl@FreeBSD.org . +It has been improved and tested by LSI Logic Corporation. This man page was written by .An Ken Merry Aq ken@FreeBSD.org . .Sh BUGS -This driver is still in development, it has only been tested on the amd64 -architecture and has some known shortcomings: +This driver has a couple of known shortcomings: .Bl -bullet -compact .It -No IR (Integrated RAID) support. +Not endian safe. +It only works on little endian machines (e.g. amd64 and i386). .It -No userland utility support (e.g. -.Xr mptutil 8). -.It -Sometimes the driver gets into a state where devices arrive and depart multiple -times, without user intervention. +No userland utility available (e.g. +.Xr mptutil 8) .It -The error recovery code isn't complete. +The driver probes devices sequentially. +If your system has a large number of devices, the probe will take a while. .El From owner-svn-src-head@FreeBSD.ORG Wed Feb 8 00:08:22 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 15D96106567E; Wed, 8 Feb 2012 00:08:22 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 9502C8FC0A; Wed, 8 Feb 2012 00:08:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1808LMM013497; Wed, 8 Feb 2012 00:08:21 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1808LlN013493; Wed, 8 Feb 2012 00:08:21 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201202080008.q1808LlN013493@svn.freebsd.org> From: Glen Barber Date: Wed, 8 Feb 2012 00:08:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231171 - in head: etc/defaults etc/periodic/daily share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 00:08:22 -0000 Author: gjb (doc committer) Date: Wed Feb 8 00:08:21 2012 New Revision: 231171 URL: http://svn.freebsd.org/changeset/base/231171 Log: Add an option to 404.status-zfs (enabled by default) to list all zfs pools on the system. While here, document daily_status_zfs_enable in periodic.conf(5). Discussed on: -fs [1] Reviewed by: netchild [1] Approved by: jhb MFC after: 1 week [1] - http://lists.freebsd.org/pipermail/freebsd-fs/2011-June/011869.html Modified: head/etc/defaults/periodic.conf head/etc/periodic/daily/404.status-zfs head/share/man/man5/periodic.conf.5 Modified: head/etc/defaults/periodic.conf ============================================================================== --- head/etc/defaults/periodic.conf Tue Feb 7 23:43:29 2012 (r231170) +++ head/etc/defaults/periodic.conf Wed Feb 8 00:08:21 2012 (r231171) @@ -96,6 +96,7 @@ daily_status_disks_df_flags="-l -h" # d # 404.status-zfs daily_status_zfs_enable="NO" # Check ZFS +daily_status_zfs_zpool_list_enable="YES" # List ZFS pools # 405.status-ata_raid daily_status_ata_raid_enable="NO" # Check ATA raid status Modified: head/etc/periodic/daily/404.status-zfs ============================================================================== --- head/etc/periodic/daily/404.status-zfs Tue Feb 7 23:43:29 2012 (r231170) +++ head/etc/periodic/daily/404.status-zfs Wed Feb 8 00:08:21 2012 (r231171) @@ -16,12 +16,21 @@ case "$daily_status_zfs_enable" in echo echo 'Checking status of zfs pools:' - out=`zpool status -x` - echo "$out" + case "$daily_status_zfs_zpool_list_enable" in + [Yy][Ee][Ss]) + lout=`zpool list` + echo "$lout" + echo + ;; + *) + ;; + esac + sout=`zpool status -x` + echo "$sout" # zpool status -x always exits with 0, so we have to interpret its # output to see what's going on. - if [ "$out" = "all pools are healthy" \ - -o "$out" = "no pools available" ]; then + if [ "$sout" = "all pools are healthy" \ + -o "$sout" = "no pools available" ]; then rc=0 else rc=1 Modified: head/share/man/man5/periodic.conf.5 ============================================================================== --- head/share/man/man5/periodic.conf.5 Tue Feb 7 23:43:29 2012 (r231170) +++ head/share/man/man5/periodic.conf.5 Wed Feb 8 00:08:21 2012 (r231171) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 8, 2011 +.Dd February 7, 2012 .Dt PERIODIC.CONF 5 .Os .Sh NAME @@ -335,6 +335,28 @@ utility when .Va daily_status_disks_enable is set to .Dq Li YES . +.It Va daily_status_zfs_enable +.Pq Vt bool +Set to +.Dq Li YES +if you want to run +.Nm zpool Cm status +on your +.Xr zfs 8 +pools. +.It Va daily_status_zfs_zpool_list_enable +.Pq Vt bool +Set to +.Dq Li YES +if you want to run +.Nm zpool Cm list +on your +.Xr zfs 8 +pools. +Requires +.Va daily_status_zfs_enable +to be set to +.Li YES . .It Va daily_status_ata_raid_enable .Pq Vt bool Set to From owner-svn-src-head@FreeBSD.ORG Wed Feb 8 00:36:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFFBC106567B; Wed, 8 Feb 2012 00:36:36 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C4F618FC14; Wed, 8 Feb 2012 00:36:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q180aaX1014446; Wed, 8 Feb 2012 00:36:36 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q180aale014444; Wed, 8 Feb 2012 00:36:36 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202080036.q180aale014444@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 8 Feb 2012 00:36:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231172 - head/sys/dev/cxgbe X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 00:36:37 -0000 Author: np Date: Wed Feb 8 00:36:36 2012 New Revision: 231172 URL: http://svn.freebsd.org/changeset/base/231172 Log: Program the MAC exact match table in batches of 7 addresses at a time when possible. This is more efficient than one at a time. Submitted by: gnn MFC after: 3 days Modified: head/sys/dev/cxgbe/t4_main.c Modified: head/sys/dev/cxgbe/t4_main.c ============================================================================== --- head/sys/dev/cxgbe/t4_main.c Wed Feb 8 00:08:21 2012 (r231171) +++ head/sys/dev/cxgbe/t4_main.c Wed Feb 8 00:36:36 2012 (r231172) @@ -2013,6 +2013,8 @@ build_medialist(struct port_info *pi) PORT_UNLOCK(pi); } +#define FW_MAC_EXACT_CHUNK 7 + /* * Program the port's XGMAC based on parameters in ifnet. The caller also * indicates which parameters should be programmed (the rest are left alone). @@ -2064,28 +2066,57 @@ update_mac_settings(struct port_info *pi } if (flags & XGMAC_MCADDRS) { - const uint8_t *mcaddr; + const uint8_t *mcaddr[FW_MAC_EXACT_CHUNK]; int del = 1; uint64_t hash = 0; struct ifmultiaddr *ifma; + int i = 0, j; if_maddr_rlock(ifp); TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { - if (ifma->ifma_addr->sa_family != AF_LINK) + if (ifma->ifma_addr->sa_family == AF_LINK) continue; - mcaddr = LLADDR((struct sockaddr_dl *)ifma->ifma_addr); + mcaddr[i++] = + LLADDR((struct sockaddr_dl *)ifma->ifma_addr); - rc = t4_alloc_mac_filt(sc, sc->mbox, pi->viid, del, 1, - &mcaddr, NULL, &hash, 0); + if (i == FW_MAC_EXACT_CHUNK) { + rc = t4_alloc_mac_filt(sc, sc->mbox, pi->viid, + del, i, mcaddr, NULL, &hash, 0); + if (rc < 0) { + rc = -rc; + for (j = 0; j < i; j++) { + if_printf(ifp, + "failed to add mc address" + " %02x:%02x:%02x:" + "%02x:%02x:%02x rc=%d\n", + mcaddr[j][0], mcaddr[j][1], + mcaddr[j][2], mcaddr[j][3], + mcaddr[j][4], mcaddr[j][5], + rc); + } + goto mcfail; + } + del = 0; + i = 0; + } + } + if (i > 0) { + rc = t4_alloc_mac_filt(sc, sc->mbox, pi->viid, + del, i, mcaddr, NULL, &hash, 0); if (rc < 0) { rc = -rc; - if_printf(ifp, "failed to add mc address" - " %02x:%02x:%02x:%02x:%02x:%02x rc=%d\n", - mcaddr[0], mcaddr[1], mcaddr[2], mcaddr[3], - mcaddr[4], mcaddr[5], rc); + for (j = 0; j < i; j++) { + if_printf(ifp, + "failed to add mc address" + " %02x:%02x:%02x:" + "%02x:%02x:%02x rc=%d\n", + mcaddr[j][0], mcaddr[j][1], + mcaddr[j][2], mcaddr[j][3], + mcaddr[j][4], mcaddr[j][5], + rc); + } goto mcfail; } - del = 0; } rc = -t4_set_addr_hash(sc, sc->mbox, pi->viid, 0, hash, 0); From owner-svn-src-head@FreeBSD.ORG Wed Feb 8 03:02:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F15CB106571E; Wed, 8 Feb 2012 03:02:12 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DCCEC8FC0A; Wed, 8 Feb 2012 03:02:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1832CoR019078; Wed, 8 Feb 2012 03:02:12 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1832CGE019076; Wed, 8 Feb 2012 03:02:12 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202080302.q1832CGE019076@svn.freebsd.org> From: Navdeep Parhar Date: Wed, 8 Feb 2012 03:02:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231175 - head/sys/dev/cxgb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 03:02:13 -0000 Author: np Date: Wed Feb 8 03:02:12 2012 New Revision: 231175 URL: http://svn.freebsd.org/changeset/base/231175 Log: Allocate the BAR for userspace doorbells after the is_offload check is functional. MFC after: 3 days Modified: head/sys/dev/cxgb/cxgb_main.c Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Wed Feb 8 02:15:59 2012 (r231174) +++ head/sys/dev/cxgb/cxgb_main.c Wed Feb 8 03:02:12 2012 (r231175) @@ -473,15 +473,6 @@ cxgb_controller_attach(device_t dev) device_printf(dev, "Cannot allocate BAR region 0\n"); return (ENXIO); } - sc->udbs_rid = PCIR_BAR(2); - sc->udbs_res = NULL; - if (is_offload(sc) && - ((sc->udbs_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, - &sc->udbs_rid, RF_ACTIVE)) == NULL)) { - device_printf(dev, "Cannot allocate BAR region 1\n"); - error = ENXIO; - goto out; - } snprintf(sc->lockbuf, ADAPTER_LOCK_NAME_LEN, "cxgb controller lock %d", device_get_unit(dev)); @@ -510,6 +501,17 @@ cxgb_controller_attach(device_t dev) error = ENODEV; goto out; } + + sc->udbs_rid = PCIR_BAR(2); + sc->udbs_res = NULL; + if (is_offload(sc) && + ((sc->udbs_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, + &sc->udbs_rid, RF_ACTIVE)) == NULL)) { + device_printf(dev, "Cannot allocate BAR region 1\n"); + error = ENXIO; + goto out; + } + /* Allocate the BAR for doing MSI-X. If it succeeds, try to allocate * enough messages for the queue sets. If that fails, try falling * back to MSI. If that fails, then try falling back to the legacy From owner-svn-src-head@FreeBSD.ORG Wed Feb 8 04:05:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9540E1065713; Wed, 8 Feb 2012 04:05:38 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 800558FC15; Wed, 8 Feb 2012 04:05:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1845c7J021232; Wed, 8 Feb 2012 04:05:38 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1845cMe021230; Wed, 8 Feb 2012 04:05:38 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201202080405.q1845cMe021230@svn.freebsd.org> From: Marcel Moolenaar Date: Wed, 8 Feb 2012 04:05:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231177 - head/sys/ia64/ia64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 04:05:38 -0000 Author: marcel Date: Wed Feb 8 04:05:38 2012 New Revision: 231177 URL: http://svn.freebsd.org/changeset/base/231177 Log: Rev. 228360 moved the call to cpu_set_upcall() to happen before td_proc gets initialized in td (=newtd). Use td0 instead. MFC after: 3 days Modified: head/sys/ia64/ia64/vm_machdep.c Modified: head/sys/ia64/ia64/vm_machdep.c ============================================================================== --- head/sys/ia64/ia64/vm_machdep.c Wed Feb 8 03:16:29 2012 (r231176) +++ head/sys/ia64/ia64/vm_machdep.c Wed Feb 8 04:05:38 2012 (r231177) @@ -192,7 +192,7 @@ cpu_set_upcall(struct thread *td, struct bcopy(td0->td_pcb, pcb, sizeof(*pcb)); pcb->pcb_special.bspstore = td->td_kstack; pcb->pcb_special.pfs = 0; - pcb->pcb_current_pmap = vmspace_pmap(td->td_proc->p_vmspace); + pcb->pcb_current_pmap = vmspace_pmap(td0->td_proc->p_vmspace); pcb->pcb_special.sp = (uintptr_t)tf - 16; pcb->pcb_special.rp = FDESC_FUNC(fork_trampoline); cpu_set_fork_handler(td, (void (*)(void*))fork_return, td); From owner-svn-src-head@FreeBSD.ORG Wed Feb 8 05:03:05 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 053D310656B8; Wed, 8 Feb 2012 05:03:05 +0000 (UTC) (envelope-from wollman@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E44298FC08; Wed, 8 Feb 2012 05:03:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q18534at023278; Wed, 8 Feb 2012 05:03:04 GMT (envelope-from wollman@svn.freebsd.org) Received: (from wollman@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18534fK023276; Wed, 8 Feb 2012 05:03:04 GMT (envelope-from wollman@svn.freebsd.org) Message-Id: <201202080503.q18534fK023276@svn.freebsd.org> From: Garrett Wollman Date: Wed, 8 Feb 2012 05:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231181 - head/usr.sbin/tzsetup X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 05:03:05 -0000 Author: wollman Date: Wed Feb 8 05:03:04 2012 New Revision: 231181 URL: http://svn.freebsd.org/changeset/base/231181 Log: It's not an error if unlink(2) fails because the pathname doesn't exist. Noticed by: kevlo Pointy hat to: wollman Modified: head/usr.sbin/tzsetup/tzsetup.c Modified: head/usr.sbin/tzsetup/tzsetup.c ============================================================================== --- head/usr.sbin/tzsetup/tzsetup.c Wed Feb 8 04:55:00 2012 (r231180) +++ head/usr.sbin/tzsetup/tzsetup.c Wed Feb 8 05:03:04 2012 (r231181) @@ -723,7 +723,7 @@ install_zoneinfo_file(const char *zonein return (DITEM_FAILURE | DITEM_RECREATE); } - if (unlink(path_localtime) < 0) { + if (unlink(path_localtime) < 0 && errno != ENOENT) { snprintf(prompt, sizeof(prompt), "Could not unlink %s: %s", path_localtime, strerror(errno)); @@ -780,7 +780,7 @@ install_zoneinfo_file(const char *zonein fprintf(stderr, "%s\n", prompt); return (DITEM_FAILURE | DITEM_RECREATE); } - if (unlink(path_localtime) < 0) { + if (unlink(path_localtime) < 0 && errno != ENOENT) { snprintf(prompt, sizeof(prompt), "Could not unlink %s: %s", path_localtime, strerror(errno)); From owner-svn-src-head@FreeBSD.ORG Wed Feb 8 06:56:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DC14106566C; Wed, 8 Feb 2012 06:56:20 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F2578FC15; Wed, 8 Feb 2012 06:56:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q186uKkr027054; Wed, 8 Feb 2012 06:56:20 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q186uK80027052; Wed, 8 Feb 2012 06:56:20 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202080656.q186uK80027052@svn.freebsd.org> From: Adrian Chadd Date: Wed, 8 Feb 2012 06:56:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231187 - head/sys/net80211 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 06:56:20 -0000 Author: adrian Date: Wed Feb 8 06:56:19 2012 New Revision: 231187 URL: http://svn.freebsd.org/changeset/base/231187 Log: Update the 802.11s IE numbers to represent the latest 802.11 amendment standard. Submitted by: monthadar@gmail.com Reviewed by: rpaulo Modified: head/sys/net80211/ieee80211.h Modified: head/sys/net80211/ieee80211.h ============================================================================== --- head/sys/net80211/ieee80211.h Wed Feb 8 06:55:22 2012 (r231186) +++ head/sys/net80211/ieee80211.h Wed Feb 8 06:56:19 2012 (r231187) @@ -709,27 +709,32 @@ enum { IEEE80211_ELEMID_VENDOR = 221, /* vendor private */ /* - * 802.11s IEs based on D3.03 spec and were not assigned by - * ANA. Beware changing them because some of them are being - * kept compatible with Linux. + * 802.11s IEs + * NB: On vanilla Linux still IEEE80211_ELEMID_MESHPEER = 55, + * but they defined a new with id 117 called PEER_MGMT. + * NB: complies with open80211 */ - IEEE80211_ELEMID_MESHCONF = 51, - IEEE80211_ELEMID_MESHID = 52, - IEEE80211_ELEMID_MESHLINK = 35, - IEEE80211_ELEMID_MESHCNGST = 36, - IEEE80211_ELEMID_MESHPEER = 55, - IEEE80211_ELEMID_MESHCSA = 38, - IEEE80211_ELEMID_MESHTIM = 39, - IEEE80211_ELEMID_MESHAWAKEW = 40, - IEEE80211_ELEMID_MESHBEACONT = 41, - IEEE80211_ELEMID_MESHPANN = 48, - IEEE80211_ELEMID_MESHRANN = 49, - IEEE80211_ELEMID_MESHPREQ = 68, - IEEE80211_ELEMID_MESHPREP = 69, - IEEE80211_ELEMID_MESHPERR = 70, - IEEE80211_ELEMID_MESHPXU = 53, - IEEE80211_ELEMID_MESHPXUC = 54, - IEEE80211_ELEMID_MESHAH = 60, /* Abbreviated Handshake */ + IEEE80211_ELEMID_MESHCONF = 113, + IEEE80211_ELEMID_MESHID = 114, + IEEE80211_ELEMID_MESHLINK = 115, + IEEE80211_ELEMID_MESHCNGST = 116, + IEEE80211_ELEMID_MESHPEER = 117, + IEEE80211_ELEMID_MESHCSA = 118, + IEEE80211_ELEMID_MESHTIM = 39, /* XXX: remove */ + IEEE80211_ELEMID_MESHAWAKEW = 119, + IEEE80211_ELEMID_MESHBEACONT = 120, + /* 121-124 MMCAOP not implemented yet */ + IEEE80211_ELEMID_MESHPANN = 125, /* XXX: is GANN now, not used */ + IEEE80211_ELEMID_MESHRANN = 126, + /* 127 Extended Capabilities */ + /* 128-129 reserved */ + IEEE80211_ELEMID_MESHPREQ = 130, + IEEE80211_ELEMID_MESHPREP = 131, + IEEE80211_ELEMID_MESHPERR = 132, + /* 133-136 reserved */ + IEEE80211_ELEMID_MESHPXU = 137, + IEEE80211_ELEMID_MESHPXUC = 138, + IEEE80211_ELEMID_MESHAH = 60, /* XXX: remove */ }; struct ieee80211_tim_ie { From owner-svn-src-head@FreeBSD.ORG Wed Feb 8 08:32:49 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3971A106566C; Wed, 8 Feb 2012 08:32:49 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id 082428FC08; Wed, 8 Feb 2012 08:32:47 +0000 (UTC) Received: by eaan10 with SMTP id n10so106281eaa.13 for ; Wed, 08 Feb 2012 00:32:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:organization:references:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=DyZ86sHXu14jIrCZAqMYj7T4wZb/K/n/BKLvL1lbAV0=; b=Rv1CjnldyTzUj467EOb1FaV9LdlnOdOgyNFITQYd7Sl5N+tFdqnsmW3nuf/mgDSBI5 1sqpt1gKl/D242+NtdE5uuTXvsdKVZUC30UdwLzkLPNPL/RJX5BpDZiJkBqcq4fUnFde sxPlw6l9AYvxKgcRP4TOhN4gey6KJNIc7GchM= Received: by 10.14.23.201 with SMTP id v49mr5175027eev.92.1328689967148; Wed, 08 Feb 2012 00:32:47 -0800 (PST) Received: from localhost ([94.27.39.186]) by mx.google.com with ESMTPS id n56sm2734810eeh.6.2012.02.08.00.32.43 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 08 Feb 2012 00:32:45 -0800 (PST) From: Mikolaj Golub To: Pawel Jakub Dawidek Organization: TOA Ukraine References: <20120204074201.GA1694@garage.freebsd.pl> <4F2CEB1D.10607@zonov.org> <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> <20120206082706.GA1324@garage.freebsd.pl> <86wr7zmy8f.fsf@kopusha.home.net> <20120206221742.GA1336@garage.freebsd.pl> Sender: Mikolaj Golub Date: Wed, 08 Feb 2012 10:32:41 +0200 In-Reply-To: <20120206221742.GA1336@garage.freebsd.pl> (Pawel Jakub Dawidek's message of "Mon, 6 Feb 2012 23:17:43 +0100") Message-ID: <86liodu3me.fsf@in138.ua3> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 08:32:49 -0000 --=-=-= On Mon, 6 Feb 2012 23:17:43 +0100 Pawel Jakub Dawidek wrote: PJD> On Mon, Feb 06, 2012 at 11:46:24PM +0200, Mikolaj Golub wrote: >> Thanks. The updated version is attached. PJD> Looks good to me. Thanks. But I still think that adding some signal handling is a good idea. I agree that there may be no sense in trying to handle many different signals, but handling SIGTERM (software termination signal :-) nicely looks like a good thing. This would solve problems like stale pid files after shutdown or orphaned programs (again with stale pid files and a possibility to start another instance) due to a user mistakenly terminated the supervising daemons. Also it is possible then to add "automatic restart" option, as Andrey has proposed. Here is the patch that does it. It also change proctitle to make identifying a a supervisor with its charge. On the other hand not being an active user of daemon(8) utility, I don't have a strong opinion and would like to see what other people, especially those who use it, think about this. A technical question concerning the patch :-). Does sombody know if sigwaitinfo() may be interrupted in my case and I should check for EINTR, as I do in the patch? -- Mikolaj Golub --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=daemon.c.3.patch Index: usr.sbin/daemon/daemon.c =================================================================== --- usr.sbin/daemon/daemon.c (revision 231014) +++ usr.sbin/daemon/daemon.c (working copy) @@ -32,30 +32,36 @@ __FBSDID("$FreeBSD$"); #include +#include #include #include -#include #include #include +#include +#include #include #include #include +static void dummy_sighandler(int); static void restrict_process(const char *); +static int wait_child(pid_t, sigset_t *); static void usage(void); int main(int argc, char *argv[]) { struct pidfh *pfh = NULL; - int ch, nochdir, noclose, errcode; + sigset_t mask, oldmask; + int ch, nochdir, noclose, restart; const char *pidfile, *user; - pid_t otherpid; + pid_t otherpid, pid; nochdir = noclose = 1; + restart = 0; pidfile = user = NULL; - while ((ch = getopt(argc, argv, "-cfp:u:")) != -1) { + while ((ch = getopt(argc, argv, "-cfp:ru:")) != -1) { switch (ch) { case 'c': nochdir = 0; @@ -66,6 +72,9 @@ main(int argc, char *argv[]) case 'p': pidfile = optarg; break; + case 'r': + restart = 1; + break; case 'u': user = optarg; break; @@ -79,14 +88,12 @@ main(int argc, char *argv[]) if (argc == 0) usage(); - if (user != NULL) - restrict_process(user); - + pfh = NULL; /* * Try to open the pidfile before calling daemon(3), * to be able to report the error intelligently */ - if (pidfile) { + if (pidfile != NULL) { pfh = pidfile_open(pidfile, 0600, &otherpid); if (pfh == NULL) { if (errno == EEXIST) { @@ -99,26 +106,83 @@ main(int argc, char *argv[]) if (daemon(nochdir, noclose) == -1) err(1, NULL); + /* + * If pidfile or restart option is specified the daemon + * executes the command in a forked process and wait on child + * exit to remove the pidfile or restart the command. + * Normally we don't want the monitoring daemon to be + * terminated leaving the running process and the stale + * pidfile, so we catch SIGTERM and pass it to the children + * expecting to get SIGCHLD eventually. + */ + pid = -1; + if (pidfile != NULL || restart) { + /* + * Restore default action for SIGTERM in case the + * parent process decided to ignore it. + */ + if (signal(SIGTERM, SIG_DFL) == SIG_ERR) + err(1, "signal"); + /* + * Because SIGCHLD is ignored by default, setup dummy handler + * for it, so we can mask it. + */ + if (signal(SIGCHLD, dummy_sighandler) == SIG_ERR) + err(1, "signal"); + /* + * Block interesting signals. + */ + sigemptyset(&mask); + sigaddset(&mask, SIGTERM); + sigaddset(&mask, SIGCHLD); + if (sigprocmask(SIG_SETMASK, &mask, &oldmask) == -1) + err(1, "sigprocmask"); +restart: + /* + * Spawn a child to exec the command, so in the parent + * we could wait for it to exit and remove pidfile. + */ + pid = fork(); + if (pid == -1) { + pidfile_remove(pfh); + err(1, "fork"); + } + } + if (pid <= 0) { + if (pid == 0) { + /* Restore old sigmask in the child. */ + if (sigprocmask(SIG_SETMASK, &oldmask, NULL) == -1) + err(1, "sigprocmask"); + } - /* Now that we are the child, write out the pid */ - if (pidfile) + /* Now that we are the child, write out the pid. */ pidfile_write(pfh); - execvp(argv[0], argv); + if (user != NULL) + restrict_process(user); - /* - * execvp() failed -- unlink pidfile if any, and - * report the error - */ - errcode = errno; /* Preserve errcode -- unlink may reset it */ - if (pidfile) - pidfile_remove(pfh); + execvp(argv[0], argv); - /* The child is now running, so the exit status doesn't matter. */ - errc(1, errcode, "%s", argv[0]); + /* + * execvp() failed -- report the error. The child is + * now running, so the exit status doesn't matter. + */ + err(1, "%s", argv[0]); + } + setproctitle("%s[%d]", argv[0], pid); + if (wait_child(pid, &mask) == 0 && restart) + goto restart; + pidfile_remove(pfh); + exit(0); /* Exit status does not matter. */ } static void +dummy_sighandler(int sig __unused) +{ + /* Nothing to do. */ +} + +static void restrict_process(const char *user) { struct passwd *pw = NULL; @@ -131,11 +195,42 @@ restrict_process(const char *user) errx(1, "failed to set user environment"); } +static int +wait_child(pid_t pid, sigset_t *mask) +{ + int terminate; + int signo; + + terminate = 0; + for (;;) { + signo = sigwaitinfo(mask, NULL); + switch (signo) { + case SIGCHLD: + return terminate; + case SIGTERM: + terminate = 1; + if (kill(pid, signo) == -1) { + warn("kill"); + return -1; + } + continue; + case -1: + if (errno == EINTR) + continue; + warn("sigwaitinfo"); + return -1; + default: + warnx("sigwaitinfo: invalid signal: %d", signo); + return -1; + } + } +} + static void usage(void) { (void)fprintf(stderr, - "usage: daemon [-cf] [-p pidfile] [-u user] command " + "usage: daemon [-cfr] [-p pidfile] [-u user] command " "arguments ...\n"); exit(1); } --=-=-=-- From owner-svn-src-head@FreeBSD.ORG Wed Feb 8 08:42:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 669EE106566B; Wed, 8 Feb 2012 08:42:18 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3799D8FC13; Wed, 8 Feb 2012 08:42:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q188gIZ3030566; Wed, 8 Feb 2012 08:42:18 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q188gHxn030563; Wed, 8 Feb 2012 08:42:18 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201202080842.q188gHxn030563@svn.freebsd.org> From: Kevin Lo Date: Wed, 8 Feb 2012 08:42:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231191 - head/share/man/man3 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 08:42:18 -0000 Author: kevlo Date: Wed Feb 8 08:42:17 2012 New Revision: 231191 URL: http://svn.freebsd.org/changeset/base/231191 Log: Add offsetof.3 man page Obtained from: OpenBSD Added: head/share/man/man3/offsetof.3 (contents, props changed) Modified: head/share/man/man3/Makefile Modified: head/share/man/man3/Makefile ============================================================================== --- head/share/man/man3/Makefile Wed Feb 8 07:34:03 2012 (r231190) +++ head/share/man/man3/Makefile Wed Feb 8 08:42:17 2012 (r231191) @@ -10,6 +10,7 @@ MAN= assert.3 \ fpgetround.3 \ intro.3 \ makedev.3 \ + offsetof.3 \ ${PTHREAD_MAN} \ queue.3 \ siginfo.3 \ Added: head/share/man/man3/offsetof.3 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man3/offsetof.3 Wed Feb 8 08:42:17 2012 (r231191) @@ -0,0 +1,47 @@ +.\" $OpenBSD: offsetof.3,v 1.2 2010/02/18 18:30:19 jmc Exp $ +.\" +.\" Copyright (c) 2010 Thomas Pfaff +.\" +.\" Permission to use, copy, modify, and distribute this software for any +.\" purpose with or without fee is hereby granted, provided that the above +.\" copyright notice and this permission notice appear in all copies. +.\" +.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. +.\" +.\" $FreeBSD$ +.\" +.Dd February 18 2010 +.Dt OFFSETOF 3 +.Os +.Sh NAME +.Nm offsetof +.Nd offset of a structure member +.Sh SYNOPSIS +.Fd #include +.Ft size_t +.Fn offsetof "type" "member" +.Sh DESCRIPTION +The +.Fn offsetof +macro expands to an integer constant expression of type +.Ft size_t +and yields the offset, +in bytes, of the field +.Ar member +from the start of the structure +.Ar type . +.Pp +A compiler error will result if +.Ar member +is not aligned to a byte boundary (i.e. it is a bit-field). +.Sh STANDARDS +The +.Fn offsetof +macro conforms to +.St -ansiC . From owner-svn-src-head@FreeBSD.ORG Wed Feb 8 08:43:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D3B5106566C; Wed, 8 Feb 2012 08:43:42 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id ECE088FC0C; Wed, 8 Feb 2012 08:43:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q188hfWZ030640; Wed, 8 Feb 2012 08:43:41 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q188hfws030638; Wed, 8 Feb 2012 08:43:41 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201202080843.q188hfws030638@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 8 Feb 2012 08:43:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231192 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 08:43:42 -0000 Author: pjd Date: Wed Feb 8 08:43:41 2012 New Revision: 231192 URL: http://svn.freebsd.org/changeset/base/231192 Log: Note that calling pidfile_write(3) multiple times is fine. MFC after: 3 days Modified: head/lib/libutil/pidfile.3 Modified: head/lib/libutil/pidfile.3 ============================================================================== --- head/lib/libutil/pidfile.3 Wed Feb 8 08:42:17 2012 (r231191) +++ head/lib/libutil/pidfile.3 Wed Feb 8 08:43:41 2012 (r231192) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd October 16, 2011 +.Dd February 8, 2012 .Dt PIDFILE 3 .Os .Sh NAME @@ -85,6 +85,9 @@ function sets the O_CLOEXEC close-on-exe The .Fn pidfile_write function writes process' PID into a previously opened file. +The file is truncated before write, so calling the +.Fn pidfile_write +function multiple times is supported. .Pp The .Fn pidfile_close From owner-svn-src-head@FreeBSD.ORG Wed Feb 8 08:49:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2C5BB1065670; Wed, 8 Feb 2012 08:49:31 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 186088FC08; Wed, 8 Feb 2012 08:49:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q188nUQ2030874; Wed, 8 Feb 2012 08:49:30 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q188nUDD030871; Wed, 8 Feb 2012 08:49:30 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201202080849.q188nUDD030871@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 8 Feb 2012 08:49:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231193 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 08:49:31 -0000 Author: pjd Date: Wed Feb 8 08:49:30 2012 New Revision: 231193 URL: http://svn.freebsd.org/changeset/base/231193 Log: Add a comment to the example that pidfile_* functions can handle pfh being NULL. MFC after: 3 days Modified: head/lib/libutil/pidfile.3 Modified: head/lib/libutil/pidfile.3 ============================================================================== --- head/lib/libutil/pidfile.3 Wed Feb 8 08:43:41 2012 (r231192) +++ head/lib/libutil/pidfile.3 Wed Feb 8 08:49:30 2012 (r231193) @@ -150,6 +150,11 @@ if (pfh == NULL) { } /* If we cannot create pidfile from other reasons, only warn. */ warn("Cannot open or create pidfile"); + /* + * Eventhough pfh is NULL we can continue, as the other pidfile_* + * function can handle such situation by doing nothing except setting + * errno to EDOOFUS. + */ } if (daemon(0, 0) == -1) { From owner-svn-src-head@FreeBSD.ORG Wed Feb 8 08:52:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 95465106566B; Wed, 8 Feb 2012 08:52:41 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 751058FC13; Wed, 8 Feb 2012 08:52:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q188qf5L031013; Wed, 8 Feb 2012 08:52:41 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q188qfMr031008; Wed, 8 Feb 2012 08:52:41 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201202080852.q188qfMr031008@svn.freebsd.org> From: Doug Barton Date: Wed, 8 Feb 2012 08:52:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231194 - in head: etc/defaults etc/rc.d share/man/man5 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 08:52:41 -0000 Author: dougb Date: Wed Feb 8 08:52:40 2012 New Revision: 231194 URL: http://svn.freebsd.org/changeset/base/231194 Log: As it stands right now, the default devfs rulesets are only loaded as a side effect of something else using them. If they haven't been loaded already but you want to use them, say for configuring a jail, you're out of luck. So add a knob to always load the default rulesets. While I'm here document the other devfs_ knobs in rc.conf.5. Modified: head/etc/defaults/rc.conf head/etc/rc.d/devfs head/share/man/man5/rc.conf.5 Modified: head/etc/defaults/rc.conf ============================================================================== --- head/etc/defaults/rc.conf Wed Feb 8 08:49:30 2012 (r231193) +++ head/etc/defaults/rc.conf Wed Feb 8 08:52:40 2012 (r231194) @@ -648,6 +648,7 @@ devfs_rulesets="/etc/defaults/devfs.rule devfs_system_ruleset="" # The name (NOT number) of a ruleset to apply to /dev devfs_set_rulesets="" # A list of /mount/dev=ruleset_name settings to # apply (must be mounted already, i.e. fstab(5)) +devfs_load_rulesets="NO" # Enable to always load the default rulesets performance_cx_lowest="HIGH" # Online CPU idle state performance_cpu_freq="NONE" # Online CPU frequency economy_cx_lowest="HIGH" # Offline CPU idle state Modified: head/etc/rc.d/devfs ============================================================================== --- head/etc/rc.d/devfs Wed Feb 8 08:49:30 2012 (r231193) +++ head/etc/rc.d/devfs Wed Feb 8 08:52:40 2012 (r231194) @@ -16,7 +16,8 @@ stop_cmd=':' devfs_start() { - if [ -n "$devfs_system_ruleset" -o -n "$devfs_set_rulesets" ]; then + if [ -n "$devfs_system_ruleset" -o -n "$devfs_set_rulesets" ] || + checkyesno devfs_load_rulesets; then devfs_init_rulesets if [ -n "$devfs_system_ruleset" ]; then devfs_set_ruleset $devfs_system_ruleset /dev Modified: head/share/man/man5/rc.conf.5 ============================================================================== --- head/share/man/man5/rc.conf.5 Wed Feb 8 08:49:30 2012 (r231193) +++ head/share/man/man5/rc.conf.5 Wed Feb 8 08:52:40 2012 (r231194) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 13, 2011 +.Dd February 8, 2012 .Dt RC.CONF 5 .Os .Sh NAME @@ -3673,6 +3673,25 @@ is set to these are the flags passed to the .Xr watchdogd 8 daemon. +.It Va devfs_rulesets +.Pq Vt str +List of files containing sets of rules for +.Xr devfs 8 . +.It Va devfs_system_ruleset +.Pq Vt str +Rule name(s) to apply to the system +.Pa /dev +itself. +.It Va devfs_set_rulesets +.Pq Vt str +Pairs of already-mounted +.Pa dev +directories and rulesets that should be applied to them. +For example: /mount/dev=ruleset_name +.It Va devfs_load_rulesets +.Pq Vt bool +If set, always load the default rulesets listed in +.Va devfs_rulesets . .It Va performance_cx_lowest .Pq Vt str CPU idle state to use while on AC power. @@ -4532,6 +4551,7 @@ The default is 30. .Xr chkprintcap 8 , .Xr chown 8 , .Xr cron 8 , +.Xr devfs 8 , .Xr dhclient 8 , .Xr ftpd 8 , .Xr geli 8 , From owner-svn-src-head@FreeBSD.ORG Wed Feb 8 09:07:16 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4B695106566B; Wed, 8 Feb 2012 09:07:16 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id E40248FC14; Wed, 8 Feb 2012 09:07:15 +0000 (UTC) Received: from localhost (58.wheelsystems.com [83.12.187.58]) by mail.dawidek.net (Postfix) with ESMTPSA id 6F885262; Wed, 8 Feb 2012 10:07:13 +0100 (CET) Date: Wed, 8 Feb 2012 10:06:01 +0100 From: Pawel Jakub Dawidek To: Mikolaj Golub Message-ID: <20120208090600.GA1308@garage.freebsd.pl> References: <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> <20120206082706.GA1324@garage.freebsd.pl> <86wr7zmy8f.fsf@kopusha.home.net> <20120206221742.GA1336@garage.freebsd.pl> <86liodu3me.fsf@in138.ua3> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6c2NcOVqGQ03X4Wi" Content-Disposition: inline In-Reply-To: <86liodu3me.fsf@in138.ua3> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 09:07:16 -0000 --6c2NcOVqGQ03X4Wi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 08, 2012 at 10:32:41AM +0200, Mikolaj Golub wrote: >=20 > On Mon, 6 Feb 2012 23:17:43 +0100 Pawel Jakub Dawidek wrote: >=20 > PJD> On Mon, Feb 06, 2012 at 11:46:24PM +0200, Mikolaj Golub wrote: >=20 > >> Thanks. The updated version is attached. >=20 > PJD> Looks good to me. >=20 > Thanks. But I still think that adding some signal handling is a good idea= =2E I > agree that there may be no sense in trying to handle many different signa= ls, > but handling SIGTERM (software termination signal :-) nicely looks like a= good > thing. Ok:) In that case could you break you patch into one that only fixes the problem we discussed and the other that implements new functionality? > This would solve problems like stale pid files after shutdown or orphaned > programs (again with stale pid files and a possibility to start another > instance) due to a user mistakenly terminated the supervising daemons. >=20 > Also it is possible then to add "automatic restart" option, as Andrey has > proposed. >=20 > Here is the patch that does it. It also change proctitle to make identify= ing a > a supervisor with its charge. I'd prefer to see more general solution to that problem, but I guess this can't hurt. I've only one suggestion based on my experience. Before you restart the program, wait for 1 second. This helps a lot when you have misbehaving program or some misconfiguration that make the process to exit immediately. > A technical question concerning the patch :-). Does sombody know if > sigwaitinfo() may be interrupted in my case and I should check for EINTR,= as I > do in the patch? Calling sigwaitinfo() with second argument equal to NULL is equivalent to calling sigwait(). The only difference is that sigwait() cannot be interrupted by signal, thus never sets errno to EINTR. Why not to use just that? --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --6c2NcOVqGQ03X4Wi Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk8yOvgACgkQForvXbEpPzQNVwCgxOxaz6gr8eiuvKD6Fj7qKCem JuMAnib1UpQbb2phqNIg5aeYH6ILy+3S =gjll -----END PGP SIGNATURE----- --6c2NcOVqGQ03X4Wi-- From owner-svn-src-head@FreeBSD.ORG Wed Feb 8 09:18:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3D6EB106564A; Wed, 8 Feb 2012 09:18:23 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2866C8FC12; Wed, 8 Feb 2012 09:18:23 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q189INxi031866; Wed, 8 Feb 2012 09:18:23 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q189IM5i031864; Wed, 8 Feb 2012 09:18:22 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201202080918.q189IM5i031864@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Wed, 8 Feb 2012 09:18:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231195 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 09:18:23 -0000 Author: pjd Date: Wed Feb 8 09:18:22 2012 New Revision: 231195 URL: http://svn.freebsd.org/changeset/base/231195 Log: Allow to set kern.ipc.shmmax from /boot/loader.conf. MFC after: 1 week Modified: head/sys/kern/sysv_shm.c Modified: head/sys/kern/sysv_shm.c ============================================================================== --- head/sys/kern/sysv_shm.c Wed Feb 8 08:52:40 2012 (r231194) +++ head/sys/kern/sysv_shm.c Wed Feb 8 09:18:22 2012 (r231195) @@ -891,14 +891,14 @@ shminit() printf("kern.ipc.shmmaxpgs is now called kern.ipc.shmall!\n"); #endif TUNABLE_ULONG_FETCH("kern.ipc.shmall", &shminfo.shmall); - - /* Initialize shmmax dealing with possible overflow. */ - for (i = PAGE_SIZE; i > 0; i--) { - shminfo.shmmax = shminfo.shmall * i; - if (shminfo.shmmax >= shminfo.shmall) - break; + if (!TUNABLE_ULONG_FETCH("kern.ipc.shmmax", &shminfo.shmmax)) { + /* Initialize shmmax dealing with possible overflow. */ + for (i = PAGE_SIZE; i > 0; i--) { + shminfo.shmmax = shminfo.shmall * i; + if (shminfo.shmmax >= shminfo.shmall) + break; + } } - TUNABLE_ULONG_FETCH("kern.ipc.shmmin", &shminfo.shmmin); TUNABLE_ULONG_FETCH("kern.ipc.shmmni", &shminfo.shmmni); TUNABLE_ULONG_FETCH("kern.ipc.shmseg", &shminfo.shmseg); From owner-svn-src-head@FreeBSD.ORG Wed Feb 8 11:30:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6DC6106566C; Wed, 8 Feb 2012 11:30:13 +0000 (UTC) (envelope-from brooks@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A26D68FC17; Wed, 8 Feb 2012 11:30:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q18BUDcX040490; Wed, 8 Feb 2012 11:30:13 GMT (envelope-from brooks@svn.freebsd.org) Received: (from brooks@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18BUDWo040488; Wed, 8 Feb 2012 11:30:13 GMT (envelope-from brooks@svn.freebsd.org) Message-Id: <201202081130.q18BUDWo040488@svn.freebsd.org> From: Brooks Davis Date: Wed, 8 Feb 2012 11:30:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231196 - head/lib/libc/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 11:30:13 -0000 Author: brooks Date: Wed Feb 8 11:30:13 2012 New Revision: 231196 URL: http://svn.freebsd.org/changeset/base/231196 Log: eui64_aton and eui64_ntoa are actually the equivalent of ether_aton_r and ether_nota_r and do not use static variables so remove the note copied from ethers.3 saying they do. Reported by: bms MFC after: 3 days Modified: head/lib/libc/net/eui64.3 Modified: head/lib/libc/net/eui64.3 ============================================================================== --- head/lib/libc/net/eui64.3 Wed Feb 8 09:18:22 2012 (r231195) +++ head/lib/libc/net/eui64.3 Wed Feb 8 11:30:13 2012 (r231196) @@ -221,10 +221,3 @@ These functions first appears in They are derived from the .Xr ethers 3 family of functions. -.Sh BUGS -The -.Fn eui64_aton -and -.Fn eui64_ntoa -functions returns values that are stored in static memory areas -which may be overwritten the next time they are called. From owner-svn-src-head@FreeBSD.ORG Wed Feb 8 11:43:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9490A1065672; Wed, 8 Feb 2012 11:43:30 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7DAB08FC15; Wed, 8 Feb 2012 11:43:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q18BhUTG040956; Wed, 8 Feb 2012 11:43:30 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18BhUth040948; Wed, 8 Feb 2012 11:43:30 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201202081143.q18BhUth040948@svn.freebsd.org> From: Luigi Rizzo Date: Wed, 8 Feb 2012 11:43:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231198 - in head: sys/dev/netmap sys/net tools/tools/netmap X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 11:43:30 -0000 Author: luigi Date: Wed Feb 8 11:43:29 2012 New Revision: 231198 URL: http://svn.freebsd.org/changeset/base/231198 Log: - change the buffer size from a constant to a TUNABLE variable (hw.netmap.buf_size) so we can experiment with values different from 2048 which may give better cache performance. - rearrange the memory allocation code so it will be easier to replace it with a different implementation. The current code relies on a single large contiguous chunk of memory obtained through contigmalloc. The new implementation (not committed yet) uses multiple smaller chunks which are easier to fit in a fragmented address space. Modified: head/sys/dev/netmap/if_em_netmap.h head/sys/dev/netmap/if_igb_netmap.h head/sys/dev/netmap/if_lem_netmap.h head/sys/dev/netmap/if_re_netmap.h head/sys/dev/netmap/ixgbe_netmap.h head/sys/dev/netmap/netmap.c head/sys/dev/netmap/netmap_kern.h head/sys/net/netmap.h head/sys/net/netmap_user.h head/tools/tools/netmap/pkt-gen.c Modified: head/sys/dev/netmap/if_em_netmap.h ============================================================================== --- head/sys/dev/netmap/if_em_netmap.h Wed Feb 8 11:33:46 2012 (r231197) +++ head/sys/dev/netmap/if_em_netmap.h Wed Feb 8 11:43:29 2012 (r231198) @@ -61,7 +61,6 @@ em_netmap_attach(struct adapter *adapter na.nm_rxsync = em_netmap_rxsync; na.nm_lock = em_netmap_lock_wrapper; na.nm_register = em_netmap_reg; - na.buff_size = NETMAP_BUF_SIZE; netmap_attach(&na, adapter->num_queues); } Modified: head/sys/dev/netmap/if_igb_netmap.h ============================================================================== --- head/sys/dev/netmap/if_igb_netmap.h Wed Feb 8 11:33:46 2012 (r231197) +++ head/sys/dev/netmap/if_igb_netmap.h Wed Feb 8 11:43:29 2012 (r231198) @@ -58,7 +58,6 @@ igb_netmap_attach(struct adapter *adapte na.nm_rxsync = igb_netmap_rxsync; na.nm_lock = igb_netmap_lock_wrapper; na.nm_register = igb_netmap_reg; - na.buff_size = NETMAP_BUF_SIZE; netmap_attach(&na, adapter->num_queues); } Modified: head/sys/dev/netmap/if_lem_netmap.h ============================================================================== --- head/sys/dev/netmap/if_lem_netmap.h Wed Feb 8 11:33:46 2012 (r231197) +++ head/sys/dev/netmap/if_lem_netmap.h Wed Feb 8 11:43:29 2012 (r231198) @@ -62,7 +62,6 @@ lem_netmap_attach(struct adapter *adapte na.nm_rxsync = lem_netmap_rxsync; na.nm_lock = lem_netmap_lock_wrapper; na.nm_register = lem_netmap_reg; - na.buff_size = NETMAP_BUF_SIZE; netmap_attach(&na, 1); } @@ -247,6 +246,7 @@ lem_netmap_txsync(void *a, u_int ring_nr ring->avail = kring->nr_hwavail; } } + if (do_lock) EM_TX_UNLOCK(adapter); return 0; @@ -351,9 +351,9 @@ lem_netmap_rxsync(void *a, u_int ring_nr /* tell userspace that there are new packets */ ring->avail = kring->nr_hwavail ; + if (do_lock) EM_RX_UNLOCK(adapter); return 0; } - - +/* end of file */ Modified: head/sys/dev/netmap/if_re_netmap.h ============================================================================== --- head/sys/dev/netmap/if_re_netmap.h Wed Feb 8 11:33:46 2012 (r231197) +++ head/sys/dev/netmap/if_re_netmap.h Wed Feb 8 11:43:29 2012 (r231198) @@ -56,7 +56,6 @@ re_netmap_attach(struct rl_softc *sc) na.nm_rxsync = re_netmap_rxsync; na.nm_lock = re_netmap_lock_wrapper; na.nm_register = re_netmap_reg; - na.buff_size = NETMAP_BUF_SIZE; netmap_attach(&na, 1); } Modified: head/sys/dev/netmap/ixgbe_netmap.h ============================================================================== --- head/sys/dev/netmap/ixgbe_netmap.h Wed Feb 8 11:33:46 2012 (r231197) +++ head/sys/dev/netmap/ixgbe_netmap.h Wed Feb 8 11:43:29 2012 (r231198) @@ -82,13 +82,6 @@ ixgbe_netmap_attach(struct adapter *adap na.nm_rxsync = ixgbe_netmap_rxsync; na.nm_lock = ixgbe_netmap_lock_wrapper; na.nm_register = ixgbe_netmap_reg; - /* - * XXX where do we put this comment ? - * adapter->rx_mbuf_sz is set by SIOCSETMTU, but in netmap mode - * we allocate the buffers on the first register. So we must - * disallow a SIOCSETMTU when if_capenable & IFCAP_NETMAP is set. - */ - na.buff_size = NETMAP_BUF_SIZE; netmap_attach(&na, adapter->num_queues); } @@ -354,7 +347,8 @@ ring_reset: * otherwise we go to sleep (in netmap_poll()) and will be * woken up when slot nr_kflags will be ready. */ - struct ixgbe_legacy_tx_desc *txd = (struct ixgbe_legacy_tx_desc *)txr->tx_base; + struct ixgbe_legacy_tx_desc *txd = + (struct ixgbe_legacy_tx_desc *)txr->tx_base; j = txr->next_to_clean + kring->nkr_num_slots/2; if (j >= kring->nkr_num_slots) @@ -365,9 +359,7 @@ ring_reset: kring->nr_kflags = j; /* the slot to check */ j = txd[j].upper.fields.status & IXGBE_TXD_STAT_DD; } - if (!j) { - netmap_skip_txsync++; - } else { + if (j) { int delta; /* @@ -471,7 +463,7 @@ ixgbe_netmap_rxsync(void *a, u_int ring_ if (j > lim) j -= lim + 1; - if (force_update) { + if (netmap_no_pendintr || force_update) { for (n = 0; ; n++) { union ixgbe_adv_rx_desc *curr = &rxr->rx_base[l]; uint32_t staterr = le32toh(curr->wb.upper.status_error); @@ -548,6 +540,7 @@ ixgbe_netmap_rxsync(void *a, u_int ring_ } /* tell userspace that there are new packets */ ring->avail = kring->nr_hwavail ; + if (do_lock) IXGBE_RX_UNLOCK(rxr); return 0; Modified: head/sys/dev/netmap/netmap.c ============================================================================== --- head/sys/dev/netmap/netmap.c Wed Feb 8 11:33:46 2012 (r231197) +++ head/sys/dev/netmap/netmap.c Wed Feb 8 11:43:29 2012 (r231198) @@ -92,6 +92,39 @@ MALLOC_DEFINE(M_NETMAP, "netmap", "Netwo */ #define NMA_LOCK() mtx_lock(&netmap_mem_d->nm_mtx); #define NMA_UNLOCK() mtx_unlock(&netmap_mem_d->nm_mtx); +struct netmap_mem_d; +static struct netmap_mem_d *netmap_mem_d; /* Our memory allocator. */ + +u_int netmap_total_buffers; +char *netmap_buffer_base; /* address of an invalid buffer */ + +/* user-controlled variables */ +int netmap_verbose; + +static int netmap_no_timestamp; /* don't timestamp on rxsync */ + +SYSCTL_NODE(_dev, OID_AUTO, netmap, CTLFLAG_RW, 0, "Netmap args"); +SYSCTL_INT(_dev_netmap, OID_AUTO, verbose, + CTLFLAG_RW, &netmap_verbose, 0, "Verbose mode"); +SYSCTL_INT(_dev_netmap, OID_AUTO, no_timestamp, + CTLFLAG_RW, &netmap_no_timestamp, 0, "no_timestamp"); +int netmap_buf_size = 2048; +TUNABLE_INT("hw.netmap.buf_size", &netmap_buf_size); +SYSCTL_INT(_dev_netmap, OID_AUTO, buf_size, + CTLFLAG_RD, &netmap_buf_size, 0, "Size of packet buffers"); +int netmap_mitigate = 1; +SYSCTL_INT(_dev_netmap, OID_AUTO, mitigate, CTLFLAG_RW, &netmap_mitigate, 0, ""); +int netmap_no_pendintr; +SYSCTL_INT(_dev_netmap, OID_AUTO, no_pendintr, + CTLFLAG_RW, &netmap_no_pendintr, 0, "Always look for new received packets."); + + + +/*----- memory allocator -----------------*/ +/* + * Here we have the low level routines for memory allocator + * and its primary users. + */ /* * Default amount of memory pre-allocated by the module. @@ -128,30 +161,13 @@ struct netmap_buf_pool { uint32_t *bitmap; /* one bit per buffer, 1 means free */ }; struct netmap_buf_pool nm_buf_pool; -/* XXX move these two vars back into netmap_buf_pool */ -u_int netmap_total_buffers; -char *netmap_buffer_base; /* address of an invalid buffer */ - -/* user-controlled variables */ -int netmap_verbose; - -static int no_timestamp; /* don't timestamp on rxsync */ - -SYSCTL_NODE(_dev, OID_AUTO, netmap, CTLFLAG_RW, 0, "Netmap args"); -SYSCTL_INT(_dev_netmap, OID_AUTO, verbose, - CTLFLAG_RW, &netmap_verbose, 0, "Verbose mode"); -SYSCTL_INT(_dev_netmap, OID_AUTO, no_timestamp, - CTLFLAG_RW, &no_timestamp, 0, "no_timestamp"); SYSCTL_INT(_dev_netmap, OID_AUTO, total_buffers, CTLFLAG_RD, &nm_buf_pool.total_buffers, 0, "total_buffers"); SYSCTL_INT(_dev_netmap, OID_AUTO, free_buffers, CTLFLAG_RD, &nm_buf_pool.free, 0, "free_buffers"); -int netmap_mitigate = 1; -SYSCTL_INT(_dev_netmap, OID_AUTO, mitigate, CTLFLAG_RW, &netmap_mitigate, 0, ""); -int netmap_skip_txsync; -SYSCTL_INT(_dev_netmap, OID_AUTO, skip_txsync, CTLFLAG_RW, &netmap_skip_txsync, 0, ""); -int netmap_skip_rxsync; -SYSCTL_INT(_dev_netmap, OID_AUTO, skip_rxsync, CTLFLAG_RW, &netmap_skip_rxsync, 0, ""); + + + /* * Allocate n buffers from the ring, and fill the slot. @@ -165,79 +181,446 @@ netmap_new_bufs(struct netmap_if *nifp _ uint32_t bi = 0; /* index in the bitmap */ uint32_t mask, j, i = 0; /* slot counter */ - if (n > p->free) { - D("only %d out of %d buffers available", i, n); - return; - } - /* termination is guaranteed by p->free */ - while (i < n && p->free > 0) { - uint32_t cur = p->bitmap[bi]; - if (cur == 0) { /* bitmask is fully used */ - bi++; - continue; - } - /* locate a slot */ - for (j = 0, mask = 1; (cur & mask) == 0; j++, mask <<= 1) ; - p->bitmap[bi] &= ~mask; /* slot in use */ - p->free--; - slot[i].buf_idx = bi*32+j; - slot[i].len = p->bufsize; - slot[i].flags = NS_BUF_CHANGED; - i++; - } - ND("allocated %d buffers, %d available", n, p->free); + if (n > p->free) { + D("only %d out of %d buffers available", i, n); + return; + } + /* termination is guaranteed by p->free */ + while (i < n && p->free > 0) { + uint32_t cur = p->bitmap[bi]; + if (cur == 0) { /* bitmask is fully used */ + bi++; + continue; + } + /* locate a slot */ + for (j = 0, mask = 1; (cur & mask) == 0; j++, mask <<= 1) ; + p->bitmap[bi] &= ~mask; /* slot in use */ + p->free--; + slot[i].buf_idx = bi*32+j; + slot[i].len = p->bufsize; + slot[i].flags = NS_BUF_CHANGED; + i++; + } + ND("allocated %d buffers, %d available", n, p->free); +} + + +static void +netmap_free_buf(struct netmap_if *nifp __unused, uint32_t i) +{ + struct netmap_buf_pool *p = &nm_buf_pool; + + uint32_t pos, mask; + if (i >= p->total_buffers) { + D("invalid free index %d", i); + return; + } + pos = i / 32; + mask = 1 << (i % 32); + if (p->bitmap[pos] & mask) { + D("slot %d already free", i); + return; + } + p->bitmap[pos] |= mask; + p->free++; +} + + +/* Descriptor of the memory objects handled by our memory allocator. */ +struct netmap_mem_obj { + TAILQ_ENTRY(netmap_mem_obj) nmo_next; /* next object in the + chain. */ + int nmo_used; /* flag set on used memory objects. */ + size_t nmo_size; /* size of the memory area reserved for the + object. */ + void *nmo_data; /* pointer to the memory area. */ +}; + +/* Wrap our memory objects to make them ``chainable``. */ +TAILQ_HEAD(netmap_mem_obj_h, netmap_mem_obj); + + +/* Descriptor of our custom memory allocator. */ +struct netmap_mem_d { + struct mtx nm_mtx; /* lock used to handle the chain of memory + objects. */ + struct netmap_mem_obj_h nm_molist; /* list of memory objects */ + size_t nm_size; /* total amount of memory used for rings etc. */ + size_t nm_totalsize; /* total amount of allocated memory + (the difference is used for buffers) */ + size_t nm_buf_start; /* offset of packet buffers. + This is page-aligned. */ + size_t nm_buf_len; /* total memory for buffers */ + void *nm_buffer; /* pointer to the whole pre-allocated memory + area. */ +}; + +/* Shorthand to compute a netmap interface offset. */ +#define netmap_if_offset(v) \ + ((char *) (v) - (char *) netmap_mem_d->nm_buffer) +/* .. and get a physical address given a memory offset */ +#define netmap_ofstophys(o) \ + (vtophys(netmap_mem_d->nm_buffer) + (o)) + + +/*------ netmap memory allocator -------*/ +/* + * Request for a chunk of memory. + * + * Memory objects are arranged into a list, hence we need to walk this + * list until we find an object with the needed amount of data free. + * This sounds like a completely inefficient implementation, but given + * the fact that data allocation is done once, we can handle it + * flawlessly. + * + * Return NULL on failure. + */ +static void * +netmap_malloc(size_t size, __unused const char *msg) +{ + struct netmap_mem_obj *mem_obj, *new_mem_obj; + void *ret = NULL; + + NMA_LOCK(); + TAILQ_FOREACH(mem_obj, &netmap_mem_d->nm_molist, nmo_next) { + if (mem_obj->nmo_used != 0 || mem_obj->nmo_size < size) + continue; + + new_mem_obj = malloc(sizeof(struct netmap_mem_obj), M_NETMAP, + M_WAITOK | M_ZERO); + TAILQ_INSERT_BEFORE(mem_obj, new_mem_obj, nmo_next); + + new_mem_obj->nmo_used = 1; + new_mem_obj->nmo_size = size; + new_mem_obj->nmo_data = mem_obj->nmo_data; + memset(new_mem_obj->nmo_data, 0, new_mem_obj->nmo_size); + + mem_obj->nmo_size -= size; + mem_obj->nmo_data = (char *) mem_obj->nmo_data + size; + if (mem_obj->nmo_size == 0) { + TAILQ_REMOVE(&netmap_mem_d->nm_molist, mem_obj, + nmo_next); + free(mem_obj, M_NETMAP); + } + + ret = new_mem_obj->nmo_data; + + break; + } + NMA_UNLOCK(); + ND("%s: %d bytes at %p", msg, size, ret); + + return (ret); +} + +/* + * Return the memory to the allocator. + * + * While freeing a memory object, we try to merge adjacent chunks in + * order to reduce memory fragmentation. + */ +static void +netmap_free(void *addr, const char *msg) +{ + size_t size; + struct netmap_mem_obj *cur, *prev, *next; + + if (addr == NULL) { + D("NULL addr for %s", msg); + return; + } + + NMA_LOCK(); + TAILQ_FOREACH(cur, &netmap_mem_d->nm_molist, nmo_next) { + if (cur->nmo_data == addr && cur->nmo_used) + break; + } + if (cur == NULL) { + NMA_UNLOCK(); + D("invalid addr %s %p", msg, addr); + return; + } + + size = cur->nmo_size; + cur->nmo_used = 0; + + /* merge current chunk of memory with the previous one, + if present. */ + prev = TAILQ_PREV(cur, netmap_mem_obj_h, nmo_next); + if (prev && prev->nmo_used == 0) { + TAILQ_REMOVE(&netmap_mem_d->nm_molist, cur, nmo_next); + prev->nmo_size += cur->nmo_size; + free(cur, M_NETMAP); + cur = prev; + } + + /* merge with the next one */ + next = TAILQ_NEXT(cur, nmo_next); + if (next && next->nmo_used == 0) { + TAILQ_REMOVE(&netmap_mem_d->nm_molist, next, nmo_next); + cur->nmo_size += next->nmo_size; + free(next, M_NETMAP); + } + NMA_UNLOCK(); + ND("freed %s %d bytes at %p", msg, size, addr); +} + + +/* + * Create and return a new ``netmap_if`` object, and possibly also + * rings and packet buffors. + * + * Return NULL on failure. + */ +static void * +netmap_if_new(const char *ifname, struct netmap_adapter *na) +{ + struct netmap_if *nifp; + struct netmap_ring *ring; + char *buff; + u_int i, len, ofs; + u_int n = na->num_queues + 1; /* shorthand, include stack queue */ + + /* + * the descriptor is followed inline by an array of offsets + * to the tx and rx rings in the shared memory region. + */ + len = sizeof(struct netmap_if) + 2 * n * sizeof(ssize_t); + nifp = netmap_if_malloc(len); + if (nifp == NULL) + return (NULL); + + /* initialize base fields */ + *(int *)(uintptr_t)&nifp->ni_num_queues = na->num_queues; + strncpy(nifp->ni_name, ifname, IFNAMSIZ); + + (na->refcount)++; /* XXX atomic ? we are under lock */ + if (na->refcount > 1) + goto final; + + /* + * If this is the first instance, allocate the shadow rings and + * buffers for this card (one for each hw queue, one for the host). + * The rings are contiguous, but have variable size. + * The entire block is reachable at + * na->tx_rings[0].ring + */ + + len = n * (2 * sizeof(struct netmap_ring) + + (na->num_tx_desc + na->num_rx_desc) * + sizeof(struct netmap_slot) ); + buff = netmap_ring_malloc(len); + if (buff == NULL) { + D("failed to allocate %d bytes for %s shadow ring", + len, ifname); +error: + (na->refcount)--; + netmap_if_free(nifp); + return (NULL); + } + /* do we have the bufers ? we are in need of num_tx_desc buffers for + * each tx ring and num_tx_desc buffers for each rx ring. */ + len = n * (na->num_tx_desc + na->num_rx_desc); + NMA_LOCK(); + if (nm_buf_pool.free < len) { + NMA_UNLOCK(); + netmap_free(buff, "not enough bufs"); + goto error; + } + /* + * in the kring, store the pointers to the shared rings + * and initialize the rings. We are under NMA_LOCK(). + */ + ofs = 0; + for (i = 0; i < n; i++) { + struct netmap_kring *kring; + int numdesc; + + /* Transmit rings */ + kring = &na->tx_rings[i]; + numdesc = na->num_tx_desc; + bzero(kring, sizeof(*kring)); + kring->na = na; + + ring = kring->ring = (struct netmap_ring *)(buff + ofs); + *(ssize_t *)(uintptr_t)&ring->buf_ofs = + nm_buf_pool.base - (char *)ring; + ND("txring[%d] at %p ofs %d", i, ring, ring->buf_ofs); + *(uint32_t *)(uintptr_t)&ring->num_slots = + kring->nkr_num_slots = numdesc; + + /* + * IMPORTANT: + * Always keep one slot empty, so we can detect new + * transmissions comparing cur and nr_hwcur (they are + * the same only if there are no new transmissions). + */ + ring->avail = kring->nr_hwavail = numdesc - 1; + ring->cur = kring->nr_hwcur = 0; + *(uint16_t *)(uintptr_t)&ring->nr_buf_size = NETMAP_BUF_SIZE; + netmap_new_bufs(nifp, ring->slot, numdesc); + + ofs += sizeof(struct netmap_ring) + + numdesc * sizeof(struct netmap_slot); + + /* Receive rings */ + kring = &na->rx_rings[i]; + numdesc = na->num_rx_desc; + bzero(kring, sizeof(*kring)); + kring->na = na; + + ring = kring->ring = (struct netmap_ring *)(buff + ofs); + *(ssize_t *)(uintptr_t)&ring->buf_ofs = + nm_buf_pool.base - (char *)ring; + ND("rxring[%d] at %p offset %d", i, ring, ring->buf_ofs); + *(uint32_t *)(uintptr_t)&ring->num_slots = + kring->nkr_num_slots = numdesc; + ring->cur = kring->nr_hwcur = 0; + ring->avail = kring->nr_hwavail = 0; /* empty */ + *(uint16_t *)(uintptr_t)&ring->nr_buf_size = NETMAP_BUF_SIZE; + netmap_new_bufs(nifp, ring->slot, numdesc); + ofs += sizeof(struct netmap_ring) + + numdesc * sizeof(struct netmap_slot); + } + NMA_UNLOCK(); + for (i = 0; i < n+1; i++) { + // XXX initialize the selrecord structs. + } +final: + /* + * fill the slots for the rx and tx queues. They contain the offset + * between the ring and nifp, so the information is usable in + * userspace to reach the ring from the nifp. + */ + for (i = 0; i < n; i++) { + char *base = (char *)nifp; + *(ssize_t *)(uintptr_t)&nifp->ring_ofs[i] = + (char *)na->tx_rings[i].ring - base; + *(ssize_t *)(uintptr_t)&nifp->ring_ofs[i+n] = + (char *)na->rx_rings[i].ring - base; + } + return (nifp); +} + +/* + * Initialize the memory allocator. + * + * Create the descriptor for the memory , allocate the pool of memory + * and initialize the list of memory objects with a single chunk + * containing the whole pre-allocated memory marked as free. + * + * Start with a large size, then halve as needed if we fail to + * allocate the block. While halving, always add one extra page + * because buffers 0 and 1 are used for special purposes. + * Return 0 on success, errno otherwise. + */ +static int +netmap_memory_init(void) +{ + struct netmap_mem_obj *mem_obj; + void *buf = NULL; + int i, n, sz = NETMAP_MEMORY_SIZE; + int extra_sz = 0; // space for rings and two spare buffers + + for (; sz >= 1<<20; sz >>=1) { + extra_sz = sz/200; + extra_sz = (extra_sz + 2*PAGE_SIZE - 1) & ~(PAGE_SIZE-1); + buf = contigmalloc(sz + extra_sz, + M_NETMAP, + M_WAITOK | M_ZERO, + 0, /* low address */ + -1UL, /* high address */ + PAGE_SIZE, /* alignment */ + 0 /* boundary */ + ); + if (buf) + break; + } + if (buf == NULL) + return (ENOMEM); + sz += extra_sz; + netmap_mem_d = malloc(sizeof(struct netmap_mem_d), M_NETMAP, + M_WAITOK | M_ZERO); + mtx_init(&netmap_mem_d->nm_mtx, "netmap memory allocator lock", NULL, + MTX_DEF); + TAILQ_INIT(&netmap_mem_d->nm_molist); + netmap_mem_d->nm_buffer = buf; + netmap_mem_d->nm_totalsize = sz; + + /* + * A buffer takes 2k, a slot takes 8 bytes + ring overhead, + * so the ratio is 200:1. In other words, we can use 1/200 of + * the memory for the rings, and the rest for the buffers, + * and be sure we never run out. + */ + netmap_mem_d->nm_size = sz/200; + netmap_mem_d->nm_buf_start = + (netmap_mem_d->nm_size + PAGE_SIZE - 1) & ~(PAGE_SIZE-1); + netmap_mem_d->nm_buf_len = sz - netmap_mem_d->nm_buf_start; + + nm_buf_pool.base = netmap_mem_d->nm_buffer; + nm_buf_pool.base += netmap_mem_d->nm_buf_start; + netmap_buffer_base = nm_buf_pool.base; + D("netmap_buffer_base %p (offset %d)", + netmap_buffer_base, (int)netmap_mem_d->nm_buf_start); + /* number of buffers, they all start as free */ + + netmap_total_buffers = nm_buf_pool.total_buffers = + netmap_mem_d->nm_buf_len / NETMAP_BUF_SIZE; + nm_buf_pool.bufsize = NETMAP_BUF_SIZE; + + D("Have %d MB, use %dKB for rings, %d buffers at %p", + (sz >> 20), (int)(netmap_mem_d->nm_size >> 10), + nm_buf_pool.total_buffers, nm_buf_pool.base); + + /* allocate and initialize the bitmap. Entry 0 is considered + * always busy (used as default when there are no buffers left). + */ + n = (nm_buf_pool.total_buffers + 31) / 32; + nm_buf_pool.bitmap = malloc(sizeof(uint32_t) * n, M_NETMAP, + M_WAITOK | M_ZERO); + nm_buf_pool.bitmap[0] = ~3; /* slot 0 and 1 always busy */ + for (i = 1; i < n; i++) + nm_buf_pool.bitmap[i] = ~0; + nm_buf_pool.free = nm_buf_pool.total_buffers - 2; + + mem_obj = malloc(sizeof(struct netmap_mem_obj), M_NETMAP, + M_WAITOK | M_ZERO); + TAILQ_INSERT_HEAD(&netmap_mem_d->nm_molist, mem_obj, nmo_next); + mem_obj->nmo_used = 0; + mem_obj->nmo_size = netmap_mem_d->nm_size; + mem_obj->nmo_data = netmap_mem_d->nm_buffer; + + return (0); } +/* + * Finalize the memory allocator. + * + * Free all the memory objects contained inside the list, and deallocate + * the pool of memory; finally free the memory allocator descriptor. + */ static void -netmap_free_buf(struct netmap_if *nifp __unused, uint32_t i) +netmap_memory_fini(void) { - struct netmap_buf_pool *p = &nm_buf_pool; + struct netmap_mem_obj *mem_obj; - uint32_t pos, mask; - if (i >= p->total_buffers) { - D("invalid free index %d", i); - return; - } - pos = i / 32; - mask = 1 << (i % 32); - if (p->bitmap[pos] & mask) { - D("slot %d already free", i); - return; + while (!TAILQ_EMPTY(&netmap_mem_d->nm_molist)) { + mem_obj = TAILQ_FIRST(&netmap_mem_d->nm_molist); + TAILQ_REMOVE(&netmap_mem_d->nm_molist, mem_obj, nmo_next); + if (mem_obj->nmo_used == 1) { + printf("netmap: leaked %d bytes at %p\n", + (int)mem_obj->nmo_size, + mem_obj->nmo_data); + } + free(mem_obj, M_NETMAP); } - p->bitmap[pos] |= mask; - p->free++; + contigfree(netmap_mem_d->nm_buffer, netmap_mem_d->nm_totalsize, M_NETMAP); + // XXX mutex_destroy(nm_mtx); + free(netmap_mem_d, M_NETMAP); } - - -/* Descriptor of the memory objects handled by our memory allocator. */ -struct netmap_mem_obj { - TAILQ_ENTRY(netmap_mem_obj) nmo_next; /* next object in the - chain. */ - int nmo_used; /* flag set on used memory objects. */ - size_t nmo_size; /* size of the memory area reserved for the - object. */ - void *nmo_data; /* pointer to the memory area. */ -}; - -/* Wrap our memory objects to make them ``chainable``. */ -TAILQ_HEAD(netmap_mem_obj_h, netmap_mem_obj); - - -/* Descriptor of our custom memory allocator. */ -struct netmap_mem_d { - struct mtx nm_mtx; /* lock used to handle the chain of memory - objects. */ - struct netmap_mem_obj_h nm_molist; /* list of memory objects */ - size_t nm_size; /* total amount of memory used for rings etc. */ - size_t nm_totalsize; /* total amount of allocated memory - (the difference is used for buffers) */ - size_t nm_buf_start; /* offset of packet buffers. - This is page-aligned. */ - size_t nm_buf_len; /* total memory for buffers */ - void *nm_buffer; /* pointer to the whole pre-allocated memory - area. */ -}; +/*------------- end of memory allocator -----------------*/ /* Structure associated to each thread which registered an interface. */ @@ -250,15 +633,8 @@ struct netmap_priv_d { uint16_t np_txpoll; }; -/* Shorthand to compute a netmap interface offset. */ -#define netmap_if_offset(v) \ - ((char *) (v) - (char *) netmap_mem_d->nm_buffer) -/* .. and get a physical address given a memory offset */ -#define netmap_ofstophys(o) \ - (vtophys(netmap_mem_d->nm_buffer) + (o)) static struct cdev *netmap_dev; /* /dev/netmap character device. */ -static struct netmap_mem_d *netmap_mem_d; /* Our memory allocator. */ static d_mmap_t netmap_mmap; @@ -351,6 +727,7 @@ netmap_kqfilter(struct cdev *dev, struct } #endif /* NETMAP_KEVENT */ + /* * File descriptor's private data destructor. * @@ -358,19 +735,13 @@ netmap_kqfilter(struct cdev *dev, struct * revert to normal operation. We expect that np_ifp has not gone. */ static void -netmap_dtor(void *data) +netmap_dtor_locked(void *data) { struct netmap_priv_d *priv = data; struct ifnet *ifp = priv->np_ifp; struct netmap_adapter *na = NA(ifp); struct netmap_if *nifp = priv->np_nifp; - if (0) - printf("%s starting for %p ifp %p\n", __FUNCTION__, priv, - priv ? priv->np_ifp : NULL); - - na->nm_lock(ifp->if_softc, NETMAP_CORE_LOCK, 0); - na->refcount--; if (na->refcount <= 0) { /* last instance */ u_int i; @@ -411,159 +782,34 @@ netmap_dtor(void *data) for (j = 0; j < lim; j++) netmap_free_buf(nifp, ring->slot[j].buf_idx); - ND("rx queue %d", i); - ring = na->rx_rings[i].ring; - lim = na->rx_rings[i].nkr_num_slots; - for (j = 0; j < lim; j++) - netmap_free_buf(nifp, ring->slot[j].buf_idx); - } - NMA_UNLOCK(); - netmap_free_rings(na); - wakeup(na); - } - netmap_if_free(nifp); - - na->nm_lock(ifp->if_softc, NETMAP_CORE_UNLOCK, 0); - - if_rele(ifp); - - bzero(priv, sizeof(*priv)); /* XXX for safety */ - free(priv, M_DEVBUF); -} - - -/* - * Create and return a new ``netmap_if`` object, and possibly also - * rings and packet buffors. - * - * Return NULL on failure. - */ -static void * -netmap_if_new(const char *ifname, struct netmap_adapter *na) -{ - struct netmap_if *nifp; - struct netmap_ring *ring; - char *buff; - u_int i, len, ofs; - u_int n = na->num_queues + 1; /* shorthand, include stack queue */ - - /* - * the descriptor is followed inline by an array of offsets - * to the tx and rx rings in the shared memory region. - */ - len = sizeof(struct netmap_if) + 2 * n * sizeof(ssize_t); - nifp = netmap_if_malloc(len); - if (nifp == NULL) - return (NULL); - - /* initialize base fields */ - *(int *)(uintptr_t)&nifp->ni_num_queues = na->num_queues; - strncpy(nifp->ni_name, ifname, IFNAMSIZ); - - (na->refcount)++; /* XXX atomic ? we are under lock */ - if (na->refcount > 1) - goto final; - - /* - * If this is the first instance, allocate the shadow rings and - * buffers for this card (one for each hw queue, one for the host). - * The rings are contiguous, but have variable size. - * The entire block is reachable at - * na->tx_rings[0].ring - */ - - len = n * (2 * sizeof(struct netmap_ring) + - (na->num_tx_desc + na->num_rx_desc) * - sizeof(struct netmap_slot) ); - buff = netmap_ring_malloc(len); - if (buff == NULL) { - D("failed to allocate %d bytes for %s shadow ring", - len, ifname); -error: - (na->refcount)--; - netmap_if_free(nifp); - return (NULL); - } - /* do we have the bufers ? we are in need of num_tx_desc buffers for - * each tx ring and num_tx_desc buffers for each rx ring. */ - len = n * (na->num_tx_desc + na->num_rx_desc); - NMA_LOCK(); - if (nm_buf_pool.free < len) { - NMA_UNLOCK(); - netmap_free(buff, "not enough bufs"); - goto error; - } - /* - * in the kring, store the pointers to the shared rings - * and initialize the rings. We are under NMA_LOCK(). - */ - ofs = 0; - for (i = 0; i < n; i++) { - struct netmap_kring *kring; - int numdesc; - - /* Transmit rings */ - kring = &na->tx_rings[i]; - numdesc = na->num_tx_desc; - bzero(kring, sizeof(*kring)); - kring->na = na; - - ring = kring->ring = (struct netmap_ring *)(buff + ofs); - *(ssize_t *)(uintptr_t)&ring->buf_ofs = - nm_buf_pool.base - (char *)ring; - ND("txring[%d] at %p ofs %d", i, ring, ring->buf_ofs); - *(int *)(int *)(uintptr_t)&ring->num_slots = - kring->nkr_num_slots = numdesc; - - /* - * IMPORTANT: - * Always keep one slot empty, so we can detect new - * transmissions comparing cur and nr_hwcur (they are - * the same only if there are no new transmissions). - */ - ring->avail = kring->nr_hwavail = numdesc - 1; - ring->cur = kring->nr_hwcur = 0; - netmap_new_bufs(nifp, ring->slot, numdesc); - - ofs += sizeof(struct netmap_ring) + - numdesc * sizeof(struct netmap_slot); - - /* Receive rings */ - kring = &na->rx_rings[i]; - numdesc = na->num_rx_desc; - bzero(kring, sizeof(*kring)); - kring->na = na; - - ring = kring->ring = (struct netmap_ring *)(buff + ofs); - *(ssize_t *)(uintptr_t)&ring->buf_ofs = - nm_buf_pool.base - (char *)ring; - ND("rxring[%d] at %p offset %d", i, ring, ring->buf_ofs); - *(int *)(int *)(uintptr_t)&ring->num_slots = - kring->nkr_num_slots = numdesc; - ring->cur = kring->nr_hwcur = 0; - ring->avail = kring->nr_hwavail = 0; /* empty */ - netmap_new_bufs(nifp, ring->slot, numdesc); - ofs += sizeof(struct netmap_ring) + - numdesc * sizeof(struct netmap_slot); - } - NMA_UNLOCK(); - for (i = 0; i < n+1; i++) { - // XXX initialize the selrecord structs. - } -final: - /* - * fill the slots for the rx and tx queues. They contain the offset - * between the ring and nifp, so the information is usable in - * userspace to reach the ring from the nifp. - */ - for (i = 0; i < n; i++) { - char *base = (char *)nifp; - *(ssize_t *)(uintptr_t)&nifp->ring_ofs[i] = - (char *)na->tx_rings[i].ring - base; - *(ssize_t *)(uintptr_t)&nifp->ring_ofs[i+n] = - (char *)na->rx_rings[i].ring - base; + ND("rx queue %d", i); + ring = na->rx_rings[i].ring; + lim = na->rx_rings[i].nkr_num_slots; + for (j = 0; j < lim; j++) + netmap_free_buf(nifp, ring->slot[j].buf_idx); + } + NMA_UNLOCK(); + netmap_free_rings(na); + wakeup(na); } - return (nifp); + netmap_if_free(nifp); +} + + +static void +netmap_dtor(void *data) +{ + struct netmap_priv_d *priv = data; + struct ifnet *ifp = priv->np_ifp; + struct netmap_adapter *na = NA(ifp); + + na->nm_lock(ifp->if_softc, NETMAP_CORE_LOCK, 0); + netmap_dtor_locked(data); + na->nm_lock(ifp->if_softc, NETMAP_CORE_UNLOCK, 0); + + if_rele(ifp); + bzero(priv, sizeof(*priv)); /* XXX for safety */ + free(priv, M_DEVBUF); } @@ -894,7 +1140,6 @@ netmap_ioctl(__unused struct cdev *dev, break; } - for (i = 10; i > 0; i--) { na->nm_lock(adapter, NETMAP_CORE_LOCK, 0); if (!NETMAP_DELETING(na)) @@ -924,25 +1169,16 @@ netmap_ioctl(__unused struct cdev *dev, * and make it use the shared buffers. */ error = na->nm_register(ifp, 1); /* mode on */ - if (error) { - /* - * do something similar to netmap_dtor(). - */ - netmap_free_rings(na); - // XXX tx_rings is inline, must not be freed. - // free(na->tx_rings, M_DEVBUF); // XXX wrong ? - na->tx_rings = na->rx_rings = NULL; - na->refcount--; - netmap_if_free(nifp); - nifp = NULL; - } + if (error) + netmap_dtor_locked(priv); } if (error) { /* reg. failed, release priv and ref */ error: na->nm_lock(adapter, NETMAP_CORE_UNLOCK, 0); - free(priv, M_DEVBUF); if_rele(ifp); /* return the refcount */ + bzero(priv, sizeof(*priv)); + free(priv, M_DEVBUF); break; } @@ -1166,6 +1402,12 @@ netmap_poll(__unused struct cdev *dev, i if (priv->np_txpoll || want_tx) { for (i = priv->np_qfirst; i < priv->np_qlast; i++) { kring = &na->tx_rings[i]; + /* + * Skip the current ring if want_tx == 0 + * (we have already done a successful sync on + * a previous ring) AND kring->cur == kring->hwcur + * (there are no pending transmissions for this ring). + */ if (!want_tx && kring->ring->cur == kring->nr_hwcur) continue; if (core_lock == NEED_CL) { @@ -1181,6 +1423,7 @@ netmap_poll(__unused struct cdev *dev, i if (na->nm_txsync(adapter, i, 0 /* no lock */)) revents |= POLLERR; + /* Check avail/call selrecord only if called with POLLOUT */ if (want_tx) { if (kring->ring->avail > 0) { /* stop at the first ring. We don't risk @@ -1212,9 +1455,10 @@ netmap_poll(__unused struct cdev *dev, i if (na->nm_rxsync(adapter, i, 0 /* no lock */)) revents |= POLLERR; - if (no_timestamp == 0 || - kring->ring->flags & NR_TIMESTAMP) + if (netmap_no_timestamp == 0 || *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Wed Feb 8 13:39:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 344BB106564A; Wed, 8 Feb 2012 13:39:39 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1F9398FC08; Wed, 8 Feb 2012 13:39:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q18DdcZ6044965; Wed, 8 Feb 2012 13:39:38 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18Ddc62044963; Wed, 8 Feb 2012 13:39:38 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202081339.q18Ddc62044963@svn.freebsd.org> From: Gleb Smirnoff Date: Wed, 8 Feb 2012 13:39:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231201 - head/sys/netinet X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 13:39:39 -0000 Author: glebius Date: Wed Feb 8 13:39:38 2012 New Revision: 231201 URL: http://svn.freebsd.org/changeset/base/231201 Log: Set vnet context in callouts and taskqueues. PR: 164696 Modified: head/sys/netinet/ip_carp.c Modified: head/sys/netinet/ip_carp.c ============================================================================== --- head/sys/netinet/ip_carp.c Wed Feb 8 12:53:14 2012 (r231200) +++ head/sys/netinet/ip_carp.c Wed Feb 8 13:39:38 2012 (r231201) @@ -707,19 +707,24 @@ carp_send_ad_all(void *ctx __unused, int LIST_FOREACH(sc, &carp_list, sc_next) if (sc->sc_state == MASTER) { CARP_LOCK(sc); + CURVNET_SET(sc->sc_carpdev->if_vnet); carp_send_ad_locked(sc); + CURVNET_RESTORE(); CARP_UNLOCK(sc); } mtx_unlock(&carp_mtx); } +/* Send a periodic advertisement, executed in callout context. */ static void carp_send_ad(void *v) { struct carp_softc *sc = v; CARP_LOCK_ASSERT(sc); + CURVNET_SET(sc->sc_carpdev->if_vnet); carp_send_ad_locked(sc); + CURVNET_RESTORE(); CARP_UNLOCK(sc); } @@ -1090,6 +1095,7 @@ carp_forus(struct ifnet *ifp, u_char *dh return (0); } +/* Master down timeout event, executed in callout context. */ static void carp_master_down(void *v) { @@ -1097,12 +1103,14 @@ carp_master_down(void *v) CARP_LOCK_ASSERT(sc); + CURVNET_SET(sc->sc_carpdev->if_vnet); if (sc->sc_state == BACKUP) { CARP_LOG("VHID %u@%s: BACKUP -> MASTER (master down)\n", sc->sc_vhid, sc->sc_carpdev->if_xname); carp_master_down_locked(sc); } + CURVNET_RESTORE(); CARP_UNLOCK(sc); } From owner-svn-src-head@FreeBSD.ORG Wed Feb 8 15:07:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0DC0106566B; Wed, 8 Feb 2012 15:07:19 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CFF598FC18; Wed, 8 Feb 2012 15:07:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q18F7Jfv048078; Wed, 8 Feb 2012 15:07:19 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18F7JmQ048076; Wed, 8 Feb 2012 15:07:19 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202081507.q18F7JmQ048076@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 8 Feb 2012 15:07:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231204 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 15:07:20 -0000 Author: kib Date: Wed Feb 8 15:07:19 2012 New Revision: 231204 URL: http://svn.freebsd.org/changeset/base/231204 Log: Unbreak detection of the async mode for clustered writes after r231075. Submitted by: bde MFC after: 12 days Modified: head/sys/kern/vfs_cluster.c Modified: head/sys/kern/vfs_cluster.c ============================================================================== --- head/sys/kern/vfs_cluster.c Wed Feb 8 14:21:20 2012 (r231203) +++ head/sys/kern/vfs_cluster.c Wed Feb 8 15:07:19 2012 (r231204) @@ -604,7 +604,7 @@ cluster_write(struct vnode *vp, struct b int async; if (vp->v_type == VREG) { - async = vp->v_mount->mnt_kern_flag & MNTK_ASYNC; + async = DOINGASYNC(vp); lblocksize = vp->v_mount->mnt_stat.f_iosize; } else { async = 0; From owner-svn-src-head@FreeBSD.ORG Wed Feb 8 17:30:09 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3E3BF106564A; Wed, 8 Feb 2012 17:30:09 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id 059088FC16; Wed, 8 Feb 2012 17:30:08 +0000 (UTC) Received: from [172.23.7.29] (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q18H3uNU035977 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Wed, 8 Feb 2012 09:04:02 -0800 (PST) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <201202052356.q15NuNuh007220@svn.freebsd.org> Date: Wed, 8 Feb 2012 09:03:51 -0800 Content-Transfer-Encoding: 7bit Message-Id: <1FDDE018-A652-44D1-B4A4-B52713A36108@xcllnt.net> References: <201202052356.q15NuNuh007220@svn.freebsd.org> To: Dimitry Andric X-Mailer: Apple Mail (2.1257) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r231057 - in head: contrib/llvm/tools/bugpoint contrib/llvm/tools/llc contrib/llvm/tools/lli contrib/llvm/tools/llvm-ar contrib/llvm/tools/llvm-as contrib/llvm/tools/llvm-bcanalyzer con... X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 17:30:09 -0000 On Feb 5, 2012, at 3:56 PM, Dimitry Andric wrote: > Author: dim > Date: Sun Feb 5 23:56:22 2012 > New Revision: 231057 > URL: http://svn.freebsd.org/changeset/base/231057 > > Log: > Add a WITH_CLANG_EXTRAS option for src.conf(5), disabled by default, > that builds the following additional llvm/clang tools: Thanks! -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Wed Feb 8 18:36:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04666106564A; Wed, 8 Feb 2012 18:36:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E7DF38FC12; Wed, 8 Feb 2012 18:36:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q18Ia7vf055654; Wed, 8 Feb 2012 18:36:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18Ia7jw055652; Wed, 8 Feb 2012 18:36:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202081836.q18Ia7jw055652@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 8 Feb 2012 18:36:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231220 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 18:36:08 -0000 Author: kib Date: Wed Feb 8 18:36:07 2012 New Revision: 231220 URL: http://svn.freebsd.org/changeset/base/231220 Log: Trim 8 unused bytes from struct vnode on 64-bit architectures. Reviewed by: alc Modified: head/sys/sys/vnode.h Modified: head/sys/sys/vnode.h ============================================================================== --- head/sys/sys/vnode.h Wed Feb 8 18:22:10 2012 (r231219) +++ head/sys/sys/vnode.h Wed Feb 8 18:36:07 2012 (r231220) @@ -149,8 +149,8 @@ struct vnode { struct lock *v_vnlock; /* u pointer to vnode lock */ int v_holdcnt; /* i prevents recycling. */ int v_usecount; /* i ref count of users */ - u_long v_iflag; /* i vnode flags (see below) */ - u_long v_vflag; /* v vnode flags */ + u_int v_iflag; /* i vnode flags (see below) */ + u_int v_vflag; /* v vnode flags */ int v_writecount; /* v ref count of writers */ /* From owner-svn-src-head@FreeBSD.ORG Wed Feb 8 20:31:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 34AF51065670; Wed, 8 Feb 2012 20:31:43 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 183998FC08; Wed, 8 Feb 2012 20:31:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q18KVgfC062103; Wed, 8 Feb 2012 20:31:42 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18KVgdC062099; Wed, 8 Feb 2012 20:31:42 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202082031.q18KVgdC062099@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 8 Feb 2012 20:31:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231226 - in head: etc sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 20:31:43 -0000 Author: jkim Date: Wed Feb 8 20:31:42 2012 New Revision: 231226 URL: http://svn.freebsd.org/changeset/base/231226 Log: Revert r211288 and move the logic to the acpi_timer itself. Modified: head/etc/rc.resume head/etc/rc.suspend head/sys/dev/acpica/acpi_timer.c Modified: head/etc/rc.resume ============================================================================== --- head/etc/rc.resume Wed Feb 8 19:31:32 2012 (r231225) +++ head/etc/rc.resume Wed Feb 8 20:31:42 2012 (r231226) @@ -43,12 +43,6 @@ if [ -r /var/run/rc.suspend.pid ]; then echo 'rc.resume: killed rc.suspend that was still around' fi -if [ -r /var/run/rc.suspend.tch ]; then - _t=`cat /var/run/rc.suspend.tch` - /sbin/sysctl -n kern.timecounter.hardware=$_t > /dev/null 2>&1 - /bin/rm -f /var/run/rc.suspend.tch -fi - if [ -r /var/run/moused.pid ]; then pkill -HUP -F /var/run/moused.pid fi Modified: head/etc/rc.suspend ============================================================================== --- head/etc/rc.suspend Wed Feb 8 19:31:32 2012 (r231225) +++ head/etc/rc.suspend Wed Feb 8 20:31:42 2012 (r231226) @@ -43,18 +43,6 @@ fi echo $$ 2> /dev/null > /var/run/rc.suspend.pid -_t=`/sbin/sysctl -n kern.timecounter.hardware 2> /dev/null` -case ${_t#ACPI-} in -fast|safe) - /bin/rm -f /var/run/rc.suspend.tch - ;; -*) - { /sbin/sysctl -n kern.timecounter.hardware=ACPI-fast || \ - /sbin/sysctl -n kern.timecounter.hardware=ACPI-safe; } \ - > /dev/null 2>&1 && echo $_t > /var/run/rc.suspend.tch - ;; -esac - # If you have troubles on suspending with PC-CARD modem, try this. # See also contrib/pccardq.c (Only for PAO users). # pccardq | awk -F '~' '$5 == "filled" && $4 ~ /uart/ \ Modified: head/sys/dev/acpica/acpi_timer.c ============================================================================== --- head/sys/dev/acpica/acpi_timer.c Wed Feb 8 19:31:32 2012 (r231225) +++ head/sys/dev/acpica/acpi_timer.c Wed Feb 8 20:31:42 2012 (r231226) @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include "opt_acpi.h" #include #include +#include #include #include #include @@ -60,12 +61,15 @@ static device_t acpi_timer_dev; static struct resource *acpi_timer_reg; static bus_space_handle_t acpi_timer_bsh; static bus_space_tag_t acpi_timer_bst; +static eventhandler_tag acpi_timer_eh; static u_int acpi_timer_frequency = 14318182 / 4; static void acpi_timer_identify(driver_t *driver, device_t parent); static int acpi_timer_probe(device_t dev); static int acpi_timer_attach(device_t dev); +static int acpi_timer_suspend(device_t); +static void acpi_timer_resume_handler(struct timecounter *); static u_int acpi_timer_get_timecount(struct timecounter *tc); static u_int acpi_timer_get_timecount_safe(struct timecounter *tc); static int acpi_timer_sysctl_freq(SYSCTL_HANDLER_ARGS); @@ -77,6 +81,7 @@ static device_method_t acpi_timer_method DEVMETHOD(device_identify, acpi_timer_identify), DEVMETHOD(device_probe, acpi_timer_probe), DEVMETHOD(device_attach, acpi_timer_attach), + DEVMETHOD(device_suspend, acpi_timer_suspend), {0, 0} }; @@ -247,6 +252,49 @@ acpi_timer_attach(device_t dev) return (0); } +static void +acpi_timer_resume_handler(struct timecounter *newtc) +{ + struct timecounter *tc; + + tc = timecounter; + if (tc != newtc) { + if (bootverbose) + device_printf(acpi_timer_dev, + "restoring timecounter, %s -> %s\n", + tc->tc_name, newtc->tc_name); + (void)newtc->tc_get_timecount(newtc); + (void)newtc->tc_get_timecount(newtc); + timecounter = newtc; + } +} + +static int +acpi_timer_suspend(device_t dev) +{ + struct timecounter *newtc, *tc; + int error; + + error = bus_generic_suspend(dev); + if (acpi_timer_eh != NULL) { + EVENTHANDLER_DEREGISTER(power_resume, acpi_timer_eh); + acpi_timer_eh = NULL; + } + tc = timecounter; + newtc = &acpi_timer_timecounter; + if (tc != newtc) { + if (bootverbose) + device_printf(dev, "switching timecounter, %s -> %s\n", + tc->tc_name, newtc->tc_name); + (void)acpi_timer_read(); + (void)acpi_timer_read(); + timecounter = newtc; + acpi_timer_eh = EVENTHANDLER_REGISTER(power_resume, + acpi_timer_resume_handler, tc, EVENTHANDLER_PRI_LAST); + } + return (error); +} + /* * Fetch current time value from reliable hardware. */ From owner-svn-src-head@FreeBSD.ORG Wed Feb 8 21:23:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5BE21106564A; Wed, 8 Feb 2012 21:23:21 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4A52E8FC14; Wed, 8 Feb 2012 21:23:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q18LNLCs065348; Wed, 8 Feb 2012 21:23:21 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18LNL9d065344; Wed, 8 Feb 2012 21:23:21 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202082123.q18LNL9d065344@svn.freebsd.org> From: Jung-uk Kim Date: Wed, 8 Feb 2012 21:23:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231227 - in head/sys: amd64/acpica dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 21:23:21 -0000 Author: jkim Date: Wed Feb 8 21:23:20 2012 New Revision: 231227 URL: http://svn.freebsd.org/changeset/base/231227 Log: Reset clock after atrtc(4) is properly resumed. Modified: head/sys/amd64/acpica/acpi_wakeup.c head/sys/dev/acpica/acpi.c head/sys/dev/acpica/acpivar.h Modified: head/sys/amd64/acpica/acpi_wakeup.c ============================================================================== --- head/sys/amd64/acpica/acpi_wakeup.c Wed Feb 8 20:31:42 2012 (r231226) +++ head/sys/amd64/acpica/acpi_wakeup.c Wed Feb 8 21:23:20 2012 (r231227) @@ -291,7 +291,6 @@ acpi_sleep_machdep(struct acpi_softc *sc if (!CPU_EMPTY(&wakeup_cpus)) acpi_wakeup_cpus(sc, &wakeup_cpus); #endif - acpi_resync_clock(sc); ret = 0; } Modified: head/sys/dev/acpica/acpi.c ============================================================================== --- head/sys/dev/acpica/acpi.c Wed Feb 8 20:31:42 2012 (r231226) +++ head/sys/dev/acpica/acpi.c Wed Feb 8 21:23:20 2012 (r231227) @@ -152,6 +152,7 @@ static ACPI_STATUS acpi_EnterSleepState( static void acpi_shutdown_final(void *arg, int howto); static void acpi_enable_fixed_events(struct acpi_softc *sc); static BOOLEAN acpi_has_hid(ACPI_HANDLE handle); +static void acpi_resync_clock(struct acpi_softc *sc); static int acpi_wake_sleep_prep(ACPI_HANDLE handle, int sstate); static int acpi_wake_run_prep(ACPI_HANDLE handle, int sstate); static int acpi_wake_prep_walk(int sstate); @@ -277,11 +278,13 @@ TUNABLE_INT("debug.acpi.interpreter_slac SYSCTL_INT(_debug_acpi, OID_AUTO, interpreter_slack, CTLFLAG_RDTUN, &acpi_interpreter_slack, 1, "Turn on interpreter slack mode."); +#ifdef __amd64__ /* Reset system clock while resuming. XXX Remove once tested. */ static int acpi_reset_clock = 1; TUNABLE_INT("debug.acpi.reset_clock", &acpi_reset_clock); SYSCTL_INT(_debug_acpi, OID_AUTO, reset_clock, CTLFLAG_RW, &acpi_reset_clock, 1, "Reset system clock while resuming."); +#endif /* Allow users to override quirks. */ TUNABLE_INT("debug.acpi.quirks", &acpi_quirks); @@ -2741,8 +2744,10 @@ backout: AcpiLeaveSleepState(state); if (slp_state >= ACPI_SS_DEV_SUSPEND) DEVICE_RESUME(root_bus); - if (slp_state >= ACPI_SS_SLEPT) + if (slp_state >= ACPI_SS_SLEPT) { + acpi_resync_clock(sc); acpi_enable_fixed_events(sc); + } sc->acpi_next_sstate = 0; mtx_unlock(&Giant); @@ -2765,10 +2770,10 @@ backout: return_ACPI_STATUS (status); } -void +static void acpi_resync_clock(struct acpi_softc *sc) { - +#ifdef __amd64__ if (!acpi_reset_clock) return; @@ -2778,6 +2783,7 @@ acpi_resync_clock(struct acpi_softc *sc) (void)timecounter->tc_get_timecount(timecounter); (void)timecounter->tc_get_timecount(timecounter); inittodr(time_second + sc->acpi_sleep_delay); +#endif } /* Enable or disable the device's wake GPE. */ Modified: head/sys/dev/acpica/acpivar.h ============================================================================== --- head/sys/dev/acpica/acpivar.h Wed Feb 8 20:31:42 2012 (r231226) +++ head/sys/dev/acpica/acpivar.h Wed Feb 8 21:23:20 2012 (r231227) @@ -339,7 +339,6 @@ ACPI_STATUS acpi_SetIntrModel(int model) int acpi_ReqSleepState(struct acpi_softc *sc, int state); int acpi_AckSleepState(struct apm_clone_data *clone, int error); ACPI_STATUS acpi_SetSleepState(struct acpi_softc *sc, int state); -void acpi_resync_clock(struct acpi_softc *sc); int acpi_wake_set_enable(device_t dev, int enable); int acpi_parse_prw(ACPI_HANDLE h, struct acpi_prw_data *prw); ACPI_STATUS acpi_Startup(void); From owner-svn-src-head@FreeBSD.ORG Wed Feb 8 21:40:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6C09E106566B; Wed, 8 Feb 2012 21:40:55 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5A24B8FC13; Wed, 8 Feb 2012 21:40:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q18LetPi066122; Wed, 8 Feb 2012 21:40:55 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18Letcd066118; Wed, 8 Feb 2012 21:40:55 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202082140.q18Letcd066118@svn.freebsd.org> From: Marius Strobl Date: Wed, 8 Feb 2012 21:40:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231228 - head/sys/dev/mpt X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 21:40:55 -0000 Author: marius Date: Wed Feb 8 21:40:54 2012 New Revision: 231228 URL: http://svn.freebsd.org/changeset/base/231228 Log: Remove extra newlines from panic messages. Modified: head/sys/dev/mpt/mpt.c head/sys/dev/mpt/mpt.h head/sys/dev/mpt/mpt_cam.c Modified: head/sys/dev/mpt/mpt.c ============================================================================== --- head/sys/dev/mpt/mpt.c Wed Feb 8 21:23:20 2012 (r231227) +++ head/sys/dev/mpt/mpt.c Wed Feb 8 21:40:54 2012 (r231228) @@ -148,7 +148,7 @@ static __inline struct mpt_personality * mpt_pers_find(struct mpt_softc *mpt, u_int start_at) { KASSERT(start_at <= MPT_MAX_PERSONALITIES, - ("mpt_pers_find: starting position out of range\n")); + ("mpt_pers_find: starting position out of range")); while (start_at < MPT_MAX_PERSONALITIES && (mpt->mpt_pers_mask & (0x1 << start_at)) == 0) { @@ -1197,8 +1197,7 @@ mpt_free_request(struct mpt_softc *mpt, uint32_t offset, reply_baddr; if (req == NULL || req != &mpt->request_pool[req->index]) { - panic("mpt_free_request bad req ptr\n"); - return; + panic("mpt_free_request: bad req ptr"); } if ((nxt = req->chain) != NULL) { req->chain = NULL; @@ -1261,7 +1260,7 @@ retry: req = TAILQ_FIRST(&mpt->request_free_list); if (req != NULL) { KASSERT(req == &mpt->request_pool[req->index], - ("mpt_get_request: corrupted request free list\n")); + ("mpt_get_request: corrupted request free list")); KASSERT(req->state == REQ_STATE_FREE, ("req %p:%u not free on free list %x index %d function %x", req, req->serno, req->state, req->index, Modified: head/sys/dev/mpt/mpt.h ============================================================================== --- head/sys/dev/mpt/mpt.h Wed Feb 8 21:23:20 2012 (r231227) +++ head/sys/dev/mpt/mpt.h Wed Feb 8 21:40:54 2012 (r231228) @@ -851,7 +851,7 @@ mpt_lockspl(struct mpt_softc *mpt) mpt->mpt_splsaved = s; } else { splx(s); - panic("Recursed lock with mask: 0x%x\n", s); + panic("Recursed lock with mask: 0x%x", s); } } @@ -863,7 +863,7 @@ mpt_unlockspl(struct mpt_softc *mpt) splx(mpt->mpt_splsaved); } } else - panic("Negative lock count\n"); + panic("Negative lock count"); } static __inline int @@ -1144,7 +1144,7 @@ static __inline request_t * mpt_tag_2_req(struct mpt_softc *mpt, uint32_t tag) { uint16_t rtg = (tag >> 18); - KASSERT(rtg < mpt->tgt_cmds_allocated, ("bad tag %d\n", tag)); + KASSERT(rtg < mpt->tgt_cmds_allocated, ("bad tag %d", tag)); KASSERT(mpt->tgt_cmd_ptrs, ("no cmd backpointer array")); KASSERT(mpt->tgt_cmd_ptrs[rtg], ("no cmd backpointer")); return (mpt->tgt_cmd_ptrs[rtg]); @@ -1211,7 +1211,7 @@ mpt_req_spcl(struct mpt_softc *mpt, requ return; } } - panic("%s(%d): req %p:%u function %x not in els or tgt ptrs\n", + panic("%s(%d): req %p:%u function %x not in els or tgt ptrs", s, line, req, req->serno, ((PTR_MSG_REQUEST_HEADER)req->req_vbuf)->Function); } @@ -1225,13 +1225,13 @@ mpt_req_not_spcl(struct mpt_softc *mpt, int i; for (i = 0; i < mpt->els_cmds_allocated; i++) { KASSERT(req != mpt->els_cmd_ptrs[i], - ("%s(%d): req %p:%u func %x in els ptrs at ioindex %d\n", + ("%s(%d): req %p:%u func %x in els ptrs at ioindex %d", s, line, req, req->serno, ((PTR_MSG_REQUEST_HEADER)req->req_vbuf)->Function, i)); } for (i = 0; i < mpt->tgt_cmds_allocated; i++) { KASSERT(req != mpt->tgt_cmd_ptrs[i], - ("%s(%d): req %p:%u func %x in tgt ptrs at ioindex %d\n", + ("%s(%d): req %p:%u func %x in tgt ptrs at ioindex %d", s, line, req, req->serno, ((PTR_MSG_REQUEST_HEADER)req->req_vbuf)->Function, i)); } Modified: head/sys/dev/mpt/mpt_cam.c ============================================================================== --- head/sys/dev/mpt/mpt_cam.c Wed Feb 8 21:23:20 2012 (r231227) +++ head/sys/dev/mpt/mpt_cam.c Wed Feb 8 21:40:54 2012 (r231228) @@ -1356,7 +1356,7 @@ bad: MPT_TGT_STATE(mpt, cmd_req)->req = NULL; } ccb->ccb_h.status &= ~CAM_SIM_QUEUED; - KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d\n", __LINE__)); + KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); xpt_done(ccb); CAMLOCK_2_MPTLOCK(mpt); mpt_free_request(mpt, req); @@ -1634,7 +1634,7 @@ out: bus_dmamap_unload(mpt->buffer_dmat, req->dmap); } ccb->ccb_h.status &= ~CAM_SIM_QUEUED; - KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d\n", __LINE__)); + KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); xpt_done(ccb); CAMLOCK_2_MPTLOCK(mpt); mpt_free_request(mpt, req); @@ -1759,7 +1759,7 @@ bad: MPT_TGT_STATE(mpt, cmd_req)->req = NULL; } ccb->ccb_h.status &= ~CAM_SIM_QUEUED; - KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d\n", __LINE__)); + KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); xpt_done(ccb); CAMLOCK_2_MPTLOCK(mpt); mpt_free_request(mpt, req); @@ -2029,7 +2029,7 @@ out: bus_dmamap_unload(mpt->buffer_dmat, req->dmap); } ccb->ccb_h.status &= ~CAM_SIM_QUEUED; - KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d\n", __LINE__)); + KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); xpt_done(ccb); CAMLOCK_2_MPTLOCK(mpt); mpt_free_request(mpt, req); @@ -2737,7 +2737,7 @@ mpt_scsi_reply_handler(struct mpt_softc mpt_prt(mpt, "mpt_scsi_reply_handler: %p:%u complete\n", req, req->serno); } - KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d\n", __LINE__)); + KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); MPTLOCK_2_CAMLOCK(mpt); xpt_done(ccb); CAMLOCK_2_MPTLOCK(mpt); @@ -3652,7 +3652,7 @@ mpt_action(struct cam_sim *sim, union cc break; } mpt_calc_geometry(ccg, /*extended*/1); - KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d\n", __LINE__)); + KASSERT(ccb->ccb_h.status, ("zero ccb sts at %d", __LINE__)); break; } case XPT_PATH_INQ: /* Path routing inquiry */ @@ -4551,7 +4551,7 @@ mpt_target_start_io(struct mpt_softc *mp request_t *req; KASSERT((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE, - ("dxfer_len %u but direction is NONE\n", csio->dxfer_len)); + ("dxfer_len %u but direction is NONE", csio->dxfer_len)); if ((req = mpt_get_request(mpt, FALSE)) == NULL) { if (mpt->outofbeer == 0) { @@ -5455,7 +5455,7 @@ mpt_scsi_tgt_reply_handler(struct mpt_so mpt_set_ccb_status(ccb, CAM_REQ_CMP); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; KASSERT(ccb->ccb_h.status, - ("zero ccb sts at %d\n", __LINE__)); + ("zero ccb sts at %d", __LINE__)); tgt->state = TGT_STATE_IN_CAM; if (mpt->outofbeer) { ccb->ccb_h.status |= CAM_RELEASE_SIMQ; @@ -5517,7 +5517,7 @@ mpt_scsi_tgt_reply_handler(struct mpt_so mpt_set_ccb_status(ccb, CAM_REQ_CMP); ccb->ccb_h.status &= ~CAM_SIM_QUEUED; KASSERT(ccb->ccb_h.status, - ("ZERO ccb sts at %d\n", __LINE__)); + ("ZERO ccb sts at %d", __LINE__)); tgt->ccb = NULL; } else { mpt_lprt(mpt, MPT_PRT_DEBUG, @@ -5589,7 +5589,7 @@ mpt_scsi_tgt_reply_handler(struct mpt_so } tgt = MPT_TGT_STATE(mpt, req); KASSERT(tgt->state == TGT_STATE_LOADING, - ("bad state 0x%x on reply to buffer post\n", tgt->state)); + ("bad state 0x%x on reply to buffer post", tgt->state)); mpt_assign_serno(mpt, req); tgt->state = TGT_STATE_LOADED; break; From owner-svn-src-head@FreeBSD.ORG Wed Feb 8 22:05:27 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 22488106566B; Wed, 8 Feb 2012 22:05:27 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EB1E48FC15; Wed, 8 Feb 2012 22:05:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q18M5QAS066919; Wed, 8 Feb 2012 22:05:26 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18M5Q6f066916; Wed, 8 Feb 2012 22:05:26 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201202082205.q18M5Q6f066916@svn.freebsd.org> From: Sergey Kandaurov Date: Wed, 8 Feb 2012 22:05:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231229 - head/sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 22:05:27 -0000 Author: pluknet Date: Wed Feb 8 22:05:26 2012 New Revision: 231229 URL: http://svn.freebsd.org/changeset/base/231229 Log: g/c last bit of old ipv6 prefix management. Reviewed by: bz Obtained from: NetBSD, net/if.h, rev 1.80 Modified: head/sys/net/if.c head/sys/net/if_var.h Modified: head/sys/net/if.c ============================================================================== --- head/sys/net/if.c Wed Feb 8 21:40:54 2012 (r231228) +++ head/sys/net/if.c Wed Feb 8 22:05:26 2012 (r231229) @@ -456,7 +456,6 @@ if_alloc(u_char type) ifp->if_afdata_initialized = 0; IF_AFDATA_LOCK_INIT(ifp); TAILQ_INIT(&ifp->if_addrhead); - TAILQ_INIT(&ifp->if_prefixhead); TAILQ_INIT(&ifp->if_multiaddrs); TAILQ_INIT(&ifp->if_groups); #ifdef MAC Modified: head/sys/net/if_var.h ============================================================================== --- head/sys/net/if_var.h Wed Feb 8 21:40:54 2012 (r231228) +++ head/sys/net/if_var.h Wed Feb 8 22:05:26 2012 (r231229) @@ -96,7 +96,6 @@ struct vnet; TAILQ_HEAD(ifnethead, ifnet); /* we use TAILQs so that the order of */ TAILQ_HEAD(ifaddrhead, ifaddr); /* instantiation is preserved in the list */ -TAILQ_HEAD(ifprefixhead, ifprefix); TAILQ_HEAD(ifmultihead, ifmultiaddr); TAILQ_HEAD(ifgrouphead, ifg_group); @@ -184,7 +183,7 @@ struct ifnet { struct label *if_label; /* interface MAC label */ /* these are only used by IPv6 */ - struct ifprefixhead if_prefixhead; /* list of prefixes per if */ + void *if_unused[2]; void *if_afdata[AF_MAX]; int if_afdata_initialized; struct rwlock if_afdata_lock; @@ -762,20 +761,6 @@ void ifa_ref(struct ifaddr *ifa); #endif /* - * The prefix structure contains information about one prefix - * of an interface. They are maintained by the different address families, - * are allocated and attached when a prefix or an address is set, - * and are linked together so all prefixes for an interface can be located. - */ -struct ifprefix { - struct sockaddr *ifpr_prefix; /* prefix of interface */ - struct ifnet *ifpr_ifp; /* back-pointer to interface */ - TAILQ_ENTRY(ifprefix) ifpr_list; /* queue macro glue */ - u_char ifpr_plen; /* prefix length in bits */ - u_char ifpr_type; /* protocol dependent prefix type */ -}; - -/* * Multicast address structure. This is analogous to the ifaddr * structure except that it keeps track of multicast addresses. */ From owner-svn-src-head@FreeBSD.ORG Wed Feb 8 23:34:48 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7DC72106566C; Wed, 8 Feb 2012 23:34:48 +0000 (UTC) (envelope-from jamie@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6CB618FC08; Wed, 8 Feb 2012 23:34:48 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q18NYmLJ070131; Wed, 8 Feb 2012 23:34:48 GMT (envelope-from jamie@svn.freebsd.org) Received: (from jamie@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q18NYmtm070129; Wed, 8 Feb 2012 23:34:48 GMT (envelope-from jamie@svn.freebsd.org) Message-Id: <201202082334.q18NYmtm070129@svn.freebsd.org> From: Jamie Gritton Date: Wed, 8 Feb 2012 23:34:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231236 - head/lib/libc/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 08 Feb 2012 23:34:48 -0000 Author: jamie Date: Wed Feb 8 23:34:47 2012 New Revision: 231236 URL: http://svn.freebsd.org/changeset/base/231236 Log: Acknowledge that jail_attach and jail_remove can return EPERM. MFC after: 1 week Modified: head/lib/libc/sys/jail.2 Modified: head/lib/libc/sys/jail.2 ============================================================================== --- head/lib/libc/sys/jail.2 Wed Feb 8 23:14:26 2012 (r231235) +++ head/lib/libc/sys/jail.2 Wed Feb 8 23:34:47 2012 (r231236) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd June 23, 2009 +.Dd February 8, 2012 .Dt JAIL 2 .Os .Sh NAME @@ -400,6 +400,8 @@ and system calls will fail if: .Bl -tag -width Er +.It Bq Er EPERM +A user other than the super-user attempted to attach to or remove a jail. .It Bq Er EINVAL The jail specified by .Fa jid From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 00:16:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3939F1065672; Thu, 9 Feb 2012 00:16:13 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 269C98FC12; Thu, 9 Feb 2012 00:16:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q190GDao071536; Thu, 9 Feb 2012 00:16:13 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q190GDUV071529; Thu, 9 Feb 2012 00:16:13 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201202090016.q190GDUV071529@svn.freebsd.org> From: "Kenneth D. Merry" Date: Thu, 9 Feb 2012 00:16:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231240 - head/sys/dev/mps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 00:16:13 -0000 Author: ken Date: Thu Feb 9 00:16:12 2012 New Revision: 231240 URL: http://svn.freebsd.org/changeset/base/231240 Log: Bring in a number of mps(4) driver fixes from LSI: 1. Fixed timeout specification for the msleep in mps_wait_command(). Added 30 second timeout for mps_wait_command() calls in mps_user.c. 2. Make sure we call mps_detach_user() from the kldunload path. 3. Raid Hotplug behavior change. The driver now removes a volume when it goes to a failed state, so we also need to add volume back to the OS when it goes to opitimal/degraded/online from failed/missing. Handle raid volume add and remove from the IR_Volume event. 4. Added some more debugging information. 5. Replace xpt_async(AC_LOST_DEVICE, path, NULL) with mpssas_rescan_target(). This is to work around a panic in CAM that shows up when adding a drive with a rescan and removing another device from the driver thread with an AC_LOST_DEVICE async notification. This problem was encountered in testing with the LSI sas2ircu utility, which was used to create a RAID volume from physical disks. The driver has to create the RAID volume target and remove the physical disk targets, and triggered a panic in the process. The CAM issue needs to be fully diagnosed and fixed, but this works around the issue for now. 6. Fix some memory initialization issues in mps_free_command(). 7. Resolve the "devq freeze forever" issue. This was caused by the internal read capacity command issued in the non-head version of the driver. When the command completed with an error, the driver wasn't unfreezing thd device queue. The version in head uses the CAM infrastructure for getting the read capacity information, and therefore doesn't have the same issue. 8. Bump the version to 13.00.00.00-fbsd. (this is very close to LSI's internal stable driver 13.00.00.00) Submitted by: Kashyap Desai MFC after: 3 days Modified: head/sys/dev/mps/mps.c head/sys/dev/mps/mps_sas.c head/sys/dev/mps/mps_sas.h head/sys/dev/mps/mps_sas_lsi.c head/sys/dev/mps/mps_user.c head/sys/dev/mps/mpsvar.h Modified: head/sys/dev/mps/mps.c ============================================================================== --- head/sys/dev/mps/mps.c Wed Feb 8 23:57:03 2012 (r231239) +++ head/sys/dev/mps/mps.c Thu Feb 9 00:16:12 2012 (r231240) @@ -529,7 +529,7 @@ mps_enqueue_request(struct mps_softc *sc mps_dprint(sc, MPS_TRACE, "%s SMID %u cm %p ccb %p\n", __func__, cm->cm_desc.Default.SMID, cm, cm->cm_ccb); - if (sc->mps_flags & MPS_FLAGS_ATTACH_DONE) + if (sc->mps_flags & MPS_FLAGS_ATTACH_DONE && !(sc->mps_flags & MPS_FLAGS_SHUTDOWN)) mtx_assert(&sc->mps_mtx, MA_OWNED); if (++sc->io_cmds_active > sc->io_cmds_highwater) @@ -1335,6 +1335,8 @@ mps_free(struct mps_softc *sc) ((error = mps_detach_sas(sc)) != 0)) return (error); + mps_detach_user(sc); + /* Put the IOC back in the READY state. */ mps_lock(sc); if ((error = mps_transition_ready(sc)) != 0) { @@ -2142,7 +2144,7 @@ mps_wait_command(struct mps_softc *sc, s error = mps_map_command(sc, cm); if ((error != 0) && (error != EINPROGRESS)) return (error); - error = msleep(cm, &sc->mps_mtx, 0, "mpswait", timeout); + error = msleep(cm, &sc->mps_mtx, 0, "mpswait", timeout*hz); if (error == EWOULDBLOCK) error = ETIMEDOUT; return (error); Modified: head/sys/dev/mps/mps_sas.c ============================================================================== --- head/sys/dev/mps/mps_sas.c Wed Feb 8 23:57:03 2012 (r231239) +++ head/sys/dev/mps/mps_sas.c Thu Feb 9 00:16:12 2012 (r231240) @@ -139,7 +139,6 @@ static uint8_t op_code_prot[256] = { MALLOC_DEFINE(M_MPSSAS, "MPSSAS", "MPS SAS memory"); -static struct mpssas_target * mpssas_find_target_by_handle(struct mpssas_softc *, int, uint16_t); static void mpssas_discovery_timeout(void *data); static void mpssas_remove_device(struct mps_softc *, struct mps_command *); static void mpssas_remove_complete(struct mps_softc *, struct mps_command *); @@ -175,7 +174,7 @@ static int mpssas_send_portenable(struct static void mpssas_portenable_complete(struct mps_softc *sc, struct mps_command *cm); -static struct mpssas_target * +struct mpssas_target * mpssas_find_target_by_handle(struct mpssas_softc *sassc, int start, uint16_t handle) { struct mpssas_target *target; @@ -351,22 +350,123 @@ mpssas_log_command(struct mps_command *c va_end(ap); } + static void -mpssas_lost_target(struct mps_softc *sc, struct mpssas_target *targ) +mpssas_remove_volume(struct mps_softc *sc, struct mps_command *tm) { - struct mpssas_softc *sassc = sc->sassc; - path_id_t pathid = cam_sim_path(sassc->sim); - struct cam_path *path; + MPI2_SCSI_TASK_MANAGE_REPLY *reply; + struct mpssas_target *targ; + uint16_t handle; + + mps_dprint(sc, MPS_INFO, "%s\n", __func__); + + reply = (MPI2_SCSI_TASK_MANAGE_REPLY *)tm->cm_reply; + handle = (uint16_t)(uintptr_t)tm->cm_complete_data; + targ = tm->cm_targ; - mps_printf(sc, "%s targetid %u\n", __func__, targ->tid); - if (xpt_create_path(&path, NULL, pathid, targ->tid, 0) != CAM_REQ_CMP) { - mps_printf(sc, "unable to create path for lost target %d\n", - targ->tid); + if (reply == NULL) { + /* XXX retry the remove after the diag reset completes? */ + mps_printf(sc, "%s NULL reply reseting device 0x%04x\n", + __func__, handle); + mpssas_free_tm(sc, tm); return; } - xpt_async(AC_LOST_DEVICE, path, NULL); - xpt_free_path(path); + if (reply->IOCStatus != MPI2_IOCSTATUS_SUCCESS) { + mps_printf(sc, "IOCStatus = 0x%x while resetting device 0x%x\n", + reply->IOCStatus, handle); + mpssas_free_tm(sc, tm); + return; + } + + mps_printf(sc, "Reset aborted %u commands\n", reply->TerminationCount); + mps_free_reply(sc, tm->cm_reply_data); + tm->cm_reply = NULL; /* Ensures the the reply won't get re-freed */ + + mps_printf(sc, "clearing target %u handle 0x%04x\n", targ->tid, handle); + + /* + * Don't clear target if remove fails because things will get confusing. + * Leave the devname and sasaddr intact so that we know to avoid reusing + * this target id if possible, and so we can assign the same target id + * to this device if it comes back in the future. + */ + if (reply->IOCStatus == MPI2_IOCSTATUS_SUCCESS) { + targ = tm->cm_targ; + targ->handle = 0x0; + targ->encl_handle = 0x0; + targ->encl_slot = 0x0; + targ->exp_dev_handle = 0x0; + targ->phy_num = 0x0; + targ->linkrate = 0x0; + targ->devinfo = 0x0; + targ->flags = 0x0; + } + + mpssas_free_tm(sc, tm); +} + + +/* + * No Need to call "MPI2_SAS_OP_REMOVE_DEVICE" For Volume removal. + * Otherwise Volume Delete is same as Bare Drive Removal. + */ +void +mpssas_prepare_volume_remove(struct mpssas_softc *sassc, uint16_t handle) +{ + MPI2_SCSI_TASK_MANAGE_REQUEST *req; + struct mps_softc *sc; + struct mps_command *cm; + struct mpssas_target *targ = NULL; + + mps_dprint(sassc->sc, MPS_INFO, "%s\n", __func__); + sc = sassc->sc; + +#ifdef WD_SUPPORT + /* + * If this is a WD controller, determine if the disk should be exposed + * to the OS or not. If disk should be exposed, return from this + * function without doing anything. + */ + if (sc->WD_available && (sc->WD_hide_expose == + MPS_WD_EXPOSE_ALWAYS)) { + return; + } +#endif //WD_SUPPORT + + targ = mpssas_find_target_by_handle(sassc, 0, handle); + if (targ == NULL) { + /* FIXME: what is the action? */ + /* We don't know about this device? */ + printf("%s %d : invalid handle 0x%x \n", __func__,__LINE__, handle); + return; + } + + targ->flags |= MPSSAS_TARGET_INREMOVAL; + + cm = mpssas_alloc_tm(sc); + if (cm == NULL) { + mps_printf(sc, "%s: command alloc failure\n", __func__); + return; + } + + mpssas_rescan_target(sc, targ); + + req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)cm->cm_req; + req->DevHandle = targ->handle; + req->Function = MPI2_FUNCTION_SCSI_TASK_MGMT; + req->TaskType = MPI2_SCSITASKMGMT_TASKTYPE_TARGET_RESET; + + /* SAS Hard Link Reset / SATA Link Reset */ + req->MsgFlags = MPI2_SCSITASKMGMT_MSGFLAGS_LINK_RESET; + + cm->cm_targ = targ; + cm->cm_data = NULL; + cm->cm_desc.HighPriority.RequestFlags = + MPI2_REQ_DESCRIPT_FLAGS_HIGH_PRIORITY; + cm->cm_complete = mpssas_remove_volume; + cm->cm_complete_data = (void *)(uintptr_t)handle; + mps_map_command(sc, cm); } /* @@ -386,7 +486,7 @@ mpssas_prepare_remove(struct mpssas_soft struct mps_command *cm; struct mpssas_target *targ = NULL; - mps_dprint(sassc->sc, MPS_TRACE, "%s\n", __func__); + mps_dprint(sassc->sc, MPS_INFO, "%s\n", __func__); /* * If this is a WD controller, determine if the disk should be exposed @@ -403,7 +503,7 @@ mpssas_prepare_remove(struct mpssas_soft if (targ == NULL) { /* FIXME: what is the action? */ /* We don't know about this device? */ - printf("%s: invalid handle 0x%x \n", __func__, handle); + printf("%s %d : invalid handle 0x%x \n", __func__,__LINE__, handle); return; } @@ -415,7 +515,7 @@ mpssas_prepare_remove(struct mpssas_soft return; } - mpssas_lost_target(sc, targ); + mpssas_rescan_target(sc, targ); req = (MPI2_SCSI_TASK_MANAGE_REQUEST *)cm->cm_req; memset(req, 0, sizeof(*req)); @@ -443,7 +543,7 @@ mpssas_remove_device(struct mps_softc *s struct mps_command *next_cm; uint16_t handle; - mps_dprint(sc, MPS_TRACE, "%s\n", __func__); + mps_dprint(sc, MPS_INFO, "%s\n", __func__); reply = (MPI2_SCSI_TASK_MANAGE_REPLY *)tm->cm_reply; handle = (uint16_t)(uintptr_t)tm->cm_complete_data; @@ -514,7 +614,7 @@ mpssas_remove_complete(struct mps_softc uint16_t handle; struct mpssas_target *targ; - mps_dprint(sc, MPS_TRACE, "%s\n", __func__); + mps_dprint(sc, MPS_INFO, "%s\n", __func__); reply = (MPI2_SAS_IOUNIT_CONTROL_REPLY *)tm->cm_reply; handle = (uint16_t)(uintptr_t)tm->cm_complete_data; @@ -558,6 +658,7 @@ mpssas_remove_complete(struct mps_softc targ->phy_num = 0x0; targ->linkrate = 0x0; targ->devinfo = 0x0; + targ->flags = 0x0; } mpssas_free_tm(sc, tm); @@ -690,7 +791,7 @@ mps_detach_sas(struct mps_softc *sc) { struct mpssas_softc *sassc; - mps_dprint(sc, MPS_TRACE, "%s\n", __func__); + mps_dprint(sc, MPS_INFO, "%s\n", __func__); if (sc->sassc == NULL) return (0); @@ -733,6 +834,7 @@ mps_detach_sas(struct mps_softc *sc) } mps_unlock(sc); + mps_dprint(sc, MPS_INFO, "%s:%d\n", __func__,__LINE__); if (sassc->devq != NULL) cam_simq_free(sassc->devq); @@ -1475,11 +1577,11 @@ mpssas_action_scsiio(struct mpssas_softc uint16_t eedp_flags; sc = sassc->sc; - mps_dprint(sc, MPS_TRACE, "%s ccb %p\n", __func__, ccb); mtx_assert(&sc->mps_mtx, MA_OWNED); csio = &ccb->csio; targ = &sassc->targets[csio->ccb_h.target_id]; + mps_dprint(sc, MPS_TRACE, "%s ccb %p target flag %x\n", __func__, ccb, targ->flags); if (targ->handle == 0x0) { mps_dprint(sc, MPS_TRACE, "%s NULL handle for target %u\n", __func__, csio->ccb_h.target_id); @@ -1487,6 +1589,13 @@ mpssas_action_scsiio(struct mpssas_softc xpt_done(ccb); return; } + if (targ->flags & MPS_TARGET_FLAGS_RAID_COMPONENT) { + mps_dprint(sc, MPS_TRACE, "%s Raid component no SCSI IO supported %u\n", + __func__, csio->ccb_h.target_id); + csio->ccb_h.status = CAM_TID_INVALID; + xpt_done(ccb); + return; + } /* * If devinfo is 0 this will be a volume. In that case don't tell CAM * that the volume has timed out. We want volumes to be enumerated @@ -1684,6 +1793,198 @@ mpssas_action_scsiio(struct mpssas_softc } static void +mps_response_code(struct mps_softc *sc, u8 response_code) +{ + char *desc; + + switch (response_code) { + case MPI2_SCSITASKMGMT_RSP_TM_COMPLETE: + desc = "task management request completed"; + break; + case MPI2_SCSITASKMGMT_RSP_INVALID_FRAME: + desc = "invalid frame"; + break; + case MPI2_SCSITASKMGMT_RSP_TM_NOT_SUPPORTED: + desc = "task management request not supported"; + break; + case MPI2_SCSITASKMGMT_RSP_TM_FAILED: + desc = "task management request failed"; + break; + case MPI2_SCSITASKMGMT_RSP_TM_SUCCEEDED: + desc = "task management request succeeded"; + break; + case MPI2_SCSITASKMGMT_RSP_TM_INVALID_LUN: + desc = "invalid lun"; + break; + case 0xA: + desc = "overlapped tag attempted"; + break; + case MPI2_SCSITASKMGMT_RSP_IO_QUEUED_ON_IOC: + desc = "task queued, however not sent to target"; + break; + default: + desc = "unknown"; + break; + } + mps_dprint(sc, MPS_INFO, "response_code(0x%01x): %s\n", + response_code, desc); +} +/** + * mps_sc_failed_io_info - translated non-succesfull SCSI_IO request + */ +static void +mps_sc_failed_io_info(struct mps_softc *sc, struct ccb_scsiio *csio, + Mpi2SCSIIOReply_t *mpi_reply) +{ + u32 response_info; + u8 *response_bytes; + u16 ioc_status = le16toh(mpi_reply->IOCStatus) & + MPI2_IOCSTATUS_MASK; + u8 scsi_state = mpi_reply->SCSIState; + u8 scsi_status = mpi_reply->SCSIStatus; + char *desc_ioc_state = NULL; + char *desc_scsi_status = NULL; + char *desc_scsi_state = sc->tmp_string; + u32 log_info = le32toh(mpi_reply->IOCLogInfo); + + if (log_info == 0x31170000) + return; + + switch (ioc_status) { + case MPI2_IOCSTATUS_SUCCESS: + desc_ioc_state = "success"; + break; + case MPI2_IOCSTATUS_INVALID_FUNCTION: + desc_ioc_state = "invalid function"; + break; + case MPI2_IOCSTATUS_SCSI_RECOVERED_ERROR: + desc_ioc_state = "scsi recovered error"; + break; + case MPI2_IOCSTATUS_SCSI_INVALID_DEVHANDLE: + desc_ioc_state = "scsi invalid dev handle"; + break; + case MPI2_IOCSTATUS_SCSI_DEVICE_NOT_THERE: + desc_ioc_state = "scsi device not there"; + break; + case MPI2_IOCSTATUS_SCSI_DATA_OVERRUN: + desc_ioc_state = "scsi data overrun"; + break; + case MPI2_IOCSTATUS_SCSI_DATA_UNDERRUN: + desc_ioc_state = "scsi data underrun"; + break; + case MPI2_IOCSTATUS_SCSI_IO_DATA_ERROR: + desc_ioc_state = "scsi io data error"; + break; + case MPI2_IOCSTATUS_SCSI_PROTOCOL_ERROR: + desc_ioc_state = "scsi protocol error"; + break; + case MPI2_IOCSTATUS_SCSI_TASK_TERMINATED: + desc_ioc_state = "scsi task terminated"; + break; + case MPI2_IOCSTATUS_SCSI_RESIDUAL_MISMATCH: + desc_ioc_state = "scsi residual mismatch"; + break; + case MPI2_IOCSTATUS_SCSI_TASK_MGMT_FAILED: + desc_ioc_state = "scsi task mgmt failed"; + break; + case MPI2_IOCSTATUS_SCSI_IOC_TERMINATED: + desc_ioc_state = "scsi ioc terminated"; + break; + case MPI2_IOCSTATUS_SCSI_EXT_TERMINATED: + desc_ioc_state = "scsi ext terminated"; + break; + case MPI2_IOCSTATUS_EEDP_GUARD_ERROR: + desc_ioc_state = "eedp guard error"; + break; + case MPI2_IOCSTATUS_EEDP_REF_TAG_ERROR: + desc_ioc_state = "eedp ref tag error"; + break; + case MPI2_IOCSTATUS_EEDP_APP_TAG_ERROR: + desc_ioc_state = "eedp app tag error"; + break; + default: + desc_ioc_state = "unknown"; + break; + } + + switch (scsi_status) { + case MPI2_SCSI_STATUS_GOOD: + desc_scsi_status = "good"; + break; + case MPI2_SCSI_STATUS_CHECK_CONDITION: + desc_scsi_status = "check condition"; + break; + case MPI2_SCSI_STATUS_CONDITION_MET: + desc_scsi_status = "condition met"; + break; + case MPI2_SCSI_STATUS_BUSY: + desc_scsi_status = "busy"; + break; + case MPI2_SCSI_STATUS_INTERMEDIATE: + desc_scsi_status = "intermediate"; + break; + case MPI2_SCSI_STATUS_INTERMEDIATE_CONDMET: + desc_scsi_status = "intermediate condmet"; + break; + case MPI2_SCSI_STATUS_RESERVATION_CONFLICT: + desc_scsi_status = "reservation conflict"; + break; + case MPI2_SCSI_STATUS_COMMAND_TERMINATED: + desc_scsi_status = "command terminated"; + break; + case MPI2_SCSI_STATUS_TASK_SET_FULL: + desc_scsi_status = "task set full"; + break; + case MPI2_SCSI_STATUS_ACA_ACTIVE: + desc_scsi_status = "aca active"; + break; + case MPI2_SCSI_STATUS_TASK_ABORTED: + desc_scsi_status = "task aborted"; + break; + default: + desc_scsi_status = "unknown"; + break; + } + + desc_scsi_state[0] = '\0'; + if (!scsi_state) + desc_scsi_state = " "; + if (scsi_state & MPI2_SCSI_STATE_RESPONSE_INFO_VALID) + strcat(desc_scsi_state, "response info "); + if (scsi_state & MPI2_SCSI_STATE_TERMINATED) + strcat(desc_scsi_state, "state terminated "); + if (scsi_state & MPI2_SCSI_STATE_NO_SCSI_STATUS) + strcat(desc_scsi_state, "no status "); + if (scsi_state & MPI2_SCSI_STATE_AUTOSENSE_FAILED) + strcat(desc_scsi_state, "autosense failed "); + if (scsi_state & MPI2_SCSI_STATE_AUTOSENSE_VALID) + strcat(desc_scsi_state, "autosense valid "); + + mps_dprint(sc, MPS_INFO, "\thandle(0x%04x), ioc_status(%s)(0x%04x), \n", + le16toh(mpi_reply->DevHandle), + desc_ioc_state, ioc_status); + /* We can add more detail about underflow data here + * TO-DO + * */ + mps_dprint(sc, MPS_INFO, "\tscsi_status(%s)(0x%02x), " + "scsi_state(%s)(0x%02x)\n", desc_scsi_status, + scsi_status, desc_scsi_state, scsi_state); + + if (sc->mps_debug & MPS_INFO && + scsi_state & MPI2_SCSI_STATE_AUTOSENSE_VALID) { + mps_dprint(sc, MPS_INFO, "-> Sense Buffer Data : Start :\n"); + scsi_sense_print(csio); + mps_dprint(sc, MPS_INFO, "-> Sense Buffer Data : End :\n"); + } + + if (scsi_state & MPI2_SCSI_STATE_RESPONSE_INFO_VALID) { + response_info = le32toh(mpi_reply->ResponseInfo); + response_bytes = (u8 *)&response_info; + mps_response_code(sc,response_bytes[0]); + } +} + +static void mpssas_scsiio_complete(struct mps_softc *sc, struct mps_command *cm) { MPI2_SCSI_IO_REPLY *rep; @@ -2018,6 +2319,8 @@ mpssas_scsiio_complete(struct mps_softc ccb->ccb_h.status = CAM_REQ_CMP_ERR; break; } + + mps_sc_failed_io_info(sc,csio,rep); if (sassc->flags & MPSSAS_QUEUE_FROZEN) { ccb->ccb_h.status |= CAM_RELEASE_SIMQ; @@ -2799,17 +3102,26 @@ mpssas_scanner_thread(void *arg) mps_lock(sc); for (;;) { + /* Sleep for 1 second and check the queue status*/ msleep(&sassc->ccb_scanq, &sc->mps_mtx, PRIBIO, - "mps_scanq", 0); + "mps_scanq", 1 * hz); if (sassc->flags & MPSSAS_SHUTDOWN) { mps_dprint(sc, MPS_TRACE, "Scanner shutting down\n"); break; } +next_work: + // Get first work. ccb = (union ccb *)TAILQ_FIRST(&sassc->ccb_scanq); if (ccb == NULL) continue; + // Got first work. TAILQ_REMOVE(&sassc->ccb_scanq, &ccb->ccb_h, sim_links.tqe); xpt_action(ccb); + if (sassc->flags & MPSSAS_SHUTDOWN) { + mps_dprint(sc, MPS_TRACE, "Scanner shutting down\n"); + break; + } + goto next_work; } sassc->flags &= ~MPSSAS_SCANTHREAD; @@ -3009,7 +3321,7 @@ mpssas_check_eedp(struct mpssas_softc *s } if (!found_lun) { lun = malloc(sizeof(struct mpssas_lun), - M_MPT2, M_WAITOK | M_ZERO); + M_MPT2, M_NOWAIT | M_ZERO); if (lun == NULL) { mps_dprint(sc, MPS_FAULT, "Unable to alloc LUN for " @@ -3084,6 +3396,20 @@ mpssas_read_cap_done(struct cam_periph * if (done_ccb == NULL) return; + + /* Driver need to release devq, it Scsi command is + * generated by driver internally. + * Currently there is a single place where driver + * calls scsi command internally. In future if driver + * calls more scsi command internally, it needs to release + * devq internally, since those command will not go back to + * cam_periph. + */ + if ((done_ccb->ccb_h.status & CAM_DEV_QFRZN) ) { + done_ccb->ccb_h.status &= ~CAM_DEV_QFRZN; + xpt_release_devq(done_ccb->ccb_h.path, + /*count*/ 1, /*run_queue*/TRUE); + } rcap_buf = (struct scsi_read_capacity_eedp *)done_ccb->csio.data_ptr; Modified: head/sys/dev/mps/mps_sas.h ============================================================================== --- head/sys/dev/mps/mps_sas.h Wed Feb 8 23:57:03 2012 (r231239) +++ head/sys/dev/mps/mps_sas.h Thu Feb 9 00:16:12 2012 (r231240) @@ -49,8 +49,11 @@ struct mpssas_target { #define MPSSAS_TARGET_INRESET (1 << 1) #define MPSSAS_TARGET_INDIAGRESET (1 << 2) #define MPSSAS_TARGET_INREMOVAL (1 << 3) +#define MPS_TARGET_FLAGS_RAID_COMPONENT (1 << 4) +#define MPS_TARGET_FLAGS_VOLUME (1 << 5) #define MPSSAS_TARGET_INRECOVERY (MPSSAS_TARGET_INABORT | \ MPSSAS_TARGET_INRESET | MPSSAS_TARGET_INCHIPRESET) + #define MPSSAS_TARGET_ADD (1 << 29) #define MPSSAS_TARGET_REMOVE (1 << 30) uint16_t tid; Modified: head/sys/dev/mps/mps_sas_lsi.c ============================================================================== --- head/sys/dev/mps/mps_sas_lsi.c Wed Feb 8 23:57:03 2012 (r231239) +++ head/sys/dev/mps/mps_sas_lsi.c Thu Feb 9 00:16:12 2012 (r231240) @@ -107,7 +107,7 @@ struct _ata_identify_device_data { u16 model_number[20]; /* 27-46*/ u16 reserved3[209]; /* 47-255*/ }; - +static u32 event_count; static void mpssas_fw_work(struct mps_softc *sc, struct mps_fw_event_work *fw_event); static void mpssas_fw_event_free(struct mps_softc *, @@ -119,7 +119,7 @@ static int mpssas_get_sata_identify(stru int mpssas_get_sas_address_for_sata_disk(struct mps_softc *sc, u64 *sas_address, u16 handle, u32 device_info); static int mpssas_volume_add(struct mps_softc *sc, - Mpi2EventIrConfigElement_t *element); + u16 handle); void mpssas_evt_handler(struct mps_softc *sc, uintptr_t data, @@ -191,6 +191,8 @@ mpssas_fw_work(struct mps_softc *sc, str struct mpssas_softc *sassc; sassc = sc->sassc; + mps_dprint(sc, MPS_INFO, "(%d)->(%s) Working on Event: [%x]\n", + event_count++,__func__,fw_event->event); switch (fw_event->event) { case MPI2_EVENT_SAS_TOPOLOGY_CHANGE_LIST: { @@ -284,7 +286,7 @@ mpssas_fw_work(struct mps_softc *sc, str case MPI2_EVENT_IR_CHANGE_RC_VOLUME_CREATED: case MPI2_EVENT_IR_CHANGE_RC_ADDED: if (!foreign_config) { - if (mpssas_volume_add(sc, element)) { + if (mpssas_volume_add(sc, le16toh(element->VolDevHandle))){ printf("%s: failed to add RAID " "volume with handle 0x%x\n", __func__, le16toh(element-> @@ -319,12 +321,18 @@ mpssas_fw_work(struct mps_softc *sc, str } break; case MPI2_EVENT_IR_CHANGE_RC_PD_CREATED: + case MPI2_EVENT_IR_CHANGE_RC_HIDE: /* * Phys Disk of a volume has been created. Hide * it from the OS. */ - mpssas_prepare_remove(sassc, element-> - PhysDiskDevHandle); + targ = mpssas_find_target_by_handle(sassc, 0, element->PhysDiskDevHandle); + if (targ == NULL) + break; + + targ->flags |= MPS_TARGET_FLAGS_RAID_COMPONENT; + mpssas_rescan_target(sc, targ); + break; case MPI2_EVENT_IR_CHANGE_RC_PD_DELETED: /* @@ -379,6 +387,35 @@ mpssas_fw_work(struct mps_softc *sc, str "handle 0x%x", event_data->PreviousValue, event_data->NewValue, event_data->VolDevHandle); + u32 state; + struct mpssas_target *targ; + state = le32toh(event_data->NewValue); + switch (state) { + case MPI2_RAID_VOL_STATE_MISSING: + case MPI2_RAID_VOL_STATE_FAILED: + mpssas_prepare_volume_remove(sassc, event_data-> + VolDevHandle); + break; + + case MPI2_RAID_VOL_STATE_ONLINE: + case MPI2_RAID_VOL_STATE_DEGRADED: + case MPI2_RAID_VOL_STATE_OPTIMAL: + targ = mpssas_find_target_by_handle(sassc, 0, event_data->VolDevHandle); + if (targ) { + printf("%s %d: Volume handle 0x%x is already added \n", + __func__, __LINE__ , event_data->VolDevHandle); + break; + } + if (mpssas_volume_add(sc, le16toh(event_data->VolDevHandle))) { + printf("%s: failed to add RAID " + "volume with handle 0x%x\n", + __func__, le16toh(event_data-> + VolDevHandle)); + } + break; + default: + break; + } break; default: break; @@ -389,6 +426,7 @@ mpssas_fw_work(struct mps_softc *sc, str { Mpi2EventDataIrPhysicalDisk_t *event_data = fw_event->event_data; + struct mpssas_target *targ; /* * Informational only. @@ -399,7 +437,7 @@ mpssas_fw_work(struct mps_softc *sc, str mps_dprint(sc, MPS_INFO, " Phys Disk Settings " "changed from 0x%x to 0x%x for Phys Disk Number " "%d and handle 0x%x at Enclosure handle 0x%x, Slot " - "%d", event_data->PreviousValue, + "%d\n", event_data->PreviousValue, event_data->NewValue, event_data->PhysDiskNum, event_data->PhysDiskDevHandle, event_data->EnclosureHandle, event_data->Slot); @@ -407,7 +445,7 @@ mpssas_fw_work(struct mps_softc *sc, str case MPI2_EVENT_IR_PHYSDISK_RC_STATUS_FLAGS_CHANGED: mps_dprint(sc, MPS_INFO, " Phys Disk Status changed " "from 0x%x to 0x%x for Phys Disk Number %d and " - "handle 0x%x at Enclosure handle 0x%x, Slot %d", + "handle 0x%x at Enclosure handle 0x%x, Slot %d\n", event_data->PreviousValue, event_data->NewValue, event_data->PhysDiskNum, event_data->PhysDiskDevHandle, @@ -416,12 +454,38 @@ mpssas_fw_work(struct mps_softc *sc, str case MPI2_EVENT_IR_PHYSDISK_RC_STATE_CHANGED: mps_dprint(sc, MPS_INFO, " Phys Disk State changed " "from 0x%x to 0x%x for Phys Disk Number %d and " - "handle 0x%x at Enclosure handle 0x%x, Slot %d", + "handle 0x%x at Enclosure handle 0x%x, Slot %d\n", event_data->PreviousValue, event_data->NewValue, event_data->PhysDiskNum, event_data->PhysDiskDevHandle, event_data->EnclosureHandle, event_data->Slot); - break; + switch (event_data->NewValue) { + case MPI2_RAID_PD_STATE_ONLINE: + case MPI2_RAID_PD_STATE_DEGRADED: + case MPI2_RAID_PD_STATE_REBUILDING: + case MPI2_RAID_PD_STATE_OPTIMAL: + case MPI2_RAID_PD_STATE_HOT_SPARE: + targ = mpssas_find_target_by_handle(sassc, 0, + event_data->PhysDiskDevHandle); + if (targ) { + targ->flags |= MPS_TARGET_FLAGS_RAID_COMPONENT; + printf("%s %d: Found Target for handle 0x%x. \n", + __func__, __LINE__ , event_data->PhysDiskDevHandle); + } + break; + case MPI2_RAID_PD_STATE_OFFLINE: + case MPI2_RAID_PD_STATE_NOT_CONFIGURED: + case MPI2_RAID_PD_STATE_NOT_COMPATIBLE: + default: + targ = mpssas_find_target_by_handle(sassc, 0, + event_data->PhysDiskDevHandle); + if (targ) { + targ->flags |= ~MPS_TARGET_FLAGS_RAID_COMPONENT; + printf("%s %d: Found Target for handle 0x%x. \n", + __func__, __LINE__ , event_data->PhysDiskDevHandle); + } + break; + } default: break; } @@ -494,6 +558,7 @@ mpssas_fw_work(struct mps_softc *sc, str break; } + mps_dprint(sc, MPS_INFO, "(%d)->(%s) Event Free: [%x]\n",event_count,__func__, fw_event->event); mpssas_fw_event_free(sc, fw_event); } @@ -584,7 +649,7 @@ mpssas_add_device(struct mps_softc *sc, error = ENXIO; goto out; } - mps_vprintf(sc, "SAS Address from SAS device page0 = %jx\n", + mps_dprint(sc, MPS_INFO, "SAS Address from SAS device page0 = %jx\n", sas_address); targ = &sassc->targets[id]; targ->devinfo = device_info; @@ -605,12 +670,12 @@ mpssas_add_device(struct mps_softc *sc, TAILQ_INIT(&targ->timedout_commands); SLIST_INIT(&targ->luns); mps_describe_devinfo(targ->devinfo, devstring, 80); - mps_vprintf(sc, "Found device <%s> <%s> <0x%04x> <%d/%d>\n", devstring, + mps_dprint(sc, MPS_INFO, "Found device <%s> <%s> <0x%04x> <%d/%d>\n", devstring, mps_describe_table(mps_linkrate_names, targ->linkrate), targ->handle, targ->encl_handle, targ->encl_slot); if ((sassc->flags & MPSSAS_IN_STARTUP) == 0) mpssas_rescan_target(sc, targ); - mps_vprintf(sc, "Target id 0x%x added\n", targ->tid); + mps_dprint(sc, MPS_INFO, "Target id 0x%x added\n", targ->tid); out: mpssas_startup_decrement(sassc); return (error); @@ -751,12 +816,11 @@ out: } static int -mpssas_volume_add(struct mps_softc *sc, Mpi2EventIrConfigElement_t *element) +mpssas_volume_add(struct mps_softc *sc, u16 handle) { struct mpssas_softc *sassc; struct mpssas_target *targ; u64 wwid; - u16 handle = le16toh(element->VolDevHandle); unsigned int id; int error = 0; @@ -855,7 +919,9 @@ mpssas_ir_shutdown(struct mps_softc *sc) action->Function = MPI2_FUNCTION_RAID_ACTION; action->Action = MPI2_RAID_ACTION_SYSTEM_SHUTDOWN_INITIATED; cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; + mps_lock(sc); mps_request_polled(sc, cm); + mps_unlock(sc); /* * Don't check for reply, just leave. Modified: head/sys/dev/mps/mps_user.c ============================================================================== --- head/sys/dev/mps/mps_user.c Wed Feb 8 23:57:03 2012 (r231239) +++ head/sys/dev/mps/mps_user.c Thu Feb 9 00:16:12 2012 (r231240) @@ -712,7 +712,7 @@ mps_user_command(struct mps_softc *sc, s cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE; mps_lock(sc); - err = mps_wait_command(sc, cm, 0); + err = mps_wait_command(sc, cm, 30); if (err) { mps_printf(sc, "%s: invalid request: error %d\n", @@ -842,7 +842,7 @@ mps_user_pass_thru(struct mps_softc *sc, cm->cm_complete = NULL; cm->cm_complete_data = NULL; - err = mps_wait_command(sc, cm, 0); + err = mps_wait_command(sc, cm, 30); if (err != 0) { err = EIO; @@ -979,7 +979,7 @@ mps_user_pass_thru(struct mps_softc *sc, mps_lock(sc); - err = mps_wait_command(sc, cm, 0); + err = mps_wait_command(sc, cm, 30); if (err) { mps_printf(sc, "%s: invalid request: error %d\n", __func__, @@ -1098,10 +1098,12 @@ mps_user_get_adapter_data(struct mps_sof * Need to get BIOS Config Page 3 for the BIOS Version. */ data->BiosVersion = 0; + mps_lock(sc); if (mps_config_get_bios_pg3(sc, &mpi_reply, &config_page)) printf("%s: Error while retrieving BIOS Version\n", __func__); else data->BiosVersion = config_page.BiosVersion; + mps_unlock(sc); } static void @@ -1194,7 +1196,7 @@ mps_post_fw_diag_buffer(struct mps_softc /* * Send command synchronously. */ - status = mps_wait_command(sc, cm, 0); + status = mps_wait_command(sc, cm, 30); if (status) { mps_printf(sc, "%s: invalid request: error %d\n", __func__, status); @@ -1278,7 +1280,7 @@ mps_release_fw_diag_buffer(struct mps_so /* * Send command synchronously. */ - status = mps_wait_command(sc, cm, 0); + status = mps_wait_command(sc, cm, 30); if (status) { mps_printf(sc, "%s: invalid request: error %d\n", __func__, status); Modified: head/sys/dev/mps/mpsvar.h ============================================================================== --- head/sys/dev/mps/mpsvar.h Wed Feb 8 23:57:03 2012 (r231239) +++ head/sys/dev/mps/mpsvar.h Thu Feb 9 00:16:12 2012 (r231240) @@ -58,7 +58,7 @@ #ifndef _MPSVAR_H #define _MPSVAR_H -#define MPS_DRIVER_VERSION "11.255.03.00-fbsd" +#define MPS_DRIVER_VERSION "13.00.00.00-fbsd" #define MPS_DB_MAX_WAIT 2500 @@ -78,6 +78,7 @@ #define MPS_PERIODIC_DELAY 1 /* 1 second heartbeat/watchdog check */ #define MPS_SCSI_RI_INVALID_FRAME (0x00000002) +#define MPS_STRING_LENGTH 64 /* * host mapping related macro definitions @@ -309,7 +310,7 @@ struct mps_softc { struct callout periodic; struct mpssas_softc *sassc; - + char tmp_string[MPS_STRING_LENGTH]; TAILQ_HEAD(, mps_command) req_list; TAILQ_HEAD(, mps_command) high_priority_req_list; TAILQ_HEAD(, mps_chain) chain_list; @@ -521,6 +522,12 @@ mps_free_command(struct mps_softc *sc, s cm->cm_max_segs = 0; cm->cm_lun = 0; cm->cm_state = MPS_CM_STATE_FREE; + cm->cm_data = NULL; + cm->cm_length = 0; + cm->cm_out_len = 0; + cm->cm_sglsize = 0; + cm->cm_sge = NULL; + TAILQ_FOREACH_SAFE(chain, &cm->cm_chain_list, chain_link, chain_temp) { TAILQ_REMOVE(&cm->cm_chain_list, chain, chain_link); mps_free_chain(sc, chain); @@ -749,7 +756,9 @@ void mps_mapping_ir_config_change_event( void mpssas_evt_handler(struct mps_softc *sc, uintptr_t data, MPI2_EVENT_NOTIFICATION_REPLY *event); void mpssas_prepare_remove(struct mpssas_softc *sassc, uint16_t handle); +void mpssas_prepare_volume_remove(struct mpssas_softc *sassc, uint16_t handle); int mpssas_startup(struct mps_softc *sc); +struct mpssas_target * mpssas_find_target_by_handle(struct mpssas_softc *, int, uint16_t); SYSCTL_DECL(_hw_mps); From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 04:13:56 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E494C106564A; Thu, 9 Feb 2012 04:13:56 +0000 (UTC) (envelope-from mdf356@gmail.com) Received: from mail-pw0-f54.google.com (mail-pw0-f54.google.com [209.85.160.54]) by mx1.freebsd.org (Postfix) with ESMTP id B052D8FC18; Thu, 9 Feb 2012 04:13:56 +0000 (UTC) Received: by pbcxa7 with SMTP id xa7so108012pbc.13 for ; Wed, 08 Feb 2012 20:13:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=/Q7TM20WASmEc2Ohv80PHaPrmllrPeAH7fC10rp8TDo=; b=hOYFIkSdIKjUqIqouD88zFkCKDELWa48F5ksYeZxDP8S6lvmgmhDpZ8mk1bYFEpjrS rsAo3Z8sASj/vldkCPjjkknnklSGMNtvciFE6oLyE7Ug9shBvQk/fp7xpFSXm6TnukRm edb8rUjSJ5Yv8Mi7ALQc3kCK4DKaTdkrJjkn0= MIME-Version: 1.0 Received: by 10.68.225.4 with SMTP id rg4mr71210614pbc.111.1328728919094; Wed, 08 Feb 2012 11:21:59 -0800 (PST) Sender: mdf356@gmail.com Received: by 10.68.131.9 with HTTP; Wed, 8 Feb 2012 11:21:59 -0800 (PST) In-Reply-To: <201202081836.q18Ia7jw055652@svn.freebsd.org> References: <201202081836.q18Ia7jw055652@svn.freebsd.org> Date: Wed, 8 Feb 2012 11:21:59 -0800 X-Google-Sender-Auth: Q0iZweMGRvi9HVnXWknG2jJuHT0 Message-ID: From: mdf@FreeBSD.org To: Konstantin Belousov Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231220 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 04:13:57 -0000 On Wed, Feb 8, 2012 at 10:36 AM, Konstantin Belousov wrot= e: > Author: kib > Date: Wed Feb =A08 18:36:07 2012 > New Revision: 231220 > URL: http://svn.freebsd.org/changeset/base/231220 > > Log: > =A0Trim 8 unused bytes from struct vnode on 64-bit architectures. Doesn't this change the KBI? So should __FreeBSD_version be bumped? Thanks, matthew > Modified: > =A0head/sys/sys/vnode.h > > Modified: head/sys/sys/vnode.h > =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 > --- head/sys/sys/vnode.h =A0 =A0 =A0 =A0Wed Feb =A08 18:22:10 2012 =A0 = =A0 =A0 =A0(r231219) > +++ head/sys/sys/vnode.h =A0 =A0 =A0 =A0Wed Feb =A08 18:36:07 2012 =A0 = =A0 =A0 =A0(r231220) > @@ -149,8 +149,8 @@ struct vnode { > =A0 =A0 =A0 =A0struct =A0lock *v_vnlock; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = /* u pointer to vnode lock */ > =A0 =A0 =A0 =A0int =A0 =A0 v_holdcnt; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0= =A0 =A0/* i prevents recycling. */ > =A0 =A0 =A0 =A0int =A0 =A0 v_usecount; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 /* i ref count of users */ > - =A0 =A0 =A0 u_long =A0v_iflag; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0/* i vnode flags (see below) */ > - =A0 =A0 =A0 u_long =A0v_vflag; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0/* v vnode flags */ > + =A0 =A0 =A0 u_int =A0 v_iflag; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0/* i vnode flags (see below) */ > + =A0 =A0 =A0 u_int =A0 v_vflag; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0/* v vnode flags */ > =A0 =A0 =A0 =A0int =A0 =A0 v_writecount; =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 /* v ref count of writers */ > > =A0 =A0 =A0 =A0/* From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 04:37:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CA46106566C; Thu, 9 Feb 2012 04:37:31 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8A01F8FC15; Thu, 9 Feb 2012 04:37:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q194bVl1081655; Thu, 9 Feb 2012 04:37:31 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q194bVRs081642; Thu, 9 Feb 2012 04:37:31 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201202090437.q194bVRs081642@svn.freebsd.org> From: Glen Barber Date: Thu, 9 Feb 2012 04:37:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231244 - in head/share/man: man4 man5 man7 man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 04:37:31 -0000 Author: gjb (doc committer) Date: Thu Feb 9 04:37:30 2012 New Revision: 231244 URL: http://svn.freebsd.org/changeset/base/231244 Log: Fix some Xr references: - ada(4): ad(4) - removed, ada(4) would be a self-referencing entry - cd(4): ad(4) -> ada(4) - da(4): ad(4) -> ada(4) - DEVICE_PROBE(9): ugen(5) -> ugen(4) - ed(4): dhclinet(8) -> dhclient(8) (typo) - lmc(4): Netgraph(4) -> netgraph(4) - security(7): rc.conf(8) -> rc.conf(5) - sfxge(4): cpuset(8) -> cpuset(1) - sbp(4): sysctl(1) -> sysctl(8) - portindex(5): build(1) -> build(7) - u3g(4): usbconfig(5) -> usbconfig(8) - usb_quirk(4): usbconfig(5) -> usbconfig(8) Found with: textproc/igor MFC after: 3 days Modified: head/share/man/man4/ada.4 head/share/man/man4/cd.4 head/share/man/man4/da.4 head/share/man/man4/ed.4 head/share/man/man4/lmc.4 head/share/man/man4/sbp.4 head/share/man/man4/sfxge.4 head/share/man/man4/u3g.4 head/share/man/man4/usb_quirk.4 head/share/man/man5/portindex.5 head/share/man/man7/security.7 head/share/man/man9/DEVICE_PROBE.9 Modified: head/share/man/man4/ada.4 ============================================================================== --- head/share/man/man4/ada.4 Thu Feb 9 01:18:35 2012 (r231243) +++ head/share/man/man4/ada.4 Thu Feb 9 04:37:30 2012 (r231244) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 8, 2011 +.Dd February 8, 2012 .Dt ADA 4 .Os .Sh NAME @@ -139,7 +139,6 @@ The per-device default is to leave it as ATA device nodes .El .Sh SEE ALSO -.Xr ad 4 , .Xr ahci 4 , .Xr cam 4 , .Xr da 4 , Modified: head/share/man/man4/cd.4 ============================================================================== --- head/share/man/man4/cd.4 Thu Feb 9 01:18:35 2012 (r231243) +++ head/share/man/man4/cd.4 Thu Feb 9 04:37:30 2012 (r231244) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 8, 2009 +.Dd February 8, 2012 .Dt CD 4 .Os .Sh NAME @@ -52,7 +52,7 @@ but it will only last until the .Tn CD-ROM is unmounted. In general the interfaces are similar to those described by -.Xr ad 4 +.Xr ada 4 and .Xr da 4 . .Pp Modified: head/share/man/man4/da.4 ============================================================================== --- head/share/man/man4/da.4 Thu Feb 9 01:18:35 2012 (r231243) +++ head/share/man/man4/da.4 Thu Feb 9 04:37:30 2012 (r231244) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 2, 2003 +.Dd February 8, 2012 .Dt DA 4 .Os .Sh NAME @@ -195,7 +195,7 @@ SCSI disk device nodes .Sh DIAGNOSTICS None. .Sh SEE ALSO -.Xr ad 4 , +.Xr ada 4 , .Xr cam 4 , .Xr geom 4 , .Xr bsdlabel 8 , Modified: head/share/man/man4/ed.4 ============================================================================== --- head/share/man/man4/ed.4 Thu Feb 9 01:18:35 2012 (r231243) +++ head/share/man/man4/ed.4 Thu Feb 9 04:37:30 2012 (r231244) @@ -30,7 +30,7 @@ .\" .\" $FreeBSD$ .\" -.Dd April 9, 2009 +.Dd February 8, 2012 .Dt ED 4 .Os .Sh NAME @@ -435,7 +435,7 @@ Some devices supported by do not generate the link state change events used by .Xr devd 8 to start -.Xr dhclinet 8 . +.Xr dhclient 8 . If you have problems with .Xr dhclient 8 not starting and the device is always attached to the network it may Modified: head/share/man/man4/lmc.4 ============================================================================== --- head/share/man/man4/lmc.4 Thu Feb 9 01:18:35 2012 (r231243) +++ head/share/man/man4/lmc.4 Thu Feb 9 04:37:30 2012 (r231244) @@ -43,7 +43,7 @@ .\" this program; if not, write to the Free Software Foundation, Inc., 59 .\" Temple Place - Suite 330, Boston, MA 02111-1307, USA. .\" -.Dd July 23, 2011 +.Dd February 8, 2012 .Dt LMC 4 .Os .\" @@ -179,7 +179,7 @@ higher-level issues like protocol multip This driver is compatible with several line protocol packages: .Bl -tag -width "Generic HDLC" .It Sy "Netgraph" -.Xr Netgraph 4 +.Xr netgraph 4 implements many basic packet-handling functions as kernel loadable modules. They can be interconnected in a graph to implement many protocols. Configuration is done from userland without rebuilding the kernel. Modified: head/share/man/man4/sbp.4 ============================================================================== --- head/share/man/man4/sbp.4 Thu Feb 9 01:18:35 2012 (r231243) +++ head/share/man/man4/sbp.4 Thu Feb 9 04:37:30 2012 (r231244) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 20, 2002 +.Dd February 8, 2012 .Dt SBP 4 .Os .Sh NAME @@ -71,7 +71,7 @@ topology. If you want to force to detach the device, run .Dq Nm fwcontrol Fl r several times or set hw.firewire.hold_count=0 by -.Xr sysctl 1 . +.Xr sysctl 8 . .Pp Some (broken) HDDs do not work well with tagged queuing. If you have problems with such drives, try Modified: head/share/man/man4/sfxge.4 ============================================================================== --- head/share/man/man4/sfxge.4 Thu Feb 9 01:18:35 2012 (r231243) +++ head/share/man/man4/sfxge.4 Thu Feb 9 04:37:30 2012 (r231244) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 16, 2011 +.Dd February 8, 2012 .Dt SFXGE 4 .Os .Sh NAME @@ -57,7 +57,7 @@ and Receive Side Scaling (RSS) using MSI The driver allocates 1 receive queue, transmit queue, event queue and IRQ per CPU up to a maximum of 64. IRQ affinities should be spread out using -.Xr cpuset 8 . +.Xr cpuset 1 . Interrupt moderation may be controlled through the sysctl .Va dev.sfxge.%d.int_mod (units are microseconds). @@ -85,7 +85,7 @@ go to the Solarflare support website at: .Xr netintro 4 , .Xr ng_ether 4 , .Xr vlan 4 , -.Xr cpuset 8 , +.Xr cpuset 1 , .Xr ifconfig 8 .Sh AUTHORS The Modified: head/share/man/man4/u3g.4 ============================================================================== --- head/share/man/man4/u3g.4 Thu Feb 9 01:18:35 2012 (r231243) +++ head/share/man/man4/u3g.4 Thu Feb 9 04:37:30 2012 (r231244) @@ -18,7 +18,7 @@ .\" .\" $FreeBSD$ .\" -.Dd November 20, 2011 +.Dd February 8, 2012 .Dt U3G 4 .Os .Sh NAME @@ -88,7 +88,7 @@ driver is present which contains Windows The device starts up in disk mode (TruInstall, ZeroCD, etc.) and requires additional commands to switch it to modem mode. If your device is not switching automatically, please try to add quirks. See -.Xr usbconfig 5 +.Xr usbconfig 8 and .Xr usb_quirk 4 . .Pp @@ -97,7 +97,7 @@ and .Xr ucom 4 , .Xr usb 4 , .Xr usb_quirk 4 , -.Xr usbconfig 5 +.Xr usbconfig 8 .Sh HISTORY The .Nm Modified: head/share/man/man4/usb_quirk.4 ============================================================================== --- head/share/man/man4/usb_quirk.4 Thu Feb 9 01:18:35 2012 (r231243) +++ head/share/man/man4/usb_quirk.4 Thu Feb 9 04:37:30 2012 (r231244) @@ -16,7 +16,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 27, 2011 +.Dd February 8, 2012 .Dt USB_QUIRK 4 .Os .Sh NAME @@ -41,7 +41,7 @@ The .Nm module provides support for dynamically adding and removing quirks for USB devices with -.Xr usbconfig 5 . +.Xr usbconfig 8 . .Sh General quirks: .Bl -tag -width Ds .It UQ_AUDIO_SWAP_LR @@ -183,7 +183,7 @@ device which appears as a USB device on usbconfig -d ugen0.3 add_quirk UQ_MSC_EJECT_WAIT .Ed .Sh SEE ALSO -.Xr usbconfig 5 +.Xr usbconfig 8 .Sh HISTORY The .Nm Modified: head/share/man/man5/portindex.5 ============================================================================== --- head/share/man/man5/portindex.5 Thu Feb 9 01:18:35 2012 (r231243) +++ head/share/man/man5/portindex.5 Thu Feb 9 04:37:30 2012 (r231244) @@ -26,7 +26,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 28, 2009 +.Dd February 8, 2012 .Dt PORTINDEX 5 .Os .Sh NAME @@ -90,7 +90,7 @@ branch. vim-6.3.15|/usr/ports/editors/vim|/usr/local|Vi "workalike", with many additional features|/usr/ports/editors/vim/pkg-descr|obrien@FreeBSD.org|editors|libiconv-1.9.2_1|libiconv-1.9.2_1|http://www.vim.org/||| .Ed .Sh SEE ALSO -.Xr build 1 , +.Xr build 7 , .Xr csup 1 , .Xr ports 7 .Sh AUTHORS Modified: head/share/man/man7/security.7 ============================================================================== --- head/share/man/man7/security.7 Thu Feb 9 01:18:35 2012 (r231243) +++ head/share/man/man7/security.7 Thu Feb 9 04:37:30 2012 (r231244) @@ -23,7 +23,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 7, 2010 +.Dd February 8, 2012 .Dt SECURITY 7 .Os .Sh NAME @@ -579,7 +579,7 @@ configuration cannot be adjusted. .El .Pp The security level can be configured with variables documented in -.Xr rc.conf 8 . +.Xr rc.conf 5 . .Sh CHECKING FILE INTEGRITY: BINARIES, CONFIG FILES, ETC When it comes right down to it, you can only protect your core system configuration and control files so much before the convenience factor Modified: head/share/man/man9/DEVICE_PROBE.9 ============================================================================== --- head/share/man/man9/DEVICE_PROBE.9 Thu Feb 9 01:18:35 2012 (r231243) +++ head/share/man/man9/DEVICE_PROBE.9 Thu Feb 9 04:37:30 2012 (r231244) @@ -28,7 +28,7 @@ .\" .\" $FreeBSD$ .\" -.Dd March 3, 2008 +.Dd February 8, 2012 .Dt DEVICE_PROBE 9 .Os .Sh NAME @@ -120,7 +120,7 @@ treatment for some reason. .It BUS_PROBE_HOOVER The driver matches all unclaimed devices on a bus. The -.Xr ugen 5 +.Xr ugen 4 device is one example. .It BUS_PROBE_NOWILDCARD The driver expects its parent to tell it which children to manage From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 08:33:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EF795106564A; Thu, 9 Feb 2012 08:33:04 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C0AAE8FC0C; Thu, 9 Feb 2012 08:33:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q198X4T9089857; Thu, 9 Feb 2012 08:33:04 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q198X4vs089855; Thu, 9 Feb 2012 08:33:04 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201202090833.q198X4vs089855@svn.freebsd.org> From: Kevin Lo Date: Thu, 9 Feb 2012 08:33:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231257 - head/usr.sbin/wpa/hostapd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 08:33:05 -0000 Author: kevlo Date: Thu Feb 9 08:33:04 2012 New Revision: 231257 URL: http://svn.freebsd.org/changeset/base/231257 Log: Mention run(4) Modified: head/usr.sbin/wpa/hostapd/hostapd.8 Modified: head/usr.sbin/wpa/hostapd/hostapd.8 ============================================================================== --- head/usr.sbin/wpa/hostapd/hostapd.8 Thu Feb 9 07:52:45 2012 (r231256) +++ head/usr.sbin/wpa/hostapd/hostapd.8 Thu Feb 9 08:33:04 2012 (r231257) @@ -112,6 +112,7 @@ Store PID in .Xr ipw 4 , .Xr iwi 4 , .Xr ral 4 , +.Xr run 4 , .Xr ural 4 , .Xr wi 4 , .Xr hostapd.conf 5 , From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 09:09:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5CD991065672; Thu, 9 Feb 2012 09:09:13 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 202BC8FC12; Thu, 9 Feb 2012 09:09:11 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q1998sPj084551 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 9 Feb 2012 11:08:54 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q1998rSu056478; Thu, 9 Feb 2012 11:08:53 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q1998rGU056477; Thu, 9 Feb 2012 11:08:53 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 9 Feb 2012 11:08:53 +0200 From: Konstantin Belousov To: mdf@freebsd.org Message-ID: <20120209090853.GY3283@deviant.kiev.zoral.com.ua> References: <201202081836.q18Ia7jw055652@svn.freebsd.org> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jGviIKn9uLGVFpXC" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231220 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 09:09:13 -0000 --jGviIKn9uLGVFpXC Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 08, 2012 at 11:21:59AM -0800, mdf@freebsd.org wrote: > On Wed, Feb 8, 2012 at 10:36 AM, Konstantin Belousov wr= ote: > > Author: kib > > Date: Wed Feb =9A8 18:36:07 2012 > > New Revision: 231220 > > URL: http://svn.freebsd.org/changeset/base/231220 > > > > Log: > > =9ATrim 8 unused bytes from struct vnode on 64-bit architectures. >=20 > Doesn't this change the KBI? So should __FreeBSD_version be bumped? Definitely, it changes the KBI. This is the reason I did not specified MFC period (but really wanted it). We do not track KBI changes on HEAD with __FreeBSD_version. IMO, __FreeBSD_version is more about KPI, and even for KPI, it is more at the discretion of the committer and usefulness of notification. With this change, all VFS modules must be recompiled. But HEAD had a lot of changes related to VFS interface which went in silently. --jGviIKn9uLGVFpXC Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk8zjSUACgkQC3+MBN1Mb4ikOwCcDjK3GfY2e+O9zHjBbG1N+WC2 jxkAoJY8rC1thtr4sfL2rI9RD+x6/dCk =5grN -----END PGP SIGNATURE----- --jGviIKn9uLGVFpXC-- From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 10:09:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A57BE1065670; Thu, 9 Feb 2012 10:09:13 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 904C28FC0C; Thu, 9 Feb 2012 10:09:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q19A9Dbe093391; Thu, 9 Feb 2012 10:09:13 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19A9D2B093386; Thu, 9 Feb 2012 10:09:13 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202091009.q19A9D2B093386@svn.freebsd.org> From: Martin Matuska Date: Thu, 9 Feb 2012 10:09:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231265 - in head: share/man/man5 sys/fs/devfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 10:09:13 -0000 Author: mm Date: Thu Feb 9 10:09:12 2012 New Revision: 231265 URL: http://svn.freebsd.org/changeset/base/231265 Log: Introduce the "ruleset=number" option for devfs(5) mounts. Add support for updating the devfs mount (currently only changing the ruleset number is supported). Check mnt_optnew with vfs_filteropt(9). This new option sets the specified ruleset number as the active ruleset of the new devfs mount and applies all its rules at mount time. If the specified ruleset doesn't exist, a new empty ruleset is created. MFC after: 1 month Modified: head/share/man/man5/devfs.5 head/sys/fs/devfs/devfs.h head/sys/fs/devfs/devfs_rule.c head/sys/fs/devfs/devfs_vfsops.c Modified: head/share/man/man5/devfs.5 ============================================================================== --- head/share/man/man5/devfs.5 Thu Feb 9 09:24:52 2012 (r231264) +++ head/share/man/man5/devfs.5 Thu Feb 9 10:09:12 2012 (r231265) @@ -38,7 +38,7 @@ .\" .\" $FreeBSD$ .\" -.Dd September 18, 2010 +.Dd February 9, 2012 .Dt DEVFS 5 .Os .Sh NAME @@ -90,6 +90,29 @@ and .Pa 2 . .Xr fdescfs 5 creates files for all open descriptors. +.Pp +The options are as follows: +.Bl -tag -width indent +.It Fl o Ar options +Use the specified mount +.Ar options , +as described in +.Xr mount 8 . +The following devfs file system-specific options are available: +.Bl -tag -width indent +.It Cm ruleset Ns No = Ns Ar ruleset +Set ruleset number +.Ar ruleset +as the current ruleset for the mount-point and apply all its rules. If the +ruleset number +.Ar ruleset +does not exist, an empty ruleset with the number +.Ar ruleset +is created. See +.Xr devfs 8 +for more information on working with devfs rulesets. +.El +.El .Sh FILES .Bl -tag -width /dev/XXXX -compact .It Pa /dev Modified: head/sys/fs/devfs/devfs.h ============================================================================== --- head/sys/fs/devfs/devfs.h Thu Feb 9 09:24:52 2012 (r231264) +++ head/sys/fs/devfs/devfs.h Thu Feb 9 10:09:12 2012 (r231265) @@ -182,6 +182,8 @@ void devfs_rules_apply(struct devfs_moun void devfs_rules_cleanup(struct devfs_mount *); int devfs_rules_ioctl(struct devfs_mount *, u_long, caddr_t, struct thread *); +void devfs_ruleset_set(devfs_rsnum rsnum, struct devfs_mount *dm); +void devfs_ruleset_apply(struct devfs_mount *dm); int devfs_allocv(struct devfs_dirent *, struct mount *, int, struct vnode **); char *devfs_fqpn(char *, struct devfs_mount *, struct devfs_dirent *, Modified: head/sys/fs/devfs/devfs_rule.c ============================================================================== --- head/sys/fs/devfs/devfs_rule.c Thu Feb 9 09:24:52 2012 (r231264) +++ head/sys/fs/devfs/devfs_rule.c Thu Feb 9 10:09:12 2012 (r231265) @@ -771,3 +771,38 @@ devfs_rules_cleanup(struct devfs_mount * devfs_ruleset_reap(ds); } } + +/* + * Make rsnum the active ruleset for dm (locked) + */ +void +devfs_ruleset_set(devfs_rsnum rsnum, struct devfs_mount *dm) +{ + + sx_assert(&dm->dm_lock, SX_XLOCKED); + + sx_xlock(&sx_rules); + devfs_ruleset_use(rsnum, dm); + sx_xunlock(&sx_rules); +} + +/* + * Apply the current active ruleset on a mount + */ +void +devfs_ruleset_apply(struct devfs_mount *dm) +{ + struct devfs_ruleset *ds; + + sx_assert(&dm->dm_lock, SX_XLOCKED); + + sx_xlock(&sx_rules); + if (dm->dm_ruleset == 0) { + sx_xunlock(&sx_rules); + return; + } + ds = devfs_ruleset_bynum(dm->dm_ruleset); + if (ds != NULL) + devfs_ruleset_applydm(ds, dm); + sx_xunlock(&sx_rules); +} Modified: head/sys/fs/devfs/devfs_vfsops.c ============================================================================== --- head/sys/fs/devfs/devfs_vfsops.c Thu Feb 9 09:24:52 2012 (r231264) +++ head/sys/fs/devfs/devfs_vfsops.c Thu Feb 9 10:09:12 2012 (r231265) @@ -56,6 +56,10 @@ static vfs_unmount_t devfs_unmount; static vfs_root_t devfs_root; static vfs_statfs_t devfs_statfs; +static const char *devfs_opts[] = { + "from", "ruleset", NULL +}; + /* * Mount the filesystem */ @@ -65,15 +69,46 @@ devfs_mount(struct mount *mp) int error; struct devfs_mount *fmp; struct vnode *rvp; + int rsnum; if (devfs_unr == NULL) devfs_unr = new_unrhdr(0, INT_MAX, NULL); error = 0; - if (mp->mnt_flag & (MNT_UPDATE | MNT_ROOTFS)) + if (mp->mnt_flag & MNT_ROOTFS) return (EOPNOTSUPP); + rsnum = 0; + + if (mp->mnt_optnew != NULL) { + if (vfs_filteropt(mp->mnt_optnew, devfs_opts)) + return (EINVAL); + + if (vfs_getopt(mp->mnt_optnew, "ruleset", NULL, NULL) == 0 && + (vfs_scanopt(mp->mnt_optnew, "ruleset", "%d", + &rsnum) != 1 || rsnum < 0 || rsnum > 65535)) + error = EINVAL; + } + + if (error) { + vfs_mount_error(mp, "%s", "invalid ruleset specification"); + return (error); + } + + if (mp->mnt_flag & MNT_UPDATE) { + if (rsnum != 0) { + fmp = mp->mnt_data; + if (fmp != NULL) { + sx_xlock(&fmp->dm_lock); + devfs_ruleset_set((devfs_rsnum)rsnum, fmp); + devfs_ruleset_apply(fmp); + sx_xunlock(&fmp->dm_lock); + } + } + return (0); + } + fmp = malloc(sizeof *fmp, M_DEVFS, M_WAITOK | M_ZERO); fmp->dm_idx = alloc_unr(devfs_unr); sx_init(&fmp->dm_lock, "devfsmount"); @@ -101,6 +136,12 @@ devfs_mount(struct mount *mp) return (error); } + if (rsnum != 0) { + sx_xlock(&fmp->dm_lock); + devfs_ruleset_set((devfs_rsnum)rsnum, fmp); + sx_xunlock(&fmp->dm_lock); + } + VOP_UNLOCK(rvp, 0); vfs_mountedfrom(mp, "devfs"); From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 10:20:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8B93A1065670; Thu, 9 Feb 2012 10:20:42 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 75CFB8FC08; Thu, 9 Feb 2012 10:20:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q19AKguL093787; Thu, 9 Feb 2012 10:20:42 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19AKgi0093783; Thu, 9 Feb 2012 10:20:42 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201202091020.q19AKgi0093783@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 9 Feb 2012 10:20:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231266 - in head: share/man/man4 sys/dev/sdhci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 10:20:42 -0000 Author: glebius Date: Thu Feb 9 10:20:41 2012 New Revision: 231266 URL: http://svn.freebsd.org/changeset/base/231266 Log: Add support for RICOH R5CE823 card reader, that can be found in some Lenovo laptops. The conroller needs a quirk to lower its frequency, and after that it operates normally. Modified: head/share/man/man4/sdhci.4 head/sys/dev/sdhci/sdhci.c head/sys/dev/sdhci/sdhci.h Modified: head/share/man/man4/sdhci.4 ============================================================================== --- head/share/man/man4/sdhci.4 Thu Feb 9 10:09:12 2012 (r231265) +++ head/share/man/man4/sdhci.4 Thu Feb 9 10:20:41 2012 (r231266) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 14, 2009 +.Dd February 9, 2012 .Dt SDHCI 4 .Os .Sh NAME @@ -69,6 +69,8 @@ ENE CB714 .It RICOH R5C822 .It +RICOH R5CE823 +.It TI PCIXX21/XX11 .El .Sh SEE ALSO Modified: head/sys/dev/sdhci/sdhci.c ============================================================================== --- head/sys/dev/sdhci/sdhci.c Thu Feb 9 10:09:12 2012 (r231265) +++ head/sys/dev/sdhci/sdhci.c Thu Feb 9 10:20:41 2012 (r231266) @@ -74,6 +74,8 @@ __FBSDID("$FreeBSD$"); #define SDHCI_QUIRK_INCR_TIMEOUT_CONTROL (1<<7) /* Controller has broken read timings */ #define SDHCI_QUIRK_BROKEN_TIMINGS (1<<8) +/* Controller needs lowered frequency */ +#define SDHCI_QUIRK_LOWER_FREQUENCY (1<<9) static const struct sdhci_device { uint32_t model; @@ -85,6 +87,8 @@ static const struct sdhci_device { SDHCI_QUIRK_FORCE_DMA }, { 0xe8221180, 0xffff, "RICOH SD", SDHCI_QUIRK_FORCE_DMA }, + { 0xe8231180, 0xffff, "RICOH R5CE823 SD", + SDHCI_QUIRK_LOWER_FREQUENCY }, { 0x8034104c, 0xffff, "TI XX21/XX11 SD", SDHCI_QUIRK_FORCE_DMA }, { 0x05501524, 0xffff, "ENE CB712 SD", @@ -350,6 +354,24 @@ sdhci_init(struct sdhci_slot *slot) } static void +sdhci_lower_frequency(device_t dev) +{ + + /* Enable SD2.0 mode. */ + pci_write_config(dev, SDHC_PCI_MODE_KEY, 0xfc, 1); + pci_write_config(dev, SDHC_PCI_MODE, SDHC_PCI_MODE_SD20, 1); + pci_write_config(dev, SDHC_PCI_MODE_KEY, 0x00, 1); + + /* + * Some SD/MMC cards don't work with the default base + * clock frequency of 200MHz. Lower it to 50Hz. + */ + pci_write_config(dev, SDHC_PCI_BASE_FREQ_KEY, 0x01, 1); + pci_write_config(dev, SDHC_PCI_BASE_FREQ, 50, 1); + pci_write_config(dev, SDHC_PCI_BASE_FREQ_KEY, 0x00, 1); +} + +static void sdhci_set_clock(struct sdhci_slot *slot, uint32_t clock) { uint32_t res; @@ -631,6 +653,9 @@ sdhci_attach(device_t dev) break; } } + /* Some controllers need to be bumped into the right mode. */ + if (sc->quirks & SDHCI_QUIRK_LOWER_FREQUENCY) + sdhci_lower_frequency(dev); /* Read slots info from PCI registers. */ slots = pci_read_config(dev, PCI_SLOT_INFO, 1); bar = PCI_SLOT_INFO_FIRST_BAR(slots); Modified: head/sys/dev/sdhci/sdhci.h ============================================================================== --- head/sys/dev/sdhci/sdhci.h Thu Feb 9 10:09:12 2012 (r231265) +++ head/sys/dev/sdhci/sdhci.h Thu Feb 9 10:20:41 2012 (r231266) @@ -38,6 +38,15 @@ #define PCI_SLOT_INFO_FIRST_BAR(x) ((x) & 7) /* + * RICOH specific PCI registers + */ +#define SDHC_PCI_MODE_KEY 0xf9 +#define SDHC_PCI_MODE 0x150 +#define SDHC_PCI_MODE_SD20 0x10 +#define SDHC_PCI_BASE_FREQ_KEY 0xfc +#define SDHC_PCI_BASE_FREQ 0xe1 + +/* * Controller registers */ From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 10:22:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4F5741065689; Thu, 9 Feb 2012 10:22:09 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3941A8FC22; Thu, 9 Feb 2012 10:22:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q19AM8wB093885; Thu, 9 Feb 2012 10:22:08 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19AM8VO093880; Thu, 9 Feb 2012 10:22:08 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202091022.q19AM8VO093880@svn.freebsd.org> From: Martin Matuska Date: Thu, 9 Feb 2012 10:22:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231267 - in head: sys/fs/devfs sys/kern sys/sys usr.sbin/jail X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 10:22:09 -0000 Author: mm Date: Thu Feb 9 10:22:08 2012 New Revision: 231267 URL: http://svn.freebsd.org/changeset/base/231267 Log: Add support for mounting devfs inside jails. A new jail(8) option "devfs_ruleset" defines the ruleset enforcement for mounting devfs inside jails. A value of -1 disables mounting devfs in jails, a value of zero means no restrictions. Nested jails can only have mounting devfs disabled or inherit parent's enforcement as jails are not allowed to view or manipulate devfs(8) rules. Utilizes new functions introduced in r231265. Reviewed by: jamie MFC after: 1 month Modified: head/sys/fs/devfs/devfs_vfsops.c head/sys/kern/kern_jail.c head/sys/sys/jail.h head/usr.sbin/jail/jail.8 Modified: head/sys/fs/devfs/devfs_vfsops.c ============================================================================== --- head/sys/fs/devfs/devfs_vfsops.c Thu Feb 9 10:20:41 2012 (r231266) +++ head/sys/fs/devfs/devfs_vfsops.c Thu Feb 9 10:22:08 2012 (r231267) @@ -44,6 +44,7 @@ #include #include #include +#include #include @@ -69,6 +70,7 @@ devfs_mount(struct mount *mp) int error; struct devfs_mount *fmp; struct vnode *rvp; + struct thread *td = curthread; int rsnum; if (devfs_unr == NULL) @@ -91,6 +93,16 @@ devfs_mount(struct mount *mp) error = EINVAL; } + /* jails enforce their ruleset, prison0 has no restrictions */ + if (td->td_ucred->cr_prison->pr_devfs_rsnum != 0) { + rsnum = td->td_ucred->cr_prison->pr_devfs_rsnum; + if (rsnum == -1) + return (EPERM); + /* check rsnum for sanity, devfs_rsnum is uint16_t */ + if (rsnum < 0 || rsnum > 65535) + error = EINVAL; + } + if (error) { vfs_mount_error(mp, "%s", "invalid ruleset specification"); return (error); @@ -227,4 +239,4 @@ static struct vfsops devfs_vfsops = { .vfs_unmount = devfs_unmount, }; -VFS_SET(devfs_vfsops, devfs, VFCF_SYNTHETIC); +VFS_SET(devfs_vfsops, devfs, VFCF_SYNTHETIC | VFCF_JAIL); Modified: head/sys/kern/kern_jail.c ============================================================================== --- head/sys/kern/kern_jail.c Thu Feb 9 10:20:41 2012 (r231266) +++ head/sys/kern/kern_jail.c Thu Feb 9 10:22:08 2012 (r231267) @@ -103,6 +103,7 @@ struct prison prison0 = { .pr_uref = 1, .pr_path = "/", .pr_securelevel = -1, + .pr_devfs_rsnum = 0, .pr_childmax = JAIL_MAX, .pr_hostuuid = DEFAULT_HOSTUUID, .pr_children = LIST_HEAD_INITIALIZER(prison0.pr_children), @@ -216,8 +217,10 @@ const size_t pr_allow_nonames_size = siz #define JAIL_DEFAULT_ALLOW PR_ALLOW_SET_HOSTNAME #define JAIL_DEFAULT_ENFORCE_STATFS 2 +#define JAIL_DEFAULT_DEVFS_RSNUM -1 static unsigned jail_default_allow = JAIL_DEFAULT_ALLOW; static int jail_default_enforce_statfs = JAIL_DEFAULT_ENFORCE_STATFS; +static int jail_default_devfs_rsnum = JAIL_DEFAULT_DEVFS_RSNUM; #if defined(INET) || defined(INET6) static unsigned jail_max_af_ips = 255; #endif @@ -529,9 +532,9 @@ kern_jail_set(struct thread *td, struct unsigned long hid; size_t namelen, onamelen; int created, cuflags, descend, enforce, error, errmsg_len, errmsg_pos; - int gotchildmax, gotenforce, gothid, gotslevel; + int gotchildmax, gotenforce, gothid, gotrsnum, gotslevel; int fi, jid, jsys, len, level; - int childmax, slevel, vfslocked; + int childmax, rsnum, slevel, vfslocked; int fullpath_disabled; #if defined(INET) || defined(INET6) int ii, ij; @@ -612,6 +615,14 @@ kern_jail_set(struct thread *td, struct } else gotenforce = 1; + error = vfs_copyopt(opts, "devfs_ruleset", &rsnum, sizeof(rsnum)); + if (error == ENOENT) + gotrsnum = 0; + else if (error != 0) + goto done_free; + else + gotrsnum = 1; + pr_flags = ch_flags = 0; for (fi = 0; fi < sizeof(pr_flag_names) / sizeof(pr_flag_names[0]); fi++) { @@ -1268,6 +1279,7 @@ kern_jail_set(struct thread *td, struct pr->pr_securelevel = ppr->pr_securelevel; pr->pr_allow = JAIL_DEFAULT_ALLOW & ppr->pr_allow; pr->pr_enforce_statfs = JAIL_DEFAULT_ENFORCE_STATFS; + pr->pr_devfs_rsnum = JAIL_DEFAULT_DEVFS_RSNUM; LIST_INIT(&pr->pr_children); mtx_init(&pr->pr_mtx, "jail mutex", NULL, MTX_DEF | MTX_DUPOK); @@ -1346,6 +1358,27 @@ kern_jail_set(struct thread *td, struct goto done_deref_locked; } } + if (gotrsnum) { + /* + * devfs_rsnum is a uint16_t + * value of -1 disables devfs mounts + */ + if (rsnum < -1 || rsnum > 65535) { + error = EINVAL; + goto done_deref_locked; + } + /* + * Nested jails may inherit parent's devfs ruleset + * or disable devfs + */ + if (jailed(td->td_ucred)) { + if (rsnum > 0 && rsnum != ppr->pr_devfs_rsnum) { + error = EPERM; + goto done_deref_locked; + } else if (rsnum == 0) + rsnum = ppr->pr_devfs_rsnum; + } + } #ifdef INET if (ip4s > 0) { if (ppr->pr_flags & PR_IP4) { @@ -1586,6 +1619,13 @@ kern_jail_set(struct thread *td, struct if (tpr->pr_enforce_statfs < enforce) tpr->pr_enforce_statfs = enforce; } + if (gotrsnum) { + pr->pr_devfs_rsnum = rsnum; + /* Pass this restriction on to the children. */ + FOREACH_PRISON_DESCENDANT_LOCKED(pr, tpr, descend) + if (tpr->pr_devfs_rsnum != -1) + tpr->pr_devfs_rsnum = rsnum; + } if (name != NULL) { if (ppr == &prison0) strlcpy(pr->pr_name, name, sizeof(pr->pr_name)); @@ -2020,6 +2060,10 @@ kern_jail_get(struct thread *td, struct sizeof(pr->pr_enforce_statfs)); if (error != 0 && error != ENOENT) goto done_deref; + error = vfs_setopt(opts, "devfs_ruleset", &pr->pr_devfs_rsnum, + sizeof(pr->pr_devfs_rsnum)); + if (error != 0 && error != ENOENT) + goto done_deref; for (fi = 0; fi < sizeof(pr_flag_names) / sizeof(pr_flag_names[0]); fi++) { if (pr_flag_names[fi] == NULL) @@ -4173,6 +4217,12 @@ SYSCTL_PROC(_security_jail, OID_AUTO, en sysctl_jail_default_level, "I", "Processes in jail cannot see all mounted file systems"); +SYSCTL_PROC(_security_jail, OID_AUTO, devfs_ruleset, + CTLTYPE_INT | CTLFLAG_RD | CTLFLAG_MPSAFE, + &jail_default_devfs_rsnum, offsetof(struct prison, pr_devfs_rsnum), + sysctl_jail_default_level, "I", + "Ruleset for the devfs filesystem in jail"); + /* * Nodes to describe jail parameters. Maximum length of string parameters * is returned in the string itself, and the other parameters exist merely @@ -4221,6 +4271,8 @@ SYSCTL_JAIL_PARAM(, securelevel, CTLTYPE "I", "Jail secure level"); SYSCTL_JAIL_PARAM(, enforce_statfs, CTLTYPE_INT | CTLFLAG_RW, "I", "Jail cannot see all mounted file systems"); +SYSCTL_JAIL_PARAM(, devfs_ruleset, CTLTYPE_INT | CTLFLAG_RW, + "I", "Ruleset for in-jail devfs mounts"); SYSCTL_JAIL_PARAM(, persist, CTLTYPE_INT | CTLFLAG_RW, "B", "Jail persistence"); #ifdef VIMAGE @@ -4413,6 +4465,7 @@ db_show_prison(struct prison *pr) #endif db_printf(" root = %p\n", pr->pr_root); db_printf(" securelevel = %d\n", pr->pr_securelevel); + db_printf(" devfs_rsnum = %d\n", pr->pr_devfs_rsnum); db_printf(" children.max = %d\n", pr->pr_childmax); db_printf(" children.cur = %d\n", pr->pr_childcount); db_printf(" child = %p\n", LIST_FIRST(&pr->pr_children)); Modified: head/sys/sys/jail.h ============================================================================== --- head/sys/sys/jail.h Thu Feb 9 10:20:41 2012 (r231266) +++ head/sys/sys/jail.h Thu Feb 9 10:22:08 2012 (r231267) @@ -176,7 +176,8 @@ struct prison { unsigned pr_allow; /* (p) PR_ALLOW_* flags */ int pr_securelevel; /* (p) securelevel */ int pr_enforce_statfs; /* (p) statfs permission */ - int pr_spare[5]; + int pr_devfs_rsnum; /* (p) devfs ruleset */ + int pr_spare[4]; unsigned long pr_hostid; /* (p) jail hostid */ char pr_name[MAXHOSTNAMELEN]; /* (p) admin jail name */ char pr_path[MAXPATHLEN]; /* (c) chroot path */ Modified: head/usr.sbin/jail/jail.8 ============================================================================== --- head/usr.sbin/jail/jail.8 Thu Feb 9 10:20:41 2012 (r231266) +++ head/usr.sbin/jail/jail.8 Thu Feb 9 10:22:08 2012 (r231267) @@ -34,7 +34,7 @@ .\" .\" $FreeBSD$ .\" -.Dd July 23, 2011 +.Dd February 9, 2012 .Dt JAIL 8 .Os .Sh NAME @@ -301,6 +301,17 @@ A jail never has a lower securelevel tha setting this parameter it may have a higher one. If the system securelevel is changed, any jail securelevels will be at least as secure. +.It Va devfs_ruleset +The number of the devfs ruleset that is enforced for mounting devfs in +this jail and its descendants. A value of zero means no ruleset is enforced +or if set inside a jail for a descendant jail, the parent jails's devfs +ruleset enforcement is inherited. A value of -1 (default) means mounting a +devfs filesystem is not allowed. Mounting devfs inside a jail is possible +only if the +.Va allow.mount +permission is effective and +.Va enforce_statfs +is set to a value lower than 2. .It Va children.max The number of child jails allowed to be created by this jail (or by other jails under this jail). From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 10:22:15 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35ABA10657BA; Thu, 9 Feb 2012 10:22:15 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 48CC48FC21; Thu, 9 Feb 2012 10:22:14 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q19AMDvc031336; Thu, 9 Feb 2012 14:22:13 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q19AMDBI031335; Thu, 9 Feb 2012 14:22:13 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 9 Feb 2012 14:22:13 +0400 From: Gleb Smirnoff To: src-committers@FreeBSD.org, svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Message-ID: <20120209102213.GX13554@FreeBSD.org> References: <201202091020.q19AKgi0093783@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <201202091020.q19AKgi0093783@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Subject: Re: svn commit: r231266 - in head: share/man/man4 sys/dev/sdhci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 10:22:15 -0000 On Thu, Feb 09, 2012 at 10:20:42AM +0000, Gleb Smirnoff wrote: T> Author: glebius T> Date: Thu Feb 9 10:20:41 2012 T> New Revision: 231266 T> URL: http://svn.freebsd.org/changeset/base/231266 T> T> Log: T> Add support for RICOH R5CE823 card reader, that can be found in T> some Lenovo laptops. T> T> The conroller needs a quirk to lower its frequency, and after T> that it operates normally. Forgot to mention: Obtained from: OpenBSD Also, I suppose, it is neccessary to run the quirk in sdhci_resume(), but it is definitely not sufficient to get controller resumed. It looks like sdhci_resume(4) lacks some more generic resume code. -- Totus tuus, Glebius. From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 10:39:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62839106566B; Thu, 9 Feb 2012 10:39:02 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D39D8FC17; Thu, 9 Feb 2012 10:39:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q19Ad2VE097024; Thu, 9 Feb 2012 10:39:02 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19Ad2aM097022; Thu, 9 Feb 2012 10:39:02 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201202091039.q19Ad2aM097022@svn.freebsd.org> From: Martin Matuska Date: Thu, 9 Feb 2012 10:39:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231269 - head/sys/fs/nullfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 10:39:02 -0000 Author: mm Date: Thu Feb 9 10:39:01 2012 New Revision: 231269 URL: http://svn.freebsd.org/changeset/base/231269 Log: Allow mounting nullfs(5) inside jails. This is now possible thanks to r230129. MFC after: 1 month Modified: head/sys/fs/nullfs/null_vfsops.c Modified: head/sys/fs/nullfs/null_vfsops.c ============================================================================== --- head/sys/fs/nullfs/null_vfsops.c Thu Feb 9 10:30:45 2012 (r231268) +++ head/sys/fs/nullfs/null_vfsops.c Thu Feb 9 10:39:01 2012 (r231269) @@ -357,4 +357,4 @@ static struct vfsops null_vfsops = { .vfs_vget = nullfs_vget, }; -VFS_SET(null_vfsops, nullfs, VFCF_LOOPBACK); +VFS_SET(null_vfsops, nullfs, VFCF_LOOPBACK | VFCF_JAIL); From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 14:00:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62B8D106564A; Thu, 9 Feb 2012 14:00:50 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4DC768FC15; Thu, 9 Feb 2012 14:00:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q19E0or5003961; Thu, 9 Feb 2012 14:00:50 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19E0oXs003959; Thu, 9 Feb 2012 14:00:50 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201202091400.q19E0oXs003959@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 9 Feb 2012 14:00:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231273 - head/sys/pc98/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 14:00:50 -0000 Author: nyan Date: Thu Feb 9 14:00:49 2012 New Revision: 231273 URL: http://svn.freebsd.org/changeset/base/231273 Log: - Disable the olpt driver. Because it conflicts with the ppc/lpt driver. - Remove obsolete comment. MFC after: 3 days Modified: head/sys/pc98/conf/GENERIC Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Thu Feb 9 13:23:44 2012 (r231272) +++ head/sys/pc98/conf/GENERIC Thu Feb 9 14:00:49 2012 (r231273) @@ -167,8 +167,7 @@ device plip # TCP/IP over parallel device ppi # Parallel port interface device #device vpo # Requires scbus and da # OLD Parallel port -# Please stay olpt driver after ppc driver -device olpt +#device olpt # PCI Ethernet NICs. device de # DEC/Intel DC21x4x (``Tulip'') From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 14:13:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1B702106566B; Thu, 9 Feb 2012 14:13:57 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 03FF28FC13; Thu, 9 Feb 2012 14:13:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q19EDuue004452; Thu, 9 Feb 2012 14:13:56 GMT (envelope-from matthew@svn.freebsd.org) Received: (from matthew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19EDujl004450; Thu, 9 Feb 2012 14:13:56 GMT (envelope-from matthew@svn.freebsd.org) Message-Id: <201202091413.q19EDujl004450@svn.freebsd.org> From: Matthew Seaman Date: Thu, 9 Feb 2012 14:13:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231274 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 14:13:57 -0000 Author: matthew (ports committer) Date: Thu Feb 9 14:13:56 2012 New Revision: 231274 URL: http://svn.freebsd.org/changeset/base/231274 Log: Add myself as a new committer Approved by: shaun (mentor) Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Thu Feb 9 14:00:49 2012 (r231273) +++ head/usr.bin/calendar/calendars/calendar.freebsd Thu Feb 9 14:13:56 2012 (r231274) @@ -274,6 +274,7 @@ 09/12 Weongyo Jeong born in Haman, Korea, 1980 09/12 Benedict Christopher Reuschling born in Darmstadt, Germany, 1981 09/12 William C. Fumerola II born in Detroit, Michigan, United States, 1981 +09/14 Matthew Seaman born in Bristol, United Kingdom, 1965 09/15 Aleksandr Rybalko born in Odessa, Ukraine, 1977 09/15 Dima Panov born in Khabarovsk, Russian Federation, 1978 09/17 Maxim Bolotin born in Rostov-on-Don, Russian Federation, 1976 From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 14:15:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFCD2106564A; Thu, 9 Feb 2012 14:15:20 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id DA5998FC13; Thu, 9 Feb 2012 14:15:20 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q19EFKW6004541; Thu, 9 Feb 2012 14:15:20 GMT (envelope-from matthew@svn.freebsd.org) Received: (from matthew@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19EFKfJ004539; Thu, 9 Feb 2012 14:15:20 GMT (envelope-from matthew@svn.freebsd.org) Message-Id: <201202091415.q19EFKfJ004539@svn.freebsd.org> From: Matthew Seaman Date: Thu, 9 Feb 2012 14:15:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231275 - head/share/misc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 14:15:21 -0000 Author: matthew (ports committer) Date: Thu Feb 9 14:15:20 2012 New Revision: 231275 URL: http://svn.freebsd.org/changeset/base/231275 Log: Adding myself as a new committer Approved by: shaun (mentor) Modified: head/share/misc/committers-ports.dot Modified: head/share/misc/committers-ports.dot ============================================================================== --- head/share/misc/committers-ports.dot Thu Feb 9 14:13:56 2012 (r231274) +++ head/share/misc/committers-ports.dot Thu Feb 9 14:15:20 2012 (r231275) @@ -134,6 +134,7 @@ marcus [label="Joe Marcus Clarke\nmarcus markus [label="Markus Brueffer\nmarkus@FreeBSD.org\n2004/02/21"] martymac [label="Ganael Laplanche\nmartymac@FreeBSD.org\n2010/09/24"] mat [label="Mathieu Arnold\nmat@FreeBSD.org\n2003/08/15"] +matthew [label="Matthew Seaman\nmatthew@FreeBSD.org\n2012/02/07"] mezz [label="Jeremy Messenger\nmezz@FreeBSD.org\n2004/04/30"] miwi [label="Martin Wilke\nmiwi@FreeBSD.org\n2006/06/04"] mm [label="Martin Matuska\nmm@FreeBSD.org\n2007/04/04"] @@ -413,6 +414,7 @@ sem -> delphij sem -> stas shaun -> timur +shaun -> matthew sobomax -> demon sobomax -> glewis From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 14:15:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C05E51065675; Thu, 9 Feb 2012 14:15:57 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 64B818FC13; Thu, 9 Feb 2012 14:15:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q19EFvX2004600; Thu, 9 Feb 2012 14:15:57 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19EFvYu004598; Thu, 9 Feb 2012 14:15:57 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201202091415.q19EFvYu004598@svn.freebsd.org> From: Takahashi Yoshihiro Date: Thu, 9 Feb 2012 14:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231276 - head/sys/pc98/conf X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 14:15:57 -0000 Author: nyan Date: Thu Feb 9 14:15:56 2012 New Revision: 231276 URL: http://svn.freebsd.org/changeset/base/231276 Log: Remove full debugger options and enable KDB_TRACE option instead to decrease kernel size and increase performance. Modified: head/sys/pc98/conf/GENERIC Modified: head/sys/pc98/conf/GENERIC ============================================================================== --- head/sys/pc98/conf/GENERIC Thu Feb 9 14:15:20 2012 (r231275) +++ head/sys/pc98/conf/GENERIC Thu Feb 9 14:15:56 2012 (r231276) @@ -67,20 +67,8 @@ options CAPABILITY_MODE # Capsicum cap options CAPABILITIES # Capsicum capabilities options MAC # TrustedBSD MAC Framework options INCLUDE_CONFIG_FILE # Include this file in kernel - -# Debugging support. Always need this: -options KDB # Enable kernel debugger support. -# For minimum debugger support (stable branch) use: -#options KDB_TRACE # Print a stack trace for a panic. -# For full debugger support use this instead: -options DDB # Support DDB. -options GDB # Support remote GDB. -options DEADLKRES # Enable the deadlock resolver -options INVARIANTS # Enable calls of extra sanity checking -options INVARIANT_SUPPORT # Extra sanity checks of internal structures, required by INVARIANTS -options WITNESS # Enable checks to detect deadlocks and cycles -options WITNESS_SKIPSPIN # Don't run witness on spinlocks for speed -options MALLOC_DEBUG_MAXZONES=8 # Separate malloc(9) zones +options KDB # Kernel debugger related code +options KDB_TRACE # Print a stack trace for a panic # To make an SMP kernel, the next two lines are needed #options SMP # Symmetric MultiProcessor Kernel From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 17:38:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 41842106566B; Thu, 9 Feb 2012 17:38:09 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 118FF8FC12; Thu, 9 Feb 2012 17:38:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q19Hc8RA015087; Thu, 9 Feb 2012 17:38:08 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19Hc8Iv015085; Thu, 9 Feb 2012 17:38:08 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202091738.q19Hc8Iv015085@svn.freebsd.org> From: Jung-uk Kim Date: Thu, 9 Feb 2012 17:38:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231295 - head/sys/dev/acpica X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 17:38:09 -0000 Author: jkim Date: Thu Feb 9 17:38:08 2012 New Revision: 231295 URL: http://svn.freebsd.org/changeset/base/231295 Log: Refine r231226. Swap timecounters before suspending any device drivers. Modified: head/sys/dev/acpica/acpi_timer.c Modified: head/sys/dev/acpica/acpi_timer.c ============================================================================== --- head/sys/dev/acpica/acpi_timer.c Thu Feb 9 16:58:06 2012 (r231294) +++ head/sys/dev/acpica/acpi_timer.c Thu Feb 9 17:38:08 2012 (r231295) @@ -68,8 +68,8 @@ static u_int acpi_timer_frequency = 1431 static void acpi_timer_identify(driver_t *driver, device_t parent); static int acpi_timer_probe(device_t dev); static int acpi_timer_attach(device_t dev); -static int acpi_timer_suspend(device_t); static void acpi_timer_resume_handler(struct timecounter *); +static void acpi_timer_suspend_handler(struct timecounter *); static u_int acpi_timer_get_timecount(struct timecounter *tc); static u_int acpi_timer_get_timecount_safe(struct timecounter *tc); static int acpi_timer_sysctl_freq(SYSCTL_HANDLER_ARGS); @@ -81,7 +81,6 @@ static device_method_t acpi_timer_method DEVMETHOD(device_identify, acpi_timer_identify), DEVMETHOD(device_probe, acpi_timer_probe), DEVMETHOD(device_attach, acpi_timer_attach), - DEVMETHOD(device_suspend, acpi_timer_suspend), {0, 0} }; @@ -249,6 +248,12 @@ acpi_timer_attach(device_t dev) return (ENXIO); acpi_timer_bsh = rman_get_bushandle(acpi_timer_reg); acpi_timer_bst = rman_get_bustag(acpi_timer_reg); + + /* Register suspend event handler. */ + if (EVENTHANDLER_REGISTER(power_suspend, acpi_timer_suspend_handler, + &acpi_timer_timecounter, EVENTHANDLER_PRI_LAST) == NULL) + device_printf(dev, "failed to register suspend event handler\n"); + return (0); } @@ -269,22 +274,25 @@ acpi_timer_resume_handler(struct timecou } } -static int -acpi_timer_suspend(device_t dev) +static void +acpi_timer_suspend_handler(struct timecounter *newtc) { - struct timecounter *newtc, *tc; - int error; + struct timecounter *tc; - error = bus_generic_suspend(dev); + /* Deregister existing resume event handler. */ if (acpi_timer_eh != NULL) { EVENTHANDLER_DEREGISTER(power_resume, acpi_timer_eh); acpi_timer_eh = NULL; } + + KASSERT(newtc == &acpi_timer_timecounter, + ("acpi_timer_suspend_handler: wrong timecounter")); + tc = timecounter; - newtc = &acpi_timer_timecounter; if (tc != newtc) { if (bootverbose) - device_printf(dev, "switching timecounter, %s -> %s\n", + device_printf(acpi_timer_dev, + "switching timecounter, %s -> %s\n", tc->tc_name, newtc->tc_name); (void)acpi_timer_read(); (void)acpi_timer_read(); @@ -292,7 +300,6 @@ acpi_timer_suspend(device_t dev) acpi_timer_eh = EVENTHANDLER_REGISTER(power_resume, acpi_timer_resume_handler, tc, EVENTHANDLER_PRI_LAST); } - return (error); } /* From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 17:50:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2F63C106566B; Thu, 9 Feb 2012 17:50:25 +0000 (UTC) (envelope-from jimharris@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1808D8FC17; Thu, 9 Feb 2012 17:50:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q19HoPNS016159; Thu, 9 Feb 2012 17:50:25 GMT (envelope-from jimharris@svn.freebsd.org) Received: (from jimharris@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19HoO0D016145; Thu, 9 Feb 2012 17:50:24 GMT (envelope-from jimharris@svn.freebsd.org) Message-Id: <201202091750.q19HoO0D016145@svn.freebsd.org> From: Jim Harris Date: Thu, 9 Feb 2012 17:50:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231296 - in head/sys: dev/isci dev/isci/scil modules/isci X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 17:50:25 -0000 Author: jimharris Date: Thu Feb 9 17:50:24 2012 New Revision: 231296 URL: http://svn.freebsd.org/changeset/base/231296 Log: Remove explicit CC assignment in isci(4) Makefile to allow for building with clang. Also fix a number of warnings uncovered when building with clang around some implicit enum conversions. Sponsored by: Intel Approved by: scottl Modified: head/sys/dev/isci/isci.h head/sys/dev/isci/isci_io_request.c head/sys/dev/isci/isci_remote_device.c head/sys/dev/isci/scil/sati_abort_task_set.c head/sys/dev/isci/scil/scic_sds_controller.c head/sys/dev/isci/scil/scif_sas_controller.c head/sys/dev/isci/scil/scif_sas_controller_state_handlers.c head/sys/dev/isci/scil/scif_sas_io_request.c head/sys/dev/isci/scil/scif_sas_remote_device_ready_substates.c head/sys/dev/isci/scil/scif_sas_smp_remote_device.c head/sys/dev/isci/scil/scif_sas_stp_io_request.c head/sys/dev/isci/scil/scif_sas_stp_task_request.c head/sys/modules/isci/Makefile Modified: head/sys/dev/isci/isci.h ============================================================================== --- head/sys/dev/isci/isci.h Thu Feb 9 17:38:08 2012 (r231295) +++ head/sys/dev/isci/isci.h Thu Feb 9 17:50:24 2012 (r231296) @@ -160,7 +160,6 @@ struct ISCI_REQUEST struct ISCI_IO_REQUEST { struct ISCI_REQUEST parent; - SCI_STATUS status; SCI_IO_REQUEST_HANDLE_T sci_object; union ccb *ccb; uint32_t num_segments; Modified: head/sys/dev/isci/isci_io_request.c ============================================================================== --- head/sys/dev/isci/isci_io_request.c Thu Feb 9 17:38:08 2012 (r231295) +++ head/sys/dev/isci/isci_io_request.c Thu Feb 9 17:50:24 2012 (r231296) @@ -626,16 +626,16 @@ isci_io_request_construct(void *arg, bus return; } - io_request->status = scif_io_request_construct( + status = scif_io_request_construct( io_request->parent.controller_handle, io_request->parent.remote_device_handle, SCI_CONTROLLER_INVALID_IO_TAG, (void *)io_request, (void *)((char*)io_request + sizeof(struct ISCI_IO_REQUEST)), &io_request->sci_object); - if (io_request->status != SCI_SUCCESS) { + if (status != SCI_SUCCESS) { isci_io_request_complete(io_request->parent.controller_handle, - device, io_request, io_request->status); + device, io_request, (SCI_IO_STATUS)status); return; } @@ -650,7 +650,7 @@ isci_io_request_construct(void *arg, bus if (status != SCI_SUCCESS) { isci_io_request_complete(io_request->parent.controller_handle, - device, io_request, status); + device, io_request, (SCI_IO_STATUS)status); return; } @@ -900,7 +900,7 @@ isci_io_request_execute_smp_io(union ccb if (status != SCI_SUCCESS) { isci_io_request_complete(controller->scif_controller_handle, - smp_device_handle, io_request, status); + smp_device_handle, io_request, (SCI_IO_STATUS)status); return; } @@ -912,7 +912,7 @@ isci_io_request_execute_smp_io(union ccb if (status != SCI_SUCCESS) { isci_io_request_complete(controller->scif_controller_handle, - smp_device_handle, io_request, status); + smp_device_handle, io_request, (SCI_IO_STATUS)status); return; } Modified: head/sys/dev/isci/isci_remote_device.c ============================================================================== --- head/sys/dev/isci/isci_remote_device.c Thu Feb 9 17:38:08 2012 (r231295) +++ head/sys/dev/isci/isci_remote_device.c Thu Feb 9 17:50:24 2012 (r231296) @@ -195,7 +195,7 @@ isci_remote_device_reset(struct ISCI_REM if (status != SCI_SUCCESS) { isci_task_request_complete(controller->scif_controller_handle, remote_device->sci_object, task_request->sci_object, - status); + (SCI_TASK_STATUS)status); return; } @@ -207,7 +207,7 @@ isci_remote_device_reset(struct ISCI_REM isci_task_request_complete( controller->scif_controller_handle, remote_device->sci_object, task_request->sci_object, - status); + (SCI_TASK_STATUS)status); return; } } Modified: head/sys/dev/isci/scil/sati_abort_task_set.c ============================================================================== --- head/sys/dev/isci/scil/sati_abort_task_set.c Thu Feb 9 17:38:08 2012 (r231295) +++ head/sys/dev/isci/scil/sati_abort_task_set.c Thu Feb 9 17:50:24 2012 (r231296) @@ -124,8 +124,8 @@ SATI_STATUS sati_abort_task_set_translat for (tag_index = 0; tag_index < 32; tag_index++) { - void * matching_command; - SCI_STATUS completion_status; + void * matching_command; + SCI_IO_STATUS completion_status; sati_cb_device_get_request_by_ncq_tag( scsi_task, tag_index, @@ -141,7 +141,7 @@ SATI_STATUS sati_abort_task_set_translat ) { sati_translate_error(sequence, matching_command, log->error); - completion_status = SCI_FAILURE_IO_RESPONSE_VALID; + completion_status = SCI_IO_FAILURE_RESPONSE_VALID; if(sequence->state == SATI_SEQUENCE_STATE_READ_ERROR) { @@ -159,7 +159,7 @@ SATI_STATUS sati_abort_task_set_translat } else { - completion_status = SCI_FAILURE_IO_TERMINATED; + completion_status = SCI_IO_FAILURE_TERMINATED; } sati_cb_io_request_complete(matching_command, completion_status); Modified: head/sys/dev/isci/scil/scic_sds_controller.c ============================================================================== --- head/sys/dev/isci/scil/scic_sds_controller.c Thu Feb 9 17:38:08 2012 (r231295) +++ head/sys/dev/isci/scil/scic_sds_controller.c Thu Feb 9 17:50:24 2012 (r231296) @@ -4165,7 +4165,7 @@ SCI_IO_STATUS scic_controller_start_io( U16 io_tag ) { - SCI_IO_STATUS status; + SCI_STATUS status; SCIC_SDS_CONTROLLER_T *this_controller; this_controller = (SCIC_SDS_CONTROLLER_T *)controller; @@ -4183,7 +4183,7 @@ SCI_IO_STATUS scic_controller_start_io( io_tag ); - return status; + return (SCI_IO_STATUS)status; } // --------------------------------------------------------------------------- @@ -4253,7 +4253,7 @@ SCI_TASK_STATUS scic_controller_start_ta U16 task_tag ) { - SCI_TASK_STATUS status = SCI_FAILURE_INVALID_STATE; + SCI_STATUS status = SCI_FAILURE_INVALID_STATE; SCIC_SDS_CONTROLLER_T *this_controller; this_controller = (SCIC_SDS_CONTROLLER_T *)controller; @@ -4282,7 +4282,7 @@ SCI_TASK_STATUS scic_controller_start_ta )); } - return status; + return (SCI_TASK_STATUS)status; } // --------------------------------------------------------------------------- Modified: head/sys/dev/isci/scil/scif_sas_controller.c ============================================================================== --- head/sys/dev/isci/scil/scif_sas_controller.c Thu Feb 9 17:38:08 2012 (r231295) +++ head/sys/dev/isci/scil/scif_sas_controller.c Thu Feb 9 17:50:24 2012 (r231296) @@ -271,6 +271,7 @@ SCI_IO_STATUS scif_controller_start_io( ) { SCIF_SAS_CONTROLLER_T * fw_controller = (SCIF_SAS_CONTROLLER_T*) controller; + SCI_STATUS status; SCIF_LOG_TRACE(( sci_base_object_get_logger(controller), @@ -284,7 +285,7 @@ SCI_IO_STATUS scif_controller_start_io( || scif_sas_controller_sufficient_resource(controller) ) { - return fw_controller->state_handlers->start_io_handler( + status = fw_controller->state_handlers->start_io_handler( (SCI_BASE_CONTROLLER_T*) controller, (SCI_BASE_REMOTE_DEVICE_T*) remote_device, (SCI_BASE_REQUEST_T*) io_request, @@ -292,7 +293,9 @@ SCI_IO_STATUS scif_controller_start_io( ); } else - return SCI_FAILURE_INSUFFICIENT_RESOURCES; + status = SCI_FAILURE_INSUFFICIENT_RESOURCES; + + return (SCI_IO_STATUS)status; } // --------------------------------------------------------------------------- @@ -305,13 +308,14 @@ SCI_TASK_STATUS scif_controller_start_ta ) { SCIF_SAS_CONTROLLER_T * fw_controller = (SCIF_SAS_CONTROLLER_T*) controller; + SCI_STATUS status; // Validate the user supplied parameters. if ( (controller == SCI_INVALID_HANDLE) || (remote_device == SCI_INVALID_HANDLE) || (task_request == SCI_INVALID_HANDLE) ) { - return SCI_FAILURE_INVALID_PARAMETER_VALUE; + return SCI_TASK_FAILURE_INVALID_PARAMETER_VALUE; } SCIF_LOG_TRACE(( @@ -323,7 +327,7 @@ SCI_TASK_STATUS scif_controller_start_ta if (scif_sas_controller_sufficient_resource(controller)) { - return fw_controller->state_handlers->start_task_handler( + status = fw_controller->state_handlers->start_task_handler( (SCI_BASE_CONTROLLER_T*) controller, (SCI_BASE_REMOTE_DEVICE_T*) remote_device, (SCI_BASE_REQUEST_T*) task_request, @@ -331,7 +335,9 @@ SCI_TASK_STATUS scif_controller_start_ta ); } else - return SCI_FAILURE_INSUFFICIENT_RESOURCES; + status = SCI_FAILURE_INSUFFICIENT_RESOURCES; + + return (SCI_TASK_STATUS)status; } // --------------------------------------------------------------------------- Modified: head/sys/dev/isci/scil/scif_sas_controller_state_handlers.c ============================================================================== --- head/sys/dev/isci/scil/scif_sas_controller_state_handlers.c Thu Feb 9 17:38:08 2012 (r231295) +++ head/sys/dev/isci/scil/scif_sas_controller_state_handlers.c Thu Feb 9 17:50:24 2012 (r231296) @@ -586,7 +586,7 @@ SCI_STATUS scif_sas_controller_ready_sta if (status == SCI_SUCCESS) { // Ask the core to start processing for this IO request. - status = scic_controller_start_io( + status = (SCI_STATUS)scic_controller_start_io( fw_controller->core_object, fw_device->core_object, fw_io->parent.core_object, @@ -903,7 +903,7 @@ SCI_STATUS scif_sas_controller_ready_sta } // Ask the core to start processing for this task request. - status = scic_controller_start_task( + status = (SCI_STATUS)scic_controller_start_task( fw_controller->core_object, fw_device->core_object, fw_task->parent.core_object, @@ -1072,7 +1072,7 @@ SCI_STATUS scif_sas_controller_common_st if (status == SCI_SUCCESS) { // Ask the core to start processing for this IO request. - status = scic_controller_start_io( + status = (SCI_STATUS)scic_controller_start_io( fw_controller->core_object, fw_device->core_object, fw_io->parent.core_object, @@ -1683,7 +1683,7 @@ SCI_STATUS scif_sas_controller_failed_st &((SCIF_SAS_CONTROLLER_T *)controller)->parent.state_machine) )); - return SCI_IO_FAILURE; + return SCI_FAILURE; } #define scif_sas_controller_stopping_complete_io_handler \ Modified: head/sys/dev/isci/scil/scif_sas_io_request.c ============================================================================== --- head/sys/dev/isci/scil/scif_sas_io_request.c Thu Feb 9 17:38:08 2012 (r231295) +++ head/sys/dev/isci/scil/scif_sas_io_request.c Thu Feb 9 17:50:24 2012 (r231296) @@ -811,7 +811,7 @@ SCI_STATUS scif_sas_io_request_continue( ); //start the new constructed IO. - return scif_controller_start_io( + return (SCI_STATUS)scif_controller_start_io( (SCI_CONTROLLER_HANDLE_T) fw_controller, (SCI_REMOTE_DEVICE_HANDLE_T) fw_device, (SCI_IO_REQUEST_HANDLE_T) fw_request, Modified: head/sys/dev/isci/scil/scif_sas_remote_device_ready_substates.c ============================================================================== --- head/sys/dev/isci/scil/scif_sas_remote_device_ready_substates.c Thu Feb 9 17:38:08 2012 (r231295) +++ head/sys/dev/isci/scil/scif_sas_remote_device_ready_substates.c Thu Feb 9 17:50:24 2012 (r231296) @@ -255,7 +255,7 @@ void scif_sas_remote_device_ready_ncq_er } } - status = scif_controller_start_task( + scif_controller_start_task( fw_controller, fw_device, fw_request, Modified: head/sys/dev/isci/scil/scif_sas_smp_remote_device.c ============================================================================== --- head/sys/dev/isci/scil/scif_sas_smp_remote_device.c Thu Feb 9 17:38:08 2012 (r231295) +++ head/sys/dev/isci/scil/scif_sas_smp_remote_device.c Thu Feb 9 17:50:24 2012 (r231296) @@ -1853,7 +1853,7 @@ void scif_sas_smp_remote_device_terminat )); scif_sas_smp_remote_device_decode_smp_response( - fw_device, fw_request, NULL, SCI_FAILURE_RETRY_REQUIRED + fw_device, fw_request, NULL, SCI_IO_FAILURE_RETRY_REQUIRED ); } Modified: head/sys/dev/isci/scil/scif_sas_stp_io_request.c ============================================================================== --- head/sys/dev/isci/scil/scif_sas_stp_io_request.c Thu Feb 9 17:38:08 2012 (r231295) +++ head/sys/dev/isci/scil/scif_sas_stp_io_request.c Thu Feb 9 17:50:24 2012 (r231296) @@ -396,7 +396,7 @@ SCI_STATUS scif_sas_stp_io_request_const fw_io->parent.protocol_complete_handler = scif_sas_stp_core_cb_io_request_complete_handler; // Done with translation - sci_status = SATI_SUCCESS; + sci_status = SCI_SUCCESS; } else if (sati_status == SATI_COMPLETE) sci_status = SCI_SUCCESS_IO_COMPLETE_BEFORE_START; Modified: head/sys/dev/isci/scil/scif_sas_stp_task_request.c ============================================================================== --- head/sys/dev/isci/scil/scif_sas_stp_task_request.c Thu Feb 9 17:38:08 2012 (r231295) +++ head/sys/dev/isci/scil/scif_sas_stp_task_request.c Thu Feb 9 17:50:24 2012 (r231296) @@ -254,7 +254,7 @@ void scif_sas_stp_task_request_abort_tas fw_domain->controller, fw_device, pending_request, - SCI_FAILURE_IO_TERMINATED + SCI_IO_FAILURE_TERMINATED ); } //otherwise, the abort succeeded. Since the waiting flag is cleared, Modified: head/sys/modules/isci/Makefile ============================================================================== --- head/sys/modules/isci/Makefile Thu Feb 9 17:38:08 2012 (r231295) +++ head/sys/modules/isci/Makefile Thu Feb 9 17:50:24 2012 (r231296) @@ -87,6 +87,4 @@ SRCS += \ SRCS += opt_scsi.h opt_cam.h opt_isci.h SRCS += device_if.h bus_if.h pci_if.h -CC = gcc - .include From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 20:44:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 815251065672; Thu, 9 Feb 2012 20:44:21 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F3D98FC14; Thu, 9 Feb 2012 20:44:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q19KiLg4027541; Thu, 9 Feb 2012 20:44:21 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19KiLUT027539; Thu, 9 Feb 2012 20:44:21 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201202092044.q19KiLUT027539@svn.freebsd.org> From: Eitan Adler Date: Thu, 9 Feb 2012 20:44:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231298 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 20:44:21 -0000 Author: eadler Date: Thu Feb 9 20:44:20 2012 New Revision: 231298 URL: http://svn.freebsd.org/changeset/base/231298 Log: Make etc/Makefile more conflict resistant PR: conf/163789 Submitted by: gcooper (iXsystems) Approved by: cperciva MFC after: 3 days Modified: head/etc/Makefile Modified: head/etc/Makefile ============================================================================== --- head/etc/Makefile Thu Feb 9 19:13:36 2012 (r231297) +++ head/etc/Makefile Thu Feb 9 20:44:20 2012 (r231298) @@ -7,18 +7,48 @@ SUBDIR= sendmail .endif -BIN1= auth.conf \ - crontab devd.conf devfs.conf \ - ddb.conf dhclient.conf disktab fbtab \ - ftpusers gettytab group \ - hosts hosts.allow hosts.equiv \ - inetd.conf libalias.conf login.access login.conf mac.conf motd \ - netconfig network.subr networks newsyslog.conf nsswitch.conf \ - phones profile protocols \ - rc rc.bsdextended rc.firewall rc.initdiskless \ - rc.sendmail rc.shutdown \ - rc.subr remote rpc services shells \ - sysctl.conf syslog.conf termcap.small +BIN1= auth.conf +BIN1+= crontab +BIN1+= devd.conf +BIN1+= devfs.conf +BIN1+= ddb.conf +BIN1+= dhclient.conf +BIN1+= disktab +BIN1+= fbtab +BIN1+= ftpusers +BIN1+= gettytab +BIN1+= group +BIN1+= hosts +BIN1+= hosts.allow +BIN1+= hosts.equiv +BIN1+= inetd.conf +BIN1+= libalias.conf +BIN1+= login.access +BIN1+= login.conf +BIN1+= mac.conf +BIN1+= motd +BIN1+= netconfig +BIN1+= network.subr +BIN1+= networks +BIN1+= newsyslog.conf +BIN1+= nsswitch.conf +BIN1+= phones +BIN1+= profile +BIN1+= protocols +BIN1+= rc +BIN1+= rc.bsdextended +BIN1+= rc.firewall +BIN1+= rc.initdiskless +BIN1+= rc.sendmail +BIN1+= rc.shutdown +BIN1+= rc.subr +BIN1+= remote +BIN1+= rpc +BIN1+= services +BIN1+= shells +BIN1+= sysctl.conf +BIN1+= syslog.conf +BIN1+= termcap.small .if exists(${.CURDIR}/etc.${MACHINE}/ttys) BIN1+= etc.${MACHINE}/ttys From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 20:49:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B4FA9106568A; Thu, 9 Feb 2012 20:49:03 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A3D0F8FC12; Thu, 9 Feb 2012 20:49:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q19Kn3ud028151; Thu, 9 Feb 2012 20:49:03 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19Kn3R2028149; Thu, 9 Feb 2012 20:49:03 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201202092049.q19Kn3R2028149@svn.freebsd.org> From: Eitan Adler Date: Thu, 9 Feb 2012 20:49:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231299 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 20:49:03 -0000 Author: eadler Date: Thu Feb 9 20:49:03 2012 New Revision: 231299 URL: http://svn.freebsd.org/changeset/base/231299 Log: More accurately document what happens on error. PR: docs/127908 Submitted by: Matthew D. Fuller Approved by: cperciva MFC after: 1 week Modified: head/lib/libc/gen/directory.3 Modified: head/lib/libc/gen/directory.3 ============================================================================== --- head/lib/libc/gen/directory.3 Thu Feb 9 20:44:20 2012 (r231298) +++ head/lib/libc/gen/directory.3 Thu Feb 9 20:49:03 2012 (r231299) @@ -122,9 +122,12 @@ function returns a pointer to the next directory entry. It returns .Dv NULL -upon reaching the end of the directory or detecting an invalid -.Fn seekdir -operation. +upon reaching the end of the directory or on error. +In the event of an error, +.Va errno +may be set to any of the values documented for the +.Xr getdirentries 2 +system call. .Pp The .Fn readdir_r From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 20:51:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 04AB9106566B; Thu, 9 Feb 2012 20:51:04 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E75838FC17; Thu, 9 Feb 2012 20:51:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q19Kp3eV028438; Thu, 9 Feb 2012 20:51:03 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19Kp3pj028436; Thu, 9 Feb 2012 20:51:03 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201202092051.q19Kp3pj028436@svn.freebsd.org> From: Eitan Adler Date: Thu, 9 Feb 2012 20:51:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231300 - head/usr.sbin/pkg_install/create X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 20:51:04 -0000 Author: eadler Date: Thu Feb 9 20:51:03 2012 New Revision: 231300 URL: http://svn.freebsd.org/changeset/base/231300 Log: Permit the use of relative paths for the prefix argument. Remove an unnecessary cwd from created plists when -p is specified PR: bin/145000 Submitted by: gcooper Approved by: portmgr (flo) MFC after: 1 month Modified: head/usr.sbin/pkg_install/create/perform.c Modified: head/usr.sbin/pkg_install/create/perform.c ============================================================================== --- head/usr.sbin/pkg_install/create/perform.c Thu Feb 9 20:49:03 2012 (r231299) +++ head/usr.sbin/pkg_install/create/perform.c Thu Feb 9 20:51:03 2012 (r231300) @@ -214,8 +214,12 @@ pkg_perform(char **pkgs) read_plist(&plist, pkg_in); /* Prefix should add an @cwd to the packing list */ - if (Prefix) - add_plist_top(&plist, PLIST_CWD, Prefix); + if (Prefix) { + char resolved_prefix[PATH_MAX]; + if (realpath(Prefix, resolved_prefix) != 0) + err(EXIT_FAILURE, "couldn't resolve path for prefix: %s", Prefix); + add_plist_top(&plist, PLIST_CWD, resolved_prefix); + } /* Add the origin if asked, at the top */ if (Origin) @@ -260,7 +264,9 @@ pkg_perform(char **pkgs) /* mark_plist(&plist); */ /* Now put the release specific items in */ - add_plist(&plist, PLIST_CWD, "."); + if (!Prefix) { + add_plist(&plist, PLIST_CWD, "."); + } write_file(COMMENT_FNAME, Comment); add_plist(&plist, PLIST_IGNORE, NULL); add_plist(&plist, PLIST_FILE, COMMENT_FNAME); From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 21:06:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D59D0106566C; Thu, 9 Feb 2012 21:06:47 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C48A08FC0A; Thu, 9 Feb 2012 21:06:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q19L6lec030731; Thu, 9 Feb 2012 21:06:47 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19L6l7I030729; Thu, 9 Feb 2012 21:06:47 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201202092106.q19L6l7I030729@svn.freebsd.org> From: Eitan Adler Date: Thu, 9 Feb 2012 21:06:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231306 - head/lib/libutil X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 21:06:47 -0000 Author: eadler Date: Thu Feb 9 21:06:47 2012 New Revision: 231306 URL: http://svn.freebsd.org/changeset/base/231306 Log: Fix NULL ptr dereference in setusercontext if pwd is null, LOGIN_SETPRIORITY is set, and setting the priority (rtprio or setpriority) fails. PR: kern/164238 Submitted by: Alexander Wittig Reviewed by: des Approved by: cperciva MFC after: 1 month Modified: head/lib/libutil/login_class.c Modified: head/lib/libutil/login_class.c ============================================================================== --- head/lib/libutil/login_class.c Thu Feb 9 20:57:36 2012 (r231305) +++ head/lib/libutil/login_class.c Thu Feb 9 21:06:47 2012 (r231306) @@ -452,18 +452,21 @@ setusercontext(login_cap_t *lc, const st p = (rtp.prio > RTP_PRIO_MAX) ? 31 : p; if (rtprio(RTP_SET, 0, &rtp)) syslog(LOG_WARNING, "rtprio '%s' (%s): %m", - pwd->pw_name, lc ? lc->lc_class : LOGIN_DEFCLASS); + pwd ? pwd->pw_name : "-", + lc ? lc->lc_class : LOGIN_DEFCLASS); } else if (p < PRIO_MIN) { rtp.type = RTP_PRIO_REALTIME; rtp.prio = abs(p - PRIO_MIN + RTP_PRIO_MAX); p = (rtp.prio > RTP_PRIO_MAX) ? 1 : p; if (rtprio(RTP_SET, 0, &rtp)) syslog(LOG_WARNING, "rtprio '%s' (%s): %m", - pwd->pw_name, lc ? lc->lc_class : LOGIN_DEFCLASS); + pwd ? pwd->pw_name : "-", + lc ? lc->lc_class : LOGIN_DEFCLASS); } else { if (setpriority(PRIO_PROCESS, 0, (int)p) != 0) syslog(LOG_WARNING, "setpriority '%s' (%s): %m", - pwd->pw_name, lc ? lc->lc_class : LOGIN_DEFCLASS); + pwd ? pwd->pw_name : "-", + lc ? lc->lc_class : LOGIN_DEFCLASS); } } From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 21:20:22 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFBA1106566C; Thu, 9 Feb 2012 21:20:22 +0000 (UTC) (envelope-from flo@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id B7A428FC08; Thu, 9 Feb 2012 21:20:22 +0000 (UTC) Received: from nibbler-wlan.fritz.box (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q19LKKQB013600; Thu, 9 Feb 2012 21:20:21 GMT (envelope-from flo@FreeBSD.org) Message-ID: <4F343893.1070903@FreeBSD.org> Date: Thu, 09 Feb 2012 22:20:19 +0100 From: Florian Smeets User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:11.0) Gecko/20120202 Thunderbird/11.0 MIME-Version: 1.0 To: Eitan Adler References: <201202092051.q19Kp3pj028436@svn.freebsd.org> In-Reply-To: <201202092051.q19Kp3pj028436@svn.freebsd.org> X-Enigmail-Version: 1.4a1pre Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="------------enigB8E11E9250150B51B7DA621C" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r231300 - head/usr.sbin/pkg_install/create X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 21:20:22 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enigB8E11E9250150B51B7DA621C Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 09.02.12 21:51, Eitan Adler wrote: > Author: eadler > Date: Thu Feb 9 20:51:03 2012 > New Revision: 231300 > URL: http://svn.freebsd.org/changeset/base/231300 >=20 > Log: > Permit the use of relative paths for the prefix argument. > Remove an unnecessary cwd from created plists when -p is specified > =20 > PR: bin/145000 > Submitted by: gcooper > Approved by: portmgr (flo) I guess this should read flz ;) Florian --------------enigB8E11E9250150B51B7DA621C Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iEYEARECAAYFAk80OJQACgkQapo8P8lCvwn62gCcCSw60P1S1sZT9Rr0x/II/zdm 4aIAn3NgsL1BAYcnVpcVekr+Q3/WgplN =K0Tj -----END PGP SIGNATURE----- --------------enigB8E11E9250150B51B7DA621C-- From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 21:47:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77B3D106564A; Thu, 9 Feb 2012 21:47:19 +0000 (UTC) (envelope-from pawel@dawidek.net) Received: from mail.dawidek.net (60.wheelsystems.com [83.12.187.60]) by mx1.freebsd.org (Postfix) with ESMTP id 1EDA38FC0C; Thu, 9 Feb 2012 21:47:18 +0000 (UTC) Received: from localhost (89-73-195-149.dynamic.chello.pl [89.73.195.149]) by mail.dawidek.net (Postfix) with ESMTPSA id 6FB3490B; Thu, 9 Feb 2012 22:47:16 +0100 (CET) Date: Thu, 9 Feb 2012 22:46:02 +0100 From: Pawel Jakub Dawidek To: Martin Matuska Message-ID: <20120209214601.GA1313@garage.freebsd.pl> References: <201202091039.q19Ad2aM097022@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="pf9I7BMVVzbSWLtt" Content-Disposition: inline In-Reply-To: <201202091039.q19Ad2aM097022@svn.freebsd.org> X-OS: FreeBSD 10.0-CURRENT amd64 User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231269 - head/sys/fs/nullfs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 21:47:19 -0000 --pf9I7BMVVzbSWLtt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Feb 09, 2012 at 10:39:02AM +0000, Martin Matuska wrote: > Author: mm > Date: Thu Feb 9 10:39:01 2012 > New Revision: 231269 > URL: http://svn.freebsd.org/changeset/base/231269 >=20 > Log: > Allow mounting nullfs(5) inside jails. > =20 > This is now possible thanks to r230129. > =20 > MFC after: 1 month I'd really like to know that someone actually audited nullfs to see it can be safely managed within a jail. devfs is probably even more critical - hopefully it isn't possible to make simple administrative mistake that will allow to get access to, eg. /dev/kmem from within a jail or something similar. Changes like this one, which can have serious security implications, should be really properly reviewed. --=20 Pawel Jakub Dawidek http://www.wheelsystems.com FreeBSD committer http://www.FreeBSD.org Am I Evil? Yes, I Am! http://tupytaj.pl --pf9I7BMVVzbSWLtt Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iEYEARECAAYFAk80PpkACgkQForvXbEpPzRtUgCcDDpIn0FF81kIPQc2oc08OD0U aicAoLe+s1uqaITI8yhJXAXFM4ao5fGs =vS6O -----END PGP SIGNATURE----- --pf9I7BMVVzbSWLtt-- From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 22:15:21 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EFB3F1065672; Thu, 9 Feb 2012 22:15:21 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id A5D098FC12; Thu, 9 Feb 2012 22:15:21 +0000 (UTC) Received: from [172.23.7.29] (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q19MFD65042946 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 9 Feb 2012 14:15:20 -0800 (PST) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: <201202092044.q19KiLUT027539@svn.freebsd.org> Date: Thu, 9 Feb 2012 14:15:07 -0800 Content-Transfer-Encoding: 7bit Message-Id: References: <201202092044.q19KiLUT027539@svn.freebsd.org> To: Eitan Adler X-Mailer: Apple Mail (2.1257) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r231298 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 22:15:22 -0000 On Feb 9, 2012, at 12:44 PM, Eitan Adler wrote: > Author: eadler > Date: Thu Feb 9 20:44:20 2012 > New Revision: 231298 > URL: http://svn.freebsd.org/changeset/base/231298 > > Log: > Make etc/Makefile more conflict resistant Nice. Question though: why not the less verbose BIN1 = \ foo \ bar \ baz It's probably faster too, and friendlier when running "make -dv" Just a thought... -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 22:17:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9ADBF106566B; Thu, 9 Feb 2012 22:17:14 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6F7DE8FC15; Thu, 9 Feb 2012 22:17:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q19MHEpb039373; Thu, 9 Feb 2012 22:17:14 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19MHEuU039370; Thu, 9 Feb 2012 22:17:14 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201202092217.q19MHEuU039370@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 9 Feb 2012 22:17:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231312 - in head/sys/mips: include mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 22:17:14 -0000 Author: gonzo Date: Thu Feb 9 22:17:13 2012 New Revision: 231312 URL: http://svn.freebsd.org/changeset/base/231312 Log: - Emulate RDHWR instruction for TLS support Reading register $29 with RDHWR is becoming the de-facto standard to implement TLS. According to linux-mips wiki, MIPS Technologies has reserved hardware register $29 for ABI use. Furthermore current GCC makes the following assumptions: - RDHWR is natively available or otherwise emulated by the kernel - Register $29 holds the TLS pointer Submitted by: Robert Millan Modified: head/sys/mips/include/mips_opcode.h head/sys/mips/mips/trap.c Modified: head/sys/mips/include/mips_opcode.h ============================================================================== --- head/sys/mips/include/mips_opcode.h Thu Feb 9 22:13:20 2012 (r231311) +++ head/sys/mips/include/mips_opcode.h Thu Feb 9 22:17:13 2012 (r231312) @@ -176,6 +176,11 @@ typedef union { #define OP_LDL 032 #define OP_LDR 033 +#define OP_SPECIAL2 034 +#define OP_JALX 035 + +#define OP_SPECIAL3 037 + #define OP_LB 040 #define OP_LH 041 #define OP_LWL 042 @@ -389,6 +394,11 @@ typedef union { #define OP_R_BGEZALL OP_BGEZALL /* + * Values for the 'func' field when 'op' == OP_SPECIAL3. + */ +#define OP_RDHWR 073 + +/* * Values for the 'rs' field when 'op' == OP_COPz. */ #define OP_MF 000 Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Thu Feb 9 22:13:20 2012 (r231311) +++ head/sys/mips/mips/trap.c Thu Feb 9 22:17:13 2012 (r231312) @@ -414,6 +414,7 @@ trap(struct trapframe *trapframe) intptr_t addr = 0; register_t pc; int cop; + register_t *frame_regs; trapdebug_enter(trapframe, 0); @@ -762,9 +763,29 @@ dofault: } case T_RES_INST + T_USER: - log_illegal_instruction("RES_INST", trapframe); - i = SIGILL; - addr = trapframe->pc; + { + InstFmt inst; + inst = *(InstFmt *)trapframe->pc; + switch (inst.RType.op) { + case OP_SPECIAL3: + switch (inst.RType.func) { + case OP_RDHWR: + /* Register 29 used for TLS */ + if (inst.RType.rd == 29) { + frame_regs = &(trapframe->zero); + frame_regs[inst.RType.rt] = (register_t)td->td_md.md_tls; + trapframe->pc += sizeof(int); + goto out; + } + break; + } + break; + } + + log_illegal_instruction("RES_INST", trapframe); + i = SIGILL; + addr = trapframe->pc; + } break; case T_C2E: case T_C2E + T_USER: From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 22:33:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AECAC1065670; Thu, 9 Feb 2012 22:33:30 +0000 (UTC) (envelope-from bzeeb-lists@lists.zabbadoz.net) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id 330778FC17; Thu, 9 Feb 2012 22:33:30 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id 28A4925D3870; Thu, 9 Feb 2012 22:33:29 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id 545D3BDB039; Thu, 9 Feb 2012 22:33:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id L2P4tXzdsv5v; Thu, 9 Feb 2012 22:33:26 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id 8A950BDB038; Thu, 9 Feb 2012 22:33:26 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201202092217.q19MHEuU039370@svn.freebsd.org> Date: Thu, 9 Feb 2012 22:33:25 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201202092217.q19MHEuU039370@svn.freebsd.org> To: Oleksandr Tymoshenko X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231312 - in head/sys/mips: include mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 22:33:31 -0000 On 9. Feb 2012, at 22:17 , Oleksandr Tymoshenko wrote: > Author: gonzo > Date: Thu Feb 9 22:17:13 2012 > New Revision: 231312 > URL: http://svn.freebsd.org/changeset/base/231312 >=20 > Log: > - Emulate RDHWR instruction for TLS support >=20 > Reading register $29 with RDHWR is becoming the de-facto standard to > implement TLS. According to linux-mips wiki, MIPS Technologies has > reserved hardware register $29 for ABI use. Furthermore current GCC > makes the following assumptions: > - RDHWR is natively available or otherwise emulated by the kernel > - Register $29 holds the TLS pointer >=20 > Submitted by: Robert Millan mips XLPN32 kernel failed, check _.mips.XLPN32 for details mips XLRN32 kernel failed, check _.mips.XLRN32 for details /scratch/tmp/bz/head.svn/sys/mips/mips/trap.c: In function 'trap': /scratch/tmp/bz/head.svn/sys/mips/mips/trap.c:768: warning: cast to = pointer from integer of different size [-Wint-to-pointer-cast] /scratch/tmp/bz/head.svn/sys/mips/mips/trap.c:776: warning: cast from = pointer to integer of different size [-Wpointer-to-int-cast] >=20 > Modified: > head/sys/mips/include/mips_opcode.h > head/sys/mips/mips/trap.c >=20 > Modified: head/sys/mips/include/mips_opcode.h > = =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 > --- head/sys/mips/include/mips_opcode.h Thu Feb 9 22:13:20 2012 = (r231311) > +++ head/sys/mips/include/mips_opcode.h Thu Feb 9 22:17:13 2012 = (r231312) > @@ -176,6 +176,11 @@ typedef union { > #define OP_LDL 032 > #define OP_LDR 033 >=20 > +#define OP_SPECIAL2 034 > +#define OP_JALX 035 > + > +#define OP_SPECIAL3 037 > + > #define OP_LB 040 > #define OP_LH 041 > #define OP_LWL 042 > @@ -389,6 +394,11 @@ typedef union { > #define OP_R_BGEZALL OP_BGEZALL >=20 > /* > + * Values for the 'func' field when 'op' =3D=3D OP_SPECIAL3. > + */ > +#define OP_RDHWR 073 > + > +/* > * Values for the 'rs' field when 'op' =3D=3D OP_COPz. > */ > #define OP_MF 000 >=20 > Modified: head/sys/mips/mips/trap.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 > --- head/sys/mips/mips/trap.c Thu Feb 9 22:13:20 2012 = (r231311) > +++ head/sys/mips/mips/trap.c Thu Feb 9 22:17:13 2012 = (r231312) > @@ -414,6 +414,7 @@ trap(struct trapframe *trapframe) > intptr_t addr =3D 0; > register_t pc; > int cop; > + register_t *frame_regs; >=20 > trapdebug_enter(trapframe, 0); > =09 > @@ -762,9 +763,29 @@ dofault: > } >=20 > case T_RES_INST + T_USER: > - log_illegal_instruction("RES_INST", trapframe); > - i =3D SIGILL; > - addr =3D trapframe->pc; > + { > + InstFmt inst; > + inst =3D *(InstFmt *)trapframe->pc; > + switch (inst.RType.op) { > + case OP_SPECIAL3: > + switch (inst.RType.func) { > + case OP_RDHWR: > + /* Register 29 used for TLS */ > + if (inst.RType.rd =3D=3D 29) { > + frame_regs =3D = &(trapframe->zero); > + = frame_regs[inst.RType.rt] =3D (register_t)td->td_md.md_tls; > + trapframe->pc +=3D = sizeof(int); > + goto out; > + } > + break; > + } > + break; > + } > + > + log_illegal_instruction("RES_INST", trapframe); > + i =3D SIGILL; > + addr =3D trapframe->pc; > + } > break; > case T_C2E: > case T_C2E + T_USER: --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 22:34:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 40B931065672; Thu, 9 Feb 2012 22:34:17 +0000 (UTC) (envelope-from mckusick@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1526F8FC13; Thu, 9 Feb 2012 22:34:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q19MYGFr040873; Thu, 9 Feb 2012 22:34:16 GMT (envelope-from mckusick@svn.freebsd.org) Received: (from mckusick@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19MYGEJ040871; Thu, 9 Feb 2012 22:34:16 GMT (envelope-from mckusick@svn.freebsd.org) Message-Id: <201202092234.q19MYGEJ040871@svn.freebsd.org> From: Kirk McKusick Date: Thu, 9 Feb 2012 22:34:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231313 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 22:34:17 -0000 Author: mckusick Date: Thu Feb 9 22:34:16 2012 New Revision: 231313 URL: http://svn.freebsd.org/changeset/base/231313 Log: Historically when an application wrote an entire block of a file, the kernel allocated a buffer but did not zero it as it was about to be completely filled by a uiomove() from the user's buffer. However, if the uiomove() failed, the old contents of the buffer could be exposed especially if the file was being mmap'ed. The fix was to always zero the buffer when it was allocated. This change first attempts the uiomove() to the newly allocated (and dirty) buffer and only zeros it if the uiomove() fails. The effect is to eliminate the gratuitous zeroing of the buffer in the usual case where the uiomove() successfully fills it. Reviewed by: kib Tested by: scottl MFC after: 2 weeks (to 9 only) Modified: head/sys/ufs/ffs/ffs_vnops.c Modified: head/sys/ufs/ffs/ffs_vnops.c ============================================================================== --- head/sys/ufs/ffs/ffs_vnops.c Thu Feb 9 22:17:13 2012 (r231312) +++ head/sys/ufs/ffs/ffs_vnops.c Thu Feb 9 22:34:16 2012 (r231313) @@ -718,15 +718,6 @@ ffs_write(ap) vnode_pager_setsize(vp, ip->i_size); break; } - /* - * If the buffer is not valid we have to clear out any - * garbage data from the pages instantiated for the buffer. - * If we do not, a failed uiomove() during a write can leave - * the prior contents of the pages exposed to a userland - * mmap(). XXX deal with uiomove() errors a better way. - */ - if ((bp->b_flags & B_CACHE) == 0 && fs->fs_bsize <= xfersize) - vfs_bio_clrbuf(bp); if (ioflag & IO_DIRECT) bp->b_flags |= B_DIRECT; if ((ioflag & (IO_SYNC|IO_INVAL)) == (IO_SYNC|IO_INVAL)) @@ -743,6 +734,26 @@ ffs_write(ap) error = uiomove((char *)bp->b_data + blkoffset, (int)xfersize, uio); + /* + * If the buffer is not already filled and we encounter an + * error while trying to fill it, we have to clear out any + * garbage data from the pages instantiated for the buffer. + * If we do not, a failed uiomove() during a write can leave + * the prior contents of the pages exposed to a userland mmap. + * + * Note that we need only clear buffers with a transfer size + * equal to the block size because buffers with a shorter + * transfer size were cleared above by the call to UFS_BALLOC() + * with the BA_CLRBUF flag set. + * + * If the source region for uiomove identically mmaps the + * buffer, uiomove() performed the NOP copy, and the buffer + * content remains valid because the page fault handler + * validated the pages. + */ + if (error != 0 && (bp->b_flags & B_CACHE) == 0 && + fs->fs_bsize == xfersize) + vfs_bio_clrbuf(bp); if ((ioflag & (IO_VMIO|IO_DIRECT)) && (LIST_EMPTY(&bp->b_dep))) { bp->b_flags |= B_RELBUF; From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 22:48:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA81D106566C; Thu, 9 Feb 2012 22:48:35 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B97198FC12; Thu, 9 Feb 2012 22:48:35 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q19MmZOo041327; Thu, 9 Feb 2012 22:48:35 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19MmZo5041325; Thu, 9 Feb 2012 22:48:35 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201202092248.q19MmZo5041325@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Thu, 9 Feb 2012 22:48:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231314 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 22:48:35 -0000 Author: gonzo Date: Thu Feb 9 22:48:35 2012 New Revision: 231314 URL: http://svn.freebsd.org/changeset/base/231314 Log: Fix n32 build breakage Modified: head/sys/mips/mips/trap.c Modified: head/sys/mips/mips/trap.c ============================================================================== --- head/sys/mips/mips/trap.c Thu Feb 9 22:34:16 2012 (r231313) +++ head/sys/mips/mips/trap.c Thu Feb 9 22:48:35 2012 (r231314) @@ -765,7 +765,7 @@ dofault: case T_RES_INST + T_USER: { InstFmt inst; - inst = *(InstFmt *)trapframe->pc; + inst = *(InstFmt *)(intptr_t)trapframe->pc; switch (inst.RType.op) { case OP_SPECIAL3: switch (inst.RType.func) { @@ -773,7 +773,7 @@ dofault: /* Register 29 used for TLS */ if (inst.RType.rd == 29) { frame_regs = &(trapframe->zero); - frame_regs[inst.RType.rt] = (register_t)td->td_md.md_tls; + frame_regs[inst.RType.rt] = (register_t)(intptr_t)td->td_md.md_tls; trapframe->pc += sizeof(int); goto out; } From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 23:09:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1692B106566B; Thu, 9 Feb 2012 23:09:33 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-we0-f182.google.com (mail-we0-f182.google.com [74.125.82.182]) by mx1.freebsd.org (Postfix) with ESMTP id 4FF368FC1B; Thu, 9 Feb 2012 23:09:31 +0000 (UTC) Received: by werm13 with SMTP id m13so2341550wer.13 for ; Thu, 09 Feb 2012 15:09:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=TwLa1VJWwRXtTYrq8He535FGpqEqUvfFxFXsz27yTgY=; b=PBHAFZc00y9pCspU5UWpmXgLvVbRzaXJUsWnz8BmCKnwV56TsSl4u+fRl4Rn8Ycb2S t8wh6wPGVgZre7Z0hOSx1n8GjHaV21ifFbD9uRHMNZpERGbPHnOObT1t5wd6BnIUc96r glee9E8JIyryMD0t297LGojEsmNz1nrmPzTKw= Received: by 10.180.83.72 with SMTP id o8mr35445017wiy.22.1328828971199; Thu, 09 Feb 2012 15:09:31 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.223.103.10 with HTTP; Thu, 9 Feb 2012 15:09:01 -0800 (PST) In-Reply-To: References: <201202092044.q19KiLUT027539@svn.freebsd.org> From: Eitan Adler Date: Thu, 9 Feb 2012 18:09:01 -0500 X-Google-Sender-Auth: kOOnsKNZO1pVjXDN7ijH991fMbo Message-ID: To: Marcel Moolenaar Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQlw5qLgbO0mZEfkkOzX56E5ooyW4/1NAV87Zm9ivhoOL2sjASK4uTIua7g1vSVGlcO578Oe Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231298 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 23:09:33 -0000 On Thu, Feb 9, 2012 at 5:15 PM, Marcel Moolenaar wrote: > > On Feb 9, 2012, at 12:44 PM, Eitan Adler wrote: > >> Author: eadler >> Date: Thu Feb =C2=A09 20:44:20 2012 >> New Revision: 231298 >> URL: http://svn.freebsd.org/changeset/base/231298 >> >> Log: >> =C2=A0Make etc/Makefile more conflict resistant > > Nice. Question though: why not the less verbose Either would have worked but I went with what was in the original patch. If it is worth it I could change to use the format you describe. --=20 Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 23:18:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CAFEB1065670; Thu, 9 Feb 2012 23:18:24 +0000 (UTC) (envelope-from gonzo@hq.bluezbox.com) Received: from hq.bluezbox.com (hq.bluezbox.com [70.38.37.145]) by mx1.freebsd.org (Postfix) with ESMTP id 69B9C8FC0A; Thu, 9 Feb 2012 23:18:24 +0000 (UTC) Received: from localhost ([127.0.0.1]) by hq.bluezbox.com with esmtpsa (TLSv1:CAMELLIA256-SHA:256) (Exim 4.73 (FreeBSD)) (envelope-from ) id 1Rvcsk-000Hfd-Uc; Thu, 09 Feb 2012 14:54:27 -0800 Message-ID: <4F344EA6.1040809@freebsd.org> Date: Thu, 09 Feb 2012 14:54:30 -0800 From: Oleksandr Tymoshenko User-Agent: Mozilla/5.0 (Windows NT 5.1; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 MIME-Version: 1.0 To: "Bjoern A. Zeeb" References: <201202092217.q19MHEuU039370@svn.freebsd.org> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Sender: gonzo@hq.bluezbox.com X-Spam-Level: ---- X-Spam-Report: Spam detection software, running on the system "hq.bluezbox.com", has identified this incoming email as possible spam. The original message has been attached to this so you can view it (if it isn't spam) or label similar future email. If you have any questions, see The administrator of that system for details. Content preview: On 09/02/2012 2:33 PM, Bjoern A. Zeeb wrote: > > On 9. Feb 2012, at 22:17 , Oleksandr Tymoshenko wrote: > >> Author: gonzo >> Date: Thu Feb 9 22:17:13 2012 >> New Revision: 231312 >> URL: http://svn.freebsd.org/changeset/base/231312 >> >> Log: >> - Emulate RDHWR instruction for TLS support >> >> Reading register $29 with RDHWR is becoming the de-facto standard to >> implement TLS. According to linux-mips wiki, MIPS Technologies has >> reserved hardware register $29 for ABI use. Furthermore current GCC >> makes the following assumptions: >> - RDHWR is natively available or otherwise emulated by the kernel >> - Register $29 holds the TLS pointer >> >> Submitted by: Robert Millan > > mips XLPN32 kernel failed, check _.mips.XLPN32 for details > mips XLRN32 kernel failed, check _.mips.XLRN32 for details > > /scratch/tmp/bz/head.svn/sys/mips/mips/trap.c: In function 'trap': > /scratch/tmp/bz/head.svn/sys/mips/mips/trap.c:768: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] > /scratch/tmp/bz/head.svn/sys/mips/mips/trap.c:776: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] [...] Content analysis details: (-4.4 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -1.8 ALL_TRUSTED Passed through trusted hosts only via SMTP -2.6 BAYES_00 BODY: Bayesian spam probability is 0 to 1% [score: 0.0000] 0.0 AWL AWL: From: address is in the auto white-list Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231312 - in head/sys/mips: include mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 23:18:25 -0000 On 09/02/2012 2:33 PM, Bjoern A. Zeeb wrote: > > On 9. Feb 2012, at 22:17 , Oleksandr Tymoshenko wrote: > >> Author: gonzo >> Date: Thu Feb 9 22:17:13 2012 >> New Revision: 231312 >> URL: http://svn.freebsd.org/changeset/base/231312 >> >> Log: >> - Emulate RDHWR instruction for TLS support >> >> Reading register $29 with RDHWR is becoming the de-facto standard to >> implement TLS. According to linux-mips wiki, MIPS Technologies has >> reserved hardware register $29 for ABI use. Furthermore current GCC >> makes the following assumptions: >> - RDHWR is natively available or otherwise emulated by the kernel >> - Register $29 holds the TLS pointer >> >> Submitted by: Robert Millan > > mips XLPN32 kernel failed, check _.mips.XLPN32 for details > mips XLRN32 kernel failed, check _.mips.XLRN32 for details > > /scratch/tmp/bz/head.svn/sys/mips/mips/trap.c: In function 'trap': > /scratch/tmp/bz/head.svn/sys/mips/mips/trap.c:768: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] > /scratch/tmp/bz/head.svn/sys/mips/mips/trap.c:776: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast] Thanks for spotting it. Fixed. From owner-svn-src-head@FreeBSD.ORG Thu Feb 9 23:19:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 76E2F1065670; Thu, 9 Feb 2012 23:19:09 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 65D238FC08; Thu, 9 Feb 2012 23:19:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q19NJ9Wn042699; Thu, 9 Feb 2012 23:19:09 GMT (envelope-from np@svn.freebsd.org) Received: (from np@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q19NJ9EC042696; Thu, 9 Feb 2012 23:19:09 GMT (envelope-from np@svn.freebsd.org) Message-Id: <201202092319.q19NJ9EC042696@svn.freebsd.org> From: Navdeep Parhar Date: Thu, 9 Feb 2012 23:19:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231317 - head/sys/dev/cxgb X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 09 Feb 2012 23:19:09 -0000 Author: np Date: Thu Feb 9 23:19:09 2012 New Revision: 231317 URL: http://svn.freebsd.org/changeset/base/231317 Log: Add IPv6 TSO (including TSO+VLAN) support to cxgb(4). If an IPv6 packet has extension headers the kernel needs to deal with it itself. For the rest it can set various CSUM_XXX flags and the driver will act on them. Modified: head/sys/dev/cxgb/cxgb_main.c head/sys/dev/cxgb/cxgb_sge.c Modified: head/sys/dev/cxgb/cxgb_main.c ============================================================================== --- head/sys/dev/cxgb/cxgb_main.c Thu Feb 9 22:54:16 2012 (r231316) +++ head/sys/dev/cxgb/cxgb_main.c Thu Feb 9 23:19:09 2012 (r231317) @@ -982,7 +982,7 @@ cxgb_makedev(struct port_info *pi) #define CXGB_CAP (IFCAP_VLAN_HWTAGGING | IFCAP_VLAN_MTU | IFCAP_HWCSUM | \ IFCAP_VLAN_HWCSUM | IFCAP_TSO | IFCAP_JUMBO_MTU | IFCAP_LRO | \ IFCAP_VLAN_HWTSO | IFCAP_LINKSTATE) -#define CXGB_CAP_ENABLE (CXGB_CAP & ~IFCAP_TSO6) +#define CXGB_CAP_ENABLE CXGB_CAP static int cxgb_port_attach(device_t dev) @@ -2059,8 +2059,8 @@ fail: } if (mask & IFCAP_RXCSUM) ifp->if_capenable ^= IFCAP_RXCSUM; - if (mask & IFCAP_TSO4) { - ifp->if_capenable ^= IFCAP_TSO4; + if (mask & IFCAP_TSO) { + ifp->if_capenable ^= IFCAP_TSO; if (IFCAP_TSO & ifp->if_capenable) { if (IFCAP_TXCSUM & ifp->if_capenable) Modified: head/sys/dev/cxgb/cxgb_sge.c ============================================================================== --- head/sys/dev/cxgb/cxgb_sge.c Thu Feb 9 22:54:16 2012 (r231316) +++ head/sys/dev/cxgb/cxgb_sge.c Thu Feb 9 23:19:09 2012 (r231317) @@ -62,6 +62,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -1492,10 +1493,10 @@ t3_encap(struct sge_qset *qs, struct mbu check_ring_tx_db(sc, txq, 0); return (0); } else if (tso_info) { - int eth_type; + uint16_t eth_type; struct cpl_tx_pkt_lso *hdr = (struct cpl_tx_pkt_lso *)txd; struct ether_header *eh; - struct ip *ip; + void *l3hdr; struct tcphdr *tcp; txd->flit[2] = 0; @@ -1521,18 +1522,37 @@ t3_encap(struct sge_qset *qs, struct mbu } eh = mtod(m0, struct ether_header *); - if (eh->ether_type == htons(ETHERTYPE_VLAN)) { - eth_type = CPL_ETH_II_VLAN; - ip = (struct ip *)((struct ether_vlan_header *)eh + 1); + eth_type = eh->ether_type; + if (eth_type == htons(ETHERTYPE_VLAN)) { + struct ether_vlan_header *evh = (void *)eh; + + tso_info |= V_LSO_ETH_TYPE(CPL_ETH_II_VLAN); + l3hdr = evh + 1; + eth_type = evh->evl_proto; } else { - eth_type = CPL_ETH_II; - ip = (struct ip *)(eh + 1); + tso_info |= V_LSO_ETH_TYPE(CPL_ETH_II); + l3hdr = eh + 1; } - tcp = (struct tcphdr *)(ip + 1); - tso_info |= V_LSO_ETH_TYPE(eth_type) | - V_LSO_IPHDR_WORDS(ip->ip_hl) | - V_LSO_TCPHDR_WORDS(tcp->th_off); + if (eth_type == htons(ETHERTYPE_IP)) { + struct ip *ip = l3hdr; + + tso_info |= V_LSO_IPHDR_WORDS(ip->ip_hl); + tcp = (struct tcphdr *)(ip + 1); + } else if (eth_type == htons(ETHERTYPE_IPV6)) { + struct ip6_hdr *ip6 = l3hdr; + + KASSERT(ip6->ip6_nxt == IPPROTO_TCP, + ("%s: CSUM_TSO with ip6_nxt %d", + __func__, ip6->ip6_nxt)); + + tso_info |= F_LSO_IPV6; + tso_info |= V_LSO_IPHDR_WORDS(sizeof(*ip6) >> 2); + tcp = (struct tcphdr *)(ip6 + 1); + } else + panic("%s: CSUM_TSO but neither ip nor ip6", __func__); + + tso_info |= V_LSO_TCPHDR_WORDS(tcp->th_off); hdr->lso_info = htonl(tso_info); if (__predict_false(mlen <= PIO_LEN)) { From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 00:02:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0C9011065675; Fri, 10 Feb 2012 00:02:14 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D50248FC08; Fri, 10 Feb 2012 00:02:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1A02D5w044149; Fri, 10 Feb 2012 00:02:13 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A02DeH044144; Fri, 10 Feb 2012 00:02:13 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202100002.q1A02DeH044144@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 10 Feb 2012 00:02:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231320 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 00:02:14 -0000 Author: kib Date: Fri Feb 10 00:02:13 2012 New Revision: 231320 URL: http://svn.freebsd.org/changeset/base/231320 Log: Mark the automatically attached child with PL_FLAG_CHILD in struct lwpinfo flags, for PT_FOLLOWFORK auto-attachment. In collaboration with: Dmitry Mikulin MFC after: 1 week Modified: head/sys/kern/kern_fork.c head/sys/kern/sys_process.c head/sys/sys/proc.h head/sys/sys/ptrace.h Modified: head/sys/kern/kern_fork.c ============================================================================== --- head/sys/kern/kern_fork.c Fri Feb 10 00:02:03 2012 (r231319) +++ head/sys/kern/kern_fork.c Fri Feb 10 00:02:13 2012 (r231320) @@ -1035,7 +1035,9 @@ fork_return(struct thread *td, struct tr p->p_oppid = p->p_pptr->p_pid; proc_reparent(p, dbg); sx_xunlock(&proctree_lock); + td->td_dbgflags |= TDB_CHILD; ptracestop(td, SIGSTOP); + td->td_dbgflags &= ~TDB_CHILD; } else { /* * ... otherwise clear the request. Modified: head/sys/kern/sys_process.c ============================================================================== --- head/sys/kern/sys_process.c Fri Feb 10 00:02:03 2012 (r231319) +++ head/sys/kern/sys_process.c Fri Feb 10 00:02:13 2012 (r231320) @@ -1145,6 +1145,8 @@ kern_ptrace(struct thread *td, int req, pl->pl_flags |= PL_FLAG_FORKED; pl->pl_child_pid = td2->td_dbg_forked; } + if (td2->td_dbgflags & TDB_CHILD) + pl->pl_flags |= PL_FLAG_CHILD; pl->pl_sigmask = td2->td_sigmask; pl->pl_siglist = td2->td_siglist; strcpy(pl->pl_tdname, td2->td_name); Modified: head/sys/sys/proc.h ============================================================================== --- head/sys/sys/proc.h Fri Feb 10 00:02:03 2012 (r231319) +++ head/sys/sys/proc.h Fri Feb 10 00:02:13 2012 (r231320) @@ -384,6 +384,7 @@ do { \ process */ #define TDB_STOPATFORK 0x00000080 /* Stop at the return from fork (child only) */ +#define TDB_CHILD 0x00000100 /* New child indicator for ptrace() */ /* * "Private" flags kept in td_pflags: Modified: head/sys/sys/ptrace.h ============================================================================== --- head/sys/sys/ptrace.h Fri Feb 10 00:02:03 2012 (r231319) +++ head/sys/sys/ptrace.h Fri Feb 10 00:02:13 2012 (r231320) @@ -107,6 +107,7 @@ struct ptrace_lwpinfo { #define PL_FLAG_EXEC 0x10 /* exec(2) succeeded */ #define PL_FLAG_SI 0x20 /* siginfo is valid */ #define PL_FLAG_FORKED 0x40 /* new child */ +#define PL_FLAG_CHILD 0x80 /* I am from child */ sigset_t pl_sigmask; /* LWP signal mask */ sigset_t pl_siglist; /* LWP pending signal */ struct __siginfo pl_siginfo; /* siginfo for signal */ From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 00:15:37 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 24CB81065672; Fri, 10 Feb 2012 00:15:37 +0000 (UTC) (envelope-from marcel@xcllnt.net) Received: from mail.xcllnt.net (mail.xcllnt.net [70.36.220.4]) by mx1.freebsd.org (Postfix) with ESMTP id E5F8D8FC0A; Fri, 10 Feb 2012 00:15:36 +0000 (UTC) Received: from [172.23.7.29] (natint3.juniper.net [66.129.224.36]) (authenticated bits=0) by mail.xcllnt.net (8.14.5/8.14.5) with ESMTP id q1A0FS3V043336 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NO); Thu, 9 Feb 2012 16:15:35 -0800 (PST) (envelope-from marcel@xcllnt.net) Mime-Version: 1.0 (Apple Message framework v1257) Content-Type: text/plain; charset=us-ascii From: Marcel Moolenaar In-Reply-To: Date: Thu, 9 Feb 2012 16:15:23 -0800 Content-Transfer-Encoding: 7bit Message-Id: <1C3260CA-8CDB-4C84-A591-637D2B342683@xcllnt.net> References: <201202092044.q19KiLUT027539@svn.freebsd.org> To: Eitan Adler X-Mailer: Apple Mail (2.1257) Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r231298 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 00:15:37 -0000 On Feb 9, 2012, at 3:09 PM, Eitan Adler wrote: > On Thu, Feb 9, 2012 at 5:15 PM, Marcel Moolenaar wrote: >> >> On Feb 9, 2012, at 12:44 PM, Eitan Adler wrote: >> >>> Author: eadler >>> Date: Thu Feb 9 20:44:20 2012 >>> New Revision: 231298 >>> URL: http://svn.freebsd.org/changeset/base/231298 >>> >>> Log: >>> Make etc/Makefile more conflict resistant >> >> Nice. Question though: why not the less verbose > > Either would have worked but I went with what was in the original > patch. If it is worth it I could change to use the format you > describe. I think it's convention (see sys/modules/Makefile or lib/Makefile), but I could just as well be mistaken (i.e. picked the only makefiles that do this :-) I leave it up to you... -- Marcel Moolenaar marcel@xcllnt.net From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 00:26:28 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29CC8106566B; Fri, 10 Feb 2012 00:26:28 +0000 (UTC) (envelope-from ache@vniz.net) Received: from vniz.net (vniz.net [194.87.13.69]) by mx1.freebsd.org (Postfix) with ESMTP id 4B10E8FC16; Fri, 10 Feb 2012 00:26:27 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by vniz.net (8.14.5/8.14.5) with ESMTP id q1A0QPSb080006; Fri, 10 Feb 2012 04:26:25 +0400 (MSK) (envelope-from ache@vniz.net) Received: (from ache@localhost) by localhost (8.14.5/8.14.5/Submit) id q1A0QPjA080005; Fri, 10 Feb 2012 04:26:25 +0400 (MSK) (envelope-from ache) Date: Fri, 10 Feb 2012 04:26:24 +0400 From: Andrey Chernov To: Eitan Adler Message-ID: <20120210002623.GA79894@vniz.net> Mail-Followup-To: Andrey Chernov , Eitan Adler , src-committers@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, svn-src-head@FreeBSD.ORG References: <201202092051.q19Kp3pj028436@svn.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201202092051.q19Kp3pj028436@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@FreeBSD.ORG, svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r231300 - head/usr.sbin/pkg_install/create X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 00:26:28 -0000 On Thu, Feb 09, 2012 at 08:51:03PM +0000, Eitan Adler wrote: > /* Prefix should add an @cwd to the packing list */ > - if (Prefix) > - add_plist_top(&plist, PLIST_CWD, Prefix); > + if (Prefix) { > + char resolved_prefix[PATH_MAX]; > + if (realpath(Prefix, resolved_prefix) != 0) > + err(EXIT_FAILURE, "couldn't resolve path for prefix: %s", Prefix); > + add_plist_top(&plist, PLIST_CWD, resolved_prefix); > + } This change cause "pkg_create: couldn't resolve path for prefix: /usr/local: No such file or directory" because test condition should really be: if (realpath(Prefix, resolved_prefix) == NULL) (and realpath(3) returns char *) -- http://ache.vniz.net/ From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 00:41:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6D31E1065676; Fri, 10 Feb 2012 00:41:35 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 23BDA8FC12; Fri, 10 Feb 2012 00:41:33 +0000 (UTC) Received: by wgbdq11 with SMTP id dq11so2404914wgb.31 for ; Thu, 09 Feb 2012 16:41:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:content-type :content-transfer-encoding; bh=L80gNgFxTLPKvZR5bVX5y0jTHq59M8fBxS5NeofOnzY=; b=CEX70VEndLygzl4nHk2jGQ/+qpUmt/LlPM/ZCw96TnC2Mcaf1+Q5YVSQrxpPZ6e9dA XjxiUhm+LE0Zk08KZKUyuD2d0dOQYyw2q59heAPJItfnr+CsyIj9FvvL63ZGik3CTUMk pDCf+m/AMGbqDYj0WAzEawRsiWXWm+HDQlZJU= Received: by 10.180.82.39 with SMTP id f7mr5945838wiy.19.1328834493220; Thu, 09 Feb 2012 16:41:33 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.223.103.10 with HTTP; Thu, 9 Feb 2012 16:41:03 -0800 (PST) In-Reply-To: <20120210002623.GA79894@vniz.net> References: <201202092051.q19Kp3pj028436@svn.freebsd.org> <20120210002623.GA79894@vniz.net> From: Eitan Adler Date: Thu, 9 Feb 2012 19:41:03 -0500 X-Google-Sender-Auth: 5UVzR6BmskSQDKskO9V8tdrz7So Message-ID: To: Andrey Chernov , Eitan Adler , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQl9wySRaU2+ycf2csDUqZETzUnc4PSVsXWMMkdxgbbV+NrXNLLPDmWA7cRMOf2RCuqJZwLv Cc: Subject: Re: svn commit: r231300 - head/usr.sbin/pkg_install/create X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 00:41:35 -0000 On Thu, Feb 9, 2012 at 7:26 PM, Andrey Chernov wrote: > On Thu, Feb 09, 2012 at 08:51:03PM +0000, Eitan Adler wrote: >> =C2=A0 =C2=A0 =C2=A0/* Prefix should add an @cwd to the packing list */ >> - =C2=A0 =C2=A0if (Prefix) >> - =C2=A0 =C2=A0 add_plist_top(&plist, PLIST_CWD, Prefix); >> + =C2=A0 =C2=A0if (Prefix) { >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0char resolved_prefix[PATH_MAX]; >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0if (realpath(Prefix, resolved_prefix) !=3D = 0) >> + =C2=A0 =C2=A0 =C2=A0 =C2=A0 err(EXIT_FAILURE, "couldn't resolve path f= or prefix: %s", Prefix); >> + =C2=A0 =C2=A0 add_plist_top(&plist, PLIST_CWD, resolved_prefix); >> + =C2=A0 =C2=A0} > > This change cause > "pkg_create: couldn't resolve path for prefix: /usr/local: No such file o= r > directory" > because test condition should really be: Patch sent - awaiting approval. Sorry for the breakage :( --=20 Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 00:53:39 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B26DA1065773; Fri, 10 Feb 2012 00:53:39 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A0E618FC14; Fri, 10 Feb 2012 00:53:39 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1A0rdf0046270; Fri, 10 Feb 2012 00:53:39 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A0rdbp046268; Fri, 10 Feb 2012 00:53:39 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201202100053.q1A0rdbp046268@svn.freebsd.org> From: Eitan Adler Date: Fri, 10 Feb 2012 00:53:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231328 - head/usr.sbin/pkg_install/create X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 00:53:39 -0000 Author: eadler Date: Fri Feb 10 00:53:39 2012 New Revision: 231328 URL: http://svn.freebsd.org/changeset/base/231328 Log: Fix r231300: Use correct test so we only bail out on error instead of on non-error. Also, fix a style bug. Submitted by: ache Approved by: cperciva MFC after: 1 month Modified: head/usr.sbin/pkg_install/create/perform.c Modified: head/usr.sbin/pkg_install/create/perform.c ============================================================================== --- head/usr.sbin/pkg_install/create/perform.c Fri Feb 10 00:51:32 2012 (r231327) +++ head/usr.sbin/pkg_install/create/perform.c Fri Feb 10 00:53:39 2012 (r231328) @@ -216,7 +216,7 @@ pkg_perform(char **pkgs) /* Prefix should add an @cwd to the packing list */ if (Prefix) { char resolved_prefix[PATH_MAX]; - if (realpath(Prefix, resolved_prefix) != 0) + if (realpath(Prefix, resolved_prefix) == NULL) err(EXIT_FAILURE, "couldn't resolve path for prefix: %s", Prefix); add_plist_top(&plist, PLIST_CWD, resolved_prefix); } From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 01:13:33 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: by hub.freebsd.org (Postfix, from userid 1033) id EF0761065675; Fri, 10 Feb 2012 01:13:33 +0000 (UTC) Date: Fri, 10 Feb 2012 01:13:33 +0000 From: Alexey Dokuchaev To: Marcel Moolenaar Message-ID: <20120210011333.GA71601@FreeBSD.org> References: <201202092044.q19KiLUT027539@svn.freebsd.org> <1C3260CA-8CDB-4C84-A591-637D2B342683@xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline In-Reply-To: <1C3260CA-8CDB-4C84-A591-637D2B342683@xcllnt.net> User-Agent: Mutt/1.4.2.1i Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Eitan Adler Subject: Re: svn commit: r231298 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 01:13:34 -0000 On Thu, Feb 09, 2012 at 04:15:23PM -0800, Marcel Moolenaar wrote: > I think it's convention (see sys/modules/Makefile or lib/Makefile), > but I could just as well be mistaken (i.e. picked the only makefiles > that do this :-) I also believe this is the usual way to do things in FreeBSD. Those BIN1+='s are too chatty. ./danfe From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 03:30:57 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 74125106566B; Fri, 10 Feb 2012 03:30:57 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 626328FC12; Fri, 10 Feb 2012 03:30:57 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1A3Uv7N051457; Fri, 10 Feb 2012 03:30:57 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A3UvhU051455; Fri, 10 Feb 2012 03:30:57 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201202100330.q1A3UvhU051455@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 10 Feb 2012 03:30:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231329 - head/libexec/rtld-elf/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 03:30:57 -0000 Author: gonzo Date: Fri Feb 10 03:30:57 2012 New Revision: 231329 URL: http://svn.freebsd.org/changeset/base/231329 Log: Fix debug output for MIPS part of rtld Modified: head/libexec/rtld-elf/mips/reloc.c Modified: head/libexec/rtld-elf/mips/reloc.c ============================================================================== --- head/libexec/rtld-elf/mips/reloc.c Fri Feb 10 00:53:39 2012 (r231328) +++ head/libexec/rtld-elf/mips/reloc.c Fri Feb 10 03:30:57 2012 (r231329) @@ -37,6 +37,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include "debug.h" #include "rtld.h" @@ -244,9 +245,9 @@ _mips_rtld_bind(Obj_Entry *obj, Elf_Size _rtld_error("bind failed no symbol"); target = (Elf_Addr)(defobj->relocbase + def->st_value); - dbg("bind now/fixup at %s sym # %d in %s --> was=%p new=%p", + dbg("bind now/fixup at %s sym # %jd in %s --> was=%p new=%p", obj->path, - reloff, defobj->strtab + def->st_name, + (intmax_t)reloff, defobj->strtab + def->st_name, (void *)got[obj->local_gotno + reloff - obj->gotsym], (void *)target); got[obj->local_gotno + reloff - obj->gotsym] = target; @@ -283,8 +284,8 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry /* Relocate the local GOT entries */ got += i; - dbg("got:%p for %d entries adding %x", - got, obj->local_gotno, (uint32_t)obj->relocbase); + dbg("got:%p for %d entries adding %p", + got, obj->local_gotno, obj->relocbase); for (; i < obj->local_gotno; i++) { *got += (Elf_Addr)obj->relocbase; got++; @@ -339,8 +340,8 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry */ *got = sym->st_value + (Elf_Addr)obj->relocbase; if ((Elf_Addr)(*got) == (Elf_Addr)obj->relocbase) { - dbg("Warning2, i:%d maps to relocbase address:%x", - i, (uint32_t)obj->relocbase); + dbg("Warning2, i:%d maps to relocbase address:%p", + i, obj->relocbase); } } else if (sym->st_info == ELF_ST_INFO(STB_GLOBAL, STT_SECTION)) { @@ -349,8 +350,8 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry *got = sym->st_value + (Elf_Addr)obj->relocbase; if ((Elf_Addr)(*got) == (Elf_Addr)obj->relocbase) { - dbg("Warning3, i:%d maps to relocbase address:%x", - i, (uint32_t)obj->relocbase); + dbg("Warning3, i:%d maps to relocbase address:%p", + i, obj->relocbase); } } } else { @@ -363,8 +364,8 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry } *got = def->st_value + (Elf_Addr)defobj->relocbase; if ((Elf_Addr)(*got) == (Elf_Addr)obj->relocbase) { - dbg("Warning4, i:%d maps to relocbase address:%x", - i, (uint32_t)obj->relocbase); + dbg("Warning4, i:%d maps to relocbase address:%p", + i, obj->relocbase); dbg("via first obj symbol %s", obj->strtab + obj->symtab[i].st_name); dbg("found in obj %p:%s", @@ -470,8 +471,8 @@ reloc_plt(Obj_Entry *obj) const Elf_Rel *rellim; const Elf_Rel *rel; - dbg("reloc_plt obj:%p pltrel:%p sz:%d", obj, obj->pltrel, (int)obj->pltrelsize); - dbg("gottable %p num syms:%d", obj->pltgot, obj->symtabno ); + dbg("reloc_plt obj:%p pltrel:%p sz:%s", obj, obj->pltrel, (int)obj->pltrelsize); + dbg("gottable %p num syms:%s", obj->pltgot, obj->symtabno ); dbg("*****************************************************"); rellim = (const Elf_Rel *)((char *)obj->pltrel + obj->pltrelsize); From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 03:34:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 363AF106566B; Fri, 10 Feb 2012 03:34:33 +0000 (UTC) (envelope-from gjb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0AF0D8FC08; Fri, 10 Feb 2012 03:34:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1A3YWev051661; Fri, 10 Feb 2012 03:34:32 GMT (envelope-from gjb@svn.freebsd.org) Received: (from gjb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A3YWGk051659; Fri, 10 Feb 2012 03:34:32 GMT (envelope-from gjb@svn.freebsd.org) Message-Id: <201202100334.q1A3YWGk051659@svn.freebsd.org> From: Glen Barber Date: Fri, 10 Feb 2012 03:34:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231331 - head/share/man/man7 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 03:34:33 -0000 Author: gjb (doc committer) Date: Fri Feb 10 03:34:32 2012 New Revision: 231331 URL: http://svn.freebsd.org/changeset/base/231331 Log: Fix date from r231111. Pointy-hat to: gjb (myself, approver of r231111) Modified: head/share/man/man7/ports.7 Modified: head/share/man/man7/ports.7 ============================================================================== --- head/share/man/man7/ports.7 Fri Feb 10 03:32:29 2012 (r231330) +++ head/share/man/man7/ports.7 Fri Feb 10 03:34:32 2012 (r231331) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd Feb 06, 2012 +.Dd February 9, 2012 .Dt PORTS 7 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 04:44:03 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 902311065673; Fri, 10 Feb 2012 04:44:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail11.syd.optusnet.com.au (mail11.syd.optusnet.com.au [211.29.132.192]) by mx1.freebsd.org (Postfix) with ESMTP id 12C0B8FC14; Fri, 10 Feb 2012 04:44:02 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail11.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q1A4hv4x010767 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 10 Feb 2012 15:44:00 +1100 Date: Fri, 10 Feb 2012 15:43:57 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Marcel Moolenaar In-Reply-To: Message-ID: <20120210154307.V882@besplex.bde.org> References: <201202092044.q19KiLUT027539@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Eitan Adler Subject: Re: svn commit: r231298 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 04:44:03 -0000 On Thu, 9 Feb 2012, Marcel Moolenaar wrote: > On Feb 9, 2012, at 12:44 PM, Eitan Adler wrote: > >> Author: eadler >> Date: Thu Feb 9 20:44:20 2012 >> New Revision: 231298 >> URL: http://svn.freebsd.org/changeset/base/231298 >> >> Log: >> Make etc/Makefile more conflict resistant > > Nice. Question though: why not the less verbose > > BIN1 = \ > foo \ > bar \ > baz > > It's probably faster too, and friendlier when > running "make -dv" And it isn't a style bug. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 05:03:18 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 558AF1065670; Fri, 10 Feb 2012 05:03:18 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-150-251.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 80FE614DE0B; Fri, 10 Feb 2012 05:03:15 +0000 (UTC) Message-ID: <4F34A50E.9050906@FreeBSD.org> Date: Thu, 09 Feb 2012 21:03:10 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:10.0) Gecko/20120201 Thunderbird/10.0 MIME-Version: 1.0 To: Marcel Moolenaar References: <201202092044.q19KiLUT027539@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.3.5 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Eitan Adler Subject: Re: svn commit: r231298 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 05:03:18 -0000 On 02/09/2012 14:15, Marcel Moolenaar wrote: > > On Feb 9, 2012, at 12:44 PM, Eitan Adler wrote: > >> Author: eadler >> Date: Thu Feb 9 20:44:20 2012 >> New Revision: 231298 >> URL: http://svn.freebsd.org/changeset/base/231298 >> >> Log: >> Make etc/Makefile more conflict resistant > > Nice. Question though: why not the less verbose > > BIN1 = \ > foo \ > bar \ > baz Yes, this change should be made to match the style in the rest of src. FWIW, the style Eitan used is what's used in all of the ports category Makefiles (which arguably should also be changed, but that's a whole 'nother windmill to tilt at). Doug -- It's always a long day; 86400 doesn't fit into a short. Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 05:05:42 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6DD3D1065686; Fri, 10 Feb 2012 05:05:42 +0000 (UTC) (envelope-from kientzle@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5C88F8FC0A; Fri, 10 Feb 2012 05:05:42 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1A55gxG054660; Fri, 10 Feb 2012 05:05:42 GMT (envelope-from kientzle@svn.freebsd.org) Received: (from kientzle@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A55grV054658; Fri, 10 Feb 2012 05:05:42 GMT (envelope-from kientzle@svn.freebsd.org) Message-Id: <201202100505.q1A55grV054658@svn.freebsd.org> From: Tim Kientzle Date: Fri, 10 Feb 2012 05:05:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231336 - head/contrib/gcc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 05:05:42 -0000 Author: kientzle Date: Fri Feb 10 05:05:42 2012 New Revision: 231336 URL: http://svn.freebsd.org/changeset/base/231336 Log: Implement -print-file-name=include (which is undocumented but used by some Linux boot loaders). This option prints out the directory holding the include files needed by a freestanding program. The default implementation of this doesn't work on FreeBSD because of the different include file layout. But it's easy to implement: just return /usr/include (or the cross-compiling equivalent). Reviewed by: kan MFC after: 1 week Modified: head/contrib/gcc/gcc.c Modified: head/contrib/gcc/gcc.c ============================================================================== --- head/contrib/gcc/gcc.c Fri Feb 10 04:11:04 2012 (r231335) +++ head/contrib/gcc/gcc.c Fri Feb 10 05:05:42 2012 (r231336) @@ -2696,6 +2696,17 @@ find_a_file (const struct path_prefix *p return xstrdup (DEFAULT_LINKER); #endif +#ifdef FREEBSD_NATIVE + if (! strcmp(name, "include")) + { +#ifdef CROSS_INCLUDE_DIR + return xstrdup(CROSS_INCLUDE_DIR); +#else + return xstrdup(STANDARD_INCLUDE_DIR); +#endif + } +#endif + /* Determine the filename to execute (special case for absolute paths). */ if (IS_ABSOLUTE_PATH (name)) From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 06:30:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8F6B4106564A; Fri, 10 Feb 2012 06:30:53 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7E74B8FC0A; Fri, 10 Feb 2012 06:30:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1A6UroA057501; Fri, 10 Feb 2012 06:30:53 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A6UrWd057499; Fri, 10 Feb 2012 06:30:53 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201202100630.q1A6UrWd057499@svn.freebsd.org> From: Kevin Lo Date: Fri, 10 Feb 2012 06:30:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231341 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 06:30:53 -0000 Author: kevlo Date: Fri Feb 10 06:30:52 2012 New Revision: 231341 URL: http://svn.freebsd.org/changeset/base/231341 Log: Add a missing break. This bug was introduced in r228856. Modified: head/sys/kern/kern_tc.c Modified: head/sys/kern/kern_tc.c ============================================================================== --- head/sys/kern/kern_tc.c Fri Feb 10 06:12:48 2012 (r231340) +++ head/sys/kern/kern_tc.c Fri Feb 10 06:30:52 2012 (r231341) @@ -1085,6 +1085,7 @@ sysclock_snap2bintime(struct sysclock_sn /* Boot time adjustment, for uptime/monotonic clocks. */ if (flags & FFCLOCK_UPTIME) bintime_sub(bt, &ffclock_boottime); + break; #endif default: return (EINVAL); From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 06:33:03 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CE4CA106566B; Fri, 10 Feb 2012 06:33:03 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id 4EE4B8FC12; Fri, 10 Feb 2012 06:33:02 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q1A6X0YG015616 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 10 Feb 2012 17:33:01 +1100 Date: Fri, 10 Feb 2012 17:32:59 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Kirk McKusick In-Reply-To: <201202092234.q19MYGEJ040871@svn.freebsd.org> Message-ID: <20120210154420.F882@besplex.bde.org> References: <201202092234.q19MYGEJ040871@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r231313 - head/sys/ufs/ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 06:33:03 -0000 On Thu, 9 Feb 2012, Kirk McKusick wrote: > Log: > Historically when an application wrote an entire block of a file, > the kernel allocated a buffer but did not zero it as it was about > to be completely filled by a uiomove() from the user's buffer. > However, if the uiomove() failed, the old contents of the buffer > could be exposed especially if the file was being mmap'ed. The > fix was to always zero the buffer when it was allocated. > > This change first attempts the uiomove() to the newly allocated > (and dirty) buffer and only zeros it if the uiomove() fails. The > effect is to eliminate the gratuitous zeroing of the buffer in > the usual case where the uiomove() successfully fills it. Lately I have been thinking again of the error handling near here: % if (error) { % if (ioflag & IO_UNIT) { % (void)ffs_truncate(vp, osize, % IO_NORMAL | (ioflag & IO_SYNC), % ap->a_cred, uio->uio_td); % uio->uio_offset -= resid - uio->uio_resid; % uio->uio_resid = resid; % } % } else if (resid > uio->uio_resid && (ioflag & IO_SYNC)) % error = ffs_update(vp, 1); This attempts to back out of the whole write after an error. But it is impossible to back out of a write in the middle of the file (unless you save all the blocks written to, and don't get more i/o errors trying to restore them). The above makes various messes trying, and even breaks some cases where the write is at the end of the file: suppose error != 0 and that some i/o has been done successfully (otherwise there is no problem): - suppose IO_UNIT is not set. Then the above fails to do anything. Even if not backing out is correct in this case, it is necessary to call ffs_update(vp, 1) under the condition where it is called in the non-error case, irrespective of whether the write is at the end of the file. But I think the existence of IO_UNIT is a bug. It is only used here and in VOP_WRITE() for some other file systems not including zfs. The others that use it are ext2fs, msdosfs and xfs (don't forget to change their VOPs when changing ffs). The 2 nfsclients have a comment saying that IO_UNIT is not used because all writes are atomic. IO_UNIT is also passed to VOP_READ(), but it is not used by any read VOPs. IO_UNIT is always set by vn_write(). Thus it is set in almost all cases. And I can't find any cases where it is not set, using grep in kern. Thus its existence does nothing except to make it hard to verify that it works correctly because it always has no effect. - suppose that IO_UNIT is set. - we don't check that ffs_truncate() succeeded, and we even explicitly (void) it, though we should check. We blindly proceed to resetting the i/o count, so that upper layers see the error and don't see the amount written, although the file may have been extended, depending on the details of how the truncation failed. - when the write is not at EOF and doesn't extend beyond the original end, ffs_truncate() usually succeeds and has no visible effect. We blindy proceed to resetting the i/o count, so that upper layers see the error and don't see the amount successfully written, although this amount is nonzero (since I specified that this case writes something before hitting the error). Upper layers also get no indication of the amount of clobbered bytes beyond the end of the successively written bytes. POSIX write semantics work very badly here. If we never return a short write, but always convert it to an error (this needs just a bit more force than the above, and might be the natural result of fixing these bugs), then writers should assume that the file is damaged for the whole region of the file that the write was attempted on, but for short writes, writers should be able to assume no damage. - when the write is not at EOF but extends beyond the original end, there is a combination of the above bugs. Just before here, we turn off the set*id bits if some i/o was done. This is unnecessary if there was an error and the i/o is successfully backed out of in a non-buggy way. But it is safer to do it anyway. It would be even safer to do it after any error. My version has the following (mostly wrong) comments and (mostly right) fixes in this area: % Index: ffs_vnops.c % =================================================================== % RCS file: /home/ncvs/src/sys/ufs/ffs/ffs_vnops.c,v % retrieving revision 1.130 % diff -u -2 -r1.130 ffs_vnops.c % --- ffs_vnops.c 21 May 2004 12:05:48 -0000 1.130 % +++ ffs_vnops.c 28 Sep 2010 10:45:17 -0000 % @@ -719,4 +722,8 @@ % * we clear the setuid and setgid bits as a precaution against % * tampering. % + * XXX too late, the tamperer may have opened the file while we % + * were writing the data (or before). % + * XXX too early, if (error && ioflag & IO_UNIT) then we will % + * unwrite the data. % */ % if (resid > uio->uio_resid && ap->a_cred && Probably wrong. Exlusive access should prevent problems. % @@ -725,7 +732,12 @@ % DIP(ip, i_mode) = ip->i_mode; % } % + /* XXX this seems to be misplaced. Which resid? */ % if (resid > uio->uio_resid) % VN_KNOTE(vp, NOTE_WRITE | (extended ? NOTE_EXTEND : 0)); This seems to have been fixed in -current, by moving the note taking to vfs, so it is now done after the back-out. % if (error) { % + /* % + * XXX should truncate to the last successfully written % + * data if the uiomove() failed. % + */ % if (ioflag & IO_UNIT) { % (void)UFS_TRUNCATE(vp, osize, Not a good idea -- see above. % @@ -735,6 +747,11 @@ % uio->uio_resid = resid; % } % - } else if (resid > uio->uio_resid && (ioflag & IO_SYNC)) % - error = UFS_UPDATE(vp, 1); % + } % + % + if (uio->uio_resid != resid) { % + ip->i_flag |= IN_CHANGE | IN_UPDATE; % + if (ioflag & IO_SYNC) % + error = UFS_UPDATE(vp, 1); % + } % return (error); % } This fixes 2 bugs: - spurious setting of IN_CHANGE | IN_UPDATE after backing out of the i/o. However, this enlarges the bugs when the backout just broke the i/o count by resetting it -- now the flags are not set despite the i/o having done some combination of successfully changing the file in the middle and clobbering the file in the middle. - 1 of the bugs pointed out above: missing update in the IO_SYNC subcase of the error case. Again this enlarges the bug if the backout just broke the i/o count by resetting it -- now the update is not done despite the i/o being non-null. In FreeBSD-1, I changed the corresponding code to do a bit more: % if (error == EFAULT || error && (ioflag & IO_UNIT)) { % (void) itrunc(ip, osize, ioflag & IO_SYNC); % uio->uio_offset -= resid - uio->uio_resid; % uio->uio_resid = resid; % } % if (!error && (ioflag & IO_SYNC)) % error = iupdat(ip, &time, &time, 1); This was a primitive incomplete fix for failing uio's. Most uio errors are when write() passes an invalid buffer to probe for security holes. The error for this case is EFAULT, and the backout is done unconditionally in this case. Any user could do this probe because, strangely, IO_UNIT was far from having no effect in FreeBSD-1 -- it was used for most but not all kernel writes (mainly for acct, ktrace and core dumps) but not for user write()s! I didn't know about the problem with mmap() at the time, but planned to fix this better someday. Bruce From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 06:42:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 432CE1065673; Fri, 10 Feb 2012 06:42:51 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 26F228FC1B; Fri, 10 Feb 2012 06:42:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1A6gpKP058159; Fri, 10 Feb 2012 06:42:51 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A6goSd058155; Fri, 10 Feb 2012 06:42:50 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201202100642.q1A6goSd058155@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 10 Feb 2012 06:42:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231347 - in head/libexec/rtld-elf: . mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 06:42:51 -0000 Author: gonzo Date: Fri Feb 10 06:42:50 2012 New Revision: 231347 URL: http://svn.freebsd.org/changeset/base/231347 Log: Switch MIPS TLS implementation to Variant I Modified: head/libexec/rtld-elf/mips/reloc.c head/libexec/rtld-elf/mips/rtld_machdep.h head/libexec/rtld-elf/rtld.c Modified: head/libexec/rtld-elf/mips/reloc.c ============================================================================== --- head/libexec/rtld-elf/mips/reloc.c Fri Feb 10 06:42:00 2012 (r231346) +++ head/libexec/rtld-elf/mips/reloc.c Fri Feb 10 06:42:50 2012 (r231347) @@ -39,8 +39,11 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include "debug.h" #include "rtld.h" +#include "rtld_printf.h" #ifdef __mips_n64 #define GOT1_MASK 0x8000000000000000UL @@ -528,11 +531,32 @@ reloc_jmpslot(Elf_Addr *where, Elf_Addr void allocate_initial_tls(Obj_Entry *objs) { + char *tls; + /* + * Fix the size of the static TLS block by using the maximum + * offset allocated so far and adding a bit for dynamic modules to + * use. + */ + tls_static_space = tls_last_offset + tls_last_size + RTLD_STATIC_TLS_EXTRA; + + tls = ((char *) allocate_tls(objs, NULL, TLS_TCB_SIZE, 8) + + TLS_TP_OFFSET + TLS_TCB_SIZE); + + sysarch(MIPS_SET_TLS, tls); + rtld_printf("allocate_initial_tls -> %p(%p)\n", tls, tls - TLS_TP_OFFSET - TLS_TCB_SIZE); } void * __tls_get_addr(tls_index* ti) { - return (NULL); + Elf_Addr** tls; + char *p; + + sysarch(MIPS_GET_TLS, &tls); + + p = tls_get_addr_common((Elf_Addr**)((Elf_Addr)tls - TLS_TP_OFFSET + - TLS_TCB_SIZE), ti->ti_module, ti->ti_offset); + + return (p + TLS_DTV_OFFSET); } Modified: head/libexec/rtld-elf/mips/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/mips/rtld_machdep.h Fri Feb 10 06:42:00 2012 (r231346) +++ head/libexec/rtld-elf/mips/rtld_machdep.h Fri Feb 10 06:42:50 2012 (r231347) @@ -47,21 +47,32 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, #define call_initfini_pointer(obj, target) \ (((InitFunc)(target))()) - + +/* + * TLS + */ + +#define TLS_TP_OFFSET 0x7000 +#define TLS_DTV_OFFSET 0x8000 +#ifdef __mips_n64 +#define TLS_TCB_SIZE 16 +#else +#define TLS_TCB_SIZE 8 +#endif + typedef struct { unsigned long ti_module; unsigned long ti_offset; } tls_index; #define round(size, align) \ - (((size) + (align) - 1) & ~((align) - 1)) + (((size) + (align) - 1) & ~((align) - 1)) #define calculate_first_tls_offset(size, align) \ - round(size, align) + round(TLS_TCB_SIZE, align) #define calculate_tls_offset(prev_offset, prev_size, size, align) \ - round(prev_offset + prev_size, align) + round(prev_offset + prev_size, align) #define calculate_tls_end(off, size) ((off) + (size)) - - + /* * Lazy binding entry point, called via PLT. */ Modified: head/libexec/rtld-elf/rtld.c ============================================================================== --- head/libexec/rtld-elf/rtld.c Fri Feb 10 06:42:00 2012 (r231346) +++ head/libexec/rtld-elf/rtld.c Fri Feb 10 06:42:50 2012 (r231347) @@ -3543,7 +3543,7 @@ tls_get_addr_common(Elf_Addr** dtvp, int /* XXX not sure what variants to use for arm. */ -#if defined(__ia64__) || defined(__powerpc__) +#if defined(__ia64__) || defined(__powerpc__) || defined(__mips__) /* * Allocate Static TLS using the Variant I method. @@ -3625,7 +3625,7 @@ free_tls(void *tcb, size_t tcbsize, size #endif #if defined(__i386__) || defined(__amd64__) || defined(__sparc64__) || \ - defined(__arm__) || defined(__mips__) + defined(__arm__) /* * Allocate Static TLS using the Variant II method. From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 06:44:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7217E1065673; Fri, 10 Feb 2012 06:44:31 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 613D08FC0C; Fri, 10 Feb 2012 06:44:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1A6iVDs058301; Fri, 10 Feb 2012 06:44:31 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A6iVm3058299; Fri, 10 Feb 2012 06:44:31 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201202100644.q1A6iVm3058299@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 10 Feb 2012 06:44:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231349 - head/sys/geom/part X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 06:44:31 -0000 Author: ae Date: Fri Feb 10 06:44:30 2012 New Revision: 231349 URL: http://svn.freebsd.org/changeset/base/231349 Log: Let's be more realistic and limit maximum number of partition to 4k. MFC after: 1 week Modified: head/sys/geom/part/g_part_apm.c Modified: head/sys/geom/part/g_part_apm.c ============================================================================== --- head/sys/geom/part/g_part_apm.c Fri Feb 10 06:43:16 2012 (r231348) +++ head/sys/geom/part/g_part_apm.c Fri Feb 10 06:44:30 2012 (r231349) @@ -102,7 +102,7 @@ static struct g_part_scheme g_part_apm_s sizeof(struct g_part_apm_table), .gps_entrysz = sizeof(struct g_part_apm_entry), .gps_minent = 16, - .gps_maxent = INT_MAX, + .gps_maxent = 4096, }; G_PART_SCHEME_DECLARE(g_part_apm); From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 06:53:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 93604106566B; Fri, 10 Feb 2012 06:53:26 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 67CA58FC12; Fri, 10 Feb 2012 06:53:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1A6rQa4058609; Fri, 10 Feb 2012 06:53:26 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A6rQRb058606; Fri, 10 Feb 2012 06:53:26 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201202100653.q1A6rQRb058606@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 10 Feb 2012 06:53:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231350 - in head/lib/libthr/arch/mips: include mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 06:53:26 -0000 Author: gonzo Date: Fri Feb 10 06:53:25 2012 New Revision: 231350 URL: http://svn.freebsd.org/changeset/base/231350 Log: Switch MIPS TLS implementation to Variant I: Save pointer to the TLS structure taking into account TP_OFFSET and TCB structure size. Modified: head/lib/libthr/arch/mips/include/pthread_md.h head/lib/libthr/arch/mips/mips/pthread_md.c Modified: head/lib/libthr/arch/mips/include/pthread_md.h ============================================================================== --- head/lib/libthr/arch/mips/include/pthread_md.h Fri Feb 10 06:44:30 2012 (r231349) +++ head/lib/libthr/arch/mips/include/pthread_md.h Fri Feb 10 06:53:25 2012 (r231350) @@ -39,15 +39,19 @@ #define CPU_SPINWAIT #define DTV_OFFSET offsetof(struct tcb, tcb_dtv) +#ifdef __mips_n64 +#define TP_OFFSET 0x7010 +#else +#define TP_OFFSET 0x7008 +#endif /* - * Variant II tcb, first two members are required by rtld. + * Variant I tcb. The structure layout is fixed, don't blindly + * change it! */ struct tcb { - struct tcb *tcb_self; /* required by rtld */ - void *tcb_dtv; /* required by rtld */ - struct pthread *tcb_thread; /* our hook */ - void *tcb_spare[1]; + void *tcb_dtv; + struct pthread *tcb_thread; }; /* @@ -61,7 +65,7 @@ static __inline void _tcb_set(struct tcb *tcb) { - sysarch(MIPS_SET_TLS, tcb); + sysarch(MIPS_SET_TLS, ((uint8_t*)tcb + TP_OFFSET)); } /* @@ -70,10 +74,10 @@ _tcb_set(struct tcb *tcb) static __inline struct tcb * _tcb_get(void) { - void *tcb; + uint8_t *tcb; sysarch(MIPS_GET_TLS, &tcb); - return tcb; + return ((struct tcb *)(tcb - TP_OFFSET)); } extern struct pthread *_thr_initial; Modified: head/lib/libthr/arch/mips/mips/pthread_md.c ============================================================================== --- head/lib/libthr/arch/mips/mips/pthread_md.c Fri Feb 10 06:44:30 2012 (r231349) +++ head/lib/libthr/arch/mips/mips/pthread_md.c Fri Feb 10 06:53:25 2012 (r231350) @@ -34,6 +34,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include + #include "pthread_md.h" struct tcb * @@ -41,16 +43,17 @@ _tcb_ctor(struct pthread *thread, int in { struct tcb *tcb; - tcb = malloc(sizeof(struct tcb)); - if (tcb) { - bzero(tcb, sizeof(struct tcb)); + tcb = _rtld_allocate_tls((initial) ? _tcb_get() : NULL, + sizeof(struct tcb), 16); + if (tcb) tcb->tcb_thread = thread; - } + return (tcb); } void _tcb_dtor(struct tcb *tcb) { - free(tcb); + + _rtld_free_tls(tcb, sizeof(struct tcb), 16); } From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 07:03:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 401791065673; Fri, 10 Feb 2012 07:03:46 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2F0A98FC13; Fri, 10 Feb 2012 07:03:46 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1A73kCj059035; Fri, 10 Feb 2012 07:03:46 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A73jum059033; Fri, 10 Feb 2012 07:03:45 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201202100703.q1A73jum059033@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 10 Feb 2012 07:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231351 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 07:03:46 -0000 Author: gonzo Date: Fri Feb 10 07:03:45 2012 New Revision: 231351 URL: http://svn.freebsd.org/changeset/base/231351 Log: Fix-up value passed by thr_new syscall to make it compatible with MIPS_TLS_GET/MIPS_TLS_SET sysarch API. Modified: head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Fri Feb 10 06:53:25 2012 (r231350) +++ head/sys/mips/mips/vm_machdep.c Fri Feb 10 07:03:45 2012 (r231351) @@ -601,7 +601,18 @@ int cpu_set_user_tls(struct thread *td, void *tls_base) { - td->td_md.md_tls = tls_base; + /* + * tls_base passed to this function + * from thr_new call and points to actual TCB struct, + * so we should add TP_OFFSET + sizeof(struct tcb) + * to make it the same way TLS base is passed to + * MIPS_SET_TLS/MIPS_GET_TLS API + */ +#ifndef __mips_n64 + td->td_md.md_tls = (char*)tls_base + 0x7010; +#else + td->td_md.md_tls = (char*)tls_base + 0x7008; +#endif return (0); } From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 09:55:19 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 665FD106566C; Fri, 10 Feb 2012 09:55:19 +0000 (UTC) (envelope-from ae@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 54ECE8FC12; Fri, 10 Feb 2012 09:55:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1A9tJVS065378; Fri, 10 Feb 2012 09:55:19 GMT (envelope-from ae@svn.freebsd.org) Received: (from ae@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A9tJ8g065375; Fri, 10 Feb 2012 09:55:19 GMT (envelope-from ae@svn.freebsd.org) Message-Id: <201202100955.q1A9tJ8g065375@svn.freebsd.org> From: "Andrey V. Elsukov" Date: Fri, 10 Feb 2012 09:55:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231367 - in head/sys: geom/part sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 09:55:19 -0000 Author: ae Date: Fri Feb 10 09:55:18 2012 New Revision: 231367 URL: http://svn.freebsd.org/changeset/base/231367 Log: Add alias for the partition with type 0x42 to the MBR scheme. MFC after: 1 week Modified: head/sys/geom/part/g_part_mbr.c head/sys/sys/diskmbr.h Modified: head/sys/geom/part/g_part_mbr.c ============================================================================== --- head/sys/geom/part/g_part_mbr.c Fri Feb 10 09:46:59 2012 (r231366) +++ head/sys/geom/part/g_part_mbr.c Fri Feb 10 09:55:18 2012 (r231367) @@ -119,6 +119,7 @@ static struct g_part_mbr_alias { { DOSPTYP_EXT, G_PART_ALIAS_EBR }, { DOSPTYP_NTFS, G_PART_ALIAS_MS_NTFS }, { DOSPTYP_FAT32, G_PART_ALIAS_MS_FAT32 }, + { DOSPTYP_LDM, G_PART_ALIAS_MS_LDM_DATA }, { DOSPTYP_LINSWP, G_PART_ALIAS_LINUX_SWAP }, { DOSPTYP_LINUX, G_PART_ALIAS_LINUX_DATA }, { DOSPTYP_LINLVM, G_PART_ALIAS_LINUX_LVM }, Modified: head/sys/sys/diskmbr.h ============================================================================== --- head/sys/sys/diskmbr.h Fri Feb 10 09:46:59 2012 (r231366) +++ head/sys/sys/diskmbr.h Fri Feb 10 09:55:18 2012 (r231367) @@ -49,6 +49,7 @@ #define DOSPTYP_FAT32 0x0b /* FAT32 partition */ #define DOSPTYP_EXTLBA 0x0f /* DOS extended partition */ #define DOSPTYP_PPCBOOT 0x41 /* PReP/CHRP boot partition */ +#define DOSPTYP_LDM 0x42 /* Win2k dynamic extended partition */ #define DOSPTYP_386BSD 0xa5 /* 386BSD partition type */ #define DOSPTYP_LINSWP 0x82 /* Linux swap partition */ #define DOSPTYP_LINUX 0x83 /* Linux partition */ From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 09:58:21 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 622821065670; Fri, 10 Feb 2012 09:58:21 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 458ED8FC12; Fri, 10 Feb 2012 09:58:21 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1A9wLqa065515; Fri, 10 Feb 2012 09:58:21 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1A9wLNd065511; Fri, 10 Feb 2012 09:58:21 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202100958.q1A9wLNd065511@svn.freebsd.org> From: Adrian Chadd Date: Fri, 10 Feb 2012 09:58:21 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231368 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 09:58:21 -0000 Author: adrian Date: Fri Feb 10 09:58:20 2012 New Revision: 231368 URL: http://svn.freebsd.org/changeset/base/231368 Log: Extend the HAL code to allow the RX and TX chainmask to be overridden by capabilities. Add an ar5416SetCapability() function, which contains logic to override the chainmask and update the relevant stream. This is designed to be called after the attach function, which presets the TX/RX chainmask and stream. TODO: check the chainmask against the hardware chainmask so non-existing chains aren't enabled. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416.h ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416.h Fri Feb 10 09:55:18 2012 (r231367) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416.h Fri Feb 10 09:58:20 2012 (r231368) @@ -207,6 +207,9 @@ extern HAL_STATUS ar5416SetQuiet(struct uint32_t duration, uint32_t nextStart, HAL_QUIET_FLAG flag); extern HAL_STATUS ar5416GetCapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type, uint32_t capability, uint32_t *result); +extern HAL_BOOL ar5416SetCapability(struct ath_hal *ah, + HAL_CAPABILITY_TYPE type, uint32_t capability, uint32_t val, + HAL_STATUS *status); extern HAL_BOOL ar5416GetDiagState(struct ath_hal *ah, int request, const void *args, uint32_t argsize, void **result, uint32_t *resultsize); Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri Feb 10 09:55:18 2012 (r231367) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_attach.c Fri Feb 10 09:58:20 2012 (r231368) @@ -129,6 +129,7 @@ ar5416InitState(struct ath_hal_5416 *ahp /* Misc Functions */ ah->ah_getCapability = ar5416GetCapability; + ah->ah_setCapability = ar5416SetCapability; ah->ah_getDiagState = ar5416GetDiagState; ah->ah_setLedState = ar5416SetLedState; ah->ah_gpioCfgOutput = ar5416GpioCfgOutput; @@ -884,6 +885,7 @@ ar5416FillCapabilityInfo(struct ath_hal /* AR5416 may have 3 antennas but is a 2x2 stream device */ pCap->halTxStreams = 2; pCap->halRxStreams = 2; + /* * If the TX or RX chainmask has less than 2 chains active, * mark it as a 1-stream device for the relevant stream. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Fri Feb 10 09:55:18 2012 (r231367) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Fri Feb 10 09:58:20 2012 (r231368) @@ -27,6 +27,8 @@ #include "ar5416/ar5416reg.h" #include "ar5416/ar5416phy.h" +#include "ah_eeprom_v14.h" /* for owl_get_ntxchains() */ + /* * Return the wireless modes (a,b,g,n,t) supported by hardware. * @@ -430,6 +432,33 @@ ar5416GetCapability(struct ath_hal *ah, return ar5212GetCapability(ah, type, capability, result); } +HAL_BOOL +ar5416SetCapability(struct ath_hal *ah, HAL_CAPABILITY_TYPE type, + u_int32_t capability, u_int32_t setting, HAL_STATUS *status) +{ + HAL_CAPABILITIES *pCap = &AH_PRIVATE(ah)->ah_caps; + + switch (type) { + case HAL_CAP_RX_CHAINMASK: + pCap->halRxChainMask = setting; + if (owl_get_ntxchains(setting) > 2) + pCap->halRxStreams = 2; + else + pCap->halRxStreams = 1; + return HAL_OK; + case HAL_CAP_TX_CHAINMASK: + pCap->halTxChainMask = setting; + if (owl_get_ntxchains(setting) > 2) + pCap->halTxStreams = 2; + else + pCap->halTxStreams = 1; + return HAL_OK; + default: + break; + } + return ar5212SetCapability(ah, type, capability, setting, status); +} + static int ar5416DetectMacHang(struct ath_hal *ah); static int ar5416DetectBBHang(struct ath_hal *ah); From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 10:01:10 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7F79A106564A; Fri, 10 Feb 2012 10:01:10 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 62B978FC13; Fri, 10 Feb 2012 10:01:10 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1AA1A1W065699; Fri, 10 Feb 2012 10:01:10 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AA1A7v065696; Fri, 10 Feb 2012 10:01:10 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202101001.q1AA1A7v065696@svn.freebsd.org> From: Adrian Chadd Date: Fri, 10 Feb 2012 10:01:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231369 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 10:01:10 -0000 Author: adrian Date: Fri Feb 10 10:01:09 2012 New Revision: 231369 URL: http://svn.freebsd.org/changeset/base/231369 Log: Add in a new driver feature to allow the TX and RX chainmask to be overridden at attach time. Some 802.11n NICs may only have one physical antenna connected. The radios will be very upset if you try enabling radios which aren't connected to antennas. This allows hints to override the TX and RX chainmask. These hints are: hint.ath.X.rx_chainmask hint.ath.X.tx_chainmask They can be set at either boot time or in kenv before the module is loaded. This and the previous HAL commit were sponsored in late 2011 by Hobnob, Inc. Sponsored by: Hobnob, Inc. Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_athvar.h Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Feb 10 09:58:20 2012 (r231368) +++ head/sys/dev/ath/if_ath.c Fri Feb 10 10:01:09 2012 (r231369) @@ -284,6 +284,7 @@ ath_attach(u_int16_t devid, struct ath_s int error = 0, i; u_int wmodes; uint8_t macaddr[IEEE80211_ADDR_LEN]; + int rx_chainmask, tx_chainmask; DPRINTF(sc, ATH_DEBUG_ANY, "%s: devid 0x%x\n", __func__, devid); @@ -634,6 +635,29 @@ ath_attach(u_int16_t devid, struct ath_s #endif /* + * Allow the TX and RX chainmasks to be overridden by + * environment variables and/or device.hints. + * + * This must be done early - before the hardware is + * calibrated or before the 802.11n stream calculation + * is done. + */ + if (resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), "rx_chainmask", + &rx_chainmask) == 0) { + device_printf(sc->sc_dev, "Setting RX chainmask to 0x%x\n", + rx_chainmask); + (void) ath_hal_setrxchainmask(sc->sc_ah, rx_chainmask); + } + if (resource_int_value(device_get_name(sc->sc_dev), + device_get_unit(sc->sc_dev), "tx_chainmask", + &tx_chainmask) == 0) { + device_printf(sc->sc_dev, "Setting TX chainmask to 0x%x\n", + tx_chainmask); + (void) ath_hal_settxchainmask(sc->sc_ah, rx_chainmask); + } + + /* * The if_ath 11n support is completely not ready for normal use. * Enabling this option will likely break everything and everything. * Don't think of doing that unless you know what you're doing. Modified: head/sys/dev/ath/if_athvar.h ============================================================================== --- head/sys/dev/ath/if_athvar.h Fri Feb 10 09:58:20 2012 (r231368) +++ head/sys/dev/ath/if_athvar.h Fri Feb 10 10:01:09 2012 (r231369) @@ -888,6 +888,10 @@ void ath_intr(void *); (ath_hal_getcapability(_ah, HAL_CAP_RX_CHAINMASK, 0, _prxchainmask)) #define ath_hal_gettxchainmask(_ah, _ptxchainmask) \ (ath_hal_getcapability(_ah, HAL_CAP_TX_CHAINMASK, 0, _ptxchainmask)) +#define ath_hal_setrxchainmask(_ah, _rx) \ + (ath_hal_setcapability(_ah, HAL_CAP_RX_CHAINMASK, 1, _rx, NULL)) +#define ath_hal_settxchainmask(_ah, _tx) \ + (ath_hal_setcapability(_ah, HAL_CAP_TX_CHAINMASK, 1, _tx, NULL)) #define ath_hal_split4ktrans(_ah) \ (ath_hal_getcapability(_ah, HAL_CAP_SPLIT_4KB_TRANS, \ 0, NULL) == HAL_OK) From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 10:09:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A28BA106566B; Fri, 10 Feb 2012 10:09:17 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 913338FC08; Fri, 10 Feb 2012 10:09:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1AA9HYZ065980; Fri, 10 Feb 2012 10:09:17 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AA9H7h065978; Fri, 10 Feb 2012 10:09:17 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202101009.q1AA9H7h065978@svn.freebsd.org> From: Adrian Chadd Date: Fri, 10 Feb 2012 10:09:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231370 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 10:09:17 -0000 Author: adrian Date: Fri Feb 10 10:09:16 2012 New Revision: 231370 URL: http://svn.freebsd.org/changeset/base/231370 Log: .. oops, use the right chainmask. Modified: head/sys/dev/ath/if_ath.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Fri Feb 10 10:01:09 2012 (r231369) +++ head/sys/dev/ath/if_ath.c Fri Feb 10 10:09:16 2012 (r231370) @@ -654,7 +654,7 @@ ath_attach(u_int16_t devid, struct ath_s &tx_chainmask) == 0) { device_printf(sc->sc_dev, "Setting TX chainmask to 0x%x\n", tx_chainmask); - (void) ath_hal_settxchainmask(sc->sc_ah, rx_chainmask); + (void) ath_hal_settxchainmask(sc->sc_ah, tx_chainmask); } /* From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 10:10:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E0A38106564A; Fri, 10 Feb 2012 10:10:41 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CF3698FC0A; Fri, 10 Feb 2012 10:10:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1AAAf2r066065; Fri, 10 Feb 2012 10:10:41 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AAAfal066063; Fri, 10 Feb 2012 10:10:41 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201202101010.q1AAAfal066063@svn.freebsd.org> From: Adrian Chadd Date: Fri, 10 Feb 2012 10:10:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231371 - head/sys/dev/ath/ath_hal/ar5416 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 10:10:42 -0000 Author: adrian Date: Fri Feb 10 10:10:41 2012 New Revision: 231371 URL: http://svn.freebsd.org/changeset/base/231371 Log: Enforce the hardware chainmask when allowing the user to override the chainmask. This way a disabled radio chain can't be enabled by a user. Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Modified: head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c ============================================================================== --- head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Fri Feb 10 10:09:16 2012 (r231370) +++ head/sys/dev/ath/ath_hal/ar5416/ar5416_misc.c Fri Feb 10 10:10:41 2012 (r231371) @@ -440,6 +440,7 @@ ar5416SetCapability(struct ath_hal *ah, switch (type) { case HAL_CAP_RX_CHAINMASK: + setting &= ath_hal_eepromGet(ah, AR_EEP_RXMASK, NULL); pCap->halRxChainMask = setting; if (owl_get_ntxchains(setting) > 2) pCap->halRxStreams = 2; @@ -447,6 +448,7 @@ ar5416SetCapability(struct ath_hal *ah, pCap->halRxStreams = 1; return HAL_OK; case HAL_CAP_TX_CHAINMASK: + setting &= ath_hal_eepromGet(ah, AR_EEP_TXMASK, NULL); pCap->halTxChainMask = setting; if (owl_get_ntxchains(setting) > 2) pCap->halTxStreams = 2; From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 10:48:04 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 5B9CC106566C; Fri, 10 Feb 2012 10:48:04 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-150-251.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 0459A14F41C; Fri, 10 Feb 2012 10:48:03 +0000 (UTC) Message-ID: <4F34F5E3.5010303@FreeBSD.org> Date: Fri, 10 Feb 2012 02:48:03 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:10.0) Gecko/20120201 Thunderbird/10.0 MIME-Version: 1.0 To: Marcel Moolenaar References: <201202092044.q19KiLUT027539@svn.freebsd.org> In-Reply-To: X-Enigmail-Version: 1.3.5 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Eitan Adler Subject: Re: svn commit: r231298 - head/etc X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 10:48:04 -0000 On 02/09/2012 14:15, Marcel Moolenaar wrote: > > On Feb 9, 2012, at 12:44 PM, Eitan Adler wrote: > >> Author: eadler >> Date: Thu Feb 9 20:44:20 2012 >> New Revision: 231298 >> URL: http://svn.freebsd.org/changeset/base/231298 >> >> Log: >> Make etc/Makefile more conflict resistant > > Nice. Question though: why not the less verbose > > BIN1 = \ > foo \ > bar \ > baz > > It's probably faster too, and friendlier when > running "make -dv" Just for fun I ran 'make INDEX' a bunch of times (which touches every category and subdir) the existing way, and after changing it from += to the same syntax as in src. There was no statistically significant difference in run time. Is there anything else that would be useful to test to see if there is a good reason to make this change in ports? Doug -- It's always a long day; 86400 doesn't fit into a short. Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 11:20:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 92AB3106566C; Fri, 10 Feb 2012 11:20:14 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7D4D78FC16; Fri, 10 Feb 2012 11:20:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1ABKEjt071089; Fri, 10 Feb 2012 11:20:14 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ABKEDG071087; Fri, 10 Feb 2012 11:20:14 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202101120.q1ABKEDG071087@svn.freebsd.org> From: Ed Schouten Date: Fri, 10 Feb 2012 11:20:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231376 - head/share/man/man9 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 11:20:14 -0000 Author: ed Date: Fri Feb 10 11:20:13 2012 New Revision: 231376 URL: http://svn.freebsd.org/changeset/base/231376 Log: Remove outdated piece of information. devtoname() always returns a pathname to the device. It will never return a #major/minor string. MFC after: 2 weeks Modified: head/share/man/man9/devtoname.9 Modified: head/share/man/man9/devtoname.9 ============================================================================== --- head/share/man/man9/devtoname.9 Fri Feb 10 10:23:55 2012 (r231375) +++ head/share/man/man9/devtoname.9 Fri Feb 10 11:20:13 2012 (r231376) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd January 19, 2012 +.Dd February 10, 2012 .Dt DEVTONAME 9 .Os .Sh NAME @@ -41,15 +41,6 @@ The function returns a pointer to the name of the device passed to it. The name is whatever was set to it in .Fn make_dev . -If no name is associated with -.Va dev , -a pointer to a string consisting of a -.Dq # -followed by -.Dq Va major Ns / Ns Va minor -as it applies to -.Va dev -is returned. .Sh HISTORY The .Fn devtoname From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 12:01:20 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02F1A10656DA; Fri, 10 Feb 2012 12:01:20 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E246C8FC25; Fri, 10 Feb 2012 12:01:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1AC1JaJ072334; Fri, 10 Feb 2012 12:01:19 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AC1Jfr072331; Fri, 10 Feb 2012 12:01:19 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201202101201.q1AC1Jfr072331@svn.freebsd.org> From: Edward Tomasz Napierala Date: Fri, 10 Feb 2012 12:01:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231377 - head/sbin/fsck_ffs X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 12:01:20 -0000 Author: trasz Date: Fri Feb 10 12:01:19 2012 New Revision: 231377 URL: http://svn.freebsd.org/changeset/base/231377 Log: Be more helpful about alternate superblocks. Modified: head/sbin/fsck_ffs/fsck_ffs.8 head/sbin/fsck_ffs/setup.c Modified: head/sbin/fsck_ffs/fsck_ffs.8 ============================================================================== --- head/sbin/fsck_ffs/fsck_ffs.8 Fri Feb 10 11:20:13 2012 (r231376) +++ head/sbin/fsck_ffs/fsck_ffs.8 Fri Feb 10 12:01:19 2012 (r231377) @@ -29,7 +29,7 @@ .\" @(#)fsck.8 8.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd April 27, 2011 +.Dd February 10, 2012 .Dt FSCK_FFS 8 .Os .Sh NAME @@ -193,6 +193,11 @@ Use the block specified immediately afte the super block for the file system. An alternate super block is usually located at block 32 for UFS1, and block 160 for UFS2. +.Pp +See the +.Fl N +flag of +.Xr newfs 8 . .It Fl C Check if file system was dismounted cleanly. If so, skip file system checks (like "preen"). Modified: head/sbin/fsck_ffs/setup.c ============================================================================== --- head/sbin/fsck_ffs/setup.c Fri Feb 10 11:20:13 2012 (r231376) +++ head/sbin/fsck_ffs/setup.c Fri Feb 10 12:01:19 2012 (r231377) @@ -194,7 +194,7 @@ setup(char *dev) "-b OPTION TO FSCK TO SPECIFY THE", "LOCATION OF AN ALTERNATE", "SUPER-BLOCK TO SUPPLY NEEDED", - "INFORMATION; SEE fsck(8)."); + "INFORMATION; SEE fsck_ffs(8)."); bflag = 0; return(0); } From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 12:35:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 18A351065673; Fri, 10 Feb 2012 12:35:58 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 00BF08FC16; Fri, 10 Feb 2012 12:35:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1ACZv4W073432; Fri, 10 Feb 2012 12:35:57 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ACZv2I073419; Fri, 10 Feb 2012 12:35:57 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202101235.q1ACZv2I073419@svn.freebsd.org> From: Ed Schouten Date: Fri, 10 Feb 2012 12:35:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231378 - in head/sys: compat/linux dev/iscsi/initiator dev/sound/pcm dev/usb dev/wtap netgraph security/mac_biba security/mac_lomac security/mac_mls vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 12:35:58 -0000 Author: ed Date: Fri Feb 10 12:35:57 2012 New Revision: 231378 URL: http://svn.freebsd.org/changeset/base/231378 Log: Remove direct access to si_name. Code should just use the devtoname() function to obtain the name of a character device. Also add const keywords to pieces of code that need it to build properly. MFC after: 2 weeks Modified: head/sys/compat/linux/linux_stats.c head/sys/compat/linux/linux_util.c head/sys/compat/linux/linux_util.h head/sys/dev/iscsi/initiator/isc_sm.c head/sys/dev/sound/pcm/mixer.c head/sys/dev/usb/usb_dev.c head/sys/dev/wtap/if_wtap.c head/sys/netgraph/ng_device.c head/sys/security/mac_biba/mac_biba.c head/sys/security/mac_lomac/mac_lomac.c head/sys/security/mac_mls/mac_mls.c head/sys/vm/swap_pager.c Modified: head/sys/compat/linux/linux_stats.c ============================================================================== --- head/sys/compat/linux/linux_stats.c Fri Feb 10 12:01:19 2012 (r231377) +++ head/sys/compat/linux/linux_stats.c Fri Feb 10 12:35:57 2012 (r231378) @@ -66,7 +66,7 @@ translate_vnhook_major_minor(struct vnod int major, minor; if (vp->v_type == VCHR && vp->v_rdev != NULL && - linux_driver_get_major_minor(vp->v_rdev->si_name, + linux_driver_get_major_minor(devtoname(vp->v_rdev), &major, &minor) == 0) { sb->st_rdev = (major << 8 | minor); } @@ -149,14 +149,14 @@ translate_fd_major_minor(struct thread * return; vp = fp->f_vnode; if (vp != NULL && vp->v_rdev != NULL && - linux_driver_get_major_minor(vp->v_rdev->si_name, + linux_driver_get_major_minor(devtoname(vp->v_rdev), &major, &minor) == 0) { buf->st_rdev = (major << 8 | minor); } else if (fp->f_type == DTYPE_PTS) { struct tty *tp = fp->f_data; /* Convert the numbers for the slave device. */ - if (linux_driver_get_major_minor(tp->t_dev->si_name, + if (linux_driver_get_major_minor(devtoname(tp->t_dev), &major, &minor) == 0) { buf->st_rdev = (major << 8 | minor); } Modified: head/sys/compat/linux/linux_util.c ============================================================================== --- head/sys/compat/linux/linux_util.c Fri Feb 10 12:01:19 2012 (r231377) +++ head/sys/compat/linux/linux_util.c Fri Feb 10 12:35:57 2012 (r231378) @@ -124,7 +124,7 @@ linux_driver_get_name_dev(device_t dev) } int -linux_driver_get_major_minor(char *node, int *major, int *minor) +linux_driver_get_major_minor(const char *node, int *major, int *minor) { struct device_element *de; Modified: head/sys/compat/linux/linux_util.h ============================================================================== --- head/sys/compat/linux/linux_util.h Fri Feb 10 12:01:19 2012 (r231377) +++ head/sys/compat/linux/linux_util.h Fri Feb 10 12:35:57 2012 (r231378) @@ -97,7 +97,7 @@ struct linux_device_handler { int linux_device_register_handler(struct linux_device_handler *h); int linux_device_unregister_handler(struct linux_device_handler *h); char *linux_driver_get_name_dev(device_t dev); -int linux_driver_get_major_minor(char *node, int *major, int *minor); +int linux_driver_get_major_minor(const char *node, int *major, int *minor); char *linux_get_char_devices(void); void linux_free_get_char_devices(char *string); Modified: head/sys/dev/iscsi/initiator/isc_sm.c ============================================================================== --- head/sys/dev/iscsi/initiator/isc_sm.c Fri Feb 10 12:01:19 2012 (r231377) +++ head/sys/dev/iscsi/initiator/isc_sm.c Fri Feb 10 12:35:57 2012 (r231378) @@ -652,13 +652,13 @@ static void isc_add_sysctls(isc_session_t *sp) { debug_called(8); - sdebug(6, "sid=%d %s", sp->sid, sp->dev->si_name); + sdebug(6, "sid=%d %s", sp->sid, devtoname(sp->dev)); sysctl_ctx_init(&sp->clist); sp->oid = SYSCTL_ADD_NODE(&sp->clist, SYSCTL_CHILDREN(sp->isc->oid), OID_AUTO, - sp->dev->si_name+5, // iscsi0 + devtoname(sp->dev) + 5, // iscsi0 CTLFLAG_RD, 0, "initiator"); Modified: head/sys/dev/sound/pcm/mixer.c ============================================================================== --- head/sys/dev/sound/pcm/mixer.c Fri Feb 10 12:01:19 2012 (r231377) +++ head/sys/dev/sound/pcm/mixer.c Fri Feb 10 12:35:57 2012 (r231378) @@ -1463,7 +1463,7 @@ mixer_oss_mixerinfo(struct cdev *i_dev, * * XXX Described by Hannu@4Front, but not found in * soundcard.h. - strlcpy(mi->devnode, d->mixer_dev->si_name, + strlcpy(mi->devnode, devtoname(d->mixer_dev), sizeof(mi->devnode)); mi->legacy_device = i; */ Modified: head/sys/dev/usb/usb_dev.c ============================================================================== --- head/sys/dev/usb/usb_dev.c Fri Feb 10 12:01:19 2012 (r231377) +++ head/sys/dev/usb/usb_dev.c Fri Feb 10 12:35:57 2012 (r231378) @@ -842,7 +842,7 @@ usb_open(struct cdev *dev, int fflags, i struct usb_cdev_privdata *cpd; int err, ep; - DPRINTFN(2, "%s fflags=0x%08x\n", dev->si_name, fflags); + DPRINTFN(2, "%s fflags=0x%08x\n", devtoname(dev), fflags); KASSERT(fflags & (FREAD|FWRITE), ("invalid open flags")); if (((fflags & FREAD) && !(pd->mode & FREAD)) || Modified: head/sys/dev/wtap/if_wtap.c ============================================================================== --- head/sys/dev/wtap/if_wtap.c Fri Feb 10 12:01:19 2012 (r231377) +++ head/sys/dev/wtap/if_wtap.c Fri Feb 10 12:35:57 2012 (r231378) @@ -84,7 +84,7 @@ wtap_node_write(struct cdev *dev, struct uint8_t buf[1024]; int buf_len; - uprintf("write device %s \"echo.\"\n", dev->si_name); + uprintf("write device %s \"echo.\"\n", devtoname(dev)); buf_len = MIN(uio->uio_iov->iov_len, 1024); err = copyin(uio->uio_iov->iov_base, buf, buf_len); @@ -101,7 +101,7 @@ wtap_node_write(struct cdev *dev, struct TAILQ_FOREACH(ifp, &V_ifnet, if_link) { printf("ifp->if_xname = %s\n", ifp->if_xname); - if(strcmp(dev->si_name, ifp->if_xname) == 0){ + if(strcmp(devtoname(dev), ifp->if_xname) == 0){ printf("found match, correspoding wtap = %s\n", ifp->if_xname); sc = (struct wtap_softc *)ifp->if_softc; Modified: head/sys/netgraph/ng_device.c ============================================================================== --- head/sys/netgraph/ng_device.c Fri Feb 10 12:01:19 2012 (r231377) +++ head/sys/netgraph/ng_device.c Fri Feb 10 12:35:57 2012 (r231378) @@ -203,6 +203,7 @@ ng_device_rcvmsg(node_p node, item_p ite const priv_p priv = NG_NODE_PRIVATE(node); struct ng_mesg *msg; struct ng_mesg *resp = NULL; + const char *dn; int error = 0; NGI_GET_MSG(item, msg); @@ -217,8 +218,8 @@ ng_device_rcvmsg(node_p node, item_p ite if (resp == NULL) ERROUT(ENOMEM); - strlcpy((char *)resp->data, priv->ngddev->si_name, - strlen(priv->ngddev->si_name) + 1); + dn = devtoname(priv->ngddev); + strlcpy((char *)resp->data, dn, strlen(dn) + 1); break; default: Modified: head/sys/security/mac_biba/mac_biba.c ============================================================================== --- head/sys/security/mac_biba/mac_biba.c Fri Feb 10 12:01:19 2012 (r231377) +++ head/sys/security/mac_biba/mac_biba.c Fri Feb 10 12:35:57 2012 (r231378) @@ -948,18 +948,20 @@ biba_devfs_create_device(struct ucred *c struct cdev *dev, struct devfs_dirent *de, struct label *delabel) { struct mac_biba *mb; + const char *dn; int biba_type; mb = SLOT(delabel); - if (strcmp(dev->si_name, "null") == 0 || - strcmp(dev->si_name, "zero") == 0 || - strcmp(dev->si_name, "random") == 0 || - strncmp(dev->si_name, "fd/", strlen("fd/")) == 0) + dn = devtoname(dev); + if (strcmp(dn, "null") == 0 || + strcmp(dn, "zero") == 0 || + strcmp(dn, "random") == 0 || + strncmp(dn, "fd/", strlen("fd/")) == 0) biba_type = MAC_BIBA_TYPE_EQUAL; else if (ptys_equal && - (strncmp(dev->si_name, "ttyp", strlen("ttyp")) == 0 || - strncmp(dev->si_name, "pts/", strlen("pts/")) == 0 || - strncmp(dev->si_name, "ptyp", strlen("ptyp")) == 0)) + (strncmp(dn, "ttyp", strlen("ttyp")) == 0 || + strncmp(dn, "pts/", strlen("pts/")) == 0 || + strncmp(dn, "ptyp", strlen("ptyp")) == 0)) biba_type = MAC_BIBA_TYPE_EQUAL; else biba_type = MAC_BIBA_TYPE_HIGH; Modified: head/sys/security/mac_lomac/mac_lomac.c ============================================================================== --- head/sys/security/mac_lomac/mac_lomac.c Fri Feb 10 12:01:19 2012 (r231377) +++ head/sys/security/mac_lomac/mac_lomac.c Fri Feb 10 12:35:57 2012 (r231378) @@ -1032,19 +1032,21 @@ lomac_devfs_create_device(struct ucred * struct cdev *dev, struct devfs_dirent *de, struct label *delabel) { struct mac_lomac *ml; + const char *dn; int lomac_type; ml = SLOT(delabel); - if (strcmp(dev->si_name, "null") == 0 || - strcmp(dev->si_name, "zero") == 0 || - strcmp(dev->si_name, "random") == 0 || - strncmp(dev->si_name, "fd/", strlen("fd/")) == 0 || - strncmp(dev->si_name, "ttyv", strlen("ttyv")) == 0) + dn = devtoname(dev); + if (strcmp(dn, "null") == 0 || + strcmp(dn, "zero") == 0 || + strcmp(dn, "random") == 0 || + strncmp(dn, "fd/", strlen("fd/")) == 0 || + strncmp(dn, "ttyv", strlen("ttyv")) == 0) lomac_type = MAC_LOMAC_TYPE_EQUAL; else if (ptys_equal && - (strncmp(dev->si_name, "ttyp", strlen("ttyp")) == 0 || - strncmp(dev->si_name, "pts/", strlen("pts/")) == 0 || - strncmp(dev->si_name, "ptyp", strlen("ptyp")) == 0)) + (strncmp(dn, "ttyp", strlen("ttyp")) == 0 || + strncmp(dn, "pts/", strlen("pts/")) == 0 || + strncmp(dn, "ptyp", strlen("ptyp")) == 0)) lomac_type = MAC_LOMAC_TYPE_EQUAL; else lomac_type = MAC_LOMAC_TYPE_HIGH; Modified: head/sys/security/mac_mls/mac_mls.c ============================================================================== --- head/sys/security/mac_mls/mac_mls.c Fri Feb 10 12:01:19 2012 (r231377) +++ head/sys/security/mac_mls/mac_mls.c Fri Feb 10 12:35:57 2012 (r231378) @@ -908,21 +908,23 @@ mls_devfs_create_device(struct ucred *cr struct cdev *dev, struct devfs_dirent *de, struct label *delabel) { struct mac_mls *mm; + const char *dn; int mls_type; mm = SLOT(delabel); - if (strcmp(dev->si_name, "null") == 0 || - strcmp(dev->si_name, "zero") == 0 || - strcmp(dev->si_name, "random") == 0 || - strncmp(dev->si_name, "fd/", strlen("fd/")) == 0) + dn = devtoname(dev); + if (strcmp(dn, "null") == 0 || + strcmp(dn, "zero") == 0 || + strcmp(dn, "random") == 0 || + strncmp(dn, "fd/", strlen("fd/")) == 0) mls_type = MAC_MLS_TYPE_EQUAL; - else if (strcmp(dev->si_name, "kmem") == 0 || - strcmp(dev->si_name, "mem") == 0) + else if (strcmp(dn, "kmem") == 0 || + strcmp(dn, "mem") == 0) mls_type = MAC_MLS_TYPE_HIGH; else if (ptys_equal && - (strncmp(dev->si_name, "ttyp", strlen("ttyp")) == 0 || - strncmp(dev->si_name, "pts/", strlen("pts/")) == 0 || - strncmp(dev->si_name, "ptyp", strlen("ptyp")) == 0)) + (strncmp(dn, "ttyp", strlen("ttyp")) == 0 || + strncmp(dn, "pts/", strlen("pts/")) == 0 || + strncmp(dn, "ptyp", strlen("ptyp")) == 0)) mls_type = MAC_MLS_TYPE_EQUAL; else mls_type = MAC_MLS_TYPE_LOW; Modified: head/sys/vm/swap_pager.c ============================================================================== --- head/sys/vm/swap_pager.c Fri Feb 10 12:01:19 2012 (r231377) +++ head/sys/vm/swap_pager.c Fri Feb 10 12:35:57 2012 (r231378) @@ -2320,7 +2320,7 @@ swapoff_all(void) TAILQ_FOREACH_SAFE(sp, &swtailq, sw_list, spt) { mtx_unlock(&sw_dev_mtx); if (vn_isdisk(sp->sw_vp, NULL)) - devname = sp->sw_vp->v_rdev->si_name; + devname = devtoname(sp->sw_vp->v_rdev); else devname = "[file]"; error = swapoff_one(sp, thread0.td_ucred); @@ -2358,7 +2358,7 @@ int swap_dev_info(int name, struct xswdev *xs, char *devname, size_t len) { struct swdevt *sp; - char *tmp_devname; + const char *tmp_devname; int error, n; n = 0; @@ -2376,7 +2376,7 @@ swap_dev_info(int name, struct xswdev *x xs->xsw_used = sp->sw_used; if (devname != NULL) { if (vn_isdisk(sp->sw_vp, NULL)) - tmp_devname = sp->sw_vp->v_rdev->si_name; + tmp_devname = devtoname(sp->sw_vp->v_rdev); else tmp_devname = "[file]"; strncpy(devname, tmp_devname, len); From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 12:40:51 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3C5701065670; Fri, 10 Feb 2012 12:40:51 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1C7778FC17; Fri, 10 Feb 2012 12:40:51 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1ACeoxo073605; Fri, 10 Feb 2012 12:40:50 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ACeoKl073601; Fri, 10 Feb 2012 12:40:50 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202101240.q1ACeoKl073601@svn.freebsd.org> From: Ed Schouten Date: Fri, 10 Feb 2012 12:40:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231379 - in head/sys: fs/devfs kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 12:40:51 -0000 Author: ed Date: Fri Feb 10 12:40:50 2012 New Revision: 231379 URL: http://svn.freebsd.org/changeset/base/231379 Log: Merge si_name and __si_namebuf. The si_name pointer always points to the __si_namebuf member inside the same object. Remove it and rename __si_namebuf to si_name. Modified: head/sys/fs/devfs/devfs_devs.c head/sys/kern/kern_conf.c head/sys/sys/conf.h Modified: head/sys/fs/devfs/devfs_devs.c ============================================================================== --- head/sys/fs/devfs/devfs_devs.c Fri Feb 10 12:35:57 2012 (r231378) +++ head/sys/fs/devfs/devfs_devs.c Fri Feb 10 12:40:50 2012 (r231379) @@ -133,7 +133,6 @@ devfs_alloc(int flags) cdev = &cdp->cdp_c; - cdev->si_name = cdev->__si_namebuf; LIST_INIT(&cdev->si_children); vfs_timestamp(&ts); cdev->si_atime = cdev->si_mtime = cdev->si_ctime = ts; Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Fri Feb 10 12:35:57 2012 (r231378) +++ head/sys/kern/kern_conf.c Fri Feb 10 12:40:50 2012 (r231379) @@ -690,16 +690,16 @@ prep_devname(struct cdev *dev, const cha mtx_assert(&devmtx, MA_OWNED); - len = vsnrprintf(dev->__si_namebuf, sizeof(dev->__si_namebuf), 32, + len = vsnrprintf(dev->si_name, sizeof(dev->si_name), 32, fmt, ap); - if (len > sizeof(dev->__si_namebuf) - 1) + if (len > sizeof(dev->si_name) - 1) return (ENAMETOOLONG); /* Strip leading slashes. */ - for (from = dev->__si_namebuf; *from == '/'; from++) + for (from = dev->si_name; *from == '/'; from++) ; - for (to = dev->__si_namebuf; *from != '\0'; from++, to++) { + for (to = dev->si_name; *from != '\0'; from++, to++) { /* Treat multiple sequential slashes as single. */ while (from[0] == '/' && from[1] == '/') from++; @@ -710,11 +710,11 @@ prep_devname(struct cdev *dev, const cha } *to = '\0'; - if (dev->__si_namebuf[0] == '\0') + if (dev->si_name[0] == '\0') return (EINVAL); /* Disallow "." and ".." components. */ - for (s = dev->__si_namebuf;;) { + for (s = dev->si_name;;) { for (q = s; *q != '/' && *q != '\0'; q++) ; if (q - s == 1 && s[0] == '.') @@ -726,7 +726,7 @@ prep_devname(struct cdev *dev, const cha s = q + 1; } - if (devfs_dev_exists(dev->__si_namebuf) != 0) + if (devfs_dev_exists(dev->si_name) != 0) return (EEXIST); return (0); Modified: head/sys/sys/conf.h ============================================================================== --- head/sys/sys/conf.h Fri Feb 10 12:35:57 2012 (r231378) +++ head/sys/sys/conf.h Fri Feb 10 12:40:50 2012 (r231379) @@ -78,7 +78,7 @@ struct cdev { LIST_HEAD(, cdev) si_children; LIST_ENTRY(cdev) si_siblings; struct cdev *si_parent; - char *si_name; + void *si_spare0; void *si_drv1, *si_drv2; struct cdevsw *si_devsw; int si_iosize_max; /* maximum I/O size (for physio &al) */ @@ -87,7 +87,7 @@ struct cdev { union { struct snapdata *__sid_snapdata; } __si_u; - char __si_namebuf[SPECNAMELEN + 1]; + char si_name[SPECNAMELEN + 1]; }; #define si_snapdata __si_u.__sid_snapdata From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 13:40:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A3ED31065670; Fri, 10 Feb 2012 13:40:32 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8EDDC8FC0C; Fri, 10 Feb 2012 13:40:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1ADeWH7076599; Fri, 10 Feb 2012 13:40:32 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ADeWDj076596; Fri, 10 Feb 2012 13:40:32 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202101340.q1ADeWDj076596@svn.freebsd.org> From: Ed Schouten Date: Fri, 10 Feb 2012 13:40:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231383 - in head: lib/libutil usr.sbin/vipw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 13:40:32 -0000 Author: ed Date: Fri Feb 10 13:40:32 2012 New Revision: 231383 URL: http://svn.freebsd.org/changeset/base/231383 Log: Detect file modification properly by using tv_nsec. POSIX 2008 standardizes st_mtim, meaning we can simply use nanosecond precision to detect file modification. MFC after: 2 weeks Modified: head/lib/libutil/pw_util.c head/usr.sbin/vipw/vipw.8 Modified: head/lib/libutil/pw_util.c ============================================================================== --- head/lib/libutil/pw_util.c Fri Feb 10 13:36:39 2012 (r231382) +++ head/lib/libutil/pw_util.c Fri Feb 10 13:40:32 2012 (r231383) @@ -347,7 +347,8 @@ pw_edit(int notsetuid) sigprocmask(SIG_SETMASK, &oldsigset, NULL); if (stat(tempname, &st2) == -1) return (-1); - return (st1.st_mtime != st2.st_mtime); + return (st1.st_mtim.tv_sec != st2.st_mtim.tv_sec || + st1.st_mtim.tv_nsec != st2.st_mtim.tv_nsec); } /* Modified: head/usr.sbin/vipw/vipw.8 ============================================================================== --- head/usr.sbin/vipw/vipw.8 Fri Feb 10 13:36:39 2012 (r231382) +++ head/usr.sbin/vipw/vipw.8 Fri Feb 10 13:40:32 2012 (r231383) @@ -28,7 +28,7 @@ .\" @(#)vipw.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd June 6, 1993 +.Dd February 10, 2011 .Dt VIPW 8 .Os .Sh NAME @@ -110,10 +110,3 @@ The .Nm utility appeared in .Bx 4.0 . -.Sh BUGS -The mechanism for checking for password file modifications requires that -.Ev EDITOR -run for at least one second. -Non-interactive editor scripts should invoke -.Xr sleep 1 -or equivalent to ensure this happens. From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 13:47:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 941FE1065670; Fri, 10 Feb 2012 13:47:41 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 7F4ED8FC12; Fri, 10 Feb 2012 13:47:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1ADlfld077213; Fri, 10 Feb 2012 13:47:41 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ADlfi9077211; Fri, 10 Feb 2012 13:47:41 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202101347.q1ADlfi9077211@svn.freebsd.org> From: Ed Schouten Date: Fri, 10 Feb 2012 13:47:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231384 - head/lib/libprocstat X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 13:47:41 -0000 Author: ed Date: Fri Feb 10 13:47:40 2012 New Revision: 231384 URL: http://svn.freebsd.org/changeset/base/231384 Log: Unbreak build. libprocstat still uses __si_namebuf. Modified: head/lib/libprocstat/common_kvm.c Modified: head/lib/libprocstat/common_kvm.c ============================================================================== --- head/lib/libprocstat/common_kvm.c Fri Feb 10 13:40:32 2012 (r231383) +++ head/lib/libprocstat/common_kvm.c Fri Feb 10 13:47:40 2012 (r231384) @@ -80,7 +80,7 @@ kdevtoname(kvm_t *kd, struct cdev *dev, assert(buf); if (!kvm_read_all(kd, (unsigned long)dev, &si, sizeof(si))) return (1); - strlcpy(buf, si.__si_namebuf, SPECNAMELEN + 1); + strlcpy(buf, si.si_name, SPECNAMELEN + 1); return (0); } From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 13:51:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12421106564A; Fri, 10 Feb 2012 13:51:03 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D7D208FC0A; Fri, 10 Feb 2012 13:51:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1ADp2R6077508; Fri, 10 Feb 2012 13:51:02 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ADp26B077506; Fri, 10 Feb 2012 13:51:02 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202101351.q1ADp26B077506@svn.freebsd.org> From: Ed Schouten Date: Fri, 10 Feb 2012 13:51:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231385 - head/usr.sbin/vipw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 13:51:03 -0000 Author: ed Date: Fri Feb 10 13:51:02 2012 New Revision: 231385 URL: http://svn.freebsd.org/changeset/base/231385 Log: Correct date. It seems to be 2012. Modified: head/usr.sbin/vipw/vipw.8 Modified: head/usr.sbin/vipw/vipw.8 ============================================================================== --- head/usr.sbin/vipw/vipw.8 Fri Feb 10 13:47:40 2012 (r231384) +++ head/usr.sbin/vipw/vipw.8 Fri Feb 10 13:51:02 2012 (r231385) @@ -28,7 +28,7 @@ .\" @(#)vipw.8 8.1 (Berkeley) 6/6/93 .\" $FreeBSD$ .\" -.Dd February 10, 2011 +.Dd February 10, 2012 .Dt VIPW 8 .Os .Sh NAME From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 14:55:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E4051106564A; Fri, 10 Feb 2012 14:55:47 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CB8318FC16; Fri, 10 Feb 2012 14:55:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1AEtlgE080239; Fri, 10 Feb 2012 14:55:47 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AEtlbX080237; Fri, 10 Feb 2012 14:55:47 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202101455.q1AEtlbX080237@svn.freebsd.org> From: Ed Schouten Date: Fri, 10 Feb 2012 14:55:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231386 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 14:55:48 -0000 Author: ed Date: Fri Feb 10 14:55:47 2012 New Revision: 231386 URL: http://svn.freebsd.org/changeset/base/231386 Log: Remove unneeded newline. It fits in 80 columns now. Pointed out by: jh Modified: head/sys/kern/kern_conf.c Modified: head/sys/kern/kern_conf.c ============================================================================== --- head/sys/kern/kern_conf.c Fri Feb 10 13:51:02 2012 (r231385) +++ head/sys/kern/kern_conf.c Fri Feb 10 14:55:47 2012 (r231386) @@ -690,8 +690,7 @@ prep_devname(struct cdev *dev, const cha mtx_assert(&devmtx, MA_OWNED); - len = vsnrprintf(dev->si_name, sizeof(dev->si_name), 32, - fmt, ap); + len = vsnrprintf(dev->si_name, sizeof(dev->si_name), 32, fmt, ap); if (len > sizeof(dev->si_name) - 1) return (ENAMETOOLONG); From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 15:34:36 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EB0AF106567D; Fri, 10 Feb 2012 15:34:36 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BA78C8FC18; Fri, 10 Feb 2012 15:34:36 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1AFYaiq081459; Fri, 10 Feb 2012 15:34:36 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AFYaP5081457; Fri, 10 Feb 2012 15:34:36 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201202101534.q1AFYaP5081457@svn.freebsd.org> From: Takahashi Yoshihiro Date: Fri, 10 Feb 2012 15:34:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231387 - head/sys/boot/pc98/loader X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 15:34:37 -0000 Author: nyan Date: Fri Feb 10 15:34:36 2012 New Revision: 231387 URL: http://svn.freebsd.org/changeset/base/231387 Log: Reduce diffs against i386. MFC after: 1 week Modified: head/sys/boot/pc98/loader/Makefile Modified: head/sys/boot/pc98/loader/Makefile ============================================================================== --- head/sys/boot/pc98/loader/Makefile Fri Feb 10 14:55:47 2012 (r231386) +++ head/sys/boot/pc98/loader/Makefile Fri Feb 10 15:34:36 2012 (r231387) @@ -3,7 +3,8 @@ .include MK_SSP= no -PROG= loader.sym +LOADER?= loader +PROG= ${LOADER}.sym INTERNALPROG= NEWVERSWHAT= "bootstrap loader" pc98 @@ -39,14 +40,14 @@ CFLAGS+= -DLOADER_BZIP2_SUPPORT CFLAGS+= -DLOADER_GZIP_SUPPORT .endif -# Always add MI sources +# Always add MI sources .PATH: ${.CURDIR}/../../common .include "${.CURDIR}/../../common/Makefile.inc" CFLAGS+= -I${.CURDIR}/../../common CFLAGS+= -I${.CURDIR}/../../i386 CFLAGS+= -I. -CLEANFILES= vers.c loader loader.bin loader.help +CLEANFILES= vers.c ${LOADER} ${LOADER}.bin loader.help CFLAGS+= -Wall LDFLAGS= -static -Ttext 0x0 @@ -68,36 +69,37 @@ CFLAGS+= -I${.CURDIR}/../btx/lib vers.c: ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../i386/loader/version sh ${.CURDIR}/../../common/newvers.sh ${.CURDIR}/../../i386/loader/version ${NEWVERSWHAT} -loader: loader.bin ${BTXLDR} ${BTXKERN} +${LOADER}: ${LOADER}.bin ${BTXLDR} ${BTXKERN} btxld -v -f aout -e ${LOADER_ADDRESS} -o ${.TARGET} -l ${BTXLDR} \ - -b ${BTXKERN} loader.bin + -b ${BTXKERN} ${LOADER}.bin -loader.bin: loader.sym +${LOADER}.bin: ${LOADER}.sym cp ${.ALLSRC} ${.TARGET} strip -R .comment -R .note ${.TARGET} loader.help: help.common help.pc98 cat ${.ALLSRC} | awk -f ${.CURDIR}/../../common/merge_help.awk > ${.TARGET} -.PATH: ${.CURDIR}/../../forth -FILES= loader loader.help loader.4th support.4th loader.conf +FILES= ${LOADER} +# XXX INSTALLFLAGS_loader= -b +FILESMODE_${LOADER}= ${BINMODE} -b + +.PATH: ${.CURDIR}/../../forth +FILES+= loader.help loader.4th support.4th loader.conf FILES+= screen.4th frames.4th beastie.4th FILES+= brand.4th check-password.4th color.4th delay.4th FILES+= menu.4th menu-commands.4th shortcuts.4th version.4th -# XXX INSTALLFLAGS_loader= -b -FILESMODE_loader= ${BINMODE} -b FILESDIR_loader.conf= /boot/defaults .if !exists(${DESTDIR}/boot/loader.rc) FILES+= ${.CURDIR}/../../i386/loader/loader.rc .endif - .if !exists(${DESTDIR}/boot/menu.rc) FILES+= menu.rc .endif # XXX crt0.o needs to be first for pxeboot(8) to work -OBJS= ${BTXCRT} +OBJS= ${BTXCRT} DPADD= ${LIBFICL} ${LIBPC98} ${LIBSTAND} LDADD= ${LIBFICL} ${LIBPC98} ${LIBSTAND} From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 16:27:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA9111065673; Fri, 10 Feb 2012 16:27:45 +0000 (UTC) (envelope-from pluknet@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9DF3D8FC12; Fri, 10 Feb 2012 16:27:44 +0000 (UTC) Received: by lagz14 with SMTP id z14so3769068lag.13 for ; Fri, 10 Feb 2012 08:27:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=RB9+d3n156XSBc5R5DDIUl0dCh768XdMUD0CANDwxiA=; b=TE/pGgz9z/IrimRmUWKqCBA158meMlPvaUddRPW0SYO05QDlAVfFf97S2LF8kqe2Sh Mdxc6ttHx09sO77odLorszIGWGRuJwzvsttkiN3kvO+zfgCsly9YNr7ow2XGeNzW6gjn H6XlfY33gmTJBmjOEtJhTerbKCgxQQrOzUZ/4= MIME-Version: 1.0 Received: by 10.112.87.225 with SMTP id bb1mr2239675lbb.59.1328891263407; Fri, 10 Feb 2012 08:27:43 -0800 (PST) Sender: pluknet@gmail.com Received: by 10.152.18.4 with HTTP; Fri, 10 Feb 2012 08:27:43 -0800 (PST) In-Reply-To: <201202101340.q1ADeWDj076596@svn.freebsd.org> References: <201202101340.q1ADeWDj076596@svn.freebsd.org> Date: Fri, 10 Feb 2012 19:27:43 +0300 X-Google-Sender-Auth: lOsGX3o2s_ci87pKwhNdPMCw9E0 Message-ID: From: Sergey Kandaurov To: Ed Schouten Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231383 - in head: lib/libutil usr.sbin/vipw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 16:27:45 -0000 On 10 February 2012 17:40, Ed Schouten wrote: > Author: ed > Date: Fri Feb 10 13:40:32 2012 > New Revision: 231383 > URL: http://svn.freebsd.org/changeset/base/231383 > > Log: > =A0Detect file modification properly by using tv_nsec. > > =A0POSIX 2008 standardizes st_mtim, meaning we can simply use nanosecond > =A0precision to detect file modification. > I am not sure we can use subsecond precision there with currently set sysctl vfs.timestamp_precision=3D0. --=20 wbr, pluknet From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 17:20:26 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5D216106564A; Fri, 10 Feb 2012 17:20:26 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail07.syd.optusnet.com.au (mail07.syd.optusnet.com.au [211.29.132.188]) by mx1.freebsd.org (Postfix) with ESMTP id CA9C18FC12; Fri, 10 Feb 2012 17:20:25 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail07.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q1AHKM5x016407 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 11 Feb 2012 04:20:24 +1100 Date: Sat, 11 Feb 2012 04:20:22 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Sergey Kandaurov In-Reply-To: Message-ID: <20120211041345.Q3573@besplex.bde.org> References: <201202101340.q1ADeWDj076596@svn.freebsd.org> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="0-267995700-1328894422=:3573" Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Ed Schouten Subject: Re: svn commit: r231383 - in head: lib/libutil usr.sbin/vipw X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 17:20:26 -0000 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --0-267995700-1328894422=:3573 Content-Type: TEXT/PLAIN; charset=X-UNKNOWN; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Fri, 10 Feb 2012, Sergey Kandaurov wrote: > On 10 February 2012 17:40, Ed Schouten wrote: >> Log: >> =A0Detect file modification properly by using tv_nsec. >> >> =A0POSIX 2008 standardizes st_mtim, meaning we can simply use nanosecond >> =A0precision to detect file modification. > > I am not sure we can use subsecond precision there with currently set > sysctl vfs.timestamp_precision=3D0. Also, not all file systems support even seconds precision. So the deleted BUGS section applies irrespective of vfs.timestamp_precision, except it doesn't describe the full extent of the problem. Sleeping for just 1 second is not enough if the timestamp precision is large. The BUGS section also applies respective of vfs.timestamp_precision, when the user uses the supported setting vfs.timestamp_precision=3D0. Of course, important databases that need POSIX semantics shouldn't be put on file systems without POSIX times, but you need a BUGS section somewhere to tell you not to do that. Bruce --0-267995700-1328894422=:3573-- From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 19:17:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DDC1C106566B; Fri, 10 Feb 2012 19:17:14 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C87018FC0C; Fri, 10 Feb 2012 19:17:14 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1AJHE3Z089467; Fri, 10 Feb 2012 19:17:14 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJHEGl089465; Fri, 10 Feb 2012 19:17:14 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201202101917.q1AJHEGl089465@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 10 Feb 2012 19:17:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231406 - head/sys/mips/include X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:17:15 -0000 Author: gonzo Date: Fri Feb 10 19:17:14 2012 New Revision: 231406 URL: http://svn.freebsd.org/changeset/base/231406 Log: - Fix spelling of R_MIPS_RELGOT - Add R_MIPS_JALR relocation - Add TLS relocation types Obtained from: NetBSD Modified: head/sys/mips/include/elf.h Modified: head/sys/mips/include/elf.h ============================================================================== --- head/sys/mips/include/elf.h Fri Feb 10 19:15:05 2012 (r231405) +++ head/sys/mips/include/elf.h Fri Feb 10 19:17:14 2012 (r231406) @@ -189,9 +189,27 @@ typedef struct { #define R_MIPS_REL16 33 #define R_MIPS_ADD_IMMEDIATE 34 #define R_MIPS_PJUMP 35 -#define R_MIPS_ERLGOT 36 +#define R_MIPS_RELGOT 36 +#define R_MIPS_JALR 37 -#define R_MIPS_max 37 +/* + * TLS relocations + */ +#define R_MIPS_TLS_DTPMOD32 38 /* Module number 32 bit */ +#define R_MIPS_TLS_DTPREL32 39 /* Module-relative offset 32 bit */ +#define R_MIPS_TLS_DTPMOD64 40 /* Module number 64 bit */ +#define R_MIPS_TLS_DTPREL64 41 /* Module-relative offset 64 bit */ +#define R_MIPS_TLS_GD 42 /* 16 bit GOT offset for GD */ +#define R_MIPS_TLS_LDM 43 /* 16 bit GOT offset for LDM */ +#define R_MIPS_TLS_DTPREL_HI16 44 /* Module-relative offset, high 16 bits */ +#define R_MIPS_TLS_DTPREL_LO16 45 /* Module-relative offset, low 16 bits */ +#define R_MIPS_TLS_GOTTPREL 46 /* 16 bit GOT offset for IE */ +#define R_MIPS_TLS_TPREL32 47 /* TP-relative offset, 32 bit */ +#define R_MIPS_TLS_TPREL64 48 /* TP-relative offset, 64 bit */ +#define R_MIPS_TLS_TPREL_HI16 49 /* TP-relative offset, high 16 bits */ +#define R_MIPS_TLS_TPREL_LO16 50 /* TP-relative offset, low 16 bits */ + +#define R_MIPS_max 51 #define R_TYPE(name) __CONCAT(R_MIPS_,name) /* Define "machine" characteristics */ From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 19:58:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C1638106578A; Fri, 10 Feb 2012 19:58:04 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BF5158FC1B; Fri, 10 Feb 2012 19:58:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1AJw47o091354; Fri, 10 Feb 2012 19:58:04 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AJw4ZB091352; Fri, 10 Feb 2012 19:58:04 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201202101958.q1AJw4ZB091352@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 10 Feb 2012 19:58:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231419 - head/libexec/rtld-elf/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 19:58:07 -0000 Author: gonzo Date: Fri Feb 10 19:58:04 2012 New Revision: 231419 URL: http://svn.freebsd.org/changeset/base/231419 Log: Remove debug output Modified: head/libexec/rtld-elf/mips/reloc.c Modified: head/libexec/rtld-elf/mips/reloc.c ============================================================================== --- head/libexec/rtld-elf/mips/reloc.c Fri Feb 10 19:57:58 2012 (r231418) +++ head/libexec/rtld-elf/mips/reloc.c Fri Feb 10 19:58:04 2012 (r231419) @@ -43,7 +43,6 @@ __FBSDID("$FreeBSD$"); #include "debug.h" #include "rtld.h" -#include "rtld_printf.h" #ifdef __mips_n64 #define GOT1_MASK 0x8000000000000000UL @@ -544,7 +543,6 @@ allocate_initial_tls(Obj_Entry *objs) + TLS_TP_OFFSET + TLS_TCB_SIZE); sysarch(MIPS_SET_TLS, tls); - rtld_printf("allocate_initial_tls -> %p(%p)\n", tls, tls - TLS_TP_OFFSET - TLS_TCB_SIZE); } void * From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 20:09:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 52A8C1065672; Fri, 10 Feb 2012 20:09:08 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id DF7848FC0C; Fri, 10 Feb 2012 20:09:07 +0000 (UTC) Received: by iaeo4 with SMTP id o4so971625iae.13 for ; Fri, 10 Feb 2012 12:09:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=WPcdAhb4/M4TTi/bw9aIaPXrzYtoL2JGn4k66D85sig=; b=w+dQkPE6LvUFX76d4fU0HMg1YGE3CLg8i7fiAojHYx8DqU57yt6LV9XagYJlPhFYqi WOQCsOkGFyQVN7cP0LBLdQ3Gmwre88cdTboZpMWDUG0vef0eu/SiJW5sc5Ca8TFHKhhj Vx5a08suJSWKwNxf1EJAceD38Jdo9WHjKauRk= MIME-Version: 1.0 Received: by 10.42.131.136 with SMTP id z8mr11564397ics.5.1328902958026; Fri, 10 Feb 2012 11:42:38 -0800 (PST) Sender: rmh.aybabtu@gmail.com Received: by 10.43.130.201 with HTTP; Fri, 10 Feb 2012 11:42:37 -0800 (PST) In-Reply-To: References: <201202040054.q140siBP012241@svn.freebsd.org> <4F2CFEE3.6070306@daemonic.se> Date: Fri, 10 Feb 2012 20:42:37 +0100 X-Google-Sender-Auth: UU-i77hd5ttlewZrBuImpQbAXH8 Message-ID: From: Robert Millan To: "Bjoern A. Zeeb" Content-Type: multipart/mixed; boundary=90e6ba6e81ccc1113d04b8a15409 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov , Adrian Chadd Subject: Re: svn commit: r230972 - in head: share/mk sys/amd64/conf sys/i386/conf sys/modules sys/modules/drm sys/modules/sound/driver sys/modules/usb tools/build/options X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 20:09:08 -0000 --90e6ba6e81ccc1113d04b8a15409 Content-Type: text/plain; charset=UTF-8 Hi all, Sorry for the late reply. I can't keep up with mail during the week. 2012/2/4, Bjoern A. Zeeb : > And can you please include GENERIC at least in these kernel configs? They > are not building and this breaks a make universe and I guess eventually the > tinderbox as well... Including GENERIC sounds problematic because if both WITHOUT_* files are included, then GENERIC is included twice! As discussed on -arch, the idea was that users would never build WITHOUT_* directly, but rather include them in their custom kernel config. These files weren't intended to be picked up by "make universe" either [1]. It just didn't occur to me that the universe target would pick them up. Here's a possible solution to this patch (untested). In case it looks fine to everyone (and my mentors approve it), I'll definitely test with "make universe" before commit. [1] shame on me for not testing lasest version of my patch with "make universe" -- I only tested the first one which didn't add WITHOUT_* files. -- Robert Millan --90e6ba6e81ccc1113d04b8a15409 Content-Type: text/plain; charset=US-ASCII; name="exclude_without_files.diff" Content-Disposition: attachment; filename="exclude_without_files.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: file0 SW5kZXg6IE1ha2VmaWxlCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIE1ha2VmaWxlCShyZXZpc2lvbiAyMzA5NzEp CisrKyBNYWtlZmlsZQkod29ya2luZyBjb3B5KQpAQCAtNDA0LDcgKzQwNCw3IEBACiAuZW5kaWYK IEtFUk5DT05GUyE9CWNkICR7S0VSTlNSQ0RJUn0vJHtUQVJHRVR9L2NvbmYgJiYgXAogCQlmaW5k IFtBLVowLTldKltBLVowLTldIC10eXBlIGYgLW1heGRlcHRoIDAgXAotCQkhIC1uYW1lIERFRkFV TFRTICEgLW5hbWUgTk9URVMKKwkJISAtbmFtZSBERUZBVUxUUyAhIC1uYW1lIE5PVEVTICEgLW5h bWUgV0lUSE9VVF9cKgogdW5pdmVyc2Vfa2VybmNvbmZzOgogLmZvciBrZXJuZWwgaW4gJHtLRVJO Q09ORlN9CiBUQVJHRVRfQVJDSF8ke2tlcm5lbH0hPQljZCAke0tFUk5TUkNESVJ9LyR7VEFSR0VU fS9jb25mICYmIFwK --90e6ba6e81ccc1113d04b8a15409-- From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 21:03:04 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BF4581065672; Fri, 10 Feb 2012 21:03:04 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A80698FC08; Fri, 10 Feb 2012 21:03:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1AL34UT094422; Fri, 10 Feb 2012 21:03:04 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AL34XZ094418; Fri, 10 Feb 2012 21:03:04 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201202102103.q1AL34XZ094418@svn.freebsd.org> From: Luigi Rizzo Date: Fri, 10 Feb 2012 21:03:04 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231437 - in head/sys: conf dev/oce modules modules/oce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 21:03:04 -0000 Author: luigi Date: Fri Feb 10 21:03:04 2012 New Revision: 231437 URL: http://svn.freebsd.org/changeset/base/231437 Log: Add a driver for Emulex OneConnect ethernet cards (10 Gbit PCIe) A manpage will come in a future commit. Submitted by: Naresh Raju Gottumukkala (emulex) Added: head/sys/dev/oce/ head/sys/dev/oce/oce_hw.c (contents, props changed) head/sys/dev/oce/oce_hw.h (contents, props changed) head/sys/dev/oce/oce_if.c (contents, props changed) head/sys/dev/oce/oce_if.h (contents, props changed) head/sys/dev/oce/oce_mbox.c (contents, props changed) head/sys/dev/oce/oce_queue.c (contents, props changed) head/sys/dev/oce/oce_sysctl.c (contents, props changed) head/sys/dev/oce/oce_util.c (contents, props changed) head/sys/modules/oce/ head/sys/modules/oce/Makefile (contents, props changed) Modified: head/sys/conf/NOTES head/sys/conf/files head/sys/modules/Makefile Modified: head/sys/conf/NOTES ============================================================================== --- head/sys/conf/NOTES Fri Feb 10 21:01:06 2012 (r231436) +++ head/sys/conf/NOTES Fri Feb 10 21:03:04 2012 (r231437) @@ -1972,6 +1972,7 @@ device xmphy # XaQti XMAC II # SMC EZ Card 1000 (SMC9462TX), D-Link DGE-500T, Asante FriendlyNet # GigaNIX 1000TA and 1000TPC, the Addtron AEG320T, the Surecom # EP-320G-TX and the Netgear GA622T. +# oce: Emulex 10 Gbit adapters (OneConnect Ethernet) # pcn: Support for PCI fast ethernet adapters based on the AMD Am79c97x # PCnet-FAST, PCnet-FAST+, PCnet-FAST III, PCnet-PRO and PCnet-Home # chipsets. These can also be handled by the le(4) driver if the @@ -2112,6 +2113,7 @@ device ixgbe # Intel Pro/10Gbe PCIE Et device le # AMD Am7900 LANCE and Am79C9xx PCnet device mxge # Myricom Myri-10G 10GbE NIC device nxge # Neterion Xframe 10GbE Server/Storage Adapter +device oce # Emulex 10 GbE (OneConnect Ethernet) device ti # Alteon Networks Tigon I/II gigabit Ethernet device txp # 3Com 3cR990 (``Typhoon'') device vx # 3Com 3c590, 3c595 (``Vortex'') Modified: head/sys/conf/files ============================================================================== --- head/sys/conf/files Fri Feb 10 21:01:06 2012 (r231436) +++ head/sys/conf/files Fri Feb 10 21:03:04 2012 (r231437) @@ -1068,6 +1068,12 @@ dev/e1000/e1000_mbx.c optional em | igb compile-with "${NORMAL_C} -I$S/dev/e1000" dev/e1000/e1000_osdep.c optional em | igb \ compile-with "${NORMAL_C} -I$S/dev/e1000" +dev/oce/oce_hw.c optional oce pci +dev/oce/oce_if.c optional oce pci +dev/oce/oce_mbox.c optional oce pci +dev/oce/oce_queue.c optional oce pci +dev/oce/oce_sysctl.c optional oce pci +dev/oce/oce_util.c optional oce pci dev/et/if_et.c optional et dev/en/if_en_pci.c optional en pci dev/en/midway.c optional en Added: head/sys/dev/oce/oce_hw.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/oce/oce_hw.c Fri Feb 10 21:03:04 2012 (r231437) @@ -0,0 +1,588 @@ +/*- + * Copyright (C) 2012 Emulex + * 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. + * + * 3. Neither the name of the Emulex Corporation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * Contact Information: + * freebsd-drivers@emulex.com + * + * Emulex + * 3333 Susan Street + * Costa Mesa, CA 92626 + */ + +/* $FreeBSD$ */ + +#include "oce_if.h" + +static int oce_POST(POCE_SOFTC sc); + +/** + * @brief Function to post status + * @param sc software handle to the device + */ +static int +oce_POST(POCE_SOFTC sc) +{ + mpu_ep_semaphore_t post_status; + int tmo = 60000; + + /* read semaphore CSR */ + post_status.dw0 = OCE_READ_REG32(sc, csr, MPU_EP_SEMAPHORE(sc)); + + /* if host is ready then wait for fw ready else send POST */ + if (post_status.bits.stage <= POST_STAGE_AWAITING_HOST_RDY) { + post_status.bits.stage = POST_STAGE_CHIP_RESET; + OCE_WRITE_REG32(sc, csr, MPU_EP_SEMAPHORE(sc), post_status.dw0); + } + + /* wait for FW ready */ + for (;;) { + if (--tmo == 0) + break; + + DELAY(1000); + + post_status.dw0 = OCE_READ_REG32(sc, csr, MPU_EP_SEMAPHORE(sc)); + if (post_status.bits.error) { + device_printf(sc->dev, + "POST failed: %x\n", post_status.dw0); + return ENXIO; + } + if (post_status.bits.stage == POST_STAGE_ARMFW_READY) + return 0; + } + + device_printf(sc->dev, "POST timed out: %x\n", post_status.dw0); + + return ENXIO; +} + +/** + * @brief Function for hardware initialization + * @param sc software handle to the device + */ +int +oce_hw_init(POCE_SOFTC sc) +{ + int rc = 0; + + rc = oce_POST(sc); + if (rc) + return rc; + + /* create the bootstrap mailbox */ + rc = oce_dma_alloc(sc, sizeof(struct oce_bmbx), &sc->bsmbx, 0); + if (rc) { + device_printf(sc->dev, "Mailbox alloc failed\n"); + return rc; + } + + rc = oce_reset_fun(sc); + if (rc) + goto error; + + + rc = oce_mbox_init(sc); + if (rc) + goto error; + + + rc = oce_get_fw_version(sc); + if (rc) + goto error; + + + rc = oce_get_fw_config(sc); + if (rc) + goto error; + + + sc->macaddr.size_of_struct = 6; + rc = oce_read_mac_addr(sc, 0, 1, MAC_ADDRESS_TYPE_NETWORK, + &sc->macaddr); + if (rc) + goto error; + + if (IS_BE(sc) && (sc->flags & OCE_FLAGS_BE3)) { + rc = oce_mbox_check_native_mode(sc); + if (rc) + goto error; + } else + sc->be3_native = 0; + + return rc; + +error: + oce_dma_free(sc, &sc->bsmbx); + device_printf(sc->dev, "Hardware initialisation failed\n"); + return rc; +} + + + +/** + * @brief Releases the obtained pci resources + * @param sc software handle to the device + */ +void +oce_hw_pci_free(POCE_SOFTC sc) +{ + int pci_cfg_barnum = 0; + + if (IS_BE(sc) && (sc->flags & OCE_FLAGS_BE2)) + pci_cfg_barnum = OCE_DEV_BE2_CFG_BAR; + else + pci_cfg_barnum = OCE_DEV_CFG_BAR; + + if (sc->devcfg_res != NULL) { + bus_release_resource(sc->dev, + SYS_RES_MEMORY, + PCIR_BAR(pci_cfg_barnum), sc->devcfg_res); + sc->devcfg_res = (struct resource *)NULL; + sc->devcfg_btag = (bus_space_tag_t) 0; + sc->devcfg_bhandle = (bus_space_handle_t)0; + sc->devcfg_vhandle = (void *)NULL; + } + + if (sc->csr_res != NULL) { + bus_release_resource(sc->dev, + SYS_RES_MEMORY, + PCIR_BAR(OCE_PCI_CSR_BAR), sc->csr_res); + sc->csr_res = (struct resource *)NULL; + sc->csr_btag = (bus_space_tag_t)0; + sc->csr_bhandle = (bus_space_handle_t)0; + sc->csr_vhandle = (void *)NULL; + } + + if (sc->db_res != NULL) { + bus_release_resource(sc->dev, + SYS_RES_MEMORY, + PCIR_BAR(OCE_PCI_DB_BAR), sc->db_res); + sc->db_res = (struct resource *)NULL; + sc->db_btag = (bus_space_tag_t)0; + sc->db_bhandle = (bus_space_handle_t)0; + sc->db_vhandle = (void *)NULL; + } +} + + + + +/** + * @brief Function to get the PCI capabilities + * @param sc software handle to the device + */ +static +void oce_get_pci_capabilities(POCE_SOFTC sc) +{ + uint32_t val; + + if (pci_find_extcap(sc->dev, PCIY_PCIX, &val) == 0) { + if (val != 0) + sc->flags |= OCE_FLAGS_PCIX; + } + + if (pci_find_extcap(sc->dev, PCIY_EXPRESS, &val) == 0) { + if (val != 0) { + uint16_t link_status = + pci_read_config(sc->dev, val + 0x12, 2); + + sc->flags |= OCE_FLAGS_PCIE; + sc->pcie_link_speed = link_status & 0xf; + sc->pcie_link_width = (link_status >> 4) & 0x3f; + } + } + + if (pci_find_extcap(sc->dev, PCIY_MSI, &val) == 0) { + if (val != 0) + sc->flags |= OCE_FLAGS_MSI_CAPABLE; + } + + if (pci_find_extcap(sc->dev, PCIY_MSIX, &val) == 0) { + if (val != 0) { + val = pci_msix_count(sc->dev); + sc->flags |= OCE_FLAGS_MSIX_CAPABLE; + } + } +} + +/** + * @brief Allocate PCI resources. + * + * @param sc software handle to the device + * @returns 0 if successful, or error + */ +int +oce_hw_pci_alloc(POCE_SOFTC sc) +{ + int rr, pci_cfg_barnum = 0; + pci_sli_intf_t intf; + + pci_enable_busmaster(sc->dev); + + oce_get_pci_capabilities(sc); + + sc->fn = pci_get_function(sc->dev); + + /* setup the device config region */ + if (IS_BE(sc) && (sc->flags & OCE_FLAGS_BE2)) + pci_cfg_barnum = OCE_DEV_BE2_CFG_BAR; + else + pci_cfg_barnum = OCE_DEV_CFG_BAR; + + rr = PCIR_BAR(pci_cfg_barnum); + + if (IS_BE(sc)) + sc->devcfg_res = bus_alloc_resource_any(sc->dev, + SYS_RES_MEMORY, &rr, + RF_ACTIVE|RF_SHAREABLE); + else + sc->devcfg_res = bus_alloc_resource(sc->dev, + SYS_RES_MEMORY, &rr, + 0ul, ~0ul, 32768, + RF_ACTIVE|RF_SHAREABLE); + + if (!sc->devcfg_res) + goto error; + + sc->devcfg_btag = rman_get_bustag(sc->devcfg_res); + sc->devcfg_bhandle = rman_get_bushandle(sc->devcfg_res); + sc->devcfg_vhandle = rman_get_virtual(sc->devcfg_res); + + /* Read the SLI_INTF register and determine whether we + * can use this port and its features + */ + intf.dw0 = pci_read_config((sc)->dev,OCE_INTF_REG_OFFSET,4); + + if (intf.bits.sli_valid != OCE_INTF_VALID_SIG) + goto error; + + if (intf.bits.sli_rev != OCE_INTF_SLI_REV4) { + device_printf(sc->dev, "Adapter doesnt support SLI4\n"); + goto error; + } + + if (intf.bits.sli_if_type == OCE_INTF_IF_TYPE_1) + sc->flags |= OCE_FLAGS_MBOX_ENDIAN_RQD; + + if (intf.bits.sli_hint1 == OCE_INTF_FUNC_RESET_REQD) + sc->flags |= OCE_FLAGS_FUNCRESET_RQD; + + if (intf.bits.sli_func_type == OCE_INTF_VIRT_FUNC) + sc->flags |= OCE_FLAGS_VIRTUAL_PORT; + + /* Lancer has one BAR (CFG) but BE3 has three (CFG, CSR, DB) */ + if (IS_BE(sc)) { + /* set up CSR region */ + rr = PCIR_BAR(OCE_PCI_CSR_BAR); + sc->csr_res = bus_alloc_resource_any(sc->dev, + SYS_RES_MEMORY, &rr, RF_ACTIVE|RF_SHAREABLE); + if (!sc->csr_res) + goto error; + sc->csr_btag = rman_get_bustag(sc->csr_res); + sc->csr_bhandle = rman_get_bushandle(sc->csr_res); + sc->csr_vhandle = rman_get_virtual(sc->csr_res); + + /* set up DB doorbell region */ + rr = PCIR_BAR(OCE_PCI_DB_BAR); + sc->db_res = bus_alloc_resource_any(sc->dev, + SYS_RES_MEMORY, &rr, RF_ACTIVE|RF_SHAREABLE); + if (!sc->db_res) + goto error; + sc->db_btag = rman_get_bustag(sc->db_res); + sc->db_bhandle = rman_get_bushandle(sc->db_res); + sc->db_vhandle = rman_get_virtual(sc->db_res); + } + + return 0; + +error: + oce_hw_pci_free(sc); + return ENXIO; +} + + +/** + * @brief Function for device shutdown + * @param sc software handle to the device + * @returns 0 on success, error otherwise + */ +void +oce_hw_shutdown(POCE_SOFTC sc) +{ + + oce_stats_free(sc); + /* disable hardware interrupts */ + oce_hw_intr_disable(sc); + /* Free LRO resources */ + oce_free_lro(sc); + /* Release queue*/ + oce_queue_release_all(sc); + /*Delete Network Interface*/ + oce_delete_nw_interface(sc); + /* After fw clean we dont send any cmds to fw.*/ + oce_fw_clean(sc); + /* release intr resources */ + oce_intr_free(sc); + /* release PCI resources */ + oce_hw_pci_free(sc); + /* free mbox specific resources */ + LOCK_DESTROY(&sc->bmbx_lock); + LOCK_DESTROY(&sc->dev_lock); + + oce_dma_free(sc, &sc->bsmbx); +} + + +/** + * @brief Function for creating nw interface. + * @param sc software handle to the device + * @returns 0 on success, error otherwise + */ +int +oce_create_nw_interface(POCE_SOFTC sc) +{ + int rc; + uint32_t capab_flags; + uint32_t capab_en_flags; + + /* interface capabilities to give device when creating interface */ + capab_flags = OCE_CAPAB_FLAGS; + + /* capabilities to enable by default (others set dynamically) */ + capab_en_flags = OCE_CAPAB_ENABLE; + + if (IS_XE201(sc)) { + /* LANCER A0 workaround */ + capab_en_flags &= ~MBX_RX_IFACE_FLAGS_PASS_L3L4_ERR; + capab_flags &= ~MBX_RX_IFACE_FLAGS_PASS_L3L4_ERR; + } + + /* enable capabilities controlled via driver startup parameters */ + if (sc->rss_enable) + capab_en_flags |= MBX_RX_IFACE_FLAGS_RSS; + else { + capab_en_flags &= ~MBX_RX_IFACE_FLAGS_RSS; + capab_flags &= ~MBX_RX_IFACE_FLAGS_RSS; + } + + rc = oce_if_create(sc, + capab_flags, + capab_en_flags, + 0, &sc->macaddr.mac_addr[0], &sc->if_id); + if (rc) + return rc; + + atomic_inc_32(&sc->nifs); + + sc->if_cap_flags = capab_en_flags; + + /* Enable VLAN Promisc on HW */ + rc = oce_config_vlan(sc, (uint8_t) sc->if_id, NULL, 0, 1, 1); + if (rc) + goto error; + + /* set default flow control */ + rc = oce_set_flow_control(sc, sc->flow_control); + if (rc) + goto error; + + rc = oce_rxf_set_promiscuous(sc, sc->promisc); + if (rc) + goto error; + + return rc; + +error: + oce_delete_nw_interface(sc); + return rc; + +} + +/** + * @brief Function to delete a nw interface. + * @param sc software handle to the device + */ +void +oce_delete_nw_interface(POCE_SOFTC sc) +{ + /* currently only single interface is implmeneted */ + if (sc->nifs > 0) { + oce_if_del(sc, sc->if_id); + atomic_dec_32(&sc->nifs); + } +} + +/** + * @brief Soft reset. + * @param sc software handle to the device + * @returns 0 on success, error otherwise + */ +int +oce_pci_soft_reset(POCE_SOFTC sc) +{ + int rc; + mpu_ep_control_t ctrl; + + ctrl.dw0 = OCE_READ_REG32(sc, csr, MPU_EP_CONTROL); + ctrl.bits.cpu_reset = 1; + OCE_WRITE_REG32(sc, csr, MPU_EP_CONTROL, ctrl.dw0); + DELAY(50); + rc=oce_POST(sc); + + return rc; +} + +/** + * @brief Function for hardware start + * @param sc software handle to the device + * @returns 0 on success, error otherwise + */ +int +oce_hw_start(POCE_SOFTC sc) +{ + struct link_status link = { 0 }; + int rc = 0; + + rc = oce_get_link_status(sc, &link); + if (rc) + return 1; + + if (link.logical_link_status == NTWK_LOGICAL_LINK_UP) { + sc->ifp->if_drv_flags |= IFF_DRV_RUNNING; + sc->link_status = NTWK_LOGICAL_LINK_UP; + if_link_state_change(sc->ifp, LINK_STATE_UP); + } else { + sc->ifp->if_drv_flags &= + ~(IFF_DRV_RUNNING | IFF_DRV_OACTIVE); + sc->link_status = NTWK_LOGICAL_LINK_DOWN; + if_link_state_change(sc->ifp, LINK_STATE_DOWN); + } + + if (link.mac_speed > 0 && link.mac_speed < 5) + sc->link_speed = link.mac_speed; + else + sc->link_speed = 0; + + sc->qos_link_speed = (uint32_t )link.qos_link_speed * 10; + + rc = oce_start_mq(sc->mq); + + /* we need to get MCC aync events. + So enable intrs and also arm first EQ + */ + oce_hw_intr_enable(sc); + oce_arm_eq(sc, sc->eq[0]->eq_id, 0, TRUE, FALSE); + + return rc; +} + + +/** + * @brief Function for hardware enable interupts. + * @param sc software handle to the device + */ +void +oce_hw_intr_enable(POCE_SOFTC sc) +{ + uint32_t reg; + + reg = OCE_READ_REG32(sc, devcfg, PCICFG_INTR_CTRL); + reg |= HOSTINTR_MASK; + OCE_WRITE_REG32(sc, devcfg, PCICFG_INTR_CTRL, reg); + +} + + +/** + * @brief Function for hardware disable interupts + * @param sc software handle to the device + */ +void +oce_hw_intr_disable(POCE_SOFTC sc) +{ + uint32_t reg; + + reg = OCE_READ_REG32(sc, devcfg, PCICFG_INTR_CTRL); + reg &= ~HOSTINTR_MASK; + OCE_WRITE_REG32(sc, devcfg, PCICFG_INTR_CTRL, reg); +} + + + +/** + * @brief Function for hardware update multicast filter + * @param sc software handle to the device + */ +int +oce_hw_update_multicast(POCE_SOFTC sc) +{ + struct ifnet *ifp = sc->ifp; + struct ifmultiaddr *ifma; + struct mbx_set_common_iface_multicast *req = NULL; + OCE_DMA_MEM dma; + int rc = 0; + + /* Allocate DMA mem*/ + if (oce_dma_alloc(sc, sizeof(struct mbx_set_common_iface_multicast), + &dma, 0)) + return ENOMEM; + + req = OCE_DMAPTR(&dma, struct mbx_set_common_iface_multicast); + bzero(req, sizeof(struct mbx_set_common_iface_multicast)); + +#if __FreeBSD_version > 800000 + IF_ADDR_LOCK(ifp); +#endif + TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { + if (ifma->ifma_addr->sa_family != AF_LINK) + continue; + + if (req->params.req.num_mac == OCE_MAX_MC_FILTER_SIZE) { + /*More multicast addresses than our hardware table + So Enable multicast promiscus in our hardware to + accept all multicat packets + */ + req->params.req.promiscuous = 1; + break; + } + bcopy(LLADDR((struct sockaddr_dl *)ifma->ifma_addr), + &req->params.req.mac[req->params.req.num_mac], + ETH_ADDR_LEN); + req->params.req.num_mac = req->params.req.num_mac + 1; + } +#if __FreeBSD_version > 800000 +IF_ADDR_UNLOCK(ifp); +#endif + req->params.req.if_id = sc->if_id; + rc = oce_update_multicast(sc, &dma); + oce_dma_free(sc, &dma); + return rc; +} + Added: head/sys/dev/oce/oce_hw.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/dev/oce/oce_hw.h Fri Feb 10 21:03:04 2012 (r231437) @@ -0,0 +1,3381 @@ +/*- + * Copyright (C) 2012 Emulex + * 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. + * + * 3. Neither the name of the Emulex Corporation nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 COPYRIGHT OWNER 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. + * + * Contact Information: + * freebsd-drivers@emulex.com + * + * Emulex + * 3333 Susan Street + * Costa Mesa, CA 92626 + */ + +/* $FreeBSD$ */ + +#include + +#undef _BIG_ENDIAN /* TODO */ +#pragma pack(1) + +#define OC_CNA_GEN2 0x2 +#define OC_CNA_GEN3 0x3 +#define DEVID_TIGERSHARK 0x700 +#define DEVID_TOMCAT 0x710 + +/* PCI CSR offsets */ +#define PCICFG_F1_CSR 0x0 /* F1 for NIC */ +#define PCICFG_SEMAPHORE 0xbc +#define PCICFG_SOFT_RESET 0x5c +#define PCICFG_UE_STATUS_HI_MASK 0xac +#define PCICFG_UE_STATUS_LO_MASK 0xa8 +#define PCICFG_ONLINE0 0xb0 +#define PCICFG_ONLINE1 0xb4 +#define INTR_EN 0x20000000 +#define IMAGE_TRANSFER_SIZE (32 * 1024) /* 32K at a time */ + +/* CSR register offsets */ +#define MPU_EP_CONTROL 0 +#define MPU_EP_SEMAPHORE_BE3 0xac +#define MPU_EP_SEMAPHORE_XE201 0x400 +#define MPU_EP_SEMAPHORE(sc) \ + ((IS_BE(sc)) ? MPU_EP_SEMAPHORE_BE3 : MPU_EP_SEMAPHORE_XE201) +#define PCICFG_INTR_CTRL 0xfc +#define HOSTINTR_MASK (1 << 29) +#define HOSTINTR_PFUNC_SHIFT 26 +#define HOSTINTR_PFUNC_MASK 7 + +/* POST status reg struct */ +#define POST_STAGE_POWER_ON_RESET 0x00 +#define POST_STAGE_AWAITING_HOST_RDY 0x01 +#define POST_STAGE_HOST_RDY 0x02 +#define POST_STAGE_CHIP_RESET 0x03 +#define POST_STAGE_ARMFW_READY 0xc000 +#define POST_STAGE_ARMFW_UE 0xf000 + +/* DOORBELL registers */ +#define PD_RXULP_DB 0x0100 +#define PD_TXULP_DB 0x0060 +#define DB_RQ_ID_MASK 0x3FF + +#define PD_CQ_DB 0x0120 +#define PD_EQ_DB PD_CQ_DB +#define PD_MPU_MBOX_DB 0x0160 +#define PD_MQ_DB 0x0140 + +/* EQE completion types */ +#define EQ_MINOR_CODE_COMPLETION 0x00 +#define EQ_MINOR_CODE_OTHER 0x01 +#define EQ_MAJOR_CODE_COMPLETION 0x00 + +/* Link Status field values */ +#define PHY_LINK_FAULT_NONE 0x0 +#define PHY_LINK_FAULT_LOCAL 0x01 +#define PHY_LINK_FAULT_REMOTE 0x02 + +#define PHY_LINK_SPEED_ZERO 0x0 /* No link */ +#define PHY_LINK_SPEED_10MBPS 0x1 /* (10 Mbps) */ +#define PHY_LINK_SPEED_100MBPS 0x2 /* (100 Mbps) */ +#define PHY_LINK_SPEED_1GBPS 0x3 /* (1 Gbps) */ +#define PHY_LINK_SPEED_10GBPS 0x4 /* (10 Gbps) */ + +#define PHY_LINK_DUPLEX_NONE 0x0 +#define PHY_LINK_DUPLEX_HALF 0x1 +#define PHY_LINK_DUPLEX_FULL 0x2 + +#define NTWK_PORT_A 0x0 /* (Port A) */ +#define NTWK_PORT_B 0x1 /* (Port B) */ + +#define PHY_LINK_SPEED_ZERO 0x0 /* (No link.) */ +#define PHY_LINK_SPEED_10MBPS 0x1 /* (10 Mbps) */ +#define PHY_LINK_SPEED_100MBPS 0x2 /* (100 Mbps) */ +#define PHY_LINK_SPEED_1GBPS 0x3 /* (1 Gbps) */ +#define PHY_LINK_SPEED_10GBPS 0x4 /* (10 Gbps) */ + +/* Hardware Address types */ +#define MAC_ADDRESS_TYPE_STORAGE 0x0 /* (Storage MAC Address) */ +#define MAC_ADDRESS_TYPE_NETWORK 0x1 /* (Network MAC Address) */ +#define MAC_ADDRESS_TYPE_PD 0x2 /* (Protection Domain MAC Addr) */ +#define MAC_ADDRESS_TYPE_MANAGEMENT 0x3 /* (Management MAC Address) */ +#define MAC_ADDRESS_TYPE_FCOE 0x4 /* (FCoE MAC Address) */ + +/* CREATE_IFACE capability and cap_en flags */ +#define MBX_RX_IFACE_FLAGS_RSS 0x4 +#define MBX_RX_IFACE_FLAGS_PROMISCUOUS 0x8 +#define MBX_RX_IFACE_FLAGS_BROADCAST 0x10 +#define MBX_RX_IFACE_FLAGS_UNTAGGED 0x20 +#define MBX_RX_IFACE_FLAGS_VLAN_PROMISCUOUS 0x80 +#define MBX_RX_IFACE_FLAGS_VLAN 0x100 +#define MBX_RX_IFACE_FLAGS_MCAST_PROMISCUOUS 0x200 +#define MBX_RX_IFACE_FLAGS_PASS_L2_ERR 0x400 +#define MBX_RX_IFACE_FLAGS_PASS_L3L4_ERR 0x800 +#define MBX_RX_IFACE_FLAGS_MULTICAST 0x1000 +#define MBX_RX_IFACE_RX_FILTER_IF_MULTICAST_HASH 0x2000 +#define MBX_RX_IFACE_FLAGS_HDS 0x4000 +#define MBX_RX_IFACE_FLAGS_DIRECTED 0x8000 +#define MBX_RX_IFACE_FLAGS_VMQ 0x10000 +#define MBX_RX_IFACE_FLAGS_NETQ 0x20000 +#define MBX_RX_IFACE_FLAGS_QGROUPS 0x40000 +#define MBX_RX_IFACE_FLAGS_LSO 0x80000 +#define MBX_RX_IFACE_FLAGS_LRO 0x100000 + +#define MQ_RING_CONTEXT_SIZE_16 0x5 /* (16 entries) */ +#define MQ_RING_CONTEXT_SIZE_32 0x6 /* (32 entries) */ +#define MQ_RING_CONTEXT_SIZE_64 0x7 /* (64 entries) */ +#define MQ_RING_CONTEXT_SIZE_128 0x8 /* (128 entries) */ + +#define MBX_DB_READY_BIT 0x1 +#define MBX_DB_HI_BIT 0x2 +#define ASYNC_EVENT_CODE_LINK_STATE 0x1 +#define ASYNC_EVENT_LINK_UP 0x1 +#define ASYNC_EVENT_LINK_DOWN 0x0 + +/* port link_status */ +#define ASYNC_EVENT_LOGICAL 0x02 + +/* Logical Link Status */ +#define NTWK_LOGICAL_LINK_DOWN 0 +#define NTWK_LOGICAL_LINK_UP 1 + +/* Rx filter bits */ +#define NTWK_RX_FILTER_IP_CKSUM 0x1 +#define NTWK_RX_FILTER_TCP_CKSUM 0x2 +#define NTWK_RX_FILTER_UDP_CKSUM 0x4 +#define NTWK_RX_FILTER_STRIP_CRC 0x8 + +/* max SGE per mbx */ +#define MAX_MBX_SGE 19 + +/* Max multicast filter size*/ +#define OCE_MAX_MC_FILTER_SIZE 64 + +/* PCI SLI (Service Level Interface) capabilities register */ +#define OCE_INTF_REG_OFFSET 0x58 +#define OCE_INTF_VALID_SIG 6 /* register's signature */ +#define OCE_INTF_FUNC_RESET_REQD 1 +#define OCE_INTF_HINT1_NOHINT 0 +#define OCE_INTF_HINT1_SEMAINIT 1 +#define OCE_INTF_HINT1_STATCTRL 2 +#define OCE_INTF_IF_TYPE_0 0 +#define OCE_INTF_IF_TYPE_1 1 +#define OCE_INTF_IF_TYPE_2 2 +#define OCE_INTF_IF_TYPE_3 3 +#define OCE_INTF_SLI_REV3 3 /* not supported by driver */ +#define OCE_INTF_SLI_REV4 4 /* driver supports SLI-4 */ +#define OCE_INTF_PHYS_FUNC 0 +#define OCE_INTF_VIRT_FUNC 1 +#define OCE_INTF_FAMILY_BE2 0 /* not supported by driver */ +#define OCE_INTF_FAMILY_BE3 1 /* driver supports BE3 */ +#define OCE_INTF_FAMILY_A0_CHIP 0xA /* Lancer A0 chip (supported) */ +#define OCE_INTF_FAMILY_B0_CHIP 0xB /* Lancer B0 chip (future) */ + +#define NIC_WQE_SIZE 16 +#define NIC_UNICAST 0x00 +#define NIC_MULTICAST 0x01 +#define NIC_BROADCAST 0x02 + +#define NIC_HDS_NO_SPLIT 0x00 +#define NIC_HDS_SPLIT_L3PL 0x01 +#define NIC_HDS_SPLIT_L4PL 0x02 + +#define NIC_WQ_TYPE_FORWARDING 0x01 +#define NIC_WQ_TYPE_STANDARD 0x02 +#define NIC_WQ_TYPE_LOW_LATENCY 0x04 + +#define OCE_RESET_STATS 1 +#define OCE_RETAIN_STATS 0 +#define OCE_TXP_SW_SZ 48 + +typedef union pci_sli_intf_u { + uint32_t dw0; + struct { +#ifdef _BIG_ENDIAN + uint32_t sli_valid:3; + uint32_t sli_hint2:5; + uint32_t sli_hint1:8; + uint32_t sli_if_type:4; + uint32_t sli_family:4; + uint32_t sli_rev:4; + uint32_t rsv0:3; + uint32_t sli_func_type:1; +#else + uint32_t sli_func_type:1; + uint32_t rsv0:3; + uint32_t sli_rev:4; + uint32_t sli_family:4; + uint32_t sli_if_type:4; + uint32_t sli_hint1:8; + uint32_t sli_hint2:5; + uint32_t sli_valid:3; +#endif + } bits; +} pci_sli_intf_t; + + + +/* physical address structure to be used in MBX */ +struct phys_addr { + /* dw0 */ + uint32_t lo; + /* dw1 */ + uint32_t hi; +}; + + + +typedef union pcicfg_intr_ctl_u { + uint32_t dw0; + struct { +#ifdef _BIG_ENDIAN + uint32_t winselect:2; + uint32_t hostintr:1; + uint32_t pfnum:3; + uint32_t vf_cev_int_line_en:1; + uint32_t winaddr:23; + uint32_t membarwinen:1; +#else + uint32_t membarwinen:1; + uint32_t winaddr:23; + uint32_t vf_cev_int_line_en:1; + uint32_t pfnum:3; + uint32_t hostintr:1; + uint32_t winselect:2; +#endif + } bits; +} pcicfg_intr_ctl_t; + + + + +typedef union pcicfg_semaphore_u { + uint32_t dw0; + struct { +#ifdef _BIG_ENDIAN + uint32_t rsvd:31; + uint32_t lock:1; +#else + uint32_t lock:1; + uint32_t rsvd:31; +#endif + } bits; +} pcicfg_semaphore_t; + + + + +typedef union pcicfg_soft_reset_u { + uint32_t dw0; + struct { +#ifdef _BIG_ENDIAN + uint32_t nec_ll_rcvdetect:8; + uint32_t dbg_all_reqs_62_49:14; + uint32_t scratchpad0:1; + uint32_t exception_oe:1; + uint32_t soft_reset:1; + uint32_t rsvd0:7; +#else + uint32_t rsvd0:7; + uint32_t soft_reset:1; + uint32_t exception_oe:1; + uint32_t scratchpad0:1; + uint32_t dbg_all_reqs_62_49:14; + uint32_t nec_ll_rcvdetect:8; +#endif + } bits; +} pcicfg_soft_reset_t; + + + + +typedef union pcicfg_online1_u { + uint32_t dw0; + struct { +#ifdef _BIG_ENDIAN + uint32_t host8_online:1; + uint32_t host7_online:1; + uint32_t host6_online:1; + uint32_t host5_online:1; + uint32_t host4_online:1; + uint32_t host3_online:1; + uint32_t host2_online:1; + uint32_t ipc_online:1; + uint32_t arm_online:1; + uint32_t txp_online:1; + uint32_t xaui_online:1; + uint32_t rxpp_online:1; + uint32_t txpb_online:1; + uint32_t rr_online:1; + uint32_t pmem_online:1; + uint32_t pctl1_online:1; + uint32_t pctl0_online:1; + uint32_t pcs1online_online:1; + uint32_t mpu_iram_online:1; + uint32_t pcs0online_online:1; + uint32_t mgmt_mac_online:1; + uint32_t lpcmemhost_online:1; +#else + uint32_t lpcmemhost_online:1; + uint32_t mgmt_mac_online:1; + uint32_t pcs0online_online:1; + uint32_t mpu_iram_online:1; + uint32_t pcs1online_online:1; + uint32_t pctl0_online:1; + uint32_t pctl1_online:1; + uint32_t pmem_online:1; + uint32_t rr_online:1; + uint32_t txpb_online:1; + uint32_t rxpp_online:1; + uint32_t xaui_online:1; + uint32_t txp_online:1; + uint32_t arm_online:1; + uint32_t ipc_online:1; + uint32_t host2_online:1; + uint32_t host3_online:1; + uint32_t host4_online:1; + uint32_t host5_online:1; + uint32_t host6_online:1; + uint32_t host7_online:1; + uint32_t host8_online:1; +#endif + } bits; +} pcicfg_online1_t; + + + +typedef union mpu_ep_semaphore_u { + uint32_t dw0; + struct { +#ifdef _BIG_ENDIAN *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 21:26:26 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 62C50106566B; Fri, 10 Feb 2012 21:26:26 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 4D6288FC15; Fri, 10 Feb 2012 21:26:26 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1ALQQYK095513; Fri, 10 Feb 2012 21:26:26 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ALQQvI095511; Fri, 10 Feb 2012 21:26:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202102126.q1ALQQvI095511@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 10 Feb 2012 21:26:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231441 - head/sys/amd64/amd64 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 21:26:26 -0000 Author: kib Date: Fri Feb 10 21:26:25 2012 New Revision: 231441 URL: http://svn.freebsd.org/changeset/base/231441 Log: In cpu_set_user_tls(), consistently set PCB_FULL_IRET pcb flag for both 64bit and 32bit binaries, not for 64bit only. The set of the flag is not neccessary there, because the only current user of the cpu_set_user_tls() is create_thread(), which calls cpu_set_upcall() before and cpu_set_upcall() itself sets PCB_FULL_IRET. Change the function for consistency and preserve existing KPI for now. MFC after: 1 week Modified: head/sys/amd64/amd64/vm_machdep.c Modified: head/sys/amd64/amd64/vm_machdep.c ============================================================================== --- head/sys/amd64/amd64/vm_machdep.c Fri Feb 10 21:07:52 2012 (r231440) +++ head/sys/amd64/amd64/vm_machdep.c Fri Feb 10 21:26:25 2012 (r231441) @@ -552,6 +552,7 @@ cpu_set_user_tls(struct thread *td, void return (EINVAL); pcb = td->td_pcb; + set_pcb_flags(pcb, PCB_FULL_IRET); #ifdef COMPAT_FREEBSD32 if (SV_PROC_FLAG(td->td_proc, SV_ILP32)) { pcb->pcb_gsbase = (register_t)tls_base; @@ -559,7 +560,6 @@ cpu_set_user_tls(struct thread *td, void } #endif pcb->pcb_fsbase = (register_t)tls_base; - set_pcb_flags(pcb, PCB_FULL_IRET); return (0); } From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 21:33:13 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E46C1065679; Fri, 10 Feb 2012 21:33:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 07C528FC26; Fri, 10 Feb 2012 21:33:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1ALXCLc095965; Fri, 10 Feb 2012 21:33:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ALXCu7095963; Fri, 10 Feb 2012 21:33:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202102133.q1ALXCu7095963@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 10 Feb 2012 21:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231443 - head/tools/test/ptrace X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 21:33:13 -0000 Author: kib Date: Fri Feb 10 21:33:12 2012 New Revision: 231443 URL: http://svn.freebsd.org/changeset/base/231443 Log: Add a test program for recently added ptrace(2) interfaces. MFC after: 1 week Added: head/tools/test/ptrace/ head/tools/test/ptrace/Makefile (contents, props changed) head/tools/test/ptrace/scescx.c (contents, props changed) Added: head/tools/test/ptrace/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/test/ptrace/Makefile Fri Feb 10 21:33:12 2012 (r231443) @@ -0,0 +1,7 @@ +# $FreeBSD$ + +PROG= scescx +NO_MAN= +WARNS?= 6 + +.include Added: head/tools/test/ptrace/scescx.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/test/ptrace/scescx.c Fri Feb 10 21:33:12 2012 (r231443) @@ -0,0 +1,406 @@ +/*- + * Copyright (c) 2011, 2012 Konstantin Belousov + * + * 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 AUTHOR 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 AUTHOR 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. + */ + +#include +__FBSDID("$FreeBSD$"); + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define TRACE ">>>> " + +static const char * +decode_wait_status(int status) +{ + static char c[128]; + char b[32]; + int first; + + c[0] = '\0'; + first = 1; + if (WIFCONTINUED(status)) { + first = 0; + strlcat(c, "CONT", sizeof(c)); + } + if (WIFEXITED(status)) { + if (first) + first = 0; + else + strlcat(c, ",", sizeof(c)); + snprintf(b, sizeof(b), "EXIT(%d)", WEXITSTATUS(status)); + strlcat(c, b, sizeof(c)); + } + if (WIFSIGNALED(status)) { + if (first) + first = 0; + else + strlcat(c, ",", sizeof(c)); + snprintf(b, sizeof(b), "SIG(%s)", strsignal(WTERMSIG(status))); + strlcat(c, b, sizeof(c)); + if (WCOREDUMP(status)) + strlcat(c, ",CORE", sizeof(c)); + } + if (WIFSTOPPED(status)) { + if (first) + first = 0; + else + strlcat(c, ",", sizeof(c)); + snprintf(b, sizeof(b), "SIG(%s)", strsignal(WSTOPSIG(status))); + strlcat(c, b, sizeof(c)); + } + return (c); +} + +static const char * +decode_pl_flags(struct ptrace_lwpinfo *lwpinfo) +{ + static char c[128]; + static struct decode_tag { + int flag; + const char *desc; + } decode[] = { + { PL_FLAG_SA, "SA" }, + { PL_FLAG_BOUND, "BOUND" }, + { PL_FLAG_SCE, "SCE" }, + { PL_FLAG_SCX, "SCX" }, + { PL_FLAG_EXEC, "EXEC" }, + { PL_FLAG_SI, "SI" }, + { PL_FLAG_FORKED, "FORKED" }, + }; + char de[32]; + unsigned first, flags, i; + + c[0] = '\0'; + first = 1; + flags = lwpinfo->pl_flags; + for (i = 0; i < sizeof(decode) / sizeof(decode[0]); i++) { + if ((flags & decode[i].flag) != 0) { + if (first) + first = 0; + else + strlcat(c, ",", sizeof(c)); + strlcat(c, decode[i].desc, sizeof(c)); + flags &= ~decode[i].flag; + } + } + for (i = 0; i < sizeof(flags) * NBBY; i++) { + if ((flags & (1 << i)) != 0) { + if (first) + first = 0; + else + strlcat(c, ",", sizeof(c)); + snprintf(de, sizeof(de), "<%d>", i); + strlcat(c, de, sizeof(c)); + } + } + return (c); +} + +static const char * +decode_pl_event(struct ptrace_lwpinfo *lwpinfo) +{ + + switch (lwpinfo->pl_event) { + case PL_EVENT_NONE: + return ("NONE"); + + case PL_EVENT_SIGNAL: + return ("SIG"); + + default: + return ("UNKNOWN"); + } +} + +static void +get_pathname(pid_t pid) +{ + char pathname[PATH_MAX]; + int error, name[4]; + size_t len; + + name[0] = CTL_KERN; + name[1] = KERN_PROC; + name[2] = KERN_PROC_PATHNAME; + name[3] = pid; + + len = sizeof(pathname); + error = sysctl(name, 4, pathname, &len, NULL, 0); + if (error < 0) { + if (errno != ESRCH) { + fprintf(stderr, "sysctl kern.proc.pathname.%d: %s\n", + pid, strerror(errno)); + return; + } + fprintf(stderr, "pid %d exited\n", pid); + return; + } + if (len == 0 || strlen(pathname) == 0) { + fprintf(stderr, "No cached pathname for process %d\n", pid); + return; + } + printf(TRACE "pid %d path %s\n", pid, pathname); +} + +static void +wait_info(int pid, int status, struct ptrace_lwpinfo *lwpinfo) +{ + + printf(TRACE "pid %d wait %s", pid, + decode_wait_status(status)); + if (lwpinfo != NULL) { + printf(" event %s flags %s", + decode_pl_event(lwpinfo), decode_pl_flags(lwpinfo)); + } + printf("\n"); +} + +static int +trace_sc(int pid) +{ + struct ptrace_lwpinfo lwpinfo; + int status; + + if (ptrace(PT_TO_SCE, pid, (caddr_t)1, 0) < 0) { + perror("PT_TO_SCE"); + ptrace(PT_KILL, pid, NULL, 0); + return (-1); + } + + if (waitpid(pid, &status, 0) == -1) { + perror("waitpid"); + return (-1); + } + if (WIFEXITED(status) || WIFSIGNALED(status)) { + wait_info(pid, status, NULL); + return (-1); + } + assert(WIFSTOPPED(status)); + assert(WSTOPSIG(status) == SIGTRAP); + + if (ptrace(PT_LWPINFO, pid, (caddr_t)&lwpinfo, sizeof(lwpinfo)) < 0) { + perror("PT_LWPINFO"); + ptrace(PT_KILL, pid, NULL, 0); + return (-1); + } + wait_info(pid, status, &lwpinfo); + assert(lwpinfo.pl_flags & PL_FLAG_SCE); + + if (ptrace(PT_TO_SCX, pid, (caddr_t)1, 0) < 0) { + perror("PT_TO_SCX"); + ptrace(PT_KILL, pid, NULL, 0); + return (-1); + } + + if (waitpid(pid, &status, 0) == -1) { + perror("waitpid"); + return (-1); + } + if (WIFEXITED(status) || WIFSIGNALED(status)) { + wait_info(pid, status, NULL); + return (-1); + } + assert(WIFSTOPPED(status)); + assert(WSTOPSIG(status) == SIGTRAP); + + if (ptrace(PT_LWPINFO, pid, (caddr_t)&lwpinfo, sizeof(lwpinfo)) < 0) { + perror("PT_LWPINFO"); + ptrace(PT_KILL, pid, NULL, 0); + return (-1); + } + wait_info(pid, status, &lwpinfo); + assert(lwpinfo.pl_flags & PL_FLAG_SCX); + + if (lwpinfo.pl_flags & PL_FLAG_EXEC) + get_pathname(pid); + + if (lwpinfo.pl_flags & PL_FLAG_FORKED) { + printf(TRACE "forked child %d\n", lwpinfo.pl_child_pid); + return (lwpinfo.pl_child_pid); + } + return (0); +} + +static int +trace_cont(int pid) +{ + struct ptrace_lwpinfo lwpinfo; + int status; + + if (ptrace(PT_CONTINUE, pid, (caddr_t)1, 0) < 0) { + perror("PT_CONTINUE"); + ptrace(PT_KILL, pid, NULL, 0); + return (-1); + } + + if (waitpid(pid, &status, 0) == -1) { + perror("waitpid"); + return (-1); + } + if (WIFEXITED(status) || WIFSIGNALED(status)) { + wait_info(pid, status, NULL); + return (-1); + } + assert(WIFSTOPPED(status)); + assert(WSTOPSIG(status) == SIGTRAP); + + if (ptrace(PT_LWPINFO, pid, (caddr_t)&lwpinfo, sizeof(lwpinfo)) < 0) { + perror("PT_LWPINFO"); + ptrace(PT_KILL, pid, NULL, 0); + return (-1); + } + wait_info(pid, status, &lwpinfo); + + if ((lwpinfo.pl_flags & (PL_FLAG_EXEC | PL_FLAG_SCX)) == + (PL_FLAG_EXEC | PL_FLAG_SCX)) + get_pathname(pid); + + if ((lwpinfo.pl_flags & (PL_FLAG_FORKED | PL_FLAG_SCX)) == + (PL_FLAG_FORKED | PL_FLAG_SCX)) { + printf(TRACE "forked child %d\n", lwpinfo.pl_child_pid); + return (lwpinfo.pl_child_pid); + } + + return (0); +} + +static int trace_syscalls = 1; + +static int +trace(pid_t pid) +{ + + return (trace_syscalls ? trace_sc(pid) : trace_cont(pid)); +} + + +int +main(int argc, char *argv[]) +{ + struct ptrace_lwpinfo lwpinfo; + int c, status, use_vfork; + pid_t pid, pid1; + + trace_syscalls = 1; + use_vfork = 0; + while ((c = getopt(argc, argv, "csv")) != -1) { + switch (c) { + case 'c': + trace_syscalls = 0; + break; + case 's': + trace_syscalls = 1; + break; + case 'v': + use_vfork = 1; + break; + default: + case '?': + fprintf(stderr, "Usage: %s [-c] [-s] [-v]\n", argv[0]); + return (2); + } + } + + if ((pid = fork()) < 0) { + perror("fork"); + return 1; + } + else if (pid == 0) { + if (ptrace(PT_TRACE_ME, 0, NULL, 0) < 0) { + perror("PT_TRACE_ME"); + _exit(1); + } + kill(getpid(), SIGSTOP); + getpid(); + if ((pid1 = use_vfork ? vfork() : fork()) < 0) { + perror("fork1"); + return (1); + } else if (pid1 == 0) { + printf("Hi from child %d\n", getpid()); + execl("/bin/ls", "ls", "/", (char *)NULL); + } + } + else { /* parent */ + if (waitpid(pid, &status, 0) == -1) { + perror("waitpid"); + return (-1); + } + assert(WIFSTOPPED(status)); + assert(WSTOPSIG(status) == SIGSTOP); + + if (ptrace(PT_LWPINFO, pid, (caddr_t)&lwpinfo, + sizeof(lwpinfo)) < 0) { + perror("PT_LWPINFO"); + ptrace(PT_KILL, pid, NULL, 0); + return (-1); + } + wait_info(pid, status, &lwpinfo); + + if (ptrace(PT_FOLLOW_FORK, pid, 0, 1) < 0) { + perror("PT_FOLLOW_FORK"); + ptrace(PT_KILL, pid, NULL, 0); + return (2); + } + + while ((pid1 = trace(pid)) >= 0) { + if (pid1 != 0) { + printf(TRACE "attached to pid %d\n", pid1); +#if 0 + kill(pid1, SIGCONT); +#endif + if (waitpid(pid1, &status, 0) == -1) { + perror("waitpid"); + return (-1); + } + printf(TRACE "nested loop, pid %d status %s\n", + pid1, decode_wait_status(status)); + assert(WIFSTOPPED(status)); + assert(WSTOPSIG(status) == SIGSTOP); + if (ptrace(PT_LWPINFO, pid1, (caddr_t)&lwpinfo, + sizeof(lwpinfo)) < 0) { + perror("PT_LWPINFO"); + ptrace(PT_KILL, pid1, NULL, 0); + return (-1); + } + wait_info(pid1, status, &lwpinfo); + + while (trace(pid1) >= 0) + ; + } + } + + ptrace(PT_CONTINUE, pid, (caddr_t)1, 0); + } + return (0); +} From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 22:16:18 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A2101065670; Fri, 10 Feb 2012 22:16:18 +0000 (UTC) (envelope-from cracauer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 547658FC12; Fri, 10 Feb 2012 22:16:18 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1AMGI7p098194; Fri, 10 Feb 2012 22:16:18 GMT (envelope-from cracauer@svn.freebsd.org) Received: (from cracauer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1AMGI0m098192; Fri, 10 Feb 2012 22:16:18 GMT (envelope-from cracauer@svn.freebsd.org) Message-Id: <201202102216.q1AMGI0m098192@svn.freebsd.org> From: Martin Cracauer Date: Fri, 10 Feb 2012 22:16:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231449 - head/usr.bin/tee X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 22:16:18 -0000 Author: cracauer Date: Fri Feb 10 22:16:17 2012 New Revision: 231449 URL: http://svn.freebsd.org/changeset/base/231449 Log: Fix bin/164947: tee looses data when writing to non-blocking file descriptors tee was not handling EAGAIN patch submitted by Diomidis Spinellis . Thanks so much reproduced and re-tested locally Modified: head/usr.bin/tee/tee.c Modified: head/usr.bin/tee/tee.c ============================================================================== --- head/usr.bin/tee/tee.c Fri Feb 10 22:14:34 2012 (r231448) +++ head/usr.bin/tee/tee.c Fri Feb 10 22:16:17 2012 (r231449) @@ -42,8 +42,10 @@ static const char rcsid[] = #endif /* not lint */ #include +#include #include #include +#include #include #include #include @@ -60,6 +62,7 @@ static LIST *head; static void add(int, const char *); static void usage(void); +static void waitfor(int fd); int main(int argc, char *argv[]) @@ -106,9 +109,14 @@ main(int argc, char *argv[]) bp = buf; do { if ((wval = write(p->fd, bp, n)) == -1) { - warn("%s", p->name); - exitval = 1; - break; + if (errno == EAGAIN) { + waitfor(p->fd); + wval = 0; + } else { + warn("%s", p->name); + exitval = 1; + break; + } } bp += wval; } while (n -= wval); @@ -137,3 +145,15 @@ add(int fd, const char *name) p->next = head; head = p; } + +/* Wait for the specified fd to be ready for writing */ +static void +waitfor(int fd) +{ + fd_set writefds; + + FD_ZERO(&writefds); + FD_SET(fd, &writefds); + if (select(fd + 1, NULL, &writefds, NULL, NULL) == -1) + err(1, "select"); +} From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 23:24:34 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 57A4C106564A; Fri, 10 Feb 2012 23:24:34 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 46C928FC0C; Fri, 10 Feb 2012 23:24:34 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1ANOYbS001593; Fri, 10 Feb 2012 23:24:34 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANOYYW001591; Fri, 10 Feb 2012 23:24:34 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201202102324.q1ANOYYW001591@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Fri, 10 Feb 2012 23:24:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231470 - head/sys/mips/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:24:34 -0000 Author: gonzo Date: Fri Feb 10 23:24:33 2012 New Revision: 231470 URL: http://svn.freebsd.org/changeset/base/231470 Log: - Reverse logic so base tls is fixed up with correct number Modified: head/sys/mips/mips/vm_machdep.c Modified: head/sys/mips/mips/vm_machdep.c ============================================================================== --- head/sys/mips/mips/vm_machdep.c Fri Feb 10 23:19:33 2012 (r231469) +++ head/sys/mips/mips/vm_machdep.c Fri Feb 10 23:24:33 2012 (r231470) @@ -608,7 +608,7 @@ cpu_set_user_tls(struct thread *td, void * to make it the same way TLS base is passed to * MIPS_SET_TLS/MIPS_GET_TLS API */ -#ifndef __mips_n64 +#ifdef __mips_n64 td->td_md.md_tls = (char*)tls_base + 0x7010; #else td->td_md.md_tls = (char*)tls_base + 0x7008; From owner-svn-src-head@FreeBSD.ORG Fri Feb 10 23:30:30 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 39197106564A; Fri, 10 Feb 2012 23:30:30 +0000 (UTC) (envelope-from jkim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 2828B8FC0C; Fri, 10 Feb 2012 23:30:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1ANUUfh001931; Fri, 10 Feb 2012 23:30:30 GMT (envelope-from jkim@svn.freebsd.org) Received: (from jkim@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1ANUUMT001929; Fri, 10 Feb 2012 23:30:30 GMT (envelope-from jkim@svn.freebsd.org) Message-Id: <201202102330.q1ANUUMT001929@svn.freebsd.org> From: Jung-uk Kim Date: Fri, 10 Feb 2012 23:30:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231474 - head/sys/dev/acpica/Osd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Feb 2012 23:30:30 -0000 Author: jkim Date: Fri Feb 10 23:30:29 2012 New Revision: 231474 URL: http://svn.freebsd.org/changeset/base/231474 Log: De-obfuscate acpi_acquire_global_lock(). It seems the function was directly translated from i386 assembly version. Modified: head/sys/dev/acpica/Osd/OsdSynch.c Modified: head/sys/dev/acpica/Osd/OsdSynch.c ============================================================================== --- head/sys/dev/acpica/Osd/OsdSynch.c Fri Feb 10 23:29:08 2012 (r231473) +++ head/sys/dev/acpica/Osd/OsdSynch.c Fri Feb 10 23:30:29 2012 (r231474) @@ -566,11 +566,8 @@ AcpiOsReleaseLock(ACPI_SPINLOCK Handle, } /* Section 5.2.10.1: global lock acquire/release functions */ -#define GL_ACQUIRED (-1) -#define GL_BUSY 0 #define GL_BIT_PENDING 0x01 #define GL_BIT_OWNED 0x02 -#define GL_BIT_MASK (GL_BIT_PENDING | GL_BIT_OWNED) /* * Acquire the global lock. If busy, set the pending bit. The caller @@ -584,11 +581,12 @@ acpi_acquire_global_lock(uint32_t *lock) do { old = *lock; - new = ((old & ~GL_BIT_MASK) | GL_BIT_OWNED) | - ((old >> 1) & GL_BIT_PENDING); + new = (old & ~GL_BIT_PENDING) | GL_BIT_OWNED; + if ((old & GL_BIT_OWNED) != 0) + new |= GL_BIT_PENDING; } while (atomic_cmpset_acq_int(lock, old, new) == 0); - return ((new < GL_BIT_MASK) ? GL_ACQUIRED : GL_BUSY); + return ((new & GL_BIT_PENDING) == 0); } /* @@ -603,8 +601,8 @@ acpi_release_global_lock(uint32_t *lock) do { old = *lock; - new = old & ~GL_BIT_MASK; + new = old & ~(GL_BIT_PENDING | GL_BIT_OWNED); } while (atomic_cmpset_rel_int(lock, old, new) == 0); - return (old & GL_BIT_PENDING); + return ((old & GL_BIT_PENDING) != 0); } From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 00:28:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0ACBE106566C; Sat, 11 Feb 2012 00:28:31 +0000 (UTC) (envelope-from ken@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id EE3B98FC08; Sat, 11 Feb 2012 00:28:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1B0SURK004250; Sat, 11 Feb 2012 00:28:30 GMT (envelope-from ken@svn.freebsd.org) Received: (from ken@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B0SUKD004248; Sat, 11 Feb 2012 00:28:30 GMT (envelope-from ken@svn.freebsd.org) Message-Id: <201202110028.q1B0SUKD004248@svn.freebsd.org> From: "Kenneth D. Merry" Date: Sat, 11 Feb 2012 00:28:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231485 - head/sys/dev/mps X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 00:28:31 -0000 Author: ken Date: Sat Feb 11 00:28:30 2012 New Revision: 231485 URL: http://svn.freebsd.org/changeset/base/231485 Log: Return BUS_PROBE_DEFAULT instead of BUS_PROBE_VENDOR from the mps driver probe routine. This will allow LSI to ship drivers that return BUS_PROBE_VENDOR to override the in-tree version of the driver. MFC after: 3 days Modified: head/sys/dev/mps/mps_pci.c Modified: head/sys/dev/mps/mps_pci.c ============================================================================== --- head/sys/dev/mps/mps_pci.c Sat Feb 11 00:19:31 2012 (r231484) +++ head/sys/dev/mps/mps_pci.c Sat Feb 11 00:28:30 2012 (r231485) @@ -172,7 +172,7 @@ mps_pci_probe(device_t dev) if ((id = mps_find_ident(dev)) != NULL) { device_set_desc(dev, id->desc); - return (BUS_PROBE_VENDOR); + return (BUS_PROBE_DEFAULT); } return (ENXIO); } From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 00:54:58 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 55067106567A; Sat, 11 Feb 2012 00:54:58 +0000 (UTC) (envelope-from gonzo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 43DEC8FC1E; Sat, 11 Feb 2012 00:54:58 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1B0sv4N005360; Sat, 11 Feb 2012 00:54:57 GMT (envelope-from gonzo@svn.freebsd.org) Received: (from gonzo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B0sv4G005356; Sat, 11 Feb 2012 00:54:57 GMT (envelope-from gonzo@svn.freebsd.org) Message-Id: <201202110054.q1B0sv4G005356@svn.freebsd.org> From: Oleksandr Tymoshenko Date: Sat, 11 Feb 2012 00:54:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231491 - head/libexec/rtld-elf/mips X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 00:54:58 -0000 Author: gonzo Date: Sat Feb 11 00:54:57 2012 New Revision: 231491 URL: http://svn.freebsd.org/changeset/base/231491 Log: Add handlers for TLS-related relocation entries Modified: head/libexec/rtld-elf/mips/reloc.c head/libexec/rtld-elf/mips/rtld_machdep.h Modified: head/libexec/rtld-elf/mips/reloc.c ============================================================================== --- head/libexec/rtld-elf/mips/reloc.c Sat Feb 11 00:54:24 2012 (r231490) +++ head/libexec/rtld-elf/mips/reloc.c Sat Feb 11 00:54:57 2012 (r231491) @@ -446,6 +446,89 @@ reloc_non_plt(Obj_Entry *obj, Obj_Entry break; } +#ifdef __mips_n64 + case R_TYPE(TLS_DTPMOD64): +#else + case R_TYPE(TLS_DTPMOD32): +#endif + { + + const size_t rlen = sizeof(Elf_Addr); + Elf_Addr old = load_ptr(where, rlen); + Elf_Addr val = old; + + def = find_symdef(r_symndx, obj, &defobj, false, NULL, + lockstate); + if (def == NULL) + return -1; + + val += (Elf_Addr)defobj->tlsindex; + + store_ptr(where, val, rlen); + dbg("DTPMOD %s in %s %p --> %p in %s", + obj->strtab + obj->symtab[r_symndx].st_name, + obj->path, (void *)old, (void*)val, defobj->path); + break; + } + +#ifdef __mips_n64 + case R_TYPE(TLS_DTPREL64): +#else + case R_TYPE(TLS_DTPREL32): +#endif + { + const size_t rlen = sizeof(Elf_Addr); + Elf_Addr old = load_ptr(where, rlen); + Elf_Addr val = old; + + def = find_symdef(r_symndx, obj, &defobj, false, NULL, + lockstate); + if (def == NULL) + return -1; + + if (!defobj->tls_done && allocate_tls_offset(obj)) + return -1; + + val += (Elf_Addr)def->st_value - TLS_DTP_OFFSET; + store_ptr(where, val, rlen); + + dbg("DTPREL %s in %s %p --> %p in %s", + obj->strtab + obj->symtab[r_symndx].st_name, + obj->path, (void*)old, (void *)val, defobj->path); + break; + } + +#ifdef __mips_n64 + case R_TYPE(TLS_TPREL64): +#else + case R_TYPE(TLS_TPREL32): +#endif + { + const size_t rlen = sizeof(Elf_Addr); + Elf_Addr old = load_ptr(where, rlen); + Elf_Addr val = old; + + def = find_symdef(r_symndx, obj, &defobj, false, NULL, + lockstate); + + if (def == NULL) + return -1; + + if (!defobj->tls_done && allocate_tls_offset(obj)) + return -1; + + val += (Elf_Addr)(def->st_value + defobj->tlsoffset + - TLS_TP_OFFSET - TLS_TCB_SIZE); + store_ptr(where, val, rlen); + + dbg("TPREL %s in %s %p --> %p in %s", + obj->strtab + obj->symtab[r_symndx].st_name, + obj->path, (void*)old, (void *)val, defobj->path); + break; + } + + + default: dbg("sym = %lu, type = %lu, offset = %p, " "contents = %p, symbol = %s", @@ -554,7 +637,7 @@ __tls_get_addr(tls_index* ti) sysarch(MIPS_GET_TLS, &tls); p = tls_get_addr_common((Elf_Addr**)((Elf_Addr)tls - TLS_TP_OFFSET - - TLS_TCB_SIZE), ti->ti_module, ti->ti_offset); + - TLS_TCB_SIZE), ti->ti_module, ti->ti_offset + TLS_DTP_OFFSET); - return (p + TLS_DTV_OFFSET); + return (p); } Modified: head/libexec/rtld-elf/mips/rtld_machdep.h ============================================================================== --- head/libexec/rtld-elf/mips/rtld_machdep.h Sat Feb 11 00:54:24 2012 (r231490) +++ head/libexec/rtld-elf/mips/rtld_machdep.h Sat Feb 11 00:54:57 2012 (r231491) @@ -53,7 +53,8 @@ Elf_Addr reloc_jmpslot(Elf_Addr *where, */ #define TLS_TP_OFFSET 0x7000 -#define TLS_DTV_OFFSET 0x8000 +#define TLS_DTP_OFFSET 0x8000 + #ifdef __mips_n64 #define TLS_TCB_SIZE 16 #else From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 04:12:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7EF6A106566C; Sat, 11 Feb 2012 04:12:12 +0000 (UTC) (envelope-from davidxu@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6E15D8FC08; Sat, 11 Feb 2012 04:12:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1B4CC3g012557; Sat, 11 Feb 2012 04:12:12 GMT (envelope-from davidxu@svn.freebsd.org) Received: (from davidxu@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B4CCYf012555; Sat, 11 Feb 2012 04:12:12 GMT (envelope-from davidxu@svn.freebsd.org) Message-Id: <201202110412.q1B4CCYf012555@svn.freebsd.org> From: David Xu Date: Sat, 11 Feb 2012 04:12:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231503 - head/lib/libthr/thread X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 04:12:12 -0000 Author: davidxu Date: Sat Feb 11 04:12:12 2012 New Revision: 231503 URL: http://svn.freebsd.org/changeset/base/231503 Log: Make code more stable by checking NULL pointers. Modified: head/lib/libthr/thread/thr_list.c Modified: head/lib/libthr/thread/thr_list.c ============================================================================== --- head/lib/libthr/thread/thr_list.c Sat Feb 11 01:17:27 2012 (r231502) +++ head/lib/libthr/thread/thr_list.c Sat Feb 11 04:12:12 2012 (r231503) @@ -154,8 +154,12 @@ _thr_alloc(struct pthread *curthread) atomic_fetchadd_int(&total_threads, -1); return (NULL); } - thread->sleepqueue = _sleepq_alloc(); - thread->wake_addr = _thr_alloc_wake_addr(); + if ((thread->sleepqueue = _sleepq_alloc()) == NULL || + (thread->wake_addr = _thr_alloc_wake_addr()) == NULL) { + thr_destroy(curthread, thread); + atomic_fetchadd_int(&total_threads, -1); + return (NULL); + } } else { bzero(&thread->_pthread_startzero, __rangeof(struct pthread, _pthread_startzero, _pthread_endzero)); From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 04:52:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 801A6106566B; Sat, 11 Feb 2012 04:52:32 +0000 (UTC) (envelope-from lists@eitanadler.com) Received: from mail-ww0-f50.google.com (mail-ww0-f50.google.com [74.125.82.50]) by mx1.freebsd.org (Postfix) with ESMTP id 8CFBE8FC08; Sat, 11 Feb 2012 04:52:31 +0000 (UTC) Received: by wgbdq11 with SMTP id dq11so3504583wgb.31 for ; Fri, 10 Feb 2012 20:52:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eitanadler.com; s=0xdeadbeef; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=1YYr0EONly28Uf1/nT4TPXM+QwOSMK/EhrWuog8SRJw=; b=GsLPvS3ixxhAyKkhCHqJbGKmU2OmFwOQXDBac2GVCi8vGnrGZpcd4OnEWkoIyjfOPQ +7C7K6kGBNaQ0c+c7CeTsNSD/iliU75sSxDpekgh0WyhHnwtE3EpcjAJM6SNWPquGspA 8eItdmD7E7m0SdFWoCHS+oRN6IHJdEntIJrQs= Received: by 10.216.135.138 with SMTP id u10mr1763160wei.43.1328935950249; Fri, 10 Feb 2012 20:52:30 -0800 (PST) MIME-Version: 1.0 Sender: lists@eitanadler.com Received: by 10.223.103.10 with HTTP; Fri, 10 Feb 2012 20:52:00 -0800 (PST) In-Reply-To: <201202102216.q1AMGI0m098192@svn.freebsd.org> References: <201202102216.q1AMGI0m098192@svn.freebsd.org> From: Eitan Adler Date: Fri, 10 Feb 2012 23:52:00 -0500 X-Google-Sender-Auth: iR4ff0MEQUSrgbEBA2KIUSBd-Ho Message-ID: To: Martin Cracauer Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Gm-Message-State: ALoCoQk8FL/RM5URDI6H31BCEqgcSvoPIGF25lbUwmqysrM0XRd/oBGp5nhYu3XMi0wAUcjG1b7e Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231449 - head/usr.bin/tee X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 04:52:32 -0000 On Fri, Feb 10, 2012 at 5:16 PM, Martin Cracauer wro= te: > Author: cracauer > Date: Fri Feb 10 22:16:17 2012 > New Revision: 231449 > URL: http://svn.freebsd.org/changeset/base/231449 > > Log: > =C2=A0Fix bin/164947: tee looses data when writing to non-blocking file d= escriptors > =C2=A0tee was not handling EAGAIN > =C2=A0patch submitted by Diomidis Spinellis . Thanks so much > =C2=A0reproduced and re-tested locally Can you please include the standard lines for the commit log (PR, Submitted by, etc). Some of us have scripts that depend on those fields. --=20 Eitan Adler Source & Ports committer X11, Bugbusting teams From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 05:59:55 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2DDD1106566C; Sat, 11 Feb 2012 05:59:55 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 02C388FC17; Sat, 11 Feb 2012 05:59:55 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1B5xsHv015851; Sat, 11 Feb 2012 05:59:54 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B5xsae015847; Sat, 11 Feb 2012 05:59:54 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202110559.q1B5xsae015847@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 11 Feb 2012 05:59:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231504 - in head: lib/libc/net sys/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 05:59:55 -0000 Author: bz Date: Sat Feb 11 05:59:54 2012 New Revision: 231504 URL: http://svn.freebsd.org/changeset/base/231504 Log: Backout changes from r228571. Remove if_data from struct ifa_msghdr again. While this breaks carp on HEAD temporary, it restores the upgrade path from stable, and head before 20111215. Reviewed by: glebius, brooks Modified: head/lib/libc/net/getifaddrs.c head/sys/net/if.h head/sys/net/rtsock.c Modified: head/lib/libc/net/getifaddrs.c ============================================================================== --- head/lib/libc/net/getifaddrs.c Sat Feb 11 04:12:12 2012 (r231503) +++ head/lib/libc/net/getifaddrs.c Sat Feb 11 05:59:54 2012 (r231504) @@ -76,7 +76,7 @@ __FBSDID("$FreeBSD$"); #define HAVE_IFM_DATA #endif -#if (_BSDI_VERSION >= 199802) || (__FreeBSD_version >= 1000003) +#if _BSDI_VERSION >= 199802 /* ifam_data is very specific to recent versions of bsdi */ #define HAVE_IFAM_DATA #endif Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Sat Feb 11 04:12:12 2012 (r231503) +++ head/sys/net/if.h Sat Feb 11 05:59:54 2012 (r231504) @@ -267,8 +267,6 @@ struct ifa_msghdr { int ifam_flags; /* value of ifa_flags */ u_short ifam_index; /* index for associated ifp */ int ifam_metric; /* value of ifa_metric */ - struct if_data ifam_data;/* statistics and other data about if or - * address */ }; /* Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sat Feb 11 04:12:12 2012 (r231503) +++ head/sys/net/rtsock.c Sat Feb 11 05:59:54 2012 (r231504) @@ -1606,10 +1606,6 @@ sysctl_iflist(int af, struct walkarg *w) ifam->ifam_flags = ifa->ifa_flags; ifam->ifam_metric = ifa->ifa_metric; ifam->ifam_addrs = info.rti_addrs; - ifam->ifam_data = ifa->if_data; - if (carp_get_vhid_p != NULL) - ifam->ifam_data.ifi_vhid = - (*carp_get_vhid_p)(ifa); error = SYSCTL_OUT(w->w_req, w->w_tmem, len); if (error) goto done; From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 06:02:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B1921065670; Sat, 11 Feb 2012 06:02:17 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 58FE58FC14; Sat, 11 Feb 2012 06:02:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1B62HNa015990; Sat, 11 Feb 2012 06:02:17 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B62Hx2015984; Sat, 11 Feb 2012 06:02:17 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202110602.q1B62Hx2015984@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 11 Feb 2012 06:02:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231505 - in head: lib/libc/gen sys/net sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 06:02:17 -0000 Author: bz Date: Sat Feb 11 06:02:16 2012 New Revision: 231505 URL: http://svn.freebsd.org/changeset/base/231505 Log: Introduce a new NET_RT_IFLISTL API to query the address list. It works on extended and extensible structs if_msghdrl and ifa_msghdrl. This will allow us to extend both the msghdrl structs and eventually if_data in the future without breaking the ABI. Bump __FreeBSD_version to allow ports to more easily detect the new API. Reviewed by: glebius, brooks MFC after: 3 days Modified: head/lib/libc/gen/sysctl.3 head/sys/net/if.h head/sys/net/rtsock.c head/sys/sys/param.h head/sys/sys/socket.h Modified: head/lib/libc/gen/sysctl.3 ============================================================================== --- head/lib/libc/gen/sysctl.3 Sat Feb 11 05:59:54 2012 (r231504) +++ head/lib/libc/gen/sysctl.3 Sat Feb 11 06:02:16 2012 (r231505) @@ -28,7 +28,7 @@ .\" @(#)sysctl.3 8.4 (Berkeley) 5/9/95 .\" $FreeBSD$ .\" -.Dd April 25, 2010 +.Dd February 11, 2012 .Dt SYSCTL 3 .Os .Sh NAME @@ -554,6 +554,7 @@ The fifth and sixth level names are as f .It "NET_RT_DUMP None" .It "NET_RT_IFLIST 0 or if_index" .It "NET_RT_IFMALIST 0 or if_index" +.It "NET_RT_IFLISTL 0 or if_index" .El .Pp The @@ -561,6 +562,19 @@ The name returns information about multicast group memberships on all interfaces if 0 is specified, or for the interface specified by .Va if_index . +.Pp +The +.Dv NET_RT_IFLISTL +is like +.Dv NET_RT_IFLIST , +just returning message header structs with additional fields allowing the +interface to be extended without breaking binary compatibility. +The +.Dv NET_RT_IFLISTL +uses 'l' versions of the message header structures: +.Va struct if_msghdrl +and +.Va struct ifa_msghdrl . .It Li PF_INET Get or set various global information about the IPv4 (Internet Protocol version 4). Modified: head/sys/net/if.h ============================================================================== --- head/sys/net/if.h Sat Feb 11 05:59:54 2012 (r231504) +++ head/sys/net/if.h Sat Feb 11 06:02:16 2012 (r231505) @@ -244,6 +244,7 @@ struct if_data { /* * Message format for use in obtaining information about interfaces * from getkerninfo and the routing socket + * For the new, extensible interface see struct if_msghdrl below. */ struct if_msghdr { u_short ifm_msglen; /* to skip over non-understood messages */ @@ -256,8 +257,34 @@ struct if_msghdr { }; /* + * The 'l' version shall be used by new interfaces, like NET_RT_IFLISTL. It is + * extensible after ifm_data_off or within ifm_data. Both the if_msghdr and + * if_data now have a member field detailing the struct length in addition to + * the routing message length. Macros are provided to find the start of + * ifm_data and the start of the socket address strucutres immediately following + * struct if_msghdrl given a pointer to struct if_msghdrl. + */ +#define IF_MSGHDRL_IFM_DATA(_l) \ + (struct if_data *)((char *)(_l) + (_l)->ifm_data_off) +#define IF_MSGHDRL_RTA(_l) \ + (void *)((uintptr_t)(_l) + (_l)->ifm_len) +struct if_msghdrl { + u_short ifm_msglen; /* to skip over non-understood messages */ + u_char ifm_version; /* future binary compatibility */ + u_char ifm_type; /* message type */ + int ifm_addrs; /* like rtm_addrs */ + int ifm_flags; /* value of if_flags */ + u_short ifm_index; /* index for associated ifp */ + u_short _ifm_spare1; /* spare space to grow if_index, see if_var.h */ + u_short ifm_len; /* length of if_msghdrl incl. if_data */ + u_short ifm_data_off; /* offset of if_data from beginning */ + struct if_data ifm_data;/* statistics and other data about if */ +}; + +/* * Message format for use in obtaining information about interface addresses * from getkerninfo and the routing socket + * For the new, extensible interface see struct ifa_msghdrl below. */ struct ifa_msghdr { u_short ifam_msglen; /* to skip over non-understood messages */ @@ -270,6 +297,33 @@ struct ifa_msghdr { }; /* + * The 'l' version shall be used by new interfaces, like NET_RT_IFLISTL. It is + * extensible after ifam_metric or within ifam_data. Both the ifa_msghdrl and + * if_data now have a member field detailing the struct length in addition to + * the routing message length. Macros are provided to find the start of + * ifm_data and the start of the socket address strucutres immediately following + * struct ifa_msghdrl given a pointer to struct ifa_msghdrl. + */ +#define IFA_MSGHDRL_IFAM_DATA(_l) \ + (struct if_data *)((char *)(_l) + (_l)->ifam_data_off) +#define IFA_MSGHDRL_RTA(_l) \ + (void *)((uintptr_t)(_l) + (_l)->ifam_len) +struct ifa_msghdrl { + u_short ifam_msglen; /* to skip over non-understood messages */ + u_char ifam_version; /* future binary compatibility */ + u_char ifam_type; /* message type */ + int ifam_addrs; /* like rtm_addrs */ + int ifam_flags; /* value of ifa_flags */ + u_short ifam_index; /* index for associated ifp */ + u_short _ifam_spare1; /* spare space to grow if_index, see if_var.h */ + u_short ifam_len; /* length of ifa_msghdrl incl. if_data */ + u_short ifam_data_off; /* offset of if_data from beginning */ + int ifam_metric; /* value of ifa_metric */ + struct if_data ifam_data;/* statistics and other data about if or + * address */ +}; + +/* * Message format for use in obtaining information about multicast addresses * from the routing socket */ Modified: head/sys/net/rtsock.c ============================================================================== --- head/sys/net/rtsock.c Sat Feb 11 05:59:54 2012 (r231504) +++ head/sys/net/rtsock.c Sat Feb 11 06:02:16 2012 (r231505) @@ -115,7 +115,34 @@ struct if_msghdr32 { uint16_t ifm_index; struct if_data32 ifm_data; }; -#endif + +struct if_msghdrl32 { + uint16_t ifm_msglen; + uint8_t ifm_version; + uint8_t ifm_type; + int32_t ifm_addrs; + int32_t ifm_flags; + uint16_t ifm_index; + uint16_t _ifm_spare1; + uint16_t ifm_len; + uint16_t ifm_data_off; + struct if_data32 ifm_data; +}; + +struct ifa_msghdrl32 { + uint16_t ifam_msglen; + uint8_t ifam_version; + uint8_t ifam_type; + int32_t ifam_addrs; + int32_t ifam_flags; + uint16_t ifam_index; + uint16_t _ifam_spare1; + uint16_t ifam_len; + uint16_t ifam_data_off; + int32_t ifam_metric; + struct if_data32 ifam_data; +}; +#endif /* COMPAT_FREEBSD32 */ MALLOC_DEFINE(M_RTABLE, "routetbl", "routing tables"); @@ -1014,6 +1041,9 @@ rt_xaddrs(caddr_t cp, caddr_t cplim, str return (0); } +/* + * Used by the routing socket. + */ static struct mbuf * rt_msg1(int type, struct rt_addrinfo *rtinfo) { @@ -1081,6 +1111,9 @@ rt_msg1(int type, struct rt_addrinfo *rt return (m); } +/* + * Used by the sysctl code and routing socket. + */ static int rt_msg2(int type, struct rt_addrinfo *rtinfo, caddr_t cp, struct walkarg *w) { @@ -1094,17 +1127,31 @@ again: case RTM_DELADDR: case RTM_NEWADDR: - len = sizeof(struct ifa_msghdr); + if (w != NULL && w->w_op == NET_RT_IFLISTL) { +#ifdef COMPAT_FREEBSD32 + if (w->w_req->flags & SCTL_MASK32) + len = sizeof(struct ifa_msghdrl32); + else +#endif + len = sizeof(struct ifa_msghdrl); + } else + len = sizeof(struct ifa_msghdr); break; case RTM_IFINFO: #ifdef COMPAT_FREEBSD32 if (w != NULL && w->w_req->flags & SCTL_MASK32) { - len = sizeof(struct if_msghdr32); + if (w->w_op == NET_RT_IFLISTL) + len = sizeof(struct if_msghdrl32); + else + len = sizeof(struct if_msghdr32); break; } #endif - len = sizeof(struct if_msghdr); + if (w != NULL && w->w_op == NET_RT_IFLISTL) + len = sizeof(struct if_msghdrl); + else + len = sizeof(struct if_msghdr); break; case RTM_NEWMADDR: @@ -1535,6 +1582,147 @@ copy_ifdata32(struct if_data *src, struc #endif static int +sysctl_iflist_ifml(struct ifnet *ifp, struct rt_addrinfo *info, + struct walkarg *w, int len) +{ + struct if_msghdrl *ifm; + +#ifdef COMPAT_FREEBSD32 + if (w->w_req->flags & SCTL_MASK32) { + struct if_msghdrl32 *ifm32; + + ifm32 = (struct if_msghdrl32 *)w->w_tmem; + ifm32->ifm_addrs = info->rti_addrs; + ifm32->ifm_flags = ifp->if_flags | ifp->if_drv_flags; + ifm32->ifm_index = ifp->if_index; + ifm32->_ifm_spare1 = 0; + ifm32->ifm_len = sizeof(*ifm32); + ifm32->ifm_data_off = offsetof(struct if_msghdrl32, ifm_data); + + copy_ifdata32(&ifp->if_data, &ifm32->ifm_data); + /* Fixup if_data carp(4) vhid. */ + if (carp_get_vhid_p != NULL) + ifm32->ifm_data.ifi_vhid = + (*carp_get_vhid_p)(ifp->if_addr); + + return (SYSCTL_OUT(w->w_req, (caddr_t)ifm32, len)); + } +#endif + ifm = (struct if_msghdrl *)w->w_tmem; + ifm->ifm_addrs = info->rti_addrs; + ifm->ifm_flags = ifp->if_flags | ifp->if_drv_flags; + ifm->ifm_index = ifp->if_index; + ifm->_ifm_spare1 = 0; + ifm->ifm_len = sizeof(*ifm); + ifm->ifm_data_off = offsetof(struct if_msghdrl, ifm_data); + + ifm->ifm_data = ifp->if_data; + /* Fixup if_data carp(4) vhid. */ + if (carp_get_vhid_p != NULL) + ifm->ifm_data.ifi_vhid = (*carp_get_vhid_p)(ifp->if_addr); + + return (SYSCTL_OUT(w->w_req, (caddr_t)ifm, len)); +} + +static int +sysctl_iflist_ifm(struct ifnet *ifp, struct rt_addrinfo *info, + struct walkarg *w, int len) +{ + struct if_msghdr *ifm; + +#ifdef COMPAT_FREEBSD32 + if (w->w_req->flags & SCTL_MASK32) { + struct if_msghdr32 *ifm32; + + ifm32 = (struct if_msghdr32 *)w->w_tmem; + ifm32->ifm_addrs = info->rti_addrs; + ifm32->ifm_flags = ifp->if_flags | ifp->if_drv_flags; + ifm32->ifm_index = ifp->if_index; + + copy_ifdata32(&ifp->if_data, &ifm32->ifm_data); + /* Fixup if_data carp(4) vhid. */ + if (carp_get_vhid_p != NULL) + ifm32->ifm_data.ifi_vhid = + (*carp_get_vhid_p)(ifp->if_addr); + + return (SYSCTL_OUT(w->w_req, (caddr_t)ifm32, len)); + } +#endif + ifm = (struct if_msghdr *)w->w_tmem; + ifm->ifm_addrs = info->rti_addrs; + ifm->ifm_flags = ifp->if_flags | ifp->if_drv_flags; + ifm->ifm_index = ifp->if_index; + + ifm->ifm_data = ifp->if_data; + /* Fixup if_data carp(4) vhid. */ + if (carp_get_vhid_p != NULL) + ifm->ifm_data.ifi_vhid = (*carp_get_vhid_p)(ifp->if_addr); + + return (SYSCTL_OUT(w->w_req, (caddr_t)ifm, len)); +} + +static int +sysctl_iflist_ifaml(struct ifaddr *ifa, struct rt_addrinfo *info, + struct walkarg *w, int len) +{ + struct ifa_msghdrl *ifam; + +#ifdef COMPAT_FREEBSD32 + if (w->w_req->flags & SCTL_MASK32) { + struct ifa_msghdrl32 *ifam32; + + ifam32 = (struct ifa_msghdrl32 *)w->w_tmem; + ifam32->ifam_addrs = info->rti_addrs; + ifam32->ifam_flags = ifa->ifa_flags; + ifam32->ifam_index = ifa->ifa_ifp->if_index; + ifam32->_ifam_spare1 = 0; + ifam32->ifam_len = sizeof(*ifam32); + ifam32->ifam_data_off = + offsetof(struct ifa_msghdrl32, ifam_data); + ifam32->ifam_metric = ifa->ifa_metric; + + copy_ifdata32(&ifa->ifa_ifp->if_data, &ifam32->ifam_data); + /* Fixup if_data carp(4) vhid. */ + if (carp_get_vhid_p != NULL) + ifam32->ifam_data.ifi_vhid = (*carp_get_vhid_p)(ifa); + + return (SYSCTL_OUT(w->w_req, (caddr_t)ifam32, len)); + } +#endif + + ifam = (struct ifa_msghdrl *)w->w_tmem; + ifam->ifam_addrs = info->rti_addrs; + ifam->ifam_flags = ifa->ifa_flags; + ifam->ifam_index = ifa->ifa_ifp->if_index; + ifam->_ifam_spare1 = 0; + ifam->ifam_len = sizeof(*ifam); + ifam->ifam_data_off = offsetof(struct ifa_msghdrl, ifam_data); + ifam->ifam_metric = ifa->ifa_metric; + + ifam->ifam_data = ifa->if_data; + /* Fixup if_data carp(4) vhid. */ + if (carp_get_vhid_p != NULL) + ifam->ifam_data.ifi_vhid = (*carp_get_vhid_p)(ifa); + + return (SYSCTL_OUT(w->w_req, w->w_tmem, len)); +} + +static int +sysctl_iflist_ifam(struct ifaddr *ifa, struct rt_addrinfo *info, + struct walkarg *w, int len) +{ + struct ifa_msghdr *ifam; + + ifam = (struct ifa_msghdr *)w->w_tmem; + ifam->ifam_addrs = info->rti_addrs; + ifam->ifam_flags = ifa->ifa_flags; + ifam->ifam_index = ifa->ifa_ifp->if_index; + ifam->ifam_metric = ifa->ifa_metric; + + return (SYSCTL_OUT(w->w_req, w->w_tmem, len)); +} + +static int sysctl_iflist(int af, struct walkarg *w) { struct ifnet *ifp; @@ -1553,38 +1741,10 @@ sysctl_iflist(int af, struct walkarg *w) len = rt_msg2(RTM_IFINFO, &info, NULL, w); info.rti_info[RTAX_IFP] = NULL; if (w->w_req && w->w_tmem) { - struct if_msghdr *ifm; - -#ifdef COMPAT_FREEBSD32 - if (w->w_req->flags & SCTL_MASK32) { - struct if_msghdr32 *ifm32; - - ifm32 = (struct if_msghdr32 *)w->w_tmem; - ifm32->ifm_index = ifp->if_index; - ifm32->ifm_flags = ifp->if_flags | - ifp->if_drv_flags; - copy_ifdata32(&ifp->if_data, &ifm32->ifm_data); - if (carp_get_vhid_p != NULL) - ifm32->ifm_data.ifi_vhid = - (*carp_get_vhid_p)(ifa); - ifm32->ifm_addrs = info.rti_addrs; - error = SYSCTL_OUT(w->w_req, (caddr_t)ifm32, - len); - goto sysctl_out; - } -#endif - ifm = (struct if_msghdr *)w->w_tmem; - ifm->ifm_index = ifp->if_index; - ifm->ifm_flags = ifp->if_flags | ifp->if_drv_flags; - ifm->ifm_data = ifp->if_data; - if (carp_get_vhid_p != NULL) - ifm->ifm_data.ifi_vhid = - (*carp_get_vhid_p)(ifa); - ifm->ifm_addrs = info.rti_addrs; - error = SYSCTL_OUT(w->w_req, (caddr_t)ifm, len); -#ifdef COMPAT_FREEBSD32 - sysctl_out: -#endif + if (w->w_op == NET_RT_IFLISTL) + error = sysctl_iflist_ifml(ifp, &info, w, len); + else + error = sysctl_iflist_ifm(ifp, &info, w, len); if (error) goto done; } @@ -1599,14 +1759,12 @@ sysctl_iflist(int af, struct walkarg *w) info.rti_info[RTAX_BRD] = ifa->ifa_dstaddr; len = rt_msg2(RTM_NEWADDR, &info, NULL, w); if (w->w_req && w->w_tmem) { - struct ifa_msghdr *ifam; - - ifam = (struct ifa_msghdr *)w->w_tmem; - ifam->ifam_index = ifa->ifa_ifp->if_index; - ifam->ifam_flags = ifa->ifa_flags; - ifam->ifam_metric = ifa->ifa_metric; - ifam->ifam_addrs = info.rti_addrs; - error = SYSCTL_OUT(w->w_req, w->w_tmem, len); + if (w->w_op == NET_RT_IFLISTL) + error = sysctl_iflist_ifaml(ifa, &info, + w, len); + else + error = sysctl_iflist_ifam(ifa, &info, + w, len); if (error) goto done; } @@ -1736,6 +1894,7 @@ sysctl_rtsock(SYSCTL_HANDLER_ARGS) break; case NET_RT_IFLIST: + case NET_RT_IFLISTL: error = sysctl_iflist(af, &w); break; Modified: head/sys/sys/param.h ============================================================================== --- head/sys/sys/param.h Sat Feb 11 05:59:54 2012 (r231504) +++ head/sys/sys/param.h Sat Feb 11 06:02:16 2012 (r231505) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1000007 /* Master, propagated to newvers */ +#define __FreeBSD_version 1000008 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, Modified: head/sys/sys/socket.h ============================================================================== --- head/sys/sys/socket.h Sat Feb 11 05:59:54 2012 (r231504) +++ head/sys/sys/socket.h Sat Feb 11 06:02:16 2012 (r231505) @@ -396,7 +396,9 @@ struct sockproto { #define NET_RT_FLAGS 2 /* by flags, e.g. RESOLVING */ #define NET_RT_IFLIST 3 /* survey interface list */ #define NET_RT_IFMALIST 4 /* return multicast address list */ -#define NET_RT_MAXID 5 +#define NET_RT_IFLISTL 5 /* Survey interface list, using 'l'en + * versions of msghdr structs. */ +#define NET_RT_MAXID 6 #define CTL_NET_RT_NAMES { \ { 0, 0 }, \ @@ -404,6 +406,7 @@ struct sockproto { { "flags", CTLTYPE_STRUCT }, \ { "iflist", CTLTYPE_STRUCT }, \ { "ifmalist", CTLTYPE_STRUCT }, \ + { "iflist2", CTLTYPE_STRUCT }, \ } #endif /* __BSD_VISIBLE */ From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 06:05:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1BECC106564A; Sat, 11 Feb 2012 06:05:41 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 0AAAF8FC12; Sat, 11 Feb 2012 06:05:41 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1B65eoZ016122; Sat, 11 Feb 2012 06:05:40 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B65e8h016119; Sat, 11 Feb 2012 06:05:40 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202110605.q1B65e8h016119@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 11 Feb 2012 06:05:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231506 - in head: . lib/libc/net X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 06:05:41 -0000 Author: bz Date: Sat Feb 11 06:05:40 2012 New Revision: 231506 URL: http://svn.freebsd.org/changeset/base/231506 Log: Switch getifaddrs(3) to the new API introduced in r231505. Also remove conditional code parts not used by or applicable to FreeBSD. The new implementation is supposed to be able to cope with changes to the 'l' versions of the msghdr structs now used as well as to if_data allowing future changes without breaking things. This restores carp(4) config support in HEAD after r231504. Reviewed by: glebius, brooks MFC After: 3 months Modified: head/UPDATING head/lib/libc/net/getifaddrs.c Modified: head/UPDATING ============================================================================== --- head/UPDATING Sat Feb 11 06:02:16 2012 (r231505) +++ head/UPDATING Sat Feb 11 06:05:40 2012 (r231506) @@ -22,6 +22,13 @@ NOTE TO PEOPLE WHO THINK THAT FreeBSD 10 machines to maximize performance. (To disable malloc debugging, run ln -s aj /etc/malloc.conf.) +20120211: + The getifaddrs upgrade path broken with 20111215 has been restored. + If you have upgraded in between 20111215 and 20120209 you need to + recompile libc again with your kernel. You still need to recompile + world to be able to configure CARP but this restriction already + comes from 20111215. + 20120114: The set_rcvar() function has been removed from /etc/rc.subr. All base and ports rc.d scripts have been updated, so if you have a Modified: head/lib/libc/net/getifaddrs.c ============================================================================== --- head/lib/libc/net/getifaddrs.c Sat Feb 11 06:02:16 2012 (r231505) +++ head/lib/libc/net/getifaddrs.c Sat Feb 11 06:05:40 2012 (r231506) @@ -72,19 +72,6 @@ __FBSDID("$FreeBSD$"); #define ALIGN(p) (((u_long)(p) + ALIGNBYTES) &~ ALIGNBYTES) #endif -#if _BSDI_VERSION >= 199701 -#define HAVE_IFM_DATA -#endif - -#if _BSDI_VERSION >= 199802 -/* ifam_data is very specific to recent versions of bsdi */ -#define HAVE_IFAM_DATA -#endif - -#if defined(__NetBSD__) || defined(__OpenBSD__) || defined(__FreeBSD__) -#define HAVE_IFM_DATA -#endif - #define MAX_SYSCTL_TRY 5 int @@ -93,7 +80,6 @@ getifaddrs(struct ifaddrs **pif) int icnt = 1; int dcnt = 0; int ncnt = 0; -#ifdef NET_RT_IFLIST int ntry = 0; int mib[6]; size_t needed; @@ -102,30 +88,23 @@ getifaddrs(struct ifaddrs **pif) struct ifaddrs *cif = 0; char *p, *p0; struct rt_msghdr *rtm; - struct if_msghdr *ifm; - struct ifa_msghdr *ifam; + struct if_msghdrl *ifm; + struct ifa_msghdrl *ifam; struct sockaddr_dl *dl; struct sockaddr *sa; struct ifaddrs *ifa, *ift; + struct if_data *if_data; u_short idx = 0; -#else /* NET_RT_IFLIST */ - char buf[1024]; - int m, sock; - struct ifconf ifc; - struct ifreq *ifr; - struct ifreq *lifr; -#endif /* NET_RT_IFLIST */ int i; size_t len, alen; char *data; char *names; -#ifdef NET_RT_IFLIST mib[0] = CTL_NET; mib[1] = PF_ROUTE; mib[2] = 0; /* protocol */ mib[3] = 0; /* wildcard address family */ - mib[4] = NET_RT_IFLIST; + mib[4] = NET_RT_IFLISTL;/* extra fields for extensible msghdr structs */ mib[5] = 0; /* no flags */ do { /* @@ -159,34 +138,33 @@ getifaddrs(struct ifaddrs **pif) continue; switch (rtm->rtm_type) { case RTM_IFINFO: - ifm = (struct if_msghdr *)(void *)rtm; + ifm = (struct if_msghdrl *)(void *)rtm; if (ifm->ifm_addrs & RTA_IFP) { idx = ifm->ifm_index; ++icnt; - dl = (struct sockaddr_dl *)(void *)(ifm + 1); + if_data = IF_MSGHDRL_IFM_DATA(ifm); + dcnt += if_data->ifi_datalen; + dl = (struct sockaddr_dl *)IF_MSGHDRL_RTA(ifm); dcnt += SA_RLEN((struct sockaddr *)(void*)dl) + ALIGNBYTES; -#ifdef HAVE_IFM_DATA - dcnt += sizeof(ifm->ifm_data); -#endif /* HAVE_IFM_DATA */ ncnt += dl->sdl_nlen + 1; } else idx = 0; break; case RTM_NEWADDR: - ifam = (struct ifa_msghdr *)(void *)rtm; + ifam = (struct ifa_msghdrl *)(void *)rtm; if (idx && ifam->ifam_index != idx) abort(); /* this cannot happen */ #define RTA_MASKS (RTA_NETMASK | RTA_IFA | RTA_BRD) if (idx == 0 || (ifam->ifam_addrs & RTA_MASKS) == 0) break; - p = (char *)(void *)(ifam + 1); + p = (char *)IFA_MSGHDRL_RTA(ifam); ++icnt; -#ifdef HAVE_IFAM_DATA - dcnt += sizeof(ifam->ifam_data) + ALIGNBYTES; -#endif /* HAVE_IFAM_DATA */ + if_data = IFA_MSGHDRL_IFAM_DATA(ifam); + dcnt += if_data->ifi_datalen + ALIGNBYTES; + /* Scan to look for length of address */ alen = 0; for (p0 = p, i = 0; i < RTAX_MAX; i++) { @@ -216,34 +194,6 @@ getifaddrs(struct ifaddrs **pif) break; } } -#else /* NET_RT_IFLIST */ - ifc.ifc_buf = buf; - ifc.ifc_len = sizeof(buf); - - if ((sock = _socket(AF_INET, SOCK_STREAM, 0)) < 0) - return (-1); - i = _ioctl(sock, SIOCGIFCONF, (char *)&ifc); - _close(sock); - if (i < 0) - return (-1); - - ifr = ifc.ifc_req; - lifr = (struct ifreq *)&ifc.ifc_buf[ifc.ifc_len]; - - while (ifr < lifr) { - struct sockaddr *sa; - - sa = &ifr->ifr_addr; - ++icnt; - dcnt += SA_RLEN(sa); - ncnt += sizeof(ifr->ifr_name) + 1; - - if (SA_LEN(sa) < sizeof(*sa)) - ifr = (struct ifreq *)(((char *)sa) + sizeof(*sa)); - else - ifr = (struct ifreq *)(((char *)sa) + SA_LEN(sa)); - } -#endif /* NET_RT_IFLIST */ if (icnt + dcnt + ncnt == 1) { *pif = NULL; @@ -263,7 +213,6 @@ getifaddrs(struct ifaddrs **pif) memset(ifa, 0, sizeof(struct ifaddrs) * icnt); ift = ifa; -#ifdef NET_RT_IFLIST idx = 0; for (next = buf; next < buf + needed; next += rtm->rtm_msglen) { rtm = (struct rt_msghdr *)(void *)next; @@ -271,41 +220,38 @@ getifaddrs(struct ifaddrs **pif) continue; switch (rtm->rtm_type) { case RTM_IFINFO: - ifm = (struct if_msghdr *)(void *)rtm; - if (ifm->ifm_addrs & RTA_IFP) { - idx = ifm->ifm_index; - dl = (struct sockaddr_dl *)(void *)(ifm + 1); + ifm = (struct if_msghdrl *)(void *)rtm; + if ((ifm->ifm_addrs & RTA_IFP) == 0) { + idx = 0; + break; + } - cif = ift; - ift->ifa_name = names; - ift->ifa_flags = (int)ifm->ifm_flags; - memcpy(names, dl->sdl_data, - (size_t)dl->sdl_nlen); - names[dl->sdl_nlen] = 0; - names += dl->sdl_nlen + 1; - - ift->ifa_addr = (struct sockaddr *)(void *)data; - memcpy(data, dl, - (size_t)SA_LEN((struct sockaddr *) - (void *)dl)); - data += SA_RLEN((struct sockaddr *)(void *)dl); - -#ifdef HAVE_IFM_DATA - /* ifm_data needs to be aligned */ - ift->ifa_data = data = (void *)ALIGN(data); - memcpy(data, &ifm->ifm_data, sizeof(ifm->ifm_data)); - data += sizeof(ifm->ifm_data); -#else /* HAVE_IFM_DATA */ - ift->ifa_data = NULL; -#endif /* HAVE_IFM_DATA */ + idx = ifm->ifm_index; + dl = (struct sockaddr_dl *)IF_MSGHDRL_RTA(ifm); - ift = (ift->ifa_next = ift + 1); - } else - idx = 0; + cif = ift; + ift->ifa_name = names; + ift->ifa_flags = (int)ifm->ifm_flags; + memcpy(names, dl->sdl_data, (size_t)dl->sdl_nlen); + names[dl->sdl_nlen] = 0; + names += dl->sdl_nlen + 1; + + ift->ifa_addr = (struct sockaddr *)(void *)data; + memcpy(data, dl, (size_t)SA_LEN((struct sockaddr *) + (void *)dl)); + data += SA_RLEN((struct sockaddr *)(void *)dl); + + if_data = IF_MSGHDRL_IFM_DATA(ifm); + /* ifm_data needs to be aligned */ + ift->ifa_data = data = (void *)ALIGN(data); + memcpy(data, if_data, if_data->ifi_datalen); + data += if_data->ifi_datalen; + + ift = (ift->ifa_next = ift + 1); break; case RTM_NEWADDR: - ifam = (struct ifa_msghdr *)(void *)rtm; + ifam = (struct ifa_msghdrl *)(void *)rtm; if (idx && ifam->ifam_index != idx) abort(); /* this cannot happen */ @@ -314,7 +260,8 @@ getifaddrs(struct ifaddrs **pif) ift->ifa_name = cif->ifa_name; ift->ifa_flags = cif->ifa_flags; ift->ifa_data = NULL; - p = (char *)(void *)(ifam + 1); + + p = (char *)IFA_MSGHDRL_RTA(ifam); /* Scan to look for length of address */ alen = 0; for (p0 = p, i = 0; i < RTAX_MAX; i++) { @@ -365,12 +312,11 @@ getifaddrs(struct ifaddrs **pif) p += len; } -#ifdef HAVE_IFAM_DATA + if_data = IFA_MSGHDRL_IFAM_DATA(ifam); /* ifam_data needs to be aligned */ ift->ifa_data = data = (void *)ALIGN(data); - memcpy(data, &ifam->ifam_data, sizeof(ifam->ifam_data)); - data += sizeof(ifam->ifam_data); -#endif /* HAVE_IFAM_DATA */ + memcpy(data, if_data, if_data->ifi_datalen); + data += if_data->ifi_datalen; ift = (ift->ifa_next = ift + 1); break; @@ -378,28 +324,7 @@ getifaddrs(struct ifaddrs **pif) } free(buf); -#else /* NET_RT_IFLIST */ - ifr = ifc.ifc_req; - lifr = (struct ifreq *)&ifc.ifc_buf[ifc.ifc_len]; - - while (ifr < lifr) { - struct sockaddr *sa; - - ift->ifa_name = names; - names[sizeof(ifr->ifr_name)] = 0; - strncpy(names, ifr->ifr_name, sizeof(ifr->ifr_name)); - while (*names++) - ; - - ift->ifa_addr = (struct sockaddr *)data; - sa = &ifr->ifr_addr; - memcpy(data, sa, SA_LEN(sa)); - data += SA_RLEN(sa); - - ifr = (struct ifreq *)(((char *)sa) + SA_LEN(sa)); - ift = (ift->ifa_next = ift + 1); - } -#endif /* NET_RT_IFLIST */ + if (--ift >= ifa) { ift->ifa_next = NULL; *pif = ifa; From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 06:21:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4E64A1065672; Sat, 11 Feb 2012 06:21:17 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 3D9298FC0A; Sat, 11 Feb 2012 06:21:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1B6LH9o016633; Sat, 11 Feb 2012 06:21:17 GMT (envelope-from dougb@svn.freebsd.org) Received: (from dougb@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B6LHMU016630; Sat, 11 Feb 2012 06:21:17 GMT (envelope-from dougb@svn.freebsd.org) Message-Id: <201202110621.q1B6LHMU016630@svn.freebsd.org> From: Doug Barton Date: Sat, 11 Feb 2012 06:21:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231507 - head/etc/rc.d X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 06:21:17 -0000 Author: dougb Date: Sat Feb 11 06:21:16 2012 New Revision: 231507 URL: http://svn.freebsd.org/changeset/base/231507 Log: In the days before r208307 addswap was running early in the second stage of rcorder. Somehow in the intervening period addswap got moved to the very end, which is almost certainly not what we want. This change moves it to right after kld so that for users who need it, they'll get it ASAP. Modified: head/etc/rc.d/addswap head/etc/rc.d/var Modified: head/etc/rc.d/addswap ============================================================================== --- head/etc/rc.d/addswap Sat Feb 11 06:05:40 2012 (r231506) +++ head/etc/rc.d/addswap Sat Feb 11 06:21:16 2012 (r231507) @@ -6,7 +6,7 @@ # # PROVIDE: addswap -# REQUIRE: FILESYSTEMS +# REQUIRE: FILESYSTEMS kld # KEYWORD: nojail . /etc/rc.subr Modified: head/etc/rc.d/var ============================================================================== --- head/etc/rc.d/var Sat Feb 11 06:05:40 2012 (r231506) +++ head/etc/rc.d/var Sat Feb 11 06:21:16 2012 (r231507) @@ -28,7 +28,7 @@ # # PROVIDE: var -# REQUIRE: FILESYSTEMS kld +# REQUIRE: FILESYSTEMS kld addswap . /etc/rc.subr From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 07:43:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BC1B8106566C; Sat, 11 Feb 2012 07:43:33 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AB3438FC0A; Sat, 11 Feb 2012 07:43:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1B7hXpL019217; Sat, 11 Feb 2012 07:43:33 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B7hXoq019215; Sat, 11 Feb 2012 07:43:33 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202110743.q1B7hXoq019215@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 11 Feb 2012 07:43:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231508 - head/sys/dev/oce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 07:43:33 -0000 Author: bz Date: Sat Feb 11 07:43:33 2012 New Revision: 231508 URL: http://svn.freebsd.org/changeset/base/231508 Log: Make use of the read-only variant of the IF_ADDR_*LOCK() macros introduced in r229614 rather than the compat one. Modified: head/sys/dev/oce/oce_hw.c Modified: head/sys/dev/oce/oce_hw.c ============================================================================== --- head/sys/dev/oce/oce_hw.c Sat Feb 11 06:21:16 2012 (r231507) +++ head/sys/dev/oce/oce_hw.c Sat Feb 11 07:43:33 2012 (r231508) @@ -558,7 +558,7 @@ oce_hw_update_multicast(POCE_SOFTC sc) bzero(req, sizeof(struct mbx_set_common_iface_multicast)); #if __FreeBSD_version > 800000 - IF_ADDR_LOCK(ifp); + IF_ADDR_RLOCK(ifp); #endif TAILQ_FOREACH(ifma, &ifp->if_multiaddrs, ifma_link) { if (ifma->ifma_addr->sa_family != AF_LINK) @@ -578,7 +578,7 @@ oce_hw_update_multicast(POCE_SOFTC sc) req->params.req.num_mac = req->params.req.num_mac + 1; } #if __FreeBSD_version > 800000 -IF_ADDR_UNLOCK(ifp); + IF_ADDR_RUNLOCK(ifp); #endif req->params.req.if_id = sc->if_id; rc = oce_update_multicast(sc, &dma); From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 07:47:07 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 690C91065670; Sat, 11 Feb 2012 07:47:07 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 584C68FC08; Sat, 11 Feb 2012 07:47:07 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1B7l7vU019378; Sat, 11 Feb 2012 07:47:07 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B7l7ga019376; Sat, 11 Feb 2012 07:47:07 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202110747.q1B7l7ga019376@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 11 Feb 2012 07:47:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231509 - head/sys/dev/oce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 07:47:07 -0000 Author: bz Date: Sat Feb 11 07:47:06 2012 New Revision: 231509 URL: http://svn.freebsd.org/changeset/base/231509 Log: Use the more common macro to set the if_baudrate to 10Gbit/s. Just use UL not ULL, which should make 32bit archs more happy. Modified: head/sys/dev/oce/oce_if.c Modified: head/sys/dev/oce/oce_if.c ============================================================================== --- head/sys/dev/oce/oce_if.c Sat Feb 11 07:43:33 2012 (r231508) +++ head/sys/dev/oce/oce_if.c Sat Feb 11 07:47:06 2012 (r231509) @@ -1644,7 +1644,7 @@ oce_attach_ifp(POCE_SOFTC sc) sc->ifp->if_capabilities |= IFCAP_LRO; sc->ifp->if_capenable = sc->ifp->if_capabilities; - sc->ifp->if_baudrate = IF_Mbps(10000ULL); + sc->ifp->if_baudrate = IF_Gbps(10UL); ether_ifattach(sc->ifp, sc->macaddr.mac_addr); From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 08:12:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 35DDD106566B; Sat, 11 Feb 2012 08:12:53 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 24E908FC17; Sat, 11 Feb 2012 08:12:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1B8CqVO020286; Sat, 11 Feb 2012 08:12:52 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B8CqfY020283; Sat, 11 Feb 2012 08:12:52 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201202110812.q1B8CqfY020283@svn.freebsd.org> From: Kevin Lo Date: Sat, 11 Feb 2012 08:12:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231510 - head/sys/dev/vge X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 08:12:53 -0000 Author: kevlo Date: Sat Feb 11 08:12:52 2012 New Revision: 231510 URL: http://svn.freebsd.org/changeset/base/231510 Log: Remove unused variable mii Modified: head/sys/dev/vge/if_vge.c Modified: head/sys/dev/vge/if_vge.c ============================================================================== --- head/sys/dev/vge/if_vge.c Sat Feb 11 07:47:06 2012 (r231509) +++ head/sys/dev/vge/if_vge.c Sat Feb 11 08:12:52 2012 (r231510) @@ -2022,11 +2022,9 @@ static void vge_init_locked(struct vge_softc *sc) { struct ifnet *ifp = sc->vge_ifp; - struct mii_data *mii; int error, i; VGE_LOCK_ASSERT(sc); - mii = device_get_softc(sc->vge_miibus); if ((ifp->if_drv_flags & IFF_DRV_RUNNING) != 0) return; From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 08:33:53 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7C502106564A; Sat, 11 Feb 2012 08:33:53 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6ACD18FC14; Sat, 11 Feb 2012 08:33:53 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1B8XrW1021029; Sat, 11 Feb 2012 08:33:53 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B8XrtA021027; Sat, 11 Feb 2012 08:33:53 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202110833.q1B8XrtA021027@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 11 Feb 2012 08:33:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231511 - head/sys/dev/oce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 08:33:53 -0000 Author: bz Date: Sat Feb 11 08:33:52 2012 New Revision: 231511 URL: http://svn.freebsd.org/changeset/base/231511 Log: Start to try to hide LRO (and some TSO) bits behind #ifdefs as especially the symbols are not there when compiling a kernel without IP support and we do have users doing so. Modified: head/sys/dev/oce/oce_if.c Modified: head/sys/dev/oce/oce_if.c ============================================================================== --- head/sys/dev/oce/oce_if.c Sat Feb 11 08:12:52 2012 (r231510) +++ head/sys/dev/oce/oce_if.c Sat Feb 11 08:33:52 2012 (r231511) @@ -39,6 +39,9 @@ /* $FreeBSD$ */ +#include "opt_inet6.h" +#include "opt_inet.h" + #include "oce_if.h" @@ -68,8 +71,10 @@ static int oce_tx(POCE_SOFTC sc, struct static void oce_tx_restart(POCE_SOFTC sc, struct oce_wq *wq); static void oce_tx_complete(struct oce_wq *wq, uint32_t wqe_idx, uint32_t status); +#if defined(INET6) || defined(INET) static struct mbuf * oce_tso_setup(POCE_SOFTC sc, struct mbuf **mpp, uint16_t *mss); +#endif static int oce_multiq_transmit(struct ifnet *ifp, struct mbuf *m, struct oce_wq *wq); @@ -77,7 +82,9 @@ static int oce_multiq_transmit(struct i static void oce_discard_rx_comp(struct oce_rq *rq, struct oce_nic_rx_cqe *cqe); static int oce_cqe_vtp_valid(POCE_SOFTC sc, struct oce_nic_rx_cqe *cqe); static int oce_cqe_portid_valid(POCE_SOFTC sc, struct oce_nic_rx_cqe *cqe); +#if defined(INET6) || defined(INET) static void oce_rx_flush_lro(struct oce_rq *rq); +#endif static void oce_rx(struct oce_rq *rq, uint32_t rqe_idx, struct oce_nic_rx_cqe *cqe); @@ -89,7 +96,9 @@ static int oce_vid_config(POCE_SOFTC sc static void oce_mac_addr_set(POCE_SOFTC sc); static int oce_handle_passthrough(struct ifnet *ifp, caddr_t data); static void oce_local_timer(void *arg); +#if defined(INET6) || defined(INET) static int oce_init_lro(POCE_SOFTC sc); +#endif static void oce_if_deactivate(POCE_SOFTC sc); static void oce_if_activate(POCE_SOFTC sc); static void setup_max_queues_want(POCE_SOFTC sc); @@ -238,9 +247,11 @@ oce_attach(device_t dev) goto queues_free; +#if defined(INET6) || defined(INET) rc = oce_init_lro(sc); if (rc) goto ifp_free; +#endif rc = oce_hw_start(sc); @@ -277,8 +288,10 @@ vlan_free: EVENTHANDLER_DEREGISTER(vlan_unconfig, sc->vlan_detach); oce_hw_intr_disable(sc); lro_free: +#if defined(INET6) || defined(INET) oce_free_lro(sc); ifp_free: +#endif ether_ifdetach(sc->ifp); if_free(sc->ifp); queues_free: @@ -462,8 +475,10 @@ oce_ioctl(struct ifnet *ifp, u_long comm oce_vid_config(sc); } +#if defined(INET6) || defined(INET) if (u & IFCAP_LRO) ifp->if_capenable ^= IFCAP_LRO; +#endif break; @@ -798,7 +813,9 @@ oce_tx(POCE_SOFTC sc, struct mbuf **mpp, struct oce_nic_frag_wqe *nicfrag; int num_wqes; uint32_t reg_value; +#if defined(INET6) || defined(INET) uint16_t mss = 0; +#endif m = *mpp; if (!m) @@ -810,8 +827,12 @@ oce_tx(POCE_SOFTC sc, struct mbuf **mpp, } if (m->m_pkthdr.csum_flags & CSUM_TSO) { +#if defined(INET6) || defined(INET) /* consolidate packet buffers for TSO/LSO segment offload */ m = oce_tso_setup(sc, mpp, &mss); +#else + m = NULL; +#endif if (m == NULL) { rc = ENXIO; goto free_ret; @@ -991,17 +1012,22 @@ oce_tx_restart(POCE_SOFTC sc, struct oce } - +#if defined(INET6) || defined(INET) static struct mbuf * oce_tso_setup(POCE_SOFTC sc, struct mbuf **mpp, uint16_t *mss) { struct mbuf *m; +#ifdef INET struct ip *ip; +#endif +#ifdef INET6 struct ip6_hdr *ip6; +#endif struct ether_vlan_header *eh; struct tcphdr *th; + int total_len = 0; uint16_t etype; - int total_len = 0, ehdrlen = 0; + int ehdrlen = 0; m = *mpp; *mss = m->m_pkthdr.tso_segsz; @@ -1025,6 +1051,7 @@ oce_tso_setup(POCE_SOFTC sc, struct mbuf switch (etype) { +#ifdef INET case ETHERTYPE_IP: ip = (struct ip *)(m->m_data + ehdrlen); if (ip->ip_p != IPPROTO_TCP) @@ -1033,6 +1060,8 @@ oce_tso_setup(POCE_SOFTC sc, struct mbuf total_len = ehdrlen + (ip->ip_hl << 2) + (th->th_off << 2); break; +#endif +#ifdef INET6 case ETHERTYPE_IPV6: ip6 = (struct ip6_hdr *)(m->m_data + ehdrlen); if (ip6->ip6_nxt != IPPROTO_TCP) @@ -1041,6 +1070,7 @@ oce_tso_setup(POCE_SOFTC sc, struct mbuf total_len = ehdrlen + sizeof(struct ip6_hdr) + (th->th_off << 2); break; +#endif default: return NULL; } @@ -1052,6 +1082,7 @@ oce_tso_setup(POCE_SOFTC sc, struct mbuf return m; } +#endif /* INET6 || INET */ void @@ -1305,6 +1336,7 @@ oce_rx(struct oce_rq *rq, uint32_t rqe_i } sc->ifp->if_ipackets++; +#if defined(INET6) || defined(INET) /* Try to queue to LRO */ if (IF_LRO_ENABLED(sc) && !(m->m_flags & M_VLANTAG) && @@ -1319,9 +1351,12 @@ oce_rx(struct oce_rq *rq, uint32_t rqe_i } /* If LRO posting fails then try to post to STACK */ } +#endif (*sc->ifp->if_input) (sc->ifp, m); +#if defined(INET6) || defined(INET) post_done: +#endif /* Update rx stats per queue */ rq->rx_stats.rx_pkts++; rq->rx_stats.rx_bytes += cqe->u0.s.pkt_size; @@ -1408,6 +1443,7 @@ oce_cqe_portid_valid(POCE_SOFTC sc, stru } +#if defined(INET6) || defined(INET) static void oce_rx_flush_lro(struct oce_rq *rq) { @@ -1446,11 +1482,12 @@ oce_init_lro(POCE_SOFTC sc) return rc; } - +#endif /* INET6 || INET */ void oce_free_lro(POCE_SOFTC sc) { +#if defined(INET6) || defined(INET) struct lro_ctrl *lro = NULL; int i = 0; @@ -1459,6 +1496,7 @@ oce_free_lro(POCE_SOFTC sc) if (lro) tcp_lro_free(lro); } +#endif } @@ -1567,9 +1605,11 @@ oce_rq_handler(void *arg) rq->rx_stats.rx_compl++; cqe->u0.dw[2] = 0; +#if defined(INET6) || defined(INET) if (IF_LRO_ENABLED(sc) && rq->lro_pkts_queued >= 16) { oce_rx_flush_lro(rq); } +#endif RING_GET(cq->ring, 1); bus_dmamap_sync(cq->ring->dma.tag, @@ -1580,8 +1620,10 @@ oce_rq_handler(void *arg) if (num_cqes >= (IS_XE201(sc) ? 8 : oce_max_rsp_handled)) break; } +#if defined(INET6) || defined(INET) if (IF_LRO_ENABLED(sc)) oce_rx_flush_lro(rq); +#endif if (num_cqes) { oce_arm_cq(sc, cq->cq_id, num_cqes, FALSE); @@ -1638,10 +1680,12 @@ oce_attach_ifp(POCE_SOFTC sc) sc->ifp->if_hwassist |= (CSUM_IP | CSUM_TCP | CSUM_UDP); sc->ifp->if_capabilities = OCE_IF_CAPABILITIES; - sc->ifp->if_capabilities |= IFCAP_TSO; sc->ifp->if_capabilities |= IFCAP_HWCSUM; sc->ifp->if_capabilities |= IFCAP_VLAN_HWFILTER; +#if defined(INET6) || defined(INET) + sc->ifp->if_capabilities |= IFCAP_TSO; sc->ifp->if_capabilities |= IFCAP_LRO; +#endif sc->ifp->if_capenable = sc->ifp->if_capabilities; sc->ifp->if_baudrate = IF_Gbps(10UL); From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 08:34:33 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B40051065670; Sat, 11 Feb 2012 08:34:33 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A31A48FC1A; Sat, 11 Feb 2012 08:34:33 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1B8YXlg021089; Sat, 11 Feb 2012 08:34:33 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1B8YXO3021087; Sat, 11 Feb 2012 08:34:33 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202110834.q1B8YXO3021087@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 11 Feb 2012 08:34:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231512 - head/sys/modules/oce X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 08:34:33 -0000 Author: bz Date: Sat Feb 11 08:34:33 2012 New Revision: 231512 URL: http://svn.freebsd.org/changeset/base/231512 Log: Depend on the relevant header files. Modified: head/sys/modules/oce/Makefile Modified: head/sys/modules/oce/Makefile ============================================================================== --- head/sys/modules/oce/Makefile Sat Feb 11 08:33:52 2012 (r231511) +++ head/sys/modules/oce/Makefile Sat Feb 11 08:34:33 2012 (r231512) @@ -5,7 +5,7 @@ .PATH: ${.CURDIR}/../../dev/oce KMOD = oce SRCS = oce_if.c oce_hw.c oce_mbox.c oce_util.c oce_queue.c oce_sysctl.c -#SRCS += ${ofw_bus_if} bus_if.h device_if.h pci_if.h opt_inet.h opt_inet6.h +SRCS += bus_if.h device_if.h pci_if.h opt_inet.h opt_inet6.h CFLAGS+= -I${.CURDIR}/../../dev/oce -DSMP From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 09:35:50 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C20B01065670; Sat, 11 Feb 2012 09:35:50 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail06.syd.optusnet.com.au (mail06.syd.optusnet.com.au [211.29.132.187]) by mx1.freebsd.org (Postfix) with ESMTP id 4C96C8FC08; Sat, 11 Feb 2012 09:35:49 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail06.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q1B9ZkX9010997 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 11 Feb 2012 20:35:47 +1100 Date: Sat, 11 Feb 2012 20:35:46 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Martin Cracauer In-Reply-To: <201202102216.q1AMGI0m098192@svn.freebsd.org> Message-ID: <20120211194854.J2214@besplex.bde.org> References: <201202102216.q1AMGI0m098192@svn.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org Subject: Re: svn commit: r231449 - head/usr.bin/tee X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 09:35:51 -0000 On Fri, 10 Feb 2012, Martin Cracauer wrote: > Log: > Fix bin/164947: tee looses data when writing to non-blocking file descriptors > > tee was not handling EAGAIN > > patch submitted by Diomidis Spinellis . Thanks so much > > reproduced and re-tested locally This seems to give a buffer overrun (apart from reducing to a write() spinloop) when the number of output files is enormous and non-blocking mode is broken. > Modified: head/usr.bin/tee/tee.c > ============================================================================== > --- head/usr.bin/tee/tee.c Fri Feb 10 22:14:34 2012 (r231448) > +++ head/usr.bin/tee/tee.c Fri Feb 10 22:16:17 2012 (r231449) > ... > @@ -106,9 +109,14 @@ main(int argc, char *argv[]) > bp = buf; > do { > if ((wval = write(p->fd, bp, n)) == -1) { > - warn("%s", p->name); > - exitval = 1; > - break; > + if (errno == EAGAIN) { > + waitfor(p->fd); p->fd is limited only by the number of args (which is limited by {ARG_MAX}, which defaults to 256K and is hard to change) and {OPEN_MAX} (which is about 12000 on all machines I can test quickly, including 2 very different ones; it is easy to reduce but not so easy to increase). However, this code should be unreachable except for fd == 0, since we opened all the other fd's for itself and we didn't ask for O_NONBLOCK on them). However2, I think some device files still have broken non-blocking mode, where the non-blocking flag is set in the device state instead of in the open file state and is thus too global. > + wval = 0; > + } else { > + warn("%s", p->name); > + exitval = 1; > + break; > + } > } > bp += wval; > } while (n -= wval); > @@ -137,3 +145,15 @@ add(int fd, const char *name) > p->next = head; > head = p; > } > + > +/* Wait for the specified fd to be ready for writing */ > +static void > +waitfor(int fd) > +{ > + fd_set writefds; The number of bits is this is limited by FD_SETSIZE, which defaults to 1024. This is much smaller than the other limits, so fd can easily exceed FD_SETSIZE. FD_SETSIZE is easy to change, but it is not changed by this program. > + > + FD_ZERO(&writefds); > + FD_SET(fd, &writefds); This gives a buffer overrun when fd >= FD_SETSIZE. FD_SET() does no internal range checking, so callers must do it. > + if (select(fd + 1, NULL, &writefds, NULL, NULL) == -1) > + err(1, "select"); This might even work if the buffer overrun doesn't trash too much, since (fd + 1) is not too large for the kernel. > +} > The easiest fix is to return immediately if fd >= FD_SETSIZE or even if fd > 0. This intentionally reduces to the write() spinloop if someone makes fd >= FD_SETSIZE, or if someone uses tee on a buggy device. An enormous number of output files enlarges chances for other interesting bugs. It only takes one in the middle to have an i/o error (EIO for hangup is most likely) to break the i/o for all. Blocking on one while the others could be displaying output is not best. Bruce From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 10:35:35 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1E0E21065672; Sat, 11 Feb 2012 10:35:35 +0000 (UTC) (envelope-from to.my.trociny@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id CC5B58FC0A; Sat, 11 Feb 2012 10:35:33 +0000 (UTC) Received: by bkcjg1 with SMTP id jg1so3135310bkc.13 for ; Sat, 11 Feb 2012 02:35:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=from:to:cc:subject:references:x-comment-to:sender:date:in-reply-to :message-id:user-agent:mime-version:content-type; bh=61MFnUhawF3Zw+N6EhNqsW69skIfjHuaSClZWCcEVbU=; b=tuY6MzoMEJxj6Q5WJVAC1BT6LXi3u6T+sTY5SjNG0vxhqcHvTDpsMZQe+sQdNYRa7L d5JtSqy0E7t507ZQJ0sETV2N9J5zjUpZopSxF3UaniyrStcMMfsAVEr3F95uOpWY512W FAinW8YkzaQDtk9s0rsbzPMQ6DasqoLxJrLcI= Received: by 10.204.151.209 with SMTP id d17mr4068781bkw.52.1328956532884; Sat, 11 Feb 2012 02:35:32 -0800 (PST) Received: from localhost ([95.69.173.122]) by mx.google.com with ESMTPS id o26sm25906448bko.14.2012.02.11.02.35.29 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 11 Feb 2012 02:35:30 -0800 (PST) From: Mikolaj Golub To: Pawel Jakub Dawidek References: <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> <20120206082706.GA1324@garage.freebsd.pl> <86wr7zmy8f.fsf@kopusha.home.net> <20120206221742.GA1336@garage.freebsd.pl> <86liodu3me.fsf@in138.ua3> <20120208090600.GA1308@garage.freebsd.pl> X-Comment-To: Pawel Jakub Dawidek Sender: Mikolaj Golub Date: Sat, 11 Feb 2012 12:35:27 +0200 In-Reply-To: <20120208090600.GA1308@garage.freebsd.pl> (Pawel Jakub Dawidek's message of "Wed, 8 Feb 2012 10:06:01 +0100") Message-ID: <86sjihsln4.fsf@kopusha.home.net> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, Andrey Zonov , src-committers@FreeBSD.org Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 10:35:35 -0000 On Wed, 8 Feb 2012 10:06:01 +0100 Pawel Jakub Dawidek wrote: PJD> On Wed, Feb 08, 2012 at 10:32:41AM +0200, Mikolaj Golub wrote: >> >> On Mon, 6 Feb 2012 23:17:43 +0100 Pawel Jakub Dawidek wrote: >> >> PJD> On Mon, Feb 06, 2012 at 11:46:24PM +0200, Mikolaj Golub wrote: >> >> >> Thanks. The updated version is attached. >> >> PJD> Looks good to me. >> >> Thanks. But I still think that adding some signal handling is a good idea. I >> agree that there may be no sense in trying to handle many different signals, >> but handling SIGTERM (software termination signal :-) nicely looks like a good >> thing. PJD> Ok:) In that case could you break you patch into one that only fixes the PJD> problem we discussed and the other that implements new functionality? >> This would solve problems like stale pid files after shutdown or orphaned >> programs (again with stale pid files and a possibility to start another >> instance) due to a user mistakenly terminated the supervising daemons. >> >> Also it is possible then to add "automatic restart" option, as Andrey has >> proposed. >> >> Here is the patch that does it. It also change proctitle to make identifying a >> a supervisor with its charge. PJD> I'd prefer to see more general solution to that problem, but I guess PJD> this can't hurt. I've only one suggestion based on my experience. PJD> Before you restart the program, wait for 1 second. This helps a lot when PJD> you have misbehaving program or some misconfiguration that make the PJD> process to exit immediately. >> A technical question concerning the patch :-). Does sombody know if >> sigwaitinfo() may be interrupted in my case and I should check for EINTR, as I >> do in the patch? PJD> Calling sigwaitinfo() with second argument equal to NULL is equivalent PJD> to calling sigwait(). The only difference is that sigwait() cannot be PJD> interrupted by signal, thus never sets errno to EINTR. Why not to use PJD> just that? Thank you. Here are the patches I would like to commit if there are no objections or other suggestions: http://people.freebsd.org/~trociny/daemon/daemon.spawn.1.patch http://people.freebsd.org/~trociny/daemon/daemon.SIGTERM.1.patch http://people.freebsd.org/~trociny/daemon/daemon.restart.1.patch -- Mikolaj Golub From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 11:11:14 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 02241106564A; Sat, 11 Feb 2012 11:11:14 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E4EB08FC14; Sat, 11 Feb 2012 11:11:13 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1BBBDrw028343; Sat, 11 Feb 2012 11:11:13 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BBBDG3028340; Sat, 11 Feb 2012 11:11:13 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202111111.q1BBBDG3028340@svn.freebsd.org> From: Ed Schouten Date: Sat, 11 Feb 2012 11:11:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231514 - head/lib/libc/gen X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 11:11:14 -0000 Author: ed Date: Sat Feb 11 11:11:13 2012 New Revision: 231514 URL: http://svn.freebsd.org/changeset/base/231514 Log: Set read buffer size to multiple of sizeof(struct futx). If the utmpx database gets updated while an application is reading it, there is a chance the reading application processes partially overwritten entries. To solve this, make sure we always read a multiple of sizeof(struct futx) at a time. MFC after: 2 weeks Modified: head/lib/libc/gen/getutxent.c Modified: head/lib/libc/gen/getutxent.c ============================================================================== --- head/lib/libc/gen/getutxent.c Sat Feb 11 08:58:12 2012 (r231513) +++ head/lib/libc/gen/getutxent.c Sat Feb 11 11:11:13 2012 (r231514) @@ -70,13 +70,18 @@ setutxdb(int db, const char *file) if (uf == NULL) return (-1); - /* Safety check: never use broken files. */ - if (db != UTXDB_LOG && _fstat(fileno(uf), &sb) != -1 && - sb.st_size % sizeof(struct futx) != 0) { - fclose(uf); - uf = NULL; - errno = EFTYPE; - return (-1); + if (db != UTXDB_LOG) { + /* Safety check: never use broken files. */ + if (_fstat(fileno(uf), &sb) != -1 && + sb.st_size % sizeof(struct futx) != 0) { + fclose(uf); + uf = NULL; + errno = EFTYPE; + return (-1); + } + /* Prevent reading of partial records. */ + (void)setvbuf(uf, NULL, _IOFBF, + rounddown(BUFSIZ, sizeof(struct futx))); } udb = db; From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 11:11:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 667CF106564A; Sat, 11 Feb 2012 11:11:44 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 555528FC08; Sat, 11 Feb 2012 11:11:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1BBBhCr028403; Sat, 11 Feb 2012 11:11:43 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BBBhw3028401; Sat, 11 Feb 2012 11:11:43 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202111111.q1BBBhw3028401@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 11 Feb 2012 11:11:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231515 - head/lib/libipsec X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 11:11:44 -0000 Author: bz Date: Sat Feb 11 11:11:43 2012 New Revision: 231515 URL: http://svn.freebsd.org/changeset/base/231515 Log: Use the correct constant (with same value) for comparying the SA type. PR: kern/142741 Submitted by: Matthijs Kooiman (matthijs stdin.nl) MFC after: 3 days Modified: head/lib/libipsec/pfkey.c Modified: head/lib/libipsec/pfkey.c ============================================================================== --- head/lib/libipsec/pfkey.c Sat Feb 11 11:11:13 2012 (r231514) +++ head/lib/libipsec/pfkey.c Sat Feb 11 11:11:43 2012 (r231515) @@ -662,7 +662,7 @@ pfkey_send_register(so, satype) { int len, algno; - if (satype == PF_UNSPEC) { + if (satype == SADB_SATYPE_UNSPEC) { for (algno = 0; algno < sizeof(supported_map)/sizeof(supported_map[0]); algno++) { From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 11:24:31 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 424BB106566C; Sat, 11 Feb 2012 11:24:31 +0000 (UTC) (envelope-from dmarion@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 307AB8FC08; Sat, 11 Feb 2012 11:24:31 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1BBOVO4028961; Sat, 11 Feb 2012 11:24:31 GMT (envelope-from dmarion@svn.freebsd.org) Received: (from dmarion@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BBOUAX028959; Sat, 11 Feb 2012 11:24:30 GMT (envelope-from dmarion@svn.freebsd.org) Message-Id: <201202111124.q1BBOUAX028959@svn.freebsd.org> From: Damjan Marion Date: Sat, 11 Feb 2012 11:24:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231516 - head/usr.bin/calendar/calendars X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 11:24:31 -0000 Author: dmarion Date: Sat Feb 11 11:24:30 2012 New Revision: 231516 URL: http://svn.freebsd.org/changeset/base/231516 Log: Add myself to calendar. Approved by: cognet (mentor) Modified: head/usr.bin/calendar/calendars/calendar.freebsd Modified: head/usr.bin/calendar/calendars/calendar.freebsd ============================================================================== --- head/usr.bin/calendar/calendars/calendar.freebsd Sat Feb 11 11:11:43 2012 (r231515) +++ head/usr.bin/calendar/calendars/calendar.freebsd Sat Feb 11 11:24:30 2012 (r231516) @@ -239,6 +239,7 @@ 08/05 Alfred Perlstein born in Brooklyn, New York, United States, 1978 08/06 Anton Berezin born in Dnepropetrovsk, Ukraine, 1970 08/06 John-Mark Gurney born in Detroit, Michigan, United States, 1978 +08/06 Damjan Marion born in Rijeka, Croatia, 1978 08/07 Jonathan Mini born in San Mateo, California, United States, 1979 08/08 Mikolaj Golub born in Kharkov, USSR, 1977 08/10 Peter Pentchev born in Sofia, Bulgaria, 1977 From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 12:03:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 890D41065675; Sat, 11 Feb 2012 12:03:45 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 76A6D8FC1F; Sat, 11 Feb 2012 12:03:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1BC3jHG030199; Sat, 11 Feb 2012 12:03:45 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BC3jJD030193; Sat, 11 Feb 2012 12:03:45 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <201202111203.q1BC3jJD030193@svn.freebsd.org> From: Marius Strobl Date: Sat, 11 Feb 2012 12:03:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231518 - head/sys/dev/mpt X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 12:03:45 -0000 Author: marius Date: Sat Feb 11 12:03:44 2012 New Revision: 231518 URL: http://svn.freebsd.org/changeset/base/231518 Log: Flesh out support for SAS1078 and SAS1078DE (which are said to actually be the same chip): - The I/O port resource may not be available with these. However, given that we actually only need this resource for some controllers that require their firmware to be up- and downloaded (which excludes the SAS1078{,DE}) just handle failure to allocate this resource gracefully when possible. While at it, generally put non-fatal resource allocation failures under bootverbose. - SAS1078{,DE} use a different hard reset protocol. - Add workarounds for the 36GB physical address limitation of scatter/ gather elements of these controllers. Tested by: Slawa Olhovchenkov PR: 149220 (remaining part) Modified: head/sys/dev/mpt/mpt.c head/sys/dev/mpt/mpt.h head/sys/dev/mpt/mpt_cam.c head/sys/dev/mpt/mpt_pci.c head/sys/dev/mpt/mpt_reg.h Modified: head/sys/dev/mpt/mpt.c ============================================================================== --- head/sys/dev/mpt/mpt.c Sat Feb 11 11:34:53 2012 (r231517) +++ head/sys/dev/mpt/mpt.c Sat Feb 11 12:03:44 2012 (r231518) @@ -1053,6 +1053,12 @@ mpt_hard_reset(struct mpt_softc *mpt) mpt_lprt(mpt, MPT_PRT_DEBUG, "hard reset\n"); + if (mpt->is_1078) { + mpt_write(mpt, MPT_OFFSET_RESET_1078, 0x07); + DELAY(1000); + return; + } + error = mpt_enable_diag_mode(mpt); if (error) { mpt_prt(mpt, "WARNING - Could not enter diagnostic mode !\n"); @@ -2450,6 +2456,11 @@ mpt_download_fw(struct mpt_softc *mpt) uint32_t ext_offset; uint32_t data; + if (mpt->pci_pio_reg == NULL) { + mpt_prt(mpt, "No PIO resource!\n"); + return (ENXIO); + } + mpt_prt(mpt, "Downloading Firmware - Image Size %d\n", mpt->fw_image_size); Modified: head/sys/dev/mpt/mpt.h ============================================================================== --- head/sys/dev/mpt/mpt.h Sat Feb 11 11:34:53 2012 (r231517) +++ head/sys/dev/mpt/mpt.h Sat Feb 11 12:03:44 2012 (r231518) @@ -608,7 +608,7 @@ struct mpt_softc { #endif uint32_t mpt_pers_mask; uint32_t - : 8, + : 7, unit : 8, ready : 1, fw_uploaded : 1, @@ -625,7 +625,8 @@ struct mpt_softc { disabled : 1, is_spi : 1, is_sas : 1, - is_fc : 1; + is_fc : 1, + is_1078 : 1; u_int cfg_role; u_int role; /* role: none, ini, target, both */ @@ -982,12 +983,14 @@ mpt_read(struct mpt_softc *mpt, int offs static __inline void mpt_pio_write(struct mpt_softc *mpt, size_t offset, uint32_t val) { + KASSERT(mpt->pci_pio_reg != NULL, ("no PIO resource")); bus_space_write_4(mpt->pci_pio_st, mpt->pci_pio_sh, offset, val); } static __inline uint32_t mpt_pio_read(struct mpt_softc *mpt, int offset) { + KASSERT(mpt->pci_pio_reg != NULL, ("no PIO resource")); return (bus_space_read_4(mpt->pci_pio_st, mpt->pci_pio_sh, offset)); } /*********************** Reply Frame/Request Management ***********************/ Modified: head/sys/dev/mpt/mpt_cam.c ============================================================================== --- head/sys/dev/mpt/mpt_cam.c Sat Feb 11 11:34:53 2012 (r231517) +++ head/sys/dev/mpt/mpt_cam.c Sat Feb 11 12:03:44 2012 (r231518) @@ -1279,8 +1279,9 @@ mpt_execute_req_a64(void *arg, bus_dma_s char *mpt_off; union ccb *ccb; struct mpt_softc *mpt; - int seg, first_lim; - uint32_t flags, nxt_off; + bus_addr_t chain_list_addr; + int first_lim, seg, this_seg_lim; + uint32_t addr, cur_off, flags, nxt_off, tf; void *sglp = NULL; MSG_REQUEST_HEADER *hdrp; SGE_SIMPLE64 *se; @@ -1434,16 +1435,20 @@ bad: se = (SGE_SIMPLE64 *) sglp; for (seg = 0; seg < first_lim; seg++, se++, dm_segs++) { - uint32_t tf; - + tf = flags; memset(se, 0, sizeof (*se)); + MPI_pSGE_SET_LENGTH(se, dm_segs->ds_len); se->Address.Low = htole32(dm_segs->ds_addr & 0xffffffff); if (sizeof(bus_addr_t) > 4) { - se->Address.High = - htole32(((uint64_t)dm_segs->ds_addr) >> 32); + addr = ((uint64_t)dm_segs->ds_addr) >> 32; + /* SAS1078 36GB limitation WAR */ + if (mpt->is_1078 && (((uint64_t)dm_segs->ds_addr + + MPI_SGE_LENGTH(se->FlagsLength)) >> 32) == 9) { + addr |= (1 << 31); + tf |= MPI_SGE_FLAGS_LOCAL_ADDRESS; + } + se->Address.High = htole32(addr); } - MPI_pSGE_SET_LENGTH(se, dm_segs->ds_len); - tf = flags; if (seg == first_lim - 1) { tf |= MPI_SGE_FLAGS_LAST_ELEMENT; } @@ -1468,15 +1473,11 @@ bad: /* * Make up the rest of the data segments out of a chain element - * (contiained in the current request frame) which points to + * (contained in the current request frame) which points to * SIMPLE64 elements in the next request frame, possibly ending * with *another* chain element (if there's more). */ while (seg < nseg) { - int this_seg_lim; - uint32_t tf, cur_off; - bus_addr_t chain_list_addr; - /* * Point to the chain descriptor. Note that the chain * descriptor is at the end of the *previous* list (whether @@ -1504,7 +1505,7 @@ bad: nxt_off += MPT_RQSL(mpt); /* - * Now initialized the chain descriptor. + * Now initialize the chain descriptor. */ memset(ce, 0, sizeof (*ce)); @@ -1554,16 +1555,24 @@ bad: * set the end of list and end of buffer flags. */ while (seg < this_seg_lim) { + tf = flags; memset(se, 0, sizeof (*se)); + MPI_pSGE_SET_LENGTH(se, dm_segs->ds_len); se->Address.Low = htole32(dm_segs->ds_addr & 0xffffffff); if (sizeof (bus_addr_t) > 4) { - se->Address.High = - htole32(((uint64_t)dm_segs->ds_addr) >> 32); + addr = ((uint64_t)dm_segs->ds_addr) >> 32; + /* SAS1078 36GB limitation WAR */ + if (mpt->is_1078 && + (((uint64_t)dm_segs->ds_addr + + MPI_SGE_LENGTH(se->FlagsLength)) >> + 32) == 9) { + addr |= (1 << 31); + tf |= MPI_SGE_FLAGS_LOCAL_ADDRESS; + } + se->Address.High = htole32(addr); } - MPI_pSGE_SET_LENGTH(se, dm_segs->ds_len); - tf = flags; - if (seg == this_seg_lim - 1) { + if (seg == this_seg_lim - 1) { tf |= MPI_SGE_FLAGS_LAST_ELEMENT; } if (seg == nseg - 1) { @@ -1868,7 +1877,7 @@ bad: /* * Make up the rest of the data segments out of a chain element - * (contiained in the current request frame) which points to + * (contained in the current request frame) which points to * SIMPLE32 elements in the next request frame, possibly ending * with *another* chain element (if there's more). */ @@ -1904,7 +1913,7 @@ bad: nxt_off += MPT_RQSL(mpt); /* - * Now initialized the chain descriptor. + * Now initialize the chain descriptor. */ memset(ce, 0, sizeof (*ce)); @@ -1958,7 +1967,7 @@ bad: MPI_pSGE_SET_LENGTH(se, dm_segs->ds_len); tf = flags; - if (seg == this_seg_lim - 1) { + if (seg == this_seg_lim - 1) { tf |= MPI_SGE_FLAGS_LAST_ELEMENT; } if (seg == nseg - 1) { Modified: head/sys/dev/mpt/mpt_pci.c ============================================================================== --- head/sys/dev/mpt/mpt_pci.c Sat Feb 11 11:34:53 2012 (r231517) +++ head/sys/dev/mpt/mpt_pci.c Sat Feb 11 12:03:44 2012 (r231518) @@ -438,6 +438,10 @@ mpt_pci_attach(device_t dev) case PCI_PRODUCT_LSI_FC7X04X: mpt->is_fc = 1; break; + case PCI_PRODUCT_LSI_SAS1078: + case PCI_PRODUCT_LSI_SAS1078DE: + mpt->is_1078 = 1; + /* FALLTHROUGH */ case PCI_PRODUCT_LSI_SAS1064: case PCI_PRODUCT_LSI_SAS1064A: case PCI_PRODUCT_LSI_SAS1064E: @@ -445,8 +449,6 @@ mpt_pci_attach(device_t dev) case PCI_PRODUCT_LSI_SAS1066E: case PCI_PRODUCT_LSI_SAS1068: case PCI_PRODUCT_LSI_SAS1068E: - case PCI_PRODUCT_LSI_SAS1078: - case PCI_PRODUCT_LSI_SAS1078DE: mpt->is_sas = 1; break; default: @@ -527,23 +529,31 @@ mpt_pci_attach(device_t dev) mpt->pci_pio_reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &mpt_io_bar, RF_ACTIVE); if (mpt->pci_pio_reg == NULL) { - device_printf(dev, "unable to map registers in PIO mode\n"); - goto bad; + if (bootverbose) { + device_printf(dev, + "unable to map registers in PIO mode\n"); + } + } else { + mpt->pci_pio_st = rman_get_bustag(mpt->pci_pio_reg); + mpt->pci_pio_sh = rman_get_bushandle(mpt->pci_pio_reg); } - mpt->pci_pio_st = rman_get_bustag(mpt->pci_pio_reg); - mpt->pci_pio_sh = rman_get_bushandle(mpt->pci_pio_reg); /* Allocate kernel virtual memory for the 9x9's Mem0 region */ mpt_mem_bar = PCIR_BAR(mpt_mem_bar); mpt->pci_reg = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &mpt_mem_bar, RF_ACTIVE); if (mpt->pci_reg == NULL) { - device_printf(dev, "Unable to memory map registers.\n"); - if (mpt->is_sas) { + if (bootverbose || mpt->is_sas || mpt->pci_pio_reg == NULL) { + device_printf(dev, + "Unable to memory map registers.\n"); + } + if (mpt->is_sas || mpt->pci_pio_reg == NULL) { device_printf(dev, "Giving Up.\n"); goto bad; } - device_printf(dev, "Falling back to PIO mode.\n"); + if (bootverbose) { + device_printf(dev, "Falling back to PIO mode.\n"); + } mpt->pci_st = mpt->pci_pio_st; mpt->pci_sh = mpt->pci_pio_sh; } else { Modified: head/sys/dev/mpt/mpt_reg.h ============================================================================== --- head/sys/dev/mpt/mpt_reg.h Sat Feb 11 11:34:53 2012 (r231517) +++ head/sys/dev/mpt/mpt_reg.h Sat Feb 11 12:03:44 2012 (r231518) @@ -77,6 +77,7 @@ #define MPT_OFFSET_REPLY_Q 0x44 #define MPT_OFFSET_HOST_INDEX 0x50 #define MPT_OFFSET_FUBAR 0x90 +#define MPT_OFFSET_RESET_1078 0x10fc /* Bit Maps for DOORBELL register */ enum DB_STATE_BITS { From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 12:16:23 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9407D106564A; Sat, 11 Feb 2012 12:16:23 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id F09228FC17; Sat, 11 Feb 2012 12:16:21 +0000 (UTC) Received: by bkcjg1 with SMTP id jg1so3175415bkc.13 for ; Sat, 11 Feb 2012 04:16:21 -0800 (PST) Received: by 10.204.133.219 with SMTP id g27mr4086642bkt.47.1328962580613; Sat, 11 Feb 2012 04:16:20 -0800 (PST) Received: from [10.254.254.77] (ppp95-165-138-46.pppoe.spdop.ru. [95.165.138.46]) by mx.google.com with ESMTPS id cg2sm26572991bkb.12.2012.02.11.04.16.18 (version=SSLv3 cipher=OTHER); Sat, 11 Feb 2012 04:16:19 -0800 (PST) Message-ID: <4F365C10.5050607@zonov.org> Date: Sat, 11 Feb 2012 16:16:16 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; ru; rv:1.8.1.24) Gecko/20100228 Thunderbird/2.0.0.24 Mnenhy/0.7.6.0 MIME-Version: 1.0 To: Mikolaj Golub References: <27A0A960-F767-4D2C-BF3E-31F73FBF4E28@palisadesystems.com> <86zkcy5ur9.fsf@kopusha.home.net> <20120205093938.GC30033@garage.freebsd.pl> <86lioh7yz5.fsf@kopusha.home.net> <20120205214647.GI30033@garage.freebsd.pl> <86sjiov29o.fsf@in138.ua3> <20120206082706.GA1324@garage.freebsd.pl> <86wr7zmy8f.fsf@kopusha.home.net> <20120206221742.GA1336@garage.freebsd.pl> <86liodu3me.fsf@in138.ua3> <20120208090600.GA1308@garage.freebsd.pl> <86sjihsln4.fsf@kopusha.home.net> In-Reply-To: <86sjihsln4.fsf@kopusha.home.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQmjkqkIuqoUexHDY0ur6TVcdRP1OJ1Pu+5O3Ea83Keh9e8ddwR+SS+CWo0w0Mal3kXhHE21 Cc: svn-src-head@FreeBSD.org, Guy Helmer , svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, Pawel Jakub Dawidek Subject: Re: svn commit: r230869 - head/usr.sbin/daemon X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 12:16:23 -0000 On 11.02.2012 14:35, Mikolaj Golub wrote: > > Thank you. Here are the patches I would like to commit if there are no > objections or other suggestions: > > http://people.freebsd.org/~trociny/daemon/daemon.spawn.1.patch > http://people.freebsd.org/~trociny/daemon/daemon.SIGTERM.1.patch > http://people.freebsd.org/~trociny/daemon/daemon.restart.1.patch > There are two more suggestions, if you don't mind. Use madvise(MADV_PROTECT). It would be useful because of the daemon(8) should not leak or eats much memory. Check return code from pidfile_write() function. I saw many times when pid could not be written because of there is not enough free space (but file was created). Unfortunately, I have no suggestions how to handle this properly. -- Andrey Zonov From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 13:41:38 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CFC141065673; Sat, 11 Feb 2012 13:41:38 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id BEC998FC17; Sat, 11 Feb 2012 13:41:38 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1BDfcZa033226; Sat, 11 Feb 2012 13:41:38 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BDfcsv033224; Sat, 11 Feb 2012 13:41:38 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202111341.q1BDfcsv033224@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 11 Feb 2012 13:41:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231520 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 13:41:38 -0000 Author: bz Date: Sat Feb 11 13:41:38 2012 New Revision: 231520 URL: http://svn.freebsd.org/changeset/base/231520 Log: Properly name the sysctl to "iflistl" rather than "iflist2", which had been the prototype name and slipped in in r231505. Spotted in a reply from: bde MFC after: 3 days Modified: head/sys/sys/socket.h Modified: head/sys/sys/socket.h ============================================================================== --- head/sys/sys/socket.h Sat Feb 11 13:12:53 2012 (r231519) +++ head/sys/sys/socket.h Sat Feb 11 13:41:38 2012 (r231520) @@ -406,7 +406,7 @@ struct sockproto { { "flags", CTLTYPE_STRUCT }, \ { "iflist", CTLTYPE_STRUCT }, \ { "ifmalist", CTLTYPE_STRUCT }, \ - { "iflist2", CTLTYPE_STRUCT }, \ + { "iflistl", CTLTYPE_STRUCT }, \ } #endif /* __BSD_VISIBLE */ From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 13:50:28 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 72EB11065670; Sat, 11 Feb 2012 13:50:28 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from mx1.sbone.de (mx1.sbone.de [IPv6:2a01:4f8:130:3ffc::401:25]) by mx1.freebsd.org (Postfix) with ESMTP id F385B8FC0A; Sat, 11 Feb 2012 13:50:27 +0000 (UTC) Received: from mail.sbone.de (mail.sbone.de [IPv6:fde9:577b:c1a9:31::2013:587]) (using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by mx1.sbone.de (Postfix) with ESMTPS id BB1F125D385E; Sat, 11 Feb 2012 13:50:26 +0000 (UTC) Received: from content-filter.sbone.de (content-filter.sbone.de [IPv6:fde9:577b:c1a9:31::2013:2742]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPS id C47F9BDB211; Sat, 11 Feb 2012 13:50:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at sbone.de Received: from mail.sbone.de ([IPv6:fde9:577b:c1a9:31::2013:587]) by content-filter.sbone.de (content-filter.sbone.de [fde9:577b:c1a9:31::2013:2742]) (amavisd-new, port 10024) with ESMTP id wJKHPHckGCLG; Sat, 11 Feb 2012 13:50:24 +0000 (UTC) Received: from orange-en1.sbone.de (orange-en1.sbone.de [IPv6:fde9:577b:c1a9:31:cabc:c8ff:fecf:e8e3]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail.sbone.de (Postfix) with ESMTPSA id B5B31BDB210; Sat, 11 Feb 2012 13:50:24 +0000 (UTC) Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset=us-ascii From: "Bjoern A. Zeeb" In-Reply-To: <201202111341.q1BDfcsv033224@svn.freebsd.org> Date: Sat, 11 Feb 2012 13:50:23 +0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <201202111341.q1BDfcsv033224@svn.freebsd.org> To: src-committers@freebsd.org X-Mailer: Apple Mail (2.1084) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org Subject: Re: svn commit: r231520 - head/sys/sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 13:50:28 -0000 On 11. Feb 2012, at 13:41 , Bjoern A. Zeeb wrote: > Author: bz > Date: Sat Feb 11 13:41:38 2012 > New Revision: 231520 > URL: http://svn.freebsd.org/changeset/base/231520 >=20 > Log: > Properly name the sysctl to "iflistl" rather than "iflist2", which = had been > the prototype name and slipped in in r231505. Not that it would make any difference, given it's entirely unused as bde = had pointed out but for consistency until someone will clean all this up. I currently do not feel like going through all of it and nuke it and = convert the numbered sysctls in rtsock.c etc. /bz >=20 > Spotted in a reply from: bde > MFC after: 3 days >=20 > Modified: > head/sys/sys/socket.h >=20 > Modified: head/sys/sys/socket.h > = =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 > --- head/sys/sys/socket.h Sat Feb 11 13:12:53 2012 = (r231519) > +++ head/sys/sys/socket.h Sat Feb 11 13:41:38 2012 = (r231520) > @@ -406,7 +406,7 @@ struct sockproto { > { "flags", CTLTYPE_STRUCT }, \ > { "iflist", CTLTYPE_STRUCT }, \ > { "ifmalist", CTLTYPE_STRUCT }, \ > - { "iflist2", CTLTYPE_STRUCT }, \ > + { "iflistl", CTLTYPE_STRUCT }, \ > } > #endif /* __BSD_VISIBLE */ >=20 --=20 Bjoern A. Zeeb You have to have visions! It does not matter how good you are. It matters what good you do! From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 13:57:32 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D70631065672; Sat, 11 Feb 2012 13:57:32 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 63C758FC0A; Sat, 11 Feb 2012 13:57:32 +0000 (UTC) Received: by iaeo4 with SMTP id o4so2190716iae.13 for ; Sat, 11 Feb 2012 05:57:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=YqG6POnUp6TX8g/fnXzKQIdw6hcpfQr3mVD4zc+YZTU=; b=YfhvEck3KgVECZz5zZPhpWhcvoOLEPcWMMK+G+xaXpxb0JzwdsmdaFYLvk20/9KgmT bYfTMM+zsqQedQ8iTIVUrYhcsYGfvaqdCQF0P4iCK3SLVFzhCokpP4uFLVGOXPYr+3IA pDCDjx6KnGdhPO9ocQonBeLW7WoQEyjQTGhBc= MIME-Version: 1.0 Received: by 10.50.236.34 with SMTP id ur2mr17333973igc.20.1328968651875; Sat, 11 Feb 2012 05:57:31 -0800 (PST) Sender: rmh.aybabtu@gmail.com Received: by 10.43.130.201 with HTTP; Sat, 11 Feb 2012 05:57:31 -0800 (PST) In-Reply-To: References: <201202040054.q140siBP012241@svn.freebsd.org> <4F2CFEE3.6070306@daemonic.se> Date: Sat, 11 Feb 2012 13:57:31 +0000 X-Google-Sender-Auth: K9k9Ge7oeNRsdYMVqc6s_DVxVL8 Message-ID: From: Robert Millan To: "Bjoern A. Zeeb" Content-Type: multipart/mixed; boundary=14dae9399d7d69a47904b8b0a061 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov , Adrian Chadd Subject: Re: svn commit: r230972 - in head: share/mk sys/amd64/conf sys/i386/conf sys/modules sys/modules/drm sys/modules/sound/driver sys/modules/usb tools/build/options X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 13:57:32 -0000 --14dae9399d7d69a47904b8b0a061 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable El 10 de febrer de 2012 19:42, Robert Millan ha escrit: > Here's a possible solution to this patch (untested). =C2=A0In case it loo= ks > fine to everyone (and my mentors approve it), I'll definitely test > with "make universe" before commit. Another possibility (perhaps a better one) would be to move those files off sys/${MACHINE}/conf directories, then they won't be picked up by "universe". Since they're not ${MACHINE}-specific, would sys/conf/ be a good location? Patch is attached. --14dae9399d7d69a47904b8b0a061 Content-Type: text/plain; charset=US-ASCII; name="without_sourceless.diff" Content-Disposition: attachment; filename="without_sourceless.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gyiplwfh1 SW5kZXg6IHN5cy9pMzg2L2NvbmYvV0lUSE9VVF9TT1VSQ0VMRVNTX0hPU1QKPT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQot LS0gc3lzL2kzODYvY29uZi9XSVRIT1VUX1NPVVJDRUxFU1NfSE9TVAkocmV2aXNpb24gMjMwOTcx KQorKysgc3lzL2kzODYvY29uZi9XSVRIT1VUX1NPVVJDRUxFU1NfSE9TVAkod29ya2luZyBjb3B5 KQpAQCAtMSwxMCArMCwwIEBACi0jCi0jIFdJVEhPVVRfU09VUkNFTEVTU19VQ09ERSAtLSBEaXNh YmxlIGRyaXZlcnMgdGhhdCBpbmNsdWRlIHNvdXJjZWxlc3MKLSMgbmF0aXZlIGNvZGUgZm9yIGhv c3QgQ1BVLgotIwotIyAkRnJlZUJTRCQKLQotbm9kZXZpY2UJaHB0Mjd4eAotbm9kZXZpY2UJaHB0 bXYKLW5vZGV2aWNlCWhwdHJyCi1ub2RldmljZQludmUKSW5kZXg6IHN5cy9pMzg2L2NvbmYvV0lU SE9VVF9TT1VSQ0VMRVNTX1VDT0RFCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9pMzg2L2NvbmYvV0lUSE9V VF9TT1VSQ0VMRVNTX1VDT0RFCShyZXZpc2lvbiAyMzA5NzEpCisrKyBzeXMvaTM4Ni9jb25mL1dJ VEhPVVRfU09VUkNFTEVTU19VQ09ERQkod29ya2luZyBjb3B5KQpAQCAtMSw0MSArMCwwIEBACi0j Ci0jIFdJVEhPVVRfU09VUkNFTEVTU19VQ09ERSAtLSBEaXNhYmxlIGRyaXZlcnMgdGhhdCBpbmNs dWRlIHNvdXJjZWxlc3MKLSMgbWljcm9jb2RlLgotIwotIyAkRnJlZUJTRCQKLQotbm9kZXZpY2UJ YWR3Ci1ub2RldmljZQliY2UKLW5vZGV2aWNlCWZhdG0KLW5vZGV2aWNlCWZ4cAotbm9kZXZpY2UJ aXNwZncKLW5vZGV2aWNlCW13bGZ3Ci1ub2RldmljZQlyYWxmdwotbm9kZXZpY2UJcnVuZncKLW5v ZGV2aWNlCXNmCi1ub2RldmljZQlzbgotbm9kZXZpY2UJdGkKLW5vZGV2aWNlCXR4cAotbm9kZXZp Y2UJY2UKLW5vZGV2aWNlCWNwCi1ub2RldmljZQljdGF1Ci1ub2RldmljZQlpcHdmdwotbm9kZXZp Y2UJaXdpZncKLW5vZGV2aWNlCWl3bmZ3Ci1ub2RldmljZQl3cGlmdwotCi0jIGRybQotbm9kZXZp Y2UJbWdhCi1ub2RldmljZQlyMTI4Ci1ub2RldmljZQlyYWRlb24KLQotIyBzb3VuZAotbm9kZXZp Y2UJY3NhCi1ub2RldmljZQlkczEKLW5vZGV2aWNlCW1hZXN0cm8zCi0KLSMgdXNiCi1ub2Rldmlj ZQlydW0KLW5vZGV2aWNlCXVhdGgKLW5vZGV2aWNlCXp5ZAotbm9kZXZpY2UJa3VlCkluZGV4OiBz eXMvaTM4Ni9jb25mL1dJVEhPVVRfU09VUkNFTEVTUwo9PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBzeXMvaTM4Ni9j b25mL1dJVEhPVVRfU09VUkNFTEVTUwkocmV2aXNpb24gMjMwOTcxKQorKysgc3lzL2kzODYvY29u Zi9XSVRIT1VUX1NPVVJDRUxFU1MJKHdvcmtpbmcgY29weSkKQEAgLTEsNyArMCwwIEBACi0jCi0j IFdJVEhPVVRfU09VUkNFTEVTUyAtLSBEaXNhYmxlIGRyaXZlcnMgdGhhdCBpbmNsdWRlIHNvdXJj ZWxlc3MgY29kZS4KLSMKLSMgJEZyZWVCU0QkCi0KLWluY2x1ZGUgV0lUSE9VVF9TT1VSQ0VMRVNT X0hPU1QKLWluY2x1ZGUgV0lUSE9VVF9TT1VSQ0VMRVNTX1VDT0RFCkluZGV4OiBzeXMvYW1kNjQv Y29uZi9XSVRIT1VUX1NPVVJDRUxFU1NfSE9TVAo9PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBzeXMvYW1kNjQvY29u Zi9XSVRIT1VUX1NPVVJDRUxFU1NfSE9TVAkocmV2aXNpb24gMjMwOTcxKQorKysgc3lzL2FtZDY0 L2NvbmYvV0lUSE9VVF9TT1VSQ0VMRVNTX0hPU1QJKHdvcmtpbmcgY29weSkKQEAgLTEsMTAgKzAs MCBAQAotIwotIyBXSVRIT1VUX1NPVVJDRUxFU1NfVUNPREUgLS0gRGlzYWJsZSBkcml2ZXJzIHRo YXQgaW5jbHVkZSBzb3VyY2VsZXNzCi0jIG5hdGl2ZSBjb2RlIGZvciBob3N0IENQVS4KLSMKLSMg JEZyZWVCU0QkCi0KLW5vZGV2aWNlCWhwdDI3eHgKLW5vZGV2aWNlCWhwdG12Ci1ub2RldmljZQlo cHRycgotbm9kZXZpY2UJbnZlCkluZGV4OiBzeXMvYW1kNjQvY29uZi9XSVRIT1VUX1NPVVJDRUxF U1NfVUNPREUKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PQotLS0gc3lzL2FtZDY0L2NvbmYvV0lUSE9VVF9TT1VSQ0VMRVNT X1VDT0RFCShyZXZpc2lvbiAyMzA5NzEpCisrKyBzeXMvYW1kNjQvY29uZi9XSVRIT1VUX1NPVVJD RUxFU1NfVUNPREUJKHdvcmtpbmcgY29weSkKQEAgLTEsNDEgKzAsMCBAQAotIwotIyBXSVRIT1VU X1NPVVJDRUxFU1NfVUNPREUgLS0gRGlzYWJsZSBkcml2ZXJzIHRoYXQgaW5jbHVkZSBzb3VyY2Vs ZXNzCi0jIG1pY3JvY29kZS4KLSMKLSMgJEZyZWVCU0QkCi0KLW5vZGV2aWNlCWFkdwotbm9kZXZp Y2UJYmNlCi1ub2RldmljZQlmYXRtCi1ub2RldmljZQlmeHAKLW5vZGV2aWNlCWlzcGZ3Ci1ub2Rl dmljZQltd2xmdwotbm9kZXZpY2UJcmFsZncKLW5vZGV2aWNlCXJ1bmZ3Ci1ub2RldmljZQlzZgot bm9kZXZpY2UJc24KLW5vZGV2aWNlCXRpCi1ub2RldmljZQl0eHAKLW5vZGV2aWNlCWNlCi1ub2Rl dmljZQljcAotbm9kZXZpY2UJY3RhdQotbm9kZXZpY2UJaXB3ZncKLW5vZGV2aWNlCWl3aWZ3Ci1u b2RldmljZQlpd25mdwotbm9kZXZpY2UJd3BpZncKLQotIyBkcm0KLW5vZGV2aWNlCW1nYQotbm9k ZXZpY2UJcjEyOAotbm9kZXZpY2UJcmFkZW9uCi0KLSMgc291bmQKLW5vZGV2aWNlCWNzYQotbm9k ZXZpY2UJZHMxCi1ub2RldmljZQltYWVzdHJvMwotCi0jIHVzYgotbm9kZXZpY2UJcnVtCi1ub2Rl dmljZQl1YXRoCi1ub2RldmljZQl6eWQKLW5vZGV2aWNlCWt1ZQpJbmRleDogc3lzL2FtZDY0L2Nv bmYvV0lUSE9VVF9TT1VSQ0VMRVNTCj09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0KLS0tIHN5cy9hbWQ2NC9jb25mL1dJVEhP VVRfU09VUkNFTEVTUwkocmV2aXNpb24gMjMwOTcxKQorKysgc3lzL2FtZDY0L2NvbmYvV0lUSE9V VF9TT1VSQ0VMRVNTCSh3b3JraW5nIGNvcHkpCkBAIC0xLDcgKzAsMCBAQAotIwotIyBXSVRIT1VU X1NPVVJDRUxFU1MgLS0gRGlzYWJsZSBkcml2ZXJzIHRoYXQgaW5jbHVkZSBzb3VyY2VsZXNzIGNv ZGUuCi0jCi0jICRGcmVlQlNEJAotCi1pbmNsdWRlIFdJVEhPVVRfU09VUkNFTEVTU19IT1NUCi1p bmNsdWRlIFdJVEhPVVRfU09VUkNFTEVTU19VQ09ERQo= --14dae9399d7d69a47904b8b0a061-- From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 14:07:12 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CF5AE106566C; Sat, 11 Feb 2012 14:07:12 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 0F3AE8FC0A; Sat, 11 Feb 2012 14:07:11 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q1BE775D033530 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 11 Feb 2012 16:07:07 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q1BE777I056796; Sat, 11 Feb 2012 16:07:07 +0200 (EET) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q1BE77Wv056795; Sat, 11 Feb 2012 16:07:07 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Sat, 11 Feb 2012 16:07:07 +0200 From: Konstantin Belousov To: Robert Millan Message-ID: <20120211140707.GS3283@deviant.kiev.zoral.com.ua> References: <201202040054.q140siBP012241@svn.freebsd.org> <4F2CFEE3.6070306@daemonic.se> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NhNFzfCfperyfXiA" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-3.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: Adrian Chadd , src-committers@freebsd.org, svn-src-all@freebsd.org, Konstantin Belousov , svn-src-head@freebsd.org, "Bjoern A. Zeeb" Subject: Re: svn commit: r230972 - in head: share/mk sys/amd64/conf sys/i386/conf sys/modules sys/modules/drm sys/modules/sound/driver sys/modules/usb tools/build/options X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 14:07:12 -0000 --NhNFzfCfperyfXiA Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Feb 11, 2012 at 01:57:31PM +0000, Robert Millan wrote: > El 10 de febrer de 2012 19:42, Robert Millan ha escrit: > > Here's a possible solution to this patch (untested). =9AIn case it looks > > fine to everyone (and my mentors approve it), I'll definitely test > > with "make universe" before commit. >=20 > Another possibility (perhaps a better one) would be to move those > files off sys/${MACHINE}/conf directories, then they won't be picked > up by "universe". Since they're not ${MACHINE}-specific, would > sys/conf/ be a good location? >=20 > Patch is attached. sys/conf is quite good, I like it. The files are much like NOTES. --NhNFzfCfperyfXiA Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk82dgsACgkQC3+MBN1Mb4isGQCeIaN4qzV/aIqqbfCyPaYYTvro LHYAoJ+vAEN83fhBYe8H6V1DdBioPscU =nzXX -----END PGP SIGNATURE----- --NhNFzfCfperyfXiA-- From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 14:38:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8DFB3106564A; Sat, 11 Feb 2012 14:38:47 +0000 (UTC) (envelope-from rmh.aybabtu@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id E8E2A8FC13; Sat, 11 Feb 2012 14:38:46 +0000 (UTC) Received: by iaeo4 with SMTP id o4so2239551iae.13 for ; Sat, 11 Feb 2012 06:38:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=cTByrUdVJelzFWfEadycft7XO4o4Dev/6HOPi6Oy3IA=; b=E1/78MXUNU/9wbHZ2siB6pCPiqfKMdhoIEEDhvZC2F/p5JisJixSZkQZSlhu0cBghi 8lYq+SKb/F9UB6Nro+i2xXc/lFKs2cbWMg9Nz5ht/7mGA9AwvvTuTQMwVWgvUeR4az3t DZO/ho4h8eXVTJWoRe0gfXR5wtHBVAzlzR1cs= MIME-Version: 1.0 Received: by 10.50.236.73 with SMTP id us9mr10329723igc.16.1328971126324; Sat, 11 Feb 2012 06:38:46 -0800 (PST) Sender: rmh.aybabtu@gmail.com Received: by 10.43.130.201 with HTTP; Sat, 11 Feb 2012 06:38:46 -0800 (PST) In-Reply-To: References: <201202040054.q140siBP012241@svn.freebsd.org> <4F2CFEE3.6070306@daemonic.se> Date: Sat, 11 Feb 2012 14:38:46 +0000 X-Google-Sender-Auth: J0ov12yfBykI_nBSV3LJpB4JxnM Message-ID: From: Robert Millan To: "Bjoern A. Zeeb" Content-Type: multipart/mixed; boundary=14dae934125de6bf8f04b8b13350 Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, Konstantin Belousov , Adrian Chadd Subject: Re: svn commit: r230972 - in head: share/mk sys/amd64/conf sys/i386/conf sys/modules sys/modules/drm sys/modules/sound/driver sys/modules/usb tools/build/options X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 14:38:47 -0000 --14dae934125de6bf8f04b8b13350 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable El 11 de febrer de 2012 13:57, Robert Millan ha escrit: > Another possibility (perhaps a better one) would be to move those > files off sys/${MACHINE}/conf directories, then they won't be picked > up by "universe". =C2=A0Since they're not ${MACHINE}-specific, would > sys/conf/ be a good location? > > Patch is attached. Sorry, I noticed that "svn diff" didn't include moved files in the patch. Here's the complete diff. --14dae934125de6bf8f04b8b13350 Content-Type: text/plain; charset=US-ASCII; name="without_sourceless.diff" Content-Disposition: attachment; filename="without_sourceless.diff" Content-Transfer-Encoding: base64 X-Attachment-Id: f_gyir39y61 ZGlmZiAtTnVyIC14IC5zdm4gc3lzLm9sZC9hbWQ2NC9jb25mL1dJVEhPVVRfU09VUkNFTEVTUyBz eXMvYW1kNjQvY29uZi9XSVRIT1VUX1NPVVJDRUxFU1MKLS0tIHN5cy5vbGQvYW1kNjQvY29uZi9X SVRIT1VUX1NPVVJDRUxFU1MJMjAxMi0wMi0xMSAxNTozMTo0OS4yOTcwOTE1NTYgKzAxMDAKKysr IHN5cy9hbWQ2NC9jb25mL1dJVEhPVVRfU09VUkNFTEVTUwkxOTcwLTAxLTAxIDAxOjAwOjAwLjAw MDAwMDAwMCArMDEwMApAQCAtMSw3ICswLDAgQEAKLSMKLSMgV0lUSE9VVF9TT1VSQ0VMRVNTIC0t IERpc2FibGUgZHJpdmVycyB0aGF0IGluY2x1ZGUgc291cmNlbGVzcyBjb2RlLgotIwotIyAkRnJl ZUJTRCQKLQotaW5jbHVkZSBXSVRIT1VUX1NPVVJDRUxFU1NfSE9TVAotaW5jbHVkZSBXSVRIT1VU X1NPVVJDRUxFU1NfVUNPREUKZGlmZiAtTnVyIC14IC5zdm4gc3lzLm9sZC9hbWQ2NC9jb25mL1dJ VEhPVVRfU09VUkNFTEVTU19IT1NUIHN5cy9hbWQ2NC9jb25mL1dJVEhPVVRfU09VUkNFTEVTU19I T1NUCi0tLSBzeXMub2xkL2FtZDY0L2NvbmYvV0lUSE9VVF9TT1VSQ0VMRVNTX0hPU1QJMjAxMi0w Mi0xMSAxNTozMTo0OS4yOTQwOTMzNDcgKzAxMDAKKysrIHN5cy9hbWQ2NC9jb25mL1dJVEhPVVRf U09VUkNFTEVTU19IT1NUCTE5NzAtMDEtMDEgMDE6MDA6MDAuMDAwMDAwMDAwICswMTAwCkBAIC0x LDEwICswLDAgQEAKLSMKLSMgV0lUSE9VVF9TT1VSQ0VMRVNTX1VDT0RFIC0tIERpc2FibGUgZHJp dmVycyB0aGF0IGluY2x1ZGUgc291cmNlbGVzcwotIyBuYXRpdmUgY29kZSBmb3IgaG9zdCBDUFUu Ci0jCi0jICRGcmVlQlNEJAotCi1ub2RldmljZQlocHQyN3h4Ci1ub2RldmljZQlocHRtdgotbm9k ZXZpY2UJaHB0cnIKLW5vZGV2aWNlCW52ZQpkaWZmIC1OdXIgLXggLnN2biBzeXMub2xkL2FtZDY0 L2NvbmYvV0lUSE9VVF9TT1VSQ0VMRVNTX1VDT0RFIHN5cy9hbWQ2NC9jb25mL1dJVEhPVVRfU09V UkNFTEVTU19VQ09ERQotLS0gc3lzLm9sZC9hbWQ2NC9jb25mL1dJVEhPVVRfU09VUkNFTEVTU19V Q09ERQkyMDEyLTAyLTExIDE1OjMxOjQ5LjI5NjA5MzY0MyArMDEwMAorKysgc3lzL2FtZDY0L2Nv bmYvV0lUSE9VVF9TT1VSQ0VMRVNTX1VDT0RFCTE5NzAtMDEtMDEgMDE6MDA6MDAuMDAwMDAwMDAw ICswMTAwCkBAIC0xLDQxICswLDAgQEAKLSMKLSMgV0lUSE9VVF9TT1VSQ0VMRVNTX1VDT0RFIC0t IERpc2FibGUgZHJpdmVycyB0aGF0IGluY2x1ZGUgc291cmNlbGVzcwotIyBtaWNyb2NvZGUuCi0j Ci0jICRGcmVlQlNEJAotCi1ub2RldmljZQlhZHcKLW5vZGV2aWNlCWJjZQotbm9kZXZpY2UJZmF0 bQotbm9kZXZpY2UJZnhwCi1ub2RldmljZQlpc3Bmdwotbm9kZXZpY2UJbXdsZncKLW5vZGV2aWNl CXJhbGZ3Ci1ub2RldmljZQlydW5mdwotbm9kZXZpY2UJc2YKLW5vZGV2aWNlCXNuCi1ub2Rldmlj ZQl0aQotbm9kZXZpY2UJdHhwCi1ub2RldmljZQljZQotbm9kZXZpY2UJY3AKLW5vZGV2aWNlCWN0 YXUKLW5vZGV2aWNlCWlwd2Z3Ci1ub2RldmljZQlpd2lmdwotbm9kZXZpY2UJaXduZncKLW5vZGV2 aWNlCXdwaWZ3Ci0KLSMgZHJtCi1ub2RldmljZQltZ2EKLW5vZGV2aWNlCXIxMjgKLW5vZGV2aWNl CXJhZGVvbgotCi0jIHNvdW5kCi1ub2RldmljZQljc2EKLW5vZGV2aWNlCWRzMQotbm9kZXZpY2UJ bWFlc3RybzMKLQotIyB1c2IKLW5vZGV2aWNlCXJ1bQotbm9kZXZpY2UJdWF0aAotbm9kZXZpY2UJ enlkCi1ub2RldmljZQlrdWUKZGlmZiAtTnVyIC14IC5zdm4gc3lzLm9sZC9jb25mL1dJVEhPVVRf U09VUkNFTEVTUyBzeXMvY29uZi9XSVRIT1VUX1NPVVJDRUxFU1MKLS0tIHN5cy5vbGQvY29uZi9X SVRIT1VUX1NPVVJDRUxFU1MJMTk3MC0wMS0wMSAwMTowMDowMC4wMDAwMDAwMDAgKzAxMDAKKysr IHN5cy9jb25mL1dJVEhPVVRfU09VUkNFTEVTUwkyMDEyLTAyLTExIDE0OjUzOjEyLjc3ODE2NDAw MCArMDEwMApAQCAtMCwwICsxLDcgQEAKKyMKKyMgV0lUSE9VVF9TT1VSQ0VMRVNTIC0tIERpc2Fi bGUgZHJpdmVycyB0aGF0IGluY2x1ZGUgc291cmNlbGVzcyBjb2RlLgorIworIyAkRnJlZUJTRCQK KworaW5jbHVkZSBXSVRIT1VUX1NPVVJDRUxFU1NfSE9TVAoraW5jbHVkZSBXSVRIT1VUX1NPVVJD RUxFU1NfVUNPREUKZGlmZiAtTnVyIC14IC5zdm4gc3lzLm9sZC9jb25mL1dJVEhPVVRfU09VUkNF TEVTU19IT1NUIHN5cy9jb25mL1dJVEhPVVRfU09VUkNFTEVTU19IT1NUCi0tLSBzeXMub2xkL2Nv bmYvV0lUSE9VVF9TT1VSQ0VMRVNTX0hPU1QJMTk3MC0wMS0wMSAwMTowMDowMC4wMDAwMDAwMDAg KzAxMDAKKysrIHN5cy9jb25mL1dJVEhPVVRfU09VUkNFTEVTU19IT1NUCTIwMTItMDItMTEgMTQ6 NTM6MTIuNzgyMTYzMDAwICswMTAwCkBAIC0wLDAgKzEsMTAgQEAKKyMKKyMgV0lUSE9VVF9TT1VS Q0VMRVNTX1VDT0RFIC0tIERpc2FibGUgZHJpdmVycyB0aGF0IGluY2x1ZGUgc291cmNlbGVzcwor IyBuYXRpdmUgY29kZSBmb3IgaG9zdCBDUFUuCisjCisjICRGcmVlQlNEJAorCitub2RldmljZQlo cHQyN3h4Citub2RldmljZQlocHRtdgorbm9kZXZpY2UJaHB0cnIKK25vZGV2aWNlCW52ZQpkaWZm IC1OdXIgLXggLnN2biBzeXMub2xkL2NvbmYvV0lUSE9VVF9TT1VSQ0VMRVNTX1VDT0RFIHN5cy9j b25mL1dJVEhPVVRfU09VUkNFTEVTU19VQ09ERQotLS0gc3lzLm9sZC9jb25mL1dJVEhPVVRfU09V UkNFTEVTU19VQ09ERQkxOTcwLTAxLTAxIDAxOjAwOjAwLjAwMDAwMDAwMCArMDEwMAorKysgc3lz L2NvbmYvV0lUSE9VVF9TT1VSQ0VMRVNTX1VDT0RFCTIwMTItMDItMTEgMTQ6NTM6MTIuODA3MTY0 MDAwICswMTAwCkBAIC0wLDAgKzEsNDEgQEAKKyMKKyMgV0lUSE9VVF9TT1VSQ0VMRVNTX1VDT0RF IC0tIERpc2FibGUgZHJpdmVycyB0aGF0IGluY2x1ZGUgc291cmNlbGVzcworIyBtaWNyb2NvZGUu CisjCisjICRGcmVlQlNEJAorCitub2RldmljZQlhZHcKK25vZGV2aWNlCWJjZQorbm9kZXZpY2UJ ZmF0bQorbm9kZXZpY2UJZnhwCitub2RldmljZQlpc3Bmdworbm9kZXZpY2UJbXdsZncKK25vZGV2 aWNlCXJhbGZ3Citub2RldmljZQlydW5mdworbm9kZXZpY2UJc2YKK25vZGV2aWNlCXNuCitub2Rl dmljZQl0aQorbm9kZXZpY2UJdHhwCitub2RldmljZQljZQorbm9kZXZpY2UJY3AKK25vZGV2aWNl CWN0YXUKK25vZGV2aWNlCWlwd2Z3Citub2RldmljZQlpd2lmdworbm9kZXZpY2UJaXduZncKK25v ZGV2aWNlCXdwaWZ3CisKKyMgZHJtCitub2RldmljZQltZ2EKK25vZGV2aWNlCXIxMjgKK25vZGV2 aWNlCXJhZGVvbgorCisjIHNvdW5kCitub2RldmljZQljc2EKK25vZGV2aWNlCWRzMQorbm9kZXZp Y2UJbWFlc3RybzMKKworIyB1c2IKK25vZGV2aWNlCXJ1bQorbm9kZXZpY2UJdWF0aAorbm9kZXZp Y2UJenlkCitub2RldmljZQlrdWUKZGlmZiAtTnVyIC14IC5zdm4gc3lzLm9sZC9pMzg2L2NvbmYv V0lUSE9VVF9TT1VSQ0VMRVNTIHN5cy9pMzg2L2NvbmYvV0lUSE9VVF9TT1VSQ0VMRVNTCi0tLSBz eXMub2xkL2kzODYvY29uZi9XSVRIT1VUX1NPVVJDRUxFU1MJMjAxMi0wMi0xMSAxNTozMTo0OS4z MDIwOTA5MDAgKzAxMDAKKysrIHN5cy9pMzg2L2NvbmYvV0lUSE9VVF9TT1VSQ0VMRVNTCTE5NzAt MDEtMDEgMDE6MDA6MDAuMDAwMDAwMDAwICswMTAwCkBAIC0xLDcgKzAsMCBAQAotIwotIyBXSVRI T1VUX1NPVVJDRUxFU1MgLS0gRGlzYWJsZSBkcml2ZXJzIHRoYXQgaW5jbHVkZSBzb3VyY2VsZXNz IGNvZGUuCi0jCi0jICRGcmVlQlNEJAotCi1pbmNsdWRlIFdJVEhPVVRfU09VUkNFTEVTU19IT1NU Ci1pbmNsdWRlIFdJVEhPVVRfU09VUkNFTEVTU19VQ09ERQpkaWZmIC1OdXIgLXggLnN2biBzeXMu b2xkL2kzODYvY29uZi9XSVRIT1VUX1NPVVJDRUxFU1NfSE9TVCBzeXMvaTM4Ni9jb25mL1dJVEhP VVRfU09VUkNFTEVTU19IT1NUCi0tLSBzeXMub2xkL2kzODYvY29uZi9XSVRIT1VUX1NPVVJDRUxF U1NfSE9TVAkyMDEyLTAyLTExIDE1OjMxOjQ5LjMwMDA5MTE2MiArMDEwMAorKysgc3lzL2kzODYv Y29uZi9XSVRIT1VUX1NPVVJDRUxFU1NfSE9TVAkxOTcwLTAxLTAxIDAxOjAwOjAwLjAwMDAwMDAw MCArMDEwMApAQCAtMSwxMCArMCwwIEBACi0jCi0jIFdJVEhPVVRfU09VUkNFTEVTU19VQ09ERSAt LSBEaXNhYmxlIGRyaXZlcnMgdGhhdCBpbmNsdWRlIHNvdXJjZWxlc3MKLSMgbmF0aXZlIGNvZGUg Zm9yIGhvc3QgQ1BVLgotIwotIyAkRnJlZUJTRCQKLQotbm9kZXZpY2UJaHB0Mjd4eAotbm9kZXZp Y2UJaHB0bXYKLW5vZGV2aWNlCWhwdHJyCi1ub2RldmljZQludmUKZGlmZiAtTnVyIC14IC5zdm4g c3lzLm9sZC9pMzg2L2NvbmYvV0lUSE9VVF9TT1VSQ0VMRVNTX1VDT0RFIHN5cy9pMzg2L2NvbmYv V0lUSE9VVF9TT1VSQ0VMRVNTX1VDT0RFCi0tLSBzeXMub2xkL2kzODYvY29uZi9XSVRIT1VUX1NP VVJDRUxFU1NfVUNPREUJMjAxMi0wMi0xMSAxNTozMTo0OS4zMDEwOTEwMzEgKzAxMDAKKysrIHN5 cy9pMzg2L2NvbmYvV0lUSE9VVF9TT1VSQ0VMRVNTX1VDT0RFCTE5NzAtMDEtMDEgMDE6MDA6MDAu MDAwMDAwMDAwICswMTAwCkBAIC0xLDQxICswLDAgQEAKLSMKLSMgV0lUSE9VVF9TT1VSQ0VMRVNT X1VDT0RFIC0tIERpc2FibGUgZHJpdmVycyB0aGF0IGluY2x1ZGUgc291cmNlbGVzcwotIyBtaWNy b2NvZGUuCi0jCi0jICRGcmVlQlNEJAotCi1ub2RldmljZQlhZHcKLW5vZGV2aWNlCWJjZQotbm9k ZXZpY2UJZmF0bQotbm9kZXZpY2UJZnhwCi1ub2RldmljZQlpc3Bmdwotbm9kZXZpY2UJbXdsZncK LW5vZGV2aWNlCXJhbGZ3Ci1ub2RldmljZQlydW5mdwotbm9kZXZpY2UJc2YKLW5vZGV2aWNlCXNu Ci1ub2RldmljZQl0aQotbm9kZXZpY2UJdHhwCi1ub2RldmljZQljZQotbm9kZXZpY2UJY3AKLW5v ZGV2aWNlCWN0YXUKLW5vZGV2aWNlCWlwd2Z3Ci1ub2RldmljZQlpd2lmdwotbm9kZXZpY2UJaXdu ZncKLW5vZGV2aWNlCXdwaWZ3Ci0KLSMgZHJtCi1ub2RldmljZQltZ2EKLW5vZGV2aWNlCXIxMjgK LW5vZGV2aWNlCXJhZGVvbgotCi0jIHNvdW5kCi1ub2RldmljZQljc2EKLW5vZGV2aWNlCWRzMQot bm9kZXZpY2UJbWFlc3RybzMKLQotIyB1c2IKLW5vZGV2aWNlCXJ1bQotbm9kZXZpY2UJdWF0aAot bm9kZXZpY2UJenlkCi1ub2RldmljZQlrdWUK --14dae934125de6bf8f04b8b13350-- From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 14:49:25 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id BE7011065670; Sat, 11 Feb 2012 14:49:25 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id AD50B8FC0C; Sat, 11 Feb 2012 14:49:25 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1BEnPov035388; Sat, 11 Feb 2012 14:49:25 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BEnPqA035385; Sat, 11 Feb 2012 14:49:25 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202111449.q1BEnPqA035385@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 11 Feb 2012 14:49:25 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231521 - in head/sys: kern sys X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 14:49:25 -0000 Author: kib Date: Sat Feb 11 14:49:25 2012 New Revision: 231521 URL: http://svn.freebsd.org/changeset/base/231521 Log: The PTRACESTOP() macro is used only once. Inline the only use and remove the macro. MFC after: 1 week Modified: head/sys/kern/subr_syscall.c head/sys/sys/ptrace.h Modified: head/sys/kern/subr_syscall.c ============================================================================== --- head/sys/kern/subr_syscall.c Sat Feb 11 13:41:38 2012 (r231520) +++ head/sys/kern/subr_syscall.c Sat Feb 11 14:49:25 2012 (r231521) @@ -85,7 +85,11 @@ syscallenter(struct thread *td, struct s if (error == 0) { STOPEVENT(p, S_SCE, sa->narg); - PTRACESTOP_SC(p, td, S_PT_SCE); + if (p->p_flag & P_TRACED && p->p_stops & S_PT_SCE) { + PROC_LOCK(p); + ptracestop((td), SIGTRAP); + PROC_UNLOCK(p); + } if (td->td_dbgflags & TDB_USERWR) { /* * Reread syscall number and arguments if Modified: head/sys/sys/ptrace.h ============================================================================== --- head/sys/sys/ptrace.h Sat Feb 11 13:41:38 2012 (r231520) +++ head/sys/sys/ptrace.h Sat Feb 11 14:49:25 2012 (r231521) @@ -131,12 +131,6 @@ struct ptrace_vm_entry { #ifdef _KERNEL -#define PTRACESTOP_SC(p, td, flag) \ - if ((p)->p_flag & P_TRACED && (p)->p_stops & (flag)) { \ - PROC_LOCK(p); \ - ptracestop((td), SIGTRAP); \ - PROC_UNLOCK(p); \ - } /* * The flags below are used for ptrace(2) tracing and have no relation * to procfs. They are stored in struct proc's p_stops member. From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 16:34:03 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2C051065670; Sat, 11 Feb 2012 16:34:03 +0000 (UTC) (envelope-from cracauer@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CD6D08FC12; Sat, 11 Feb 2012 16:34:03 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1BGY37x038863; Sat, 11 Feb 2012 16:34:03 GMT (envelope-from cracauer@svn.freebsd.org) Received: (from cracauer@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BGY3BN038861; Sat, 11 Feb 2012 16:34:03 GMT (envelope-from cracauer@svn.freebsd.org) Message-Id: <201202111634.q1BGY3BN038861@svn.freebsd.org> From: Martin Cracauer Date: Sat, 11 Feb 2012 16:34:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231524 - head/usr.bin/tee X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 16:34:04 -0000 Author: cracauer Date: Sat Feb 11 16:34:03 2012 New Revision: 231524 URL: http://svn.freebsd.org/changeset/base/231524 Log: Reverting last change r231449 (fix bin/164947) due to concerns voiced on src-committers and the fact that I can only take care of this in a week. Modified: head/usr.bin/tee/tee.c Modified: head/usr.bin/tee/tee.c ============================================================================== --- head/usr.bin/tee/tee.c Sat Feb 11 14:58:46 2012 (r231523) +++ head/usr.bin/tee/tee.c Sat Feb 11 16:34:03 2012 (r231524) @@ -42,10 +42,8 @@ static const char rcsid[] = #endif /* not lint */ #include -#include #include #include -#include #include #include #include @@ -62,7 +60,6 @@ static LIST *head; static void add(int, const char *); static void usage(void); -static void waitfor(int fd); int main(int argc, char *argv[]) @@ -109,14 +106,9 @@ main(int argc, char *argv[]) bp = buf; do { if ((wval = write(p->fd, bp, n)) == -1) { - if (errno == EAGAIN) { - waitfor(p->fd); - wval = 0; - } else { - warn("%s", p->name); - exitval = 1; - break; - } + warn("%s", p->name); + exitval = 1; + break; } bp += wval; } while (n -= wval); @@ -145,15 +137,3 @@ add(int fd, const char *name) p->next = head; head = p; } - -/* Wait for the specified fd to be ready for writing */ -static void -waitfor(int fd) -{ - fd_set writefds; - - FD_ZERO(&writefds); - FD_SET(fd, &writefds); - if (select(fd + 1, NULL, &writefds, NULL, NULL) == -1) - err(1, "select"); -} From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 16:38:13 2012 Return-Path: Delivered-To: svn-src-head@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1F23A106566C; Sat, 11 Feb 2012 16:38:13 +0000 (UTC) (envelope-from cracauer@koef.zs64.net) Received: from koef.zs64.net (koef.zs64.net [IPv6:2001:470:1f0b:105e::1e6]) by mx1.freebsd.org (Postfix) with ESMTP id C75D98FC0A; Sat, 11 Feb 2012 16:38:09 +0000 (UTC) Received: from koef.zs64.net (koef.zs64.net [IPv6:2001:470:1f0b:105e::1e6]) by koef.zs64.net (8.14.5/8.14.5) with ESMTP id q1BGc7R5080395; Sat, 11 Feb 2012 16:38:07 GMT (envelope-from cracauer@koef.zs64.net) Received: (from cracauer@localhost) by koef.zs64.net (8.14.5/8.14.5/Submit) id q1BGc77j080394; Sat, 11 Feb 2012 11:38:07 -0500 (EST) (envelope-from cracauer) Date: Sat, 11 Feb 2012 11:38:07 -0500 From: Martin Cracauer To: Bruce Evans Message-ID: <20120211163807.GA25525@cons.org> References: <201202102216.q1AMGI0m098192@svn.freebsd.org> <20120211194854.J2214@besplex.bde.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120211194854.J2214@besplex.bde.org> User-Agent: Mutt/1.4.2.3i Cc: svn-src-head@FreeBSD.ORG, Martin Cracauer , svn-src-all@FreeBSD.ORG, src-committers@FreeBSD.ORG Subject: Re: svn commit: r231449 - head/usr.bin/tee X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 16:38:13 -0000 I (kinda) knew I shouldn't have tried to do this real quick before leaving for a trip. I reverted the change and I'll fix the concerns including the commit message when I'm back in a week. Now I also want to know what exactly is going on in bash there, the difference between the explicit named pipe and bash'es construct is unexplained. Bruce, do you have a rule of thumb concerning reacting to EAGAIN with select/poll or with a busy loop, or with one try instantly and then going with select? Martin -- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Martin Cracauer http://www.cons.org/cracauer/ From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 16:41:52 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B6A0D106564A; Sat, 11 Feb 2012 16:41:52 +0000 (UTC) (envelope-from pjd@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A19328FC1A; Sat, 11 Feb 2012 16:41:52 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1BGfqgk039141; Sat, 11 Feb 2012 16:41:52 GMT (envelope-from pjd@svn.freebsd.org) Received: (from pjd@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BGfqit039139; Sat, 11 Feb 2012 16:41:52 GMT (envelope-from pjd@svn.freebsd.org) Message-Id: <201202111641.q1BGfqit039139@svn.freebsd.org> From: Pawel Jakub Dawidek Date: Sat, 11 Feb 2012 16:41:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231525 - head/sbin/hastd X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 16:41:52 -0000 Author: pjd Date: Sat Feb 11 16:41:52 2012 New Revision: 231525 URL: http://svn.freebsd.org/changeset/base/231525 Log: Nice range comparison. MFC after: 3 days Modified: head/sbin/hastd/rangelock.c Modified: head/sbin/hastd/rangelock.c ============================================================================== --- head/sbin/hastd/rangelock.c Sat Feb 11 16:34:03 2012 (r231524) +++ head/sbin/hastd/rangelock.c Sat Feb 11 16:41:52 2012 (r231525) @@ -128,15 +128,13 @@ bool rangelock_islocked(struct rangelocks *rls, off_t offset, off_t length) { struct rlock *rl; + off_t end; PJDLOG_ASSERT(rls->rls_magic == RANGELOCKS_MAGIC); + end = offset + length; TAILQ_FOREACH(rl, &rls->rls_locks, rl_next) { - if (rl->rl_start >= offset && rl->rl_start < offset + length) - break; - else if (rl->rl_end > offset && rl->rl_end <= offset + length) - break; - else if (rl->rl_start < offset && rl->rl_end > offset + length) + if (rl->rl_start < end && rl->rl_end > offset) break; } return (rl != NULL); From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 17:29:08 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4802D1065676; Sat, 11 Feb 2012 17:29:08 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 32DB78FC1B; Sat, 11 Feb 2012 17:29:08 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1BHT8Tb040605; Sat, 11 Feb 2012 17:29:08 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BHT7Io040601; Sat, 11 Feb 2012 17:29:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201202111729.q1BHT7Io040601@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 11 Feb 2012 17:29:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231526 - head/sys/vm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 17:29:08 -0000 Author: kib Date: Sat Feb 11 17:29:07 2012 New Revision: 231526 URL: http://svn.freebsd.org/changeset/base/231526 Log: Close a race due to dropping of the map lock between creating map entry for a shared mapping and marking the entry for inheritance. Other thread might execute vmspace_fork() in between (e.g. by fork(2)), resulting in the mapping becoming private. Noted and reviewed by: alc MFC after: 1 week Modified: head/sys/vm/vm_map.c head/sys/vm/vm_map.h head/sys/vm/vm_mmap.c Modified: head/sys/vm/vm_map.c ============================================================================== --- head/sys/vm/vm_map.c Sat Feb 11 16:41:52 2012 (r231525) +++ head/sys/vm/vm_map.c Sat Feb 11 17:29:07 2012 (r231526) @@ -1130,6 +1130,7 @@ vm_map_insert(vm_map_t map, vm_object_t vm_map_entry_t temp_entry; vm_eflags_t protoeflags; struct ucred *cred; + vm_inherit_t inheritance; boolean_t charge_prev_obj; VM_MAP_ASSERT_LOCKED(map); @@ -1173,6 +1174,10 @@ vm_map_insert(vm_map_t map, vm_object_t protoeflags |= MAP_ENTRY_NOSYNC; if (cow & MAP_DISABLE_COREDUMP) protoeflags |= MAP_ENTRY_NOCOREDUMP; + if (cow & MAP_INHERIT_SHARE) + inheritance = VM_INHERIT_SHARE; + else + inheritance = VM_INHERIT_DEFAULT; cred = NULL; KASSERT((object != kmem_object && object != kernel_object) || @@ -1227,7 +1232,7 @@ charged: * can extend the previous map entry to include the * new range as well. */ - if ((prev_entry->inheritance == VM_INHERIT_DEFAULT) && + if ((prev_entry->inheritance == inheritance) && (prev_entry->protection == prot) && (prev_entry->max_protection == max)) { map->size += (end - prev_entry->end); @@ -1276,7 +1281,7 @@ charged: new_entry->offset = offset; new_entry->avail_ssize = 0; - new_entry->inheritance = VM_INHERIT_DEFAULT; + new_entry->inheritance = inheritance; new_entry->protection = prot; new_entry->max_protection = max; new_entry->wired_count = 0; Modified: head/sys/vm/vm_map.h ============================================================================== --- head/sys/vm/vm_map.h Sat Feb 11 16:41:52 2012 (r231525) +++ head/sys/vm/vm_map.h Sat Feb 11 17:29:07 2012 (r231526) @@ -307,7 +307,7 @@ long vmspace_wired_count(struct vmspace /* * Copy-on-write flags for vm_map operations */ -#define MAP_UNUSED_01 0x0001 +#define MAP_INHERIT_SHARE 0x0001 #define MAP_COPY_ON_WRITE 0x0002 #define MAP_NOFAULT 0x0004 #define MAP_PREFAULT 0x0008 Modified: head/sys/vm/vm_mmap.c ============================================================================== --- head/sys/vm/vm_mmap.c Sat Feb 11 16:41:52 2012 (r231525) +++ head/sys/vm/vm_mmap.c Sat Feb 11 17:29:07 2012 (r231526) @@ -1517,6 +1517,9 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, docow |= MAP_DISABLE_SYNCER; if (flags & MAP_NOCORE) docow |= MAP_DISABLE_COREDUMP; + /* Shared memory is also shared with children. */ + if (flags & MAP_SHARED) + docow |= MAP_INHERIT_SHARE; if (flags & MAP_STACK) rv = vm_map_stack(map, *addr, size, prot, maxprot, @@ -1536,13 +1539,6 @@ vm_mmap(vm_map_t map, vm_offset_t *addr, * or named anonymous without other references. */ vm_object_deallocate(object); - } else if (flags & MAP_SHARED) { - /* - * Shared memory is also shared with children. - */ - rv = vm_map_inherit(map, *addr, *addr + size, VM_INHERIT_SHARE); - if (rv != KERN_SUCCESS) - (void) vm_map_remove(map, *addr, *addr + size); } /* From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 18:51:44 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 387D7106566B; Sat, 11 Feb 2012 18:51:44 +0000 (UTC) (envelope-from brde@optusnet.com.au) Received: from mail02.syd.optusnet.com.au (mail02.syd.optusnet.com.au [211.29.132.183]) by mx1.freebsd.org (Postfix) with ESMTP id C20F58FC12; Sat, 11 Feb 2012 18:51:42 +0000 (UTC) Received: from c211-30-171-136.carlnfd1.nsw.optusnet.com.au (c211-30-171-136.carlnfd1.nsw.optusnet.com.au [211.30.171.136]) by mail02.syd.optusnet.com.au (8.13.1/8.13.1) with ESMTP id q1BIpX4K018501 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 12 Feb 2012 05:51:34 +1100 Date: Sun, 12 Feb 2012 05:51:33 +1100 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Martin Cracauer In-Reply-To: <20120211163807.GA25525@cons.org> Message-ID: <20120212040658.D4220@besplex.bde.org> References: <201202102216.q1AMGI0m098192@svn.freebsd.org> <20120211194854.J2214@besplex.bde.org> <20120211163807.GA25525@cons.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: svn-src-head@freebsd.org, Martin Cracauer , svn-src-all@freebsd.org, src-committers@freebsd.org, Bruce Evans Subject: Re: svn commit: r231449 - head/usr.bin/tee X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 18:51:44 -0000 On Sat, 11 Feb 2012, Martin Cracauer wrote: > I (kinda) knew I shouldn't have tried to do this real quick before > leaving for a trip. I reverted the change and I'll fix the concerns > including the commit message when I'm back in a week. Now I also want > to know what exactly is going on in bash there, the difference between > the explicit named pipe and bash'es construct is unexplained. > > Bruce, do you have a rule of thumb concerning reacting to EAGAIN with > select/poll or with a busy loop, or with one try instantly and then > going with select? I think using select() directly is best, except possibly if there is only 1 more byte to write. A pure busy loop with write() is too likely to write tinygrams, and one write() try before select() is too likely to either return EAGAIN, or succeed and write a tinygram, leading to further tinygrams. Devices should have output watermarks and not return from select() when there is only space to write a tinygram. BTW, one of the many bugs in the tty driver in -current is that it no longer does watermark processing for select() and poll(), so it reads and writes tinygrams even when polled using select() and poll() (and there is no better way). I use the following quick fix: % Index: ttydisc.h % =================================================================== % RCS file: /home/ncvs/src/sys/sys/ttydisc.h,v % retrieving revision 1.7 % diff -u -2 -r1.7 ttydisc.h % --- ttydisc.h 23 Aug 2009 08:04:40 -0000 1.7 % +++ ttydisc.h 25 Sep 2010 14:37:54 -0000 % @@ -70,8 +70,13 @@ % ttydisc_read_poll(struct tty *tp) % { % + size_t navail; % % tty_lock_assert(tp, MA_OWNED); % % - return ttyinq_bytescanonicalized(&tp->t_inq); % + navail = ttyinq_bytescanonicalized(&tp->t_inq); % + if ((tp->t_termios.c_lflag & ICANON) == 0 && % + navail < tp->t_termios.c_cc[VMIN] && tp->t_termios.c_cc[VTIME] == 0) % + navail = 0; % + return (navail); % } % % @@ -79,8 +84,10 @@ % ttydisc_write_poll(struct tty *tp) % { % + size_t nleft; % % tty_lock_assert(tp, MA_OWNED); % % - return ttyoutq_bytesleft(&tp->t_outq); % + nleft = ttyoutq_bytesleft(&tp->t_outq); % + return (nleft >= tp->t_outlow ? nleft : 0); % } % The watermarks that affect applications should be under control of the application like they are for sockets. There is only limited control of the read watermark for ttys, by enabling MIN and setting it as high as possible (the maximum is normally UCHAR_MAX which is normally 255), and this is not standardized, but it works in Linux and used to work in FreeBSD. The watermarks that affect drivers should be under control of drivers like they used to be. Bruce From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 20:28:43 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37AC3106566C; Sat, 11 Feb 2012 20:28:43 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 1EE388FC12; Sat, 11 Feb 2012 20:28:43 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1BKSg0H046657; Sat, 11 Feb 2012 20:28:42 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BKSgY3046649; Sat, 11 Feb 2012 20:28:42 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202112028.q1BKSgY3046649@svn.freebsd.org> From: Ed Schouten Date: Sat, 11 Feb 2012 20:28:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231530 - in head: lib/libc/gen tools/build/mk tools/build/options usr.sbin usr.sbin/utx usr.sbin/utxrm X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 20:28:43 -0000 Author: ed Date: Sat Feb 11 20:28:42 2012 New Revision: 231530 URL: http://svn.freebsd.org/changeset/base/231530 Log: Replace utxrm(8) by utx(8). At first, I added a utility called utxrm(8) to remove stale entries from the user accounting database. It seems there are cases in which we need to perform different operations on the database as well. Simply rename utxrm(8) to utx(8) and place the old code under the "rm" command. In addition to "rm", this tool supports "boot" and "shutdown", which are going to be used by an rc-script which I am going to commit separately. Added: head/usr.sbin/utx/ - copied from r231514, head/usr.sbin/utxrm/ head/usr.sbin/utx/utx.8 - copied, changed from r231514, head/usr.sbin/utxrm/utxrm.8 head/usr.sbin/utx/utx.c - copied, changed from r231514, head/usr.sbin/utxrm/utxrm.c Deleted: head/usr.sbin/utx/utxrm.8 head/usr.sbin/utx/utxrm.c head/usr.sbin/utxrm/ Modified: head/lib/libc/gen/getutxent.3 head/tools/build/mk/OptionalObsoleteFiles.inc head/tools/build/options/WITHOUT_UTMPX head/usr.sbin/Makefile head/usr.sbin/utx/Makefile Modified: head/lib/libc/gen/getutxent.3 ============================================================================== --- head/lib/libc/gen/getutxent.3 Sat Feb 11 20:08:46 2012 (r231529) +++ head/lib/libc/gen/getutxent.3 Sat Feb 11 20:28:42 2012 (r231530) @@ -423,7 +423,7 @@ The file format is invalid. .Xr tty 4 , .Xr ac 8 , .Xr newsyslog 8 , -.Xr utxrm 8 +.Xr utx 8 .Sh STANDARDS The .Fn endutxent , Modified: head/tools/build/mk/OptionalObsoleteFiles.inc ============================================================================== --- head/tools/build/mk/OptionalObsoleteFiles.inc Sat Feb 11 20:08:46 2012 (r231529) +++ head/tools/build/mk/OptionalObsoleteFiles.inc Sat Feb 11 20:28:42 2012 (r231530) @@ -3407,6 +3407,7 @@ OLD_FILES+=usr/bin/who OLD_FILES+=usr/bin/wtmpcvt OLD_FILES+=usr/sbin/ac OLD_FILES+=usr/sbin/lastlogin +OLD_FILES+=usr/sbin/utx OLD_FILES+=usr/sbin/utxrm OLD_FILES+=usr/share/man/man1/last.1.gz OLD_FILES+=usr/share/man/man1/users.1.gz @@ -3414,6 +3415,7 @@ OLD_FILES+=usr/share/man/man1/who.1.gz OLD_FILES+=usr/share/man/man1/wtmpcvt.1.gz OLD_FILES+=usr/share/man/man8/ac.8.gz OLD_FILES+=usr/share/man/man8/lastlogin.8.gz +OLD_FILES+=usr/share/man/man8/utx.8.gz OLD_FILES+=usr/share/man/man8/utxrm.8.gz .endif Modified: head/tools/build/options/WITHOUT_UTMPX ============================================================================== --- head/tools/build/options/WITHOUT_UTMPX Sat Feb 11 20:08:46 2012 (r231529) +++ head/tools/build/options/WITHOUT_UTMPX Sat Feb 11 20:28:42 2012 (r231530) @@ -6,4 +6,4 @@ Set to not build user accounting tools s .Xr ac 8 , .Xr lastlogin 8 and -.Xr utxrm 8 . +.Xr utx 8 . Modified: head/usr.sbin/Makefile ============================================================================== --- head/usr.sbin/Makefile Sat Feb 11 20:08:46 2012 (r231529) +++ head/usr.sbin/Makefile Sat Feb 11 20:28:42 2012 (r231530) @@ -306,7 +306,7 @@ SUBDIR+= usbdump .if ${MK_UTMPX} != "no" SUBDIR+= ac SUBDIR+= lastlogin -SUBDIR+= utxrm +SUBDIR+= utx .endif .if ${MK_WIRELESS} != "no" Modified: head/usr.sbin/utx/Makefile ============================================================================== --- head/usr.sbin/utxrm/Makefile Sat Feb 11 11:11:13 2012 (r231514) +++ head/usr.sbin/utx/Makefile Sat Feb 11 20:28:42 2012 (r231530) @@ -1,6 +1,9 @@ # $FreeBSD$ -PROG= utxrm -MAN= utxrm.8 +PROG= utx +MAN= utx.8 + +LINKS= ${BINDIR}/utx ${BINDIR}/utxrm +MLINKS= utx.8 utxrm.8 .include Copied and modified: head/usr.sbin/utx/utx.8 (from r231514, head/usr.sbin/utxrm/utxrm.8) ============================================================================== --- head/usr.sbin/utxrm/utxrm.8 Sat Feb 11 11:11:13 2012 (r231514, copy source) +++ head/usr.sbin/utx/utx.8 Sat Feb 11 20:28:42 2012 (r231530) @@ -1,4 +1,4 @@ -.\" Copyright (c) 2011 Ed Schouten +.\" Copyright (c) 2011-2012 Ed Schouten .\" All rights reserved. .\" .\" Redistribution and use in source and binary forms, with or without @@ -24,20 +24,46 @@ .\" .\" $FreeBSD$ .\" -.Dd February 19, 2011 -.Dt UTXRM 8 +.Dd February 11, 2012 +.Dt UTX 8 .Os .Sh NAME +.Nm utx , .Nm utxrm -.Nd remove sessions from the user accounting database +.Nd manage the user accounting database .Sh SYNOPSIS .Nm +.Cm boot +.Nm +.Cm shutdown +.Nm +.Cm rm +.Ar identifier +.Ar ... +.Nm utxrm .Ar identifier .Ar ... .Sh DESCRIPTION The .Nm -utility can be used to remove stale sessions from the user accounting +utility can be used to perform operations on the user accounting +database, as done by +.Xr pututxline 3 . +.Pp +The first argument to +.Nm +indicates an action to be performed: +.Bl -tag -width ".Cm shutdown" +.It Cm boot +Write a boot time record to the user accounting database. +This option should typically only be used by +.Xr rc 8 . +.It Cm shutdown +Write a shutdown time record to the user accounting database. +This option should typically only be used by +.Xr rc 8 . +.It Cm rm +Remove stale sessions from the user accounting database, by referring to their .Ar identifier . Stale sessions can occur if a login service exits prematurely or fails @@ -57,6 +83,13 @@ Identifiers can either be supplied in he .Xr getent 1 , or as a string if the identifier allows such a representation. .Pp +To remain backward compatible, this action can also be invoked directly +by using the +.Nm utxrm +command. +.El +.Pp +.Pp Because this utility requires write-access to the user accounting database, its use is limited to the super-user. .Sh SEE ALSO @@ -66,7 +99,9 @@ database, its use is limited to the supe .Sh HISTORY The .Nm -utility appeared in -.Fx 9.0 . +utility replaced +.Nm utxrm +in +.Fx 10.0 . .Sh AUTHORS .An Ed Schouten Aq ed@FreeBSD.org Copied and modified: head/usr.sbin/utx/utx.c (from r231514, head/usr.sbin/utxrm/utxrm.c) ============================================================================== --- head/usr.sbin/utxrm/utxrm.c Sat Feb 11 11:11:13 2012 (r231514, copy source) +++ head/usr.sbin/utx/utx.c Sat Feb 11 20:28:42 2012 (r231530) @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2011 Ed Schouten + * Copyright (c) 2011-2012 Ed Schouten * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,6 +31,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -47,38 +48,67 @@ b16_pton(const char *in, char *out, size return (0); } -int -main(int argc, char *argv[]) +static int +rm(char *id[]) { struct utmpx utx = { .ut_type = DEAD_PROCESS }; size_t len; - int i, ret = 0; - - if (argc < 2) { - fprintf(stderr, "usage: utxrm identifier ...\n"); - return (1); - } + int ret = 0; - gettimeofday(&utx.ut_tv, NULL); - for (i = 1; i < argc; i++) { - len = strlen(argv[i]); + (void)gettimeofday(&utx.ut_tv, NULL); + for (; *id != NULL; id++) { + len = strlen(*id); if (len <= sizeof(utx.ut_id)) { /* Identifier as string. */ - strncpy(utx.ut_id, argv[i], sizeof(utx.ut_id)); + strncpy(utx.ut_id, *id, sizeof(utx.ut_id)); } else if (len != sizeof(utx.ut_id) * 2 || - b16_pton(argv[i], utx.ut_id, sizeof(utx.ut_id)) != 0) { + b16_pton(*id, utx.ut_id, sizeof(utx.ut_id)) != 0) { /* Also not hexadecimal. */ - fprintf(stderr, "%s: Invalid identifier format\n", - argv[i]); + fprintf(stderr, "%s: Invalid identifier format\n", *id); ret = 1; continue; } /* Zap the entry. */ if (pututxline(&utx) == NULL) { - perror(argv[i]); + perror(*id); ret = 1; } } return (ret); } + +static int +boot(short type) +{ + struct utmpx utx = { .ut_type = type }; + + (void)gettimeofday(&utx.ut_tv, NULL); + if (pututxline(&utx) == NULL) { + perror("pututxline"); + return (1); + } + return (0); +} + +int +main(int argc, char *argv[]) +{ + + if (argc >= 2 && strcmp(getprogname(), "utxrm") == 0) + /* For compatibility. */ + return (rm(&argv[1])); + else if (argc == 2 && strcmp(argv[1], "boot") == 0) + return (boot(BOOT_TIME)); + else if (argc == 2 && strcmp(argv[1], "shutdown") == 0) + return (boot(SHUTDOWN_TIME)); + else if (argc >= 3 && strcmp(argv[1], "rm") == 0) + return (rm(&argv[2])); + + fprintf(stderr, + "usage: utx boot\n" + " utx shutdown\n" + " utx rm identifier ...\n" + " utxrm identifier ...\n"); + exit(1); +} From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 20:43:02 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3A7DA106564A; Sat, 11 Feb 2012 20:43:02 +0000 (UTC) (envelope-from bz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 240DF8FC15; Sat, 11 Feb 2012 20:43:02 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1BKh1tI047245; Sat, 11 Feb 2012 20:43:01 GMT (envelope-from bz@svn.freebsd.org) Received: (from bz@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BKh1tP047243; Sat, 11 Feb 2012 20:43:01 GMT (envelope-from bz@svn.freebsd.org) Message-Id: <201202112043.q1BKh1tP047243@svn.freebsd.org> From: "Bjoern A. Zeeb" Date: Sat, 11 Feb 2012 20:43:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231532 - head/lib/libipsec X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 20:43:02 -0000 Author: bz Date: Sat Feb 11 20:43:01 2012 New Revision: 231532 URL: http://svn.freebsd.org/changeset/base/231532 Log: MFp4 204292: Ignore the NAT_T extension types so we can at least dump the SADB from the in-base libipsec/setkey without error when NAT_T support is present in the kernel, though not printing the additional information yet. However in case there is no NAT_T support in kernel still consider them to be an error. MFC after: 8 weeks Modified: head/lib/libipsec/pfkey.c Modified: head/lib/libipsec/pfkey.c ============================================================================== --- head/lib/libipsec/pfkey.c Sat Feb 11 20:37:08 2012 (r231531) +++ head/lib/libipsec/pfkey.c Sat Feb 11 20:43:01 2012 (r231532) @@ -1778,6 +1778,18 @@ pfkey_align(msg, mhp) case SADB_X_EXT_SA2: mhp[ext->sadb_ext_type] = (caddr_t)ext; break; + case SADB_X_EXT_NAT_T_TYPE: + case SADB_X_EXT_NAT_T_SPORT: + case SADB_X_EXT_NAT_T_DPORT: + /* case SADB_X_EXT_NAT_T_OA: is OAI */ + case SADB_X_EXT_NAT_T_OAI: + case SADB_X_EXT_NAT_T_OAR: + case SADB_X_EXT_NAT_T_FRAG: + if (feature_present("ipsec_natt")) { + mhp[ext->sadb_ext_type] = (caddr_t)ext; + break; + } + /* FALLTHROUGH */ default: __ipsec_errcode = EIPSEC_INVAL_EXTTYPE; return -1; From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 20:47:17 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1EEEE106564A; Sat, 11 Feb 2012 20:47:17 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 088F08FC17; Sat, 11 Feb 2012 20:47:17 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1BKlGq9047504; Sat, 11 Feb 2012 20:47:16 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BKlGhP047498; Sat, 11 Feb 2012 20:47:16 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202112047.q1BKlGhP047498@svn.freebsd.org> From: Ed Schouten Date: Sat, 11 Feb 2012 20:47:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231534 - in head: etc/rc.d sbin/init X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 20:47:17 -0000 Author: ed Date: Sat Feb 11 20:47:16 2012 New Revision: 231534 URL: http://svn.freebsd.org/changeset/base/231534 Log: Move utmpx handling out of init(8). This has the following advantages: - During boot, the BOOT_TIME record is now written right after the file systems become writable, but before users are allowed to log in. This means that they can't cause `hidden logins' by logging in right before init(8) kicks in. - The pututxline(3) function may potentially block on file locking, though this is very rare to occur. By placing it in an rc script, the user can still kill it with ^C if needed. - Most importantly: jails don't use init(8). This means that a force reboot of a system running jails will leave stale entries in the accounting database of the jails individually. Added: head/etc/rc.d/utx (contents, props changed) Modified: head/etc/rc.d/Makefile head/etc/rc.d/cleanvar head/sbin/init/init.8 head/sbin/init/init.c Modified: head/etc/rc.d/Makefile ============================================================================== --- head/etc/rc.d/Makefile Sat Feb 11 20:44:16 2012 (r231533) +++ head/etc/rc.d/Makefile Sat Feb 11 20:47:16 2012 (r231534) @@ -144,6 +144,7 @@ FILES= DAEMON \ tmp \ ${_ubthidhci} \ ugidfw \ + ${_utx} \ var \ virecover \ watchdogd \ @@ -177,6 +178,10 @@ _nscd= nscd _ubthidhci= ubthidhci .endif +.if ${MK_UTMPX} != "no" +_utx= utx +.endif + FILESDIR= /etc/rc.d FILESMODE= ${BINMODE} Modified: head/etc/rc.d/cleanvar ============================================================================== --- head/etc/rc.d/cleanvar Sat Feb 11 20:44:16 2012 (r231533) +++ head/etc/rc.d/cleanvar Sat Feb 11 20:47:16 2012 (r231534) @@ -58,8 +58,6 @@ cleanvar_start () { if [ -d /var/run -a ! -f /var/run/clean_var ]; then purgedir /var/run - # And an initial utmpx active session file - (cd /var/run && cp /dev/null utx.active && chmod 644 utx.active) >/var/run/clean_var fi if [ -d /var/spool/lock -a ! -f /var/spool/lock/clean_var ]; then Added: head/etc/rc.d/utx ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/etc/rc.d/utx Sat Feb 11 20:47:16 2012 (r231534) @@ -0,0 +1,18 @@ +#!/bin/sh +# +# $FreeBSD$ +# + +# PROVIDE: utx +# REQUIRE: DAEMON cleanvar +# BEFORE: LOGIN +# KEYWORD: shutdown + +. /etc/rc.subr + +name="utx" +start_cmd="utx boot" +stop_cmd="utx shutdown" + +load_rc_config $name +run_rc_command "$1" Modified: head/sbin/init/init.8 ============================================================================== --- head/sbin/init/init.8 Sat Feb 11 20:44:16 2012 (r231533) +++ head/sbin/init/init.8 Sat Feb 11 20:47:16 2012 (r231534) @@ -31,7 +31,7 @@ .\" @(#)init.8 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd January 23, 2011 +.Dd February 11, 2012 .Dt INIT 8 .Os .Sh NAME @@ -146,14 +146,7 @@ executes a shell for that user. When this shell dies, either because the user logged out or an abnormal termination occurred (a signal), -.Nm login -records the logout in the user accounting -database (see -.Xr getutxent 3) -and terminates. -The cycle is -then restarted by -.Nm +the cycle is restarted by executing a new .Nm getty for the line. Modified: head/sbin/init/init.c ============================================================================== --- head/sbin/init/init.c Sat Feb 11 20:44:16 2012 (r231533) +++ head/sbin/init/init.c Sat Feb 11 20:47:16 2012 (r231534) @@ -66,7 +66,6 @@ static const char rcsid[] = #include #include #include -#include #include #include @@ -181,8 +180,6 @@ static void setprocresources(const char #endif static int clang; -static void clear_session_logs(session_t *); - static int start_session_db(void); static void add_session(session_t *); static void del_session(session_t *); @@ -567,20 +564,6 @@ transition(state_t s) } /* - * Close out the accounting files for a login session. - * NB: should send a message to the session logger to avoid blocking. - */ -static void -clear_session_logs(session_t *sp __unused) -{ - - /* - * XXX: Use getutxline() and call pututxline() for each entry. - * Is this safe to do this here? Is it really required anyway? - */ -} - -/* * Start a session and allocate a controlling terminal. * Only called by children of init after forking. */ @@ -780,17 +763,12 @@ single_user(void) static state_func_t runcom(void) { - struct utmpx utx; state_func_t next_transition; if ((next_transition = run_script(_PATH_RUNCOM)) != 0) return next_transition; runcom_mode = AUTOBOOT; /* the default */ - /* NB: should send a message to the session logger to avoid blocking. */ - utx.ut_type = BOOT_TIME; - gettimeofday(&utx.ut_tv, NULL); - pututxline(&utx); return (state_func_t) read_ttys; } @@ -1119,8 +1097,6 @@ read_ttys(void) * There shouldn't be any, but just in case... */ for (sp = sessions; sp; sp = snext) { - if (sp->se_process) - clear_session_logs(sp); snext = sp->se_next; free_session(sp); } @@ -1274,7 +1250,6 @@ collect_child(pid_t pid) if (! (sp = find_session(pid))) return; - clear_session_logs(sp); del_session(sp); sp->se_process = 0; @@ -1504,14 +1479,8 @@ alrm_handler(int sig) static state_func_t death(void) { - struct utmpx utx; session_t *sp; - /* NB: should send a message to the session logger to avoid blocking. */ - utx.ut_type = SHUTDOWN_TIME; - gettimeofday(&utx.ut_tv, NULL); - pututxline(&utx); - /* * Also revoke the TTY here. Because runshutdown() may reopen * the TTY whose getty we're killing here, there is no guarantee From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 21:06:46 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0B3F61065672; Sat, 11 Feb 2012 21:06:46 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E9FB78FC0A; Sat, 11 Feb 2012 21:06:45 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1BL6j4k048149; Sat, 11 Feb 2012 21:06:45 GMT (envelope-from jilles@svn.freebsd.org) Received: (from jilles@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BL6jMf048146; Sat, 11 Feb 2012 21:06:45 GMT (envelope-from jilles@svn.freebsd.org) Message-Id: <201202112106.q1BL6jMf048146@svn.freebsd.org> From: Jilles Tjoelker Date: Sat, 11 Feb 2012 21:06:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231535 - in head: bin/sh tools/regression/bin/sh/builtins X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 21:06:46 -0000 Author: jilles Date: Sat Feb 11 21:06:45 2012 New Revision: 231535 URL: http://svn.freebsd.org/changeset/base/231535 Log: sh: Make 'hash' return 1 if at least one utility is not found. Reported by: lme Added: head/tools/regression/bin/sh/builtins/hash4.0 (contents, props changed) Modified: head/bin/sh/exec.c Modified: head/bin/sh/exec.c ============================================================================== --- head/bin/sh/exec.c Sat Feb 11 20:47:16 2012 (r231534) +++ head/bin/sh/exec.c Sat Feb 11 21:06:45 2012 (r231535) @@ -231,7 +231,9 @@ hashcmd(int argc __unused, char **argv _ int verbose; struct cmdentry entry; char *name; + int errors; + errors = 0; verbose = 0; while ((c = nextopt("rv")) != '\0') { if (c == 'r') { @@ -254,19 +256,21 @@ hashcmd(int argc __unused, char **argv _ && cmdp->cmdtype == CMDNORMAL) delete_cmd_entry(); find_command(name, &entry, DO_ERR, pathval()); - if (verbose) { - if (entry.cmdtype != CMDUNKNOWN) { /* if no error msg */ - cmdp = cmdlookup(name, 0); - if (cmdp != NULL) - printentry(cmdp, verbose); - else - outfmt(out2, "%s: not found\n", name); + if (entry.cmdtype == CMDUNKNOWN) + errors = 1; + else if (verbose) { + cmdp = cmdlookup(name, 0); + if (cmdp != NULL) + printentry(cmdp, verbose); + else { + outfmt(out2, "%s: not found\n", name); + errors = 1; } flushall(); } argptr++; } - return 0; + return errors; } Added: head/tools/regression/bin/sh/builtins/hash4.0 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/tools/regression/bin/sh/builtins/hash4.0 Sat Feb 11 21:06:45 2012 (r231535) @@ -0,0 +1,6 @@ +# $FreeBSD$ + +exec 3>&1 +m=`hash nosuchtool 2>&1 >&3` +r=$? +[ "$r" != 0 ] && [ -n "$m" ] From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 21:49:24 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8647C1065670; Sat, 11 Feb 2012 21:49:24 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 6681D8FC15; Sat, 11 Feb 2012 21:49:24 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1BLnOdx049513; Sat, 11 Feb 2012 21:49:24 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BLnOfT049510; Sat, 11 Feb 2012 21:49:24 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202112149.q1BLnOfT049510@svn.freebsd.org> From: Ed Schouten Date: Sat, 11 Feb 2012 21:49:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231536 - head/usr.bin/who X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 21:49:24 -0000 Author: ed Date: Sat Feb 11 21:49:23 2012 New Revision: 231536 URL: http://svn.freebsd.org/changeset/base/231536 Log: Attempt to implement who -a. According to POSIX, -a is equal to -bdlprtTu. It seems this is not true in practice, as -b normally restricts the output to BOOT_TIME entries and all implementations that I know of don't. Modified: head/usr.bin/who/who.1 head/usr.bin/who/who.c Modified: head/usr.bin/who/who.1 ============================================================================== --- head/usr.bin/who/who.1 Sat Feb 11 21:06:45 2012 (r231535) +++ head/usr.bin/who/who.1 Sat Feb 11 21:49:23 2012 (r231536) @@ -28,7 +28,7 @@ .\" @(#)who.1 8.2 (Berkeley) 12/30/93 .\" $FreeBSD$ .\" -.Dd Oct 28, 2011 +.Dd February 11, 2012 .Dt WHO 1 .Os .Sh NAME @@ -36,7 +36,7 @@ .Nd display who is on the system .Sh SYNOPSIS .Nm -.Op Fl bHmqsTu +.Op Fl abHmqsTu .Op Cm am I .Op Ar file .Sh DESCRIPTION @@ -48,6 +48,11 @@ remote hostname if not local. .Pp The options are as follows: .Bl -tag -width indent +.It Fl a +Equivalent to +.Fl bTu , +with the exception that output isn't restricted to the time and date of +the last system reboot. .It Fl b Write the time and date of the last system reboot. .It Fl H Modified: head/usr.bin/who/who.c ============================================================================== --- head/usr.bin/who/who.c Sat Feb 11 21:06:45 2012 (r231535) +++ head/usr.bin/who/who.c Sat Feb 11 21:49:23 2012 (r231536) @@ -48,7 +48,6 @@ __FBSDID("$FreeBSD$"); #include static void heading(void); -static void boottime(void); static void process_utmp(void); static void quick(void); static void row(const struct utmpx *); @@ -57,6 +56,7 @@ static void usage(void); static void whoami(void); static int Hflag; /* Write column headings */ +static int aflag; /* Print all entries */ static int bflag; /* Show date of the last reboot */ static int mflag; /* Show info about current terminal */ static int qflag; /* "Quick" mode */ @@ -71,7 +71,7 @@ main(int argc, char *argv[]) setlocale(LC_TIME, ""); - while ((ch = getopt(argc, argv, "HTbmqsu")) != -1) { + while ((ch = getopt(argc, argv, "HTabmqsu")) != -1) { switch (ch) { case 'H': /* Write column headings */ Hflag = 1; @@ -79,6 +79,9 @@ main(int argc, char *argv[]) case 'T': /* Show terminal state */ Tflag = 1; break; + case 'a': /* Same as -bdlprtTu */ + aflag = bflag = Tflag = uflag = 1; + break; case 'b': /* Show date of the last reboot */ bflag = 1; break; @@ -126,8 +129,6 @@ main(int argc, char *argv[]) heading(); if (mflag) whoami(); - else if (bflag) - boottime(); else process_utmp(); } @@ -226,26 +227,14 @@ process_utmp(void) struct utmpx *utx; while ((utx = getutxent()) != NULL) { - if (utx->ut_type != USER_PROCESS) - continue; - if (ttystat(utx->ut_line) != 0) - continue; - row(utx); + if (((aflag || !bflag) && utx->ut_type == USER_PROCESS) || + (bflag && utx->ut_type == BOOT_TIME)) + if (ttystat(utx->ut_line) == 0) + row(utx); } } static void -boottime(void) -{ - struct utmpx u1, *u2; - - u1.ut_type = BOOT_TIME; - if ((u2 = getutxid(&u1)) == NULL) - return; - row(u2); -} - -static void quick(void) { struct utmpx *utx; From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 21:50:45 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 07C5D1065670; Sat, 11 Feb 2012 21:50:45 +0000 (UTC) (envelope-from ed@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id CC6EA8FC0C; Sat, 11 Feb 2012 21:50:44 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q1BLoi20049598; Sat, 11 Feb 2012 21:50:44 GMT (envelope-from ed@svn.freebsd.org) Received: (from ed@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q1BLoiFg049596; Sat, 11 Feb 2012 21:50:44 GMT (envelope-from ed@svn.freebsd.org) Message-Id: <201202112150.q1BLoiFg049596@svn.freebsd.org> From: Ed Schouten Date: Sat, 11 Feb 2012 21:50:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r231537 - head/usr.bin/who X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 21:50:45 -0000 Author: ed Date: Sat Feb 11 21:50:44 2012 New Revision: 231537 URL: http://svn.freebsd.org/changeset/base/231537 Log: And of course, I forgot to add -a to the usage. Modified: head/usr.bin/who/who.c Modified: head/usr.bin/who/who.c ============================================================================== --- head/usr.bin/who/who.c Sat Feb 11 21:49:23 2012 (r231536) +++ head/usr.bin/who/who.c Sat Feb 11 21:50:44 2012 (r231537) @@ -142,7 +142,7 @@ static void usage(void) { - fprintf(stderr, "usage: who [-bHmqsTu] [am I] [file]\n"); + fprintf(stderr, "usage: who [-abHmqsTu] [am I] [file]\n"); exit(1); } From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 22:58:47 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id 4E64F1065673; Sat, 11 Feb 2012 22:58:47 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-150-251.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id 426A41515D5; Sat, 11 Feb 2012 22:58:46 +0000 (UTC) Message-ID: <4F36F2A5.6040405@FreeBSD.org> Date: Sat, 11 Feb 2012 14:58:45 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:10.0) Gecko/20120201 Thunderbird/10.0 MIME-Version: 1.0 To: Ed Schouten References: <201202112047.q1BKlGhP047498@svn.freebsd.org> In-Reply-To: <201202112047.q1BKlGhP047498@svn.freebsd.org> X-Enigmail-Version: 1.3.5 OpenPGP: id=1A1ABC84 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231534 - in head: etc/rc.d sbin/init X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 22:58:47 -0000 On 02/11/2012 12:47, Ed Schouten wrote: > +# BEFORE: LOGIN New scripts in the base should not use BEFORE. Rather, LOGIN should REQUIRE this script. Doug -- It's always a long day; 86400 doesn't fit into a short. Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 23:21:41 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9943E106564A; Sat, 11 Feb 2012 23:21:41 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from mx0.hoeg.nl (mx0.hoeg.nl [IPv6:2a01:4f8:101:5343::aa]) by mx1.freebsd.org (Postfix) with ESMTP id 3103C8FC13; Sat, 11 Feb 2012 23:21:41 +0000 (UTC) Received: by mx0.hoeg.nl (Postfix, from userid 1000) id 3CCB82A28CD0; Sun, 12 Feb 2012 00:21:40 +0100 (CET) Date: Sun, 12 Feb 2012 00:21:40 +0100 From: Ed Schouten To: Doug Barton Message-ID: <20120211232140.GU1860@hoeg.nl> References: <201202112047.q1BKlGhP047498@svn.freebsd.org> <4F36F2A5.6040405@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="hgy5D1otryeNPdmY" Content-Disposition: inline In-Reply-To: <4F36F2A5.6040405@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231534 - in head: etc/rc.d sbin/init X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 23:21:41 -0000 --hgy5D1otryeNPdmY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Doug, * Doug Barton , 20120211 23:58: > New scripts in the base should not use BEFORE. Rather, LOGIN should > REQUIRE this script. You mean like this? I noticed there are still over 60 occurrences of BEFORE in the tree. Looks like there's still quite a lot of work to do to get rid of it then. %%% Index: etc/rc.d/utx =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 --- etc/rc.d/utx (revision 231534) +++ etc/rc.d/utx (working copy) @@ -5,7 +5,6 @@ =20 # PROVIDE: utx # REQUIRE: DAEMON cleanvar -# BEFORE: LOGIN # KEYWORD: shutdown =20 . /etc/rc.subr Index: etc/rc.d/LOGIN =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 --- etc/rc.d/LOGIN (revision 231514) +++ etc/rc.d/LOGIN (working copy) @@ -4,7 +4,7 @@ # =20 # PROVIDE: LOGIN -# REQUIRE: DAEMON +# REQUIRE: DAEMON utx =20 # This is a dummy dependency to ensure user services such as xdm, # inetd, cron and kerberos are started after everything else, in case %%% --=20 Ed Schouten WWW: http://80386.nl/ --hgy5D1otryeNPdmY Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iQIcBAEBAgAGBQJPNvgEAAoJEG5e2P40kaK7UHQP/0fFB9xIu+9IX5WXHkEc56EL wS9iCMfRx7KkVEEdITx2RzJCNKGkYX3QeXtyQLUk/nAj9uvnqYiW8vkwEkapJzxC 54wDwG7p5gzgaJYf39XMqrl6XEyDC4b8Htlmnu/eWFntSXw1iiJinkOa4j2i1ROl gh01uL5H60WAuFLsHAGrjj4VUWCkJEoVITxfqbQwCpIUb1OloKhHVD0qBYcjVWM8 MLc8xZpwPa5fW2XiO+brw6RraEWmC0euhUBCMVw1GbuXFKDrSbyIPqb9UtiZkpp8 CDasO+Oak0xRloGxgCT7A4KTPsXXSgCBiatmWvpgc4KTpKy/KC3+7S36ttVY2vB4 aqxlvD5PRhd6vwhVjJvn2zzvjDQP5xWd8VDiJzziVpg8A5a5catjRqptHQkV7ni+ 09VHmjUkyweDoUWfg6DZdWXORCqbw2jvp+q8cWQn+8Img+S9w3St0G8vmCFlJnMz ip16jSyXn6UH/f4Siy/DXgLZrw6I6pcntC3fendn/76wYUVxYUJDAzujVmWYiSEE EUUq25xBwZlgLcPszhYxSjwfDg6Lm20tcW8KpzLwsLjbksoqiOeVO4yCbBA1Nkrc 6fjWELcZPR6hvICKYMBYjSyD/eJNkR12Oms+R45bwh9K64daDY3Pyu5lr6z0bt9C E8uzKvBSxHgRypt0ozny =BTDT -----END PGP SIGNATURE----- --hgy5D1otryeNPdmY-- From owner-svn-src-head@FreeBSD.ORG Sat Feb 11 23:46:09 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx2.freebsd.org (mx2.freebsd.org [IPv6:2001:4f8:fff6::35]) by hub.freebsd.org (Postfix) with ESMTP id AD270106567F; Sat, 11 Feb 2012 23:46:09 +0000 (UTC) (envelope-from dougb@FreeBSD.org) Received: from 172-17-150-251.globalsuite.net (hub.freebsd.org [IPv6:2001:4f8:fff6::36]) by mx2.freebsd.org (Postfix) with ESMTP id D5DB91A4437; Sat, 11 Feb 2012 23:45:38 +0000 (UTC) Message-ID: <4F36FD9D.8030907@FreeBSD.org> Date: Sat, 11 Feb 2012 15:45:33 -0800 From: Doug Barton Organization: http://SupersetSolutions.com/ User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:10.0) Gecko/20120201 Thunderbird/10.0 MIME-Version: 1.0 To: Ed Schouten References: <201202112047.q1BKlGhP047498@svn.freebsd.org> <4F36F2A5.6040405@FreeBSD.org> <20120211232140.GU1860@hoeg.nl> In-Reply-To: <20120211232140.GU1860@hoeg.nl> X-Enigmail-Version: 1.3.5 OpenPGP: id=1A1ABC84 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig00446C995BD23614797927C1" Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org Subject: Re: svn commit: r231534 - in head: etc/rc.d sbin/init X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 11 Feb 2012 23:46:09 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig00446C995BD23614797927C1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 02/11/2012 15:21, Ed Schouten wrote: > Hi Doug, >=20 > * Doug Barton , 20120211 23:58: >> New scripts in the base should not use BEFORE. Rather, LOGIN should >> REQUIRE this script. >=20 > You mean like this? Yes, thanks. > I noticed there are still over 60 occurrences of > BEFORE in the tree. Looks like there's still quite a lot of work to do > to get rid of it then. Quite. I tackle them when I can, but the goal at this point is to avoid making the problem any worse. :) Doug > %%% > Index: etc/rc.d/utx > =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 > --- etc/rc.d/utx (revision 231534) > +++ etc/rc.d/utx (working copy) > @@ -5,7 +5,6 @@ > =20 > # PROVIDE: utx > # REQUIRE: DAEMON cleanvar > -# BEFORE: LOGIN > # KEYWORD: shutdown > =20 > . /etc/rc.subr > Index: etc/rc.d/LOGIN > =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 > --- etc/rc.d/LOGIN (revision 231514) > +++ etc/rc.d/LOGIN (working copy) > @@ -4,7 +4,7 @@ > # > =20 > # PROVIDE: LOGIN > -# REQUIRE: DAEMON > +# REQUIRE: DAEMON utx > =20 > # This is a dummy dependency to ensure user services such as xdm, > # inetd, cron and kerberos are started after everything else, in case > %%% >=20 --=20 It's always a long day; 86400 doesn't fit into a short. Breadth of IT experience, and depth of knowledge in the DNS. Yours for the right price. :) http://SupersetSolutions.com/ --------------enig00446C995BD23614797927C1 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.18 (FreeBSD) iQEcBAEBCAAGBQJPNv2iAAoJEFzGhvEaGryEZMMIALxRlSlciOiH9WsHMAi1bBlK WqCb6hGUBMKxPf5v9a7P8lqweIaD1myEwxj5GoFAQHtwA7D0iGWlIsEZV7fxgw+7 Xs+9xx4YfhpomenR4o1qo1qFQH7Bq3Yuzk2YnMLLLlbDg/+hbUQoxdQFN0W9XTm5 aeLtnVfMFO/g9an23Xf7rgqZkYzaMxxN+Hx1sEu83UShLmxwLVOvmkGCtwb9t/HD WUjedOeZuJBvAcfttjZckyAbAtvRvihFtPBx6T1fUxsbdbqo1CZPjVH9kDkx+5l/ GHNy8UNPZOuir733bSjIkpZfZCgBiOCFRdIJYuM4H71sU8akjUv5tjY/AR3o8dM= =Qr59 -----END PGP SIGNATURE----- --------------enig00446C995BD23614797927C1--