From owner-svn-src-stable@FreeBSD.ORG Sun Feb 3 00:03:00 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D20FED17; Sun, 3 Feb 2013 00:03:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9491FC06; Sun, 3 Feb 2013 00:03:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r130307h051082; Sun, 3 Feb 2013 00:03:00 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1302xn9051065; Sun, 3 Feb 2013 00:02:59 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302030002.r1302xn9051065@svn.freebsd.org> From: Eitan Adler Date: Sun, 3 Feb 2013 00:02:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246273 - stable/8/sys/dev/sound/pci/hda X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 00:03:00 -0000 Author: eadler Date: Sun Feb 3 00:02:59 2013 New Revision: 246273 URL: http://svnweb.freebsd.org/changeset/base/246273 Log: MFC r243793,r243794: Add a few more translations from IDs to model name. PR: kern/174059 Approved by: cperciva (mentor, implicit) Modified: stable/8/sys/dev/sound/pci/hda/hdac.h stable/8/sys/dev/sound/pci/hda/hdacc.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/sound/ (props changed) stable/8/sys/dev/sound/pci/ (props changed) Modified: stable/8/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdac.h Sat Feb 2 23:31:10 2013 (r246272) +++ stable/8/sys/dev/sound/pci/hda/hdac.h Sun Feb 3 00:02:59 2013 (r246273) @@ -574,7 +574,10 @@ #define HDA_CODEC_NVIDIAGT21X HDA_CODEC_CONSTRUCT(NVIDIA, 0x000b) #define HDA_CODEC_NVIDIAMCP89 HDA_CODEC_CONSTRUCT(NVIDIA, 0x000c) #define HDA_CODEC_NVIDIAGT240 HDA_CODEC_CONSTRUCT(NVIDIA, 0x000d) +#define HDA_CODEC_NVIDIAGTS450 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0011) #define HDA_CODEC_NVIDIAGT440 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0014) +#define HDA_CODEC_NVIDIAGTX550 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0015) +#define HDA_CODEC_NVIDIAGTX570 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0018) #define HDA_CODEC_NVIDIAMCP67 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0067) #define HDA_CODEC_NVIDIAMCP73 HDA_CODEC_CONSTRUCT(NVIDIA, 0x8001) #define HDA_CODEC_NVIDIAXXXX HDA_CODEC_CONSTRUCT(NVIDIA, 0xffff) Modified: stable/8/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- stable/8/sys/dev/sound/pci/hda/hdacc.c Sat Feb 2 23:31:10 2013 (r246272) +++ stable/8/sys/dev/sound/pci/hda/hdacc.c Sun Feb 3 00:02:59 2013 (r246273) @@ -307,7 +307,10 @@ static const struct { { HDA_CODEC_NVIDIAGT21X, 0, "NVIDIA GT21x" }, { HDA_CODEC_NVIDIAMCP89, 0, "NVIDIA MCP89" }, { HDA_CODEC_NVIDIAGT240, 0, "NVIDIA GT240" }, + { HDA_CODEC_NVIDIAGTS450, 0, "NVIDIA GTS450" }, { HDA_CODEC_NVIDIAGT440, 0, "NVIDIA GT440" }, + { HDA_CODEC_NVIDIAGTX550, 0, "NVIDIA GTX550" }, + { HDA_CODEC_NVIDIAGTX570, 0, "NVIDIA GTX570" }, { HDA_CODEC_INTELIP, 0, "Intel Ibex Peak" }, { HDA_CODEC_INTELBL, 0, "Intel Bearlake" }, { HDA_CODEC_INTELCA, 0, "Intel Cantiga" }, From owner-svn-src-stable@FreeBSD.ORG Sun Feb 3 00:03:00 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id DCD0AD18; Sun, 3 Feb 2013 00:03:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A3461C0F; Sun, 3 Feb 2013 00:03:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r13030jJ051093; Sun, 3 Feb 2013 00:03:00 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r13030wZ051089; Sun, 3 Feb 2013 00:03:00 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302030003.r13030wZ051089@svn.freebsd.org> From: Eitan Adler Date: Sun, 3 Feb 2013 00:03:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246274 - stable/9/sys/dev/sound/pci/hda X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 00:03:01 -0000 Author: eadler Date: Sun Feb 3 00:02:59 2013 New Revision: 246274 URL: http://svnweb.freebsd.org/changeset/base/246274 Log: MFC r243793,r243794: Add a few more translations from IDs to model name. PR: kern/174059 Approved by: cperciva (mentor, implicit) Modified: stable/9/sys/dev/sound/pci/hda/hdac.h stable/9/sys/dev/sound/pci/hda/hdacc.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/sound/pci/hda/hdac.h ============================================================================== --- stable/9/sys/dev/sound/pci/hda/hdac.h Sun Feb 3 00:02:59 2013 (r246273) +++ stable/9/sys/dev/sound/pci/hda/hdac.h Sun Feb 3 00:02:59 2013 (r246274) @@ -574,6 +574,10 @@ #define HDA_CODEC_NVIDIAGT21X HDA_CODEC_CONSTRUCT(NVIDIA, 0x000b) #define HDA_CODEC_NVIDIAMCP89 HDA_CODEC_CONSTRUCT(NVIDIA, 0x000c) #define HDA_CODEC_NVIDIAGT240 HDA_CODEC_CONSTRUCT(NVIDIA, 0x000d) +#define HDA_CODEC_NVIDIAGTS450 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0011) +#define HDA_CODEC_NVIDIAGT440 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0014) +#define HDA_CODEC_NVIDIAGTX550 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0015) +#define HDA_CODEC_NVIDIAGTX570 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0018) #define HDA_CODEC_NVIDIAMCP67 HDA_CODEC_CONSTRUCT(NVIDIA, 0x0067) #define HDA_CODEC_NVIDIAMCP73 HDA_CODEC_CONSTRUCT(NVIDIA, 0x8001) #define HDA_CODEC_NVIDIAXXXX HDA_CODEC_CONSTRUCT(NVIDIA, 0xffff) Modified: stable/9/sys/dev/sound/pci/hda/hdacc.c ============================================================================== --- stable/9/sys/dev/sound/pci/hda/hdacc.c Sun Feb 3 00:02:59 2013 (r246273) +++ stable/9/sys/dev/sound/pci/hda/hdacc.c Sun Feb 3 00:02:59 2013 (r246274) @@ -307,6 +307,10 @@ static const struct { { HDA_CODEC_NVIDIAGT21X, 0, "NVIDIA GT21x" }, { HDA_CODEC_NVIDIAMCP89, 0, "NVIDIA MCP89" }, { HDA_CODEC_NVIDIAGT240, 0, "NVIDIA GT240" }, + { HDA_CODEC_NVIDIAGTS450, 0, "NVIDIA GTS450" }, + { HDA_CODEC_NVIDIAGT440, 0, "NVIDIA GT440" }, + { HDA_CODEC_NVIDIAGTX550, 0, "NVIDIA GTX550" }, + { HDA_CODEC_NVIDIAGTX570, 0, "NVIDIA GTX570" }, { HDA_CODEC_INTELIP, 0, "Intel Ibex Peak" }, { HDA_CODEC_INTELBL, 0, "Intel Bearlake" }, { HDA_CODEC_INTELCA, 0, "Intel Cantiga" }, From owner-svn-src-stable@FreeBSD.ORG Sun Feb 3 01:22:29 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id D3C878DE; Sun, 3 Feb 2013 01:22:29 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AC8C4E19; Sun, 3 Feb 2013 01:22:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r131MTws075465; Sun, 3 Feb 2013 01:22:29 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r131MTIh075462; Sun, 3 Feb 2013 01:22:29 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302030122.r131MTIh075462@svn.freebsd.org> From: Eitan Adler Date: Sun, 3 Feb 2013 01:22:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246277 - in stable/9: tools/regression/usr.bin/printf usr.bin/printf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 01:22:29 -0000 Author: eadler Date: Sun Feb 3 01:22:28 2013 New Revision: 246277 URL: http://svnweb.freebsd.org/changeset/base/246277 Log: MFC r244407,r244409: POSIX requires that non-existent or null arguments be treated as if a zero argument were supplied. Add regression tests to catch this case as well. PR: bin/174521 Approved by: cperciva (mentor, implicit) Added: stable/9/tools/regression/usr.bin/printf/regress.zero.out - copied unchanged from r244407, head/tools/regression/usr.bin/printf/regress.zero.out Modified: stable/9/tools/regression/usr.bin/printf/regress.sh stable/9/usr.bin/printf/printf.c Directory Properties: stable/9/tools/regression/ (props changed) stable/9/usr.bin/printf/ (props changed) Modified: stable/9/tools/regression/usr.bin/printf/regress.sh ============================================================================== --- stable/9/tools/regression/usr.bin/printf/regress.sh Sun Feb 3 01:08:01 2013 (r246276) +++ stable/9/tools/regression/usr.bin/printf/regress.sh Sun Feb 3 01:22:28 2013 (r246277) @@ -2,7 +2,7 @@ REGRESSION_START($1) -echo '1..11' +echo '1..12' REGRESSION_TEST(`b', `printf "abc%b%b" "def\n" "\cghi"') REGRESSION_TEST(`d', `printf "%d,%5d,%.5d,%0*d,%.*d\n" 123 123 123 5 123 5 123') @@ -15,5 +15,9 @@ REGRESSION_TEST(`m3', `printf "%%%s\n" a REGRESSION_TEST(`m4', `printf "%d,%f,%c,%s\n"') REGRESSION_TEST(`m5', `printf -- "-d\n"') REGRESSION_TEST(`s', `printf "%.3s,%-5s\n" abcd abc') +REGRESSION_TEST('zero', `printf "%u%u\n" 15') +REGRESSION_TEST('zero', `printf "%d%d\n" 15') +REGRESSION_TEST('zero', `printf "%d%u\n" 15') +REGRESSION_TEST('zero', `printf "%u%d\n" 15') REGRESSION_END() Copied: stable/9/tools/regression/usr.bin/printf/regress.zero.out (from r244407, head/tools/regression/usr.bin/printf/regress.zero.out) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/regression/usr.bin/printf/regress.zero.out Sun Feb 3 01:22:28 2013 (r246277, copy of r244407, head/tools/regression/usr.bin/printf/regress.zero.out) @@ -0,0 +1 @@ +150 Modified: stable/9/usr.bin/printf/printf.c ============================================================================== --- stable/9/usr.bin/printf/printf.c Sun Feb 3 01:08:01 2013 (r246276) +++ stable/9/usr.bin/printf/printf.c Sun Feb 3 01:22:28 2013 (r246277) @@ -467,7 +467,7 @@ getnum(intmax_t *ip, uintmax_t *uip, int int rval; if (!*gargv) { - *ip = 0; + *ip = *uip = 0; return (0); } if (**gargv == '"' || **gargv == '\'') { From owner-svn-src-stable@FreeBSD.ORG Sun Feb 3 03:38:46 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9506FB91; Sun, 3 Feb 2013 03:38:46 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 570C42BF; Sun, 3 Feb 2013 03:38:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r133cjs6015455; Sun, 3 Feb 2013 03:38:45 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r133cjQQ015450; Sun, 3 Feb 2013 03:38:45 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302030338.r133cjQQ015450@svn.freebsd.org> From: Eitan Adler Date: Sun, 3 Feb 2013 03:38:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246279 - stable/9/usr.bin/grep X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 03:38:46 -0000 Author: eadler Date: Sun Feb 3 03:38:44 2013 New Revision: 246279 URL: http://svnweb.freebsd.org/changeset/base/246279 Log: MFC r244493: Make bsdgrep behave as gnugrep and as documented: -m should only stop reading the specific file, not any file. Approved by: cperciva (mentor, implicit) Modified: stable/9/usr.bin/grep/grep.c stable/9/usr.bin/grep/grep.h stable/9/usr.bin/grep/util.c Directory Properties: stable/9/usr.bin/grep/ (props changed) Modified: stable/9/usr.bin/grep/grep.c ============================================================================== --- stable/9/usr.bin/grep/grep.c Sun Feb 3 01:54:25 2013 (r246278) +++ stable/9/usr.bin/grep/grep.c Sun Feb 3 03:38:44 2013 (r246279) @@ -107,6 +107,7 @@ bool iflag; /* -i: ignore case */ bool lflag; /* -l: only show names of files with matches */ bool mflag; /* -m x: stop reading the files after x matches */ long long mcount; /* count for -m */ +long long mlimit; /* requested value for -m */ bool nflag; /* -n: show line numbers in front of matching lines */ bool oflag; /* -o: print only matching part */ bool qflag; /* -q: quiet mode (don't output anything) */ @@ -529,7 +530,7 @@ main(int argc, char *argv[]) case 'm': mflag = true; errno = 0; - mcount = strtoll(optarg, &ep, 10); + mlimit = mcount = strtoll(optarg, &ep, 10); if (((errno == ERANGE) && (mcount == LLONG_MAX)) || ((errno == EINVAL) && (mcount == 0))) err(2, NULL); Modified: stable/9/usr.bin/grep/grep.h ============================================================================== --- stable/9/usr.bin/grep/grep.h Sun Feb 3 01:54:25 2013 (r246278) +++ stable/9/usr.bin/grep/grep.h Sun Feb 3 03:38:44 2013 (r246279) @@ -115,6 +115,7 @@ extern bool Eflag, Fflag, Gflag, Hflag, extern bool dexclude, dinclude, fexclude, finclude, lbflag, nullflag; extern unsigned long long Aflag, Bflag; extern long long mcount; +extern long long mlimit; extern char *label; extern const char *color; extern int binbehave, devbehave, dirbehave, filebehave, grepbehave, linkbehave; Modified: stable/9/usr.bin/grep/util.c ============================================================================== --- stable/9/usr.bin/grep/util.c Sun Feb 3 01:54:25 2013 (r246278) +++ stable/9/usr.bin/grep/util.c Sun Feb 3 03:38:44 2013 (r246279) @@ -176,8 +176,7 @@ procfile(const char *fn) mode_t s; int c, t; - if (mflag && (mcount <= 0)) - return (0); + mcount = mlimit; if (strcmp(fn, "-") == 0) { fn = label != NULL ? label : getstr(1); From owner-svn-src-stable@FreeBSD.ORG Sun Feb 3 03:44:00 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 979DCD58; Sun, 3 Feb 2013 03:44:00 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8ABD92F0; Sun, 3 Feb 2013 03:44:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r133i0KC017765; Sun, 3 Feb 2013 03:44:00 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r133i0kl017764; Sun, 3 Feb 2013 03:44:00 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302030344.r133i0kl017764@svn.freebsd.org> From: Eitan Adler Date: Sun, 3 Feb 2013 03:44:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246280 - stable/9/usr.sbin/pw X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 03:44:00 -0000 Author: eadler Date: Sun Feb 3 03:43:59 2013 New Revision: 246280 URL: http://svnweb.freebsd.org/changeset/base/246280 Log: MFC r243896: Use strdup instead of malloc + strcpy Approved by: cperciva (mentor, implicit) Modified: stable/9/usr.sbin/pw/pwupd.c Directory Properties: stable/9/usr.sbin/pw/ (props changed) Modified: stable/9/usr.sbin/pw/pwupd.c ============================================================================== --- stable/9/usr.sbin/pw/pwupd.c Sun Feb 3 03:38:44 2013 (r246279) +++ stable/9/usr.sbin/pw/pwupd.c Sun Feb 3 03:43:59 2013 (r246280) @@ -53,12 +53,10 @@ setpwdir(const char * dir) { if (dir == NULL) return -1; - else { - char * d = malloc(strlen(dir)+1); - if (d == NULL) - return -1; - pwpath = strcpy(d, dir); - } + else + pwpath = strdup(dir); + if (pwpath == NULL) + return -1; return 0; } From owner-svn-src-stable@FreeBSD.ORG Sun Feb 3 03:46:16 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EA708EDB; Sun, 3 Feb 2013 03:46:16 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D8D03307; Sun, 3 Feb 2013 03:46:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r133kGS8018106; Sun, 3 Feb 2013 03:46:16 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r133kGQ8018102; Sun, 3 Feb 2013 03:46:16 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302030346.r133kGQ8018102@svn.freebsd.org> From: Eitan Adler Date: Sun, 3 Feb 2013 03:46:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246281 - stable/9/usr.sbin/cpucontrol X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 03:46:17 -0000 Author: eadler Date: Sun Feb 3 03:46:16 2013 New Revision: 246281 URL: http://svnweb.freebsd.org/changeset/base/246281 Log: MFC r245491: Avoid clobbering errno with a call to fprintf PR: bin/173923 Approved by: cperciva (mentor, implicit) Modified: stable/9/usr.sbin/cpucontrol/intel.c stable/9/usr.sbin/cpucontrol/via.c Directory Properties: stable/9/usr.sbin/cpucontrol/ (props changed) Modified: stable/9/usr.sbin/cpucontrol/intel.c ============================================================================== --- stable/9/usr.sbin/cpucontrol/intel.c Sun Feb 3 03:43:59 2013 (r246280) +++ stable/9/usr.sbin/cpucontrol/intel.c Sun Feb 3 03:46:16 2013 (r246281) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -266,7 +267,9 @@ matched: args.size = data_size; error = ioctl(devfd, CPUCTL_UPDATE, &args); if (error < 0) { + error = errno; fprintf(stderr, "failed.\n"); + errno = error; WARN(0, "ioctl()"); goto fail; } Modified: stable/9/usr.sbin/cpucontrol/via.c ============================================================================== --- stable/9/usr.sbin/cpucontrol/via.c Sun Feb 3 03:43:59 2013 (r246280) +++ stable/9/usr.sbin/cpucontrol/via.c Sun Feb 3 03:46:16 2013 (r246281) @@ -33,6 +33,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -204,7 +205,9 @@ via_update(const char *dev, const char * args.size = data_size; error = ioctl(devfd, CPUCTL_UPDATE, &args); if (error < 0) { + error = errno; fprintf(stderr, "failed.\n"); + errno = error; WARN(0, "ioctl()"); goto fail; } From owner-svn-src-stable@FreeBSD.ORG Sun Feb 3 07:27:52 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4562342E; Sun, 3 Feb 2013 07:27:52 +0000 (UTC) (envelope-from jase@FreeBSD.org) Received: from svr06-mx.btshosting.co.uk (mx-2.btshosting.co.uk [178.63.196.248]) by mx1.freebsd.org (Postfix) with ESMTP id E5C33A6C; Sun, 3 Feb 2013 07:27:51 +0000 (UTC) Received: from [192.168.1.65] (5e0cd374.bb.sky.com [94.12.211.116]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by svr06-mx.btshosting.co.uk (Postfix) with ESMTPSA id E391B34840; Sun, 3 Feb 2013 07:27:43 +0000 (UTC) Message-ID: <510E116C.1060009@FreeBSD.org> Date: Sun, 03 Feb 2013 07:27:40 +0000 From: Jase Thew Organization: The FreeBSD Project User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: Andriy Gapon Subject: Re: svn commit: r246239 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs References: <201302021120.r12BKbGX020113@svn.freebsd.org> In-Reply-To: <201302021120.r12BKbGX020113@svn.freebsd.org> X-Enigmail-Version: 1.5 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-8@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 07:27:52 -0000 On 02/02/2013 11:20, Andriy Gapon wrote: > Author: avg > Date: Sat Feb 2 11:20:36 2013 > New Revision: 246239 > URL: http://svnweb.freebsd.org/changeset/base/246239 > > Log: > MFC r245945: spa_generate_rootconf: add support for old vdev labels > Thanks! -- Jase Thew jase@FreeBSD.org FreeBSD Ports Committer From owner-svn-src-stable@FreeBSD.ORG Sun Feb 3 12:17:51 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3DA29E4B; Sun, 3 Feb 2013 12:17:51 +0000 (UTC) (envelope-from trasz@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 215D7632; Sun, 3 Feb 2013 12:17:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r13CHpuG069453; Sun, 3 Feb 2013 12:17:51 GMT (envelope-from trasz@svn.freebsd.org) Received: (from trasz@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r13CHnX5069446; Sun, 3 Feb 2013 12:17:49 GMT (envelope-from trasz@svn.freebsd.org) Message-Id: <201302031217.r13CHnX5069446@svn.freebsd.org> From: Edward Tomasz Napierala Date: Sun, 3 Feb 2013 12:17:49 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246284 - in stable/9: sbin/dumpfs sbin/growfs sbin/newfs sys/geom/label sys/ufs/ffs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 12:17:51 -0000 Author: trasz Date: Sun Feb 3 12:17:49 2013 New Revision: 246284 URL: http://svnweb.freebsd.org/changeset/base/246284 Log: MFC r242379: Fix problem with geom_label(4) not recognizing UFS labels on filesystems extended using growfs(8). The problem here is that geom_label checks if the filesystem size recorded in UFS superblock is equal to the provider (i.e. device) size. This check cannot be removed due to backward compatibility. On the other hand, in most cases growfs(8) cannot set fs_size in the superblock to match the provider size, because, differently from newfs(8), it cannot recompute cylinder group sizes. To fix this problem, add another superblock field, fs_providersize, used only for this purpose. The geom_label(4) will attach if either fs_size (filesystem created with newfs(8)) or fs_providersize (filesystem expanded using growfs(8)) matches the device size. PR: kern/165962 Reviewed by: mckusick Sponsored by: FreeBSD Foundation Modified: stable/9/sbin/dumpfs/dumpfs.c stable/9/sbin/growfs/growfs.c stable/9/sbin/newfs/mkfs.c stable/9/sbin/newfs/newfs.c stable/9/sbin/newfs/newfs.h stable/9/sys/geom/label/g_label_ufs.c stable/9/sys/ufs/ffs/fs.h Directory Properties: stable/9/sbin/dumpfs/ (props changed) stable/9/sbin/growfs/ (props changed) stable/9/sbin/newfs/ (props changed) stable/9/sys/ (props changed) Modified: stable/9/sbin/dumpfs/dumpfs.c ============================================================================== --- stable/9/sbin/dumpfs/dumpfs.c Sun Feb 3 10:26:24 2013 (r246283) +++ stable/9/sbin/dumpfs/dumpfs.c Sun Feb 3 12:17:49 2013 (r246284) @@ -277,8 +277,9 @@ dumpfs(const char *name) printf("unknown flags (%#x)", fsflags); putchar('\n'); printf("fsmnt\t%s\n", afs.fs_fsmnt); - printf("volname\t%s\tswuid\t%ju\n", - afs.fs_volname, (uintmax_t)afs.fs_swuid); + printf("volname\t%s\tswuid\t%ju\tprovidersize\t%ju\n", + afs.fs_volname, (uintmax_t)afs.fs_swuid, + (uintmax_t)afs.fs_providersize); printf("\ncs[].cs_(nbfree,ndir,nifree,nffree):\n\t"); afs.fs_csp = calloc(1, afs.fs_cssize); if (bread(&disk, fsbtodb(&afs, afs.fs_csaddr), afs.fs_csp, afs.fs_cssize) == -1) Modified: stable/9/sbin/growfs/growfs.c ============================================================================== --- stable/9/sbin/growfs/growfs.c Sun Feb 3 10:26:24 2013 (r246283) +++ stable/9/sbin/growfs/growfs.c Sun Feb 3 12:17:49 2013 (r246284) @@ -1504,6 +1504,7 @@ main(int argc, char **argv) } sblock.fs_size = dbtofsb(&osblock, size / DEV_BSIZE); + sblock.fs_providersize = dbtofsb(&osblock, mediasize / DEV_BSIZE); /* * Are we really growing? Modified: stable/9/sbin/newfs/mkfs.c ============================================================================== --- stable/9/sbin/newfs/mkfs.c Sun Feb 3 10:26:24 2013 (r246283) +++ stable/9/sbin/newfs/mkfs.c Sun Feb 3 12:17:49 2013 (r246284) @@ -263,6 +263,7 @@ restart: } sblock.fs_fsbtodb = ilog2(sblock.fs_fsize / sectorsize); sblock.fs_size = fssize = dbtofsb(&sblock, fssize); + sblock.fs_providersize = dbtofsb(&sblock, mediasize / sectorsize); /* * Before the filesystem is finally initialized, mark it Modified: stable/9/sbin/newfs/newfs.c ============================================================================== --- stable/9/sbin/newfs/newfs.c Sun Feb 3 10:26:24 2013 (r246283) +++ stable/9/sbin/newfs/newfs.c Sun Feb 3 12:17:49 2013 (r246284) @@ -94,6 +94,7 @@ int lflag; /* enable multilabel for fi int nflag; /* do not create .snap directory */ int tflag; /* enable TRIM */ intmax_t fssize; /* file system size */ +off_t mediasize; /* device size */ int sectorsize; /* bytes/sector */ int realsectorsize; /* bytes/sector in hardware */ int fsize = 0; /* fragment size */ @@ -135,7 +136,6 @@ main(int argc, char *argv[]) char *cp, *special; intmax_t reserved; int ch, i, rval; - off_t mediasize; char part_name; /* partition name, default to full disk */ part_name = 'c'; Modified: stable/9/sbin/newfs/newfs.h ============================================================================== --- stable/9/sbin/newfs/newfs.h Sun Feb 3 10:26:24 2013 (r246283) +++ stable/9/sbin/newfs/newfs.h Sun Feb 3 12:17:49 2013 (r246284) @@ -87,6 +87,7 @@ extern int lflag; /* enable multilabel extern int nflag; /* do not create .snap directory */ extern int tflag; /* enable TRIM */ extern intmax_t fssize; /* file system size */ +extern off_t mediasize; /* device size */ extern int sectorsize; /* bytes/sector */ extern int realsectorsize; /* bytes/sector in hardware*/ extern int fsize; /* fragment size */ Modified: stable/9/sys/geom/label/g_label_ufs.c ============================================================================== --- stable/9/sys/geom/label/g_label_ufs.c Sun Feb 3 10:26:24 2013 (r246283) +++ stable/9/sys/geom/label/g_label_ufs.c Sun Feb 3 12:17:49 2013 (r246284) @@ -86,7 +86,8 @@ g_label_ufs_taste_common(struct g_consum pp->mediasize / fs->fs_fsize == fs->fs_old_size) { /* Valid UFS1. */ } else if (fs->fs_magic == FS_UFS2_MAGIC && fs->fs_fsize > 0 && - pp->mediasize / fs->fs_fsize == fs->fs_size) { + ((pp->mediasize / fs->fs_fsize == fs->fs_size) || + (pp->mediasize / fs->fs_fsize == fs->fs_providersize))) { /* Valid UFS2. */ } else { g_free(fs); Modified: stable/9/sys/ufs/ffs/fs.h ============================================================================== --- stable/9/sys/ufs/ffs/fs.h Sun Feb 3 10:26:24 2013 (r246283) +++ stable/9/sys/ufs/ffs/fs.h Sun Feb 3 12:17:49 2013 (r246284) @@ -332,7 +332,8 @@ struct fs { int32_t fs_old_cpc; /* cyl per cycle in postbl */ int32_t fs_maxbsize; /* maximum blocking factor permitted */ int64_t fs_unrefs; /* number of unreferenced inodes */ - int64_t fs_sparecon64[16]; /* old rotation block list head */ + int64_t fs_providersize; /* size of underlying GEOM provider */ + int64_t fs_sparecon64[15]; /* old rotation block list head */ int64_t fs_sblockloc; /* byte offset of standard superblock */ struct csum_total fs_cstotal; /* (u) cylinder summary information */ ufs_time_t fs_time; /* last time written */ From owner-svn-src-stable@FreeBSD.ORG Sun Feb 3 14:24:52 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id BCEE5EA5; Sun, 3 Feb 2013 14:24:52 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AA58799A; Sun, 3 Feb 2013 14:24:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r13EOqS1007709; Sun, 3 Feb 2013 14:24:52 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r13EOquH007708; Sun, 3 Feb 2013 14:24:52 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302031424.r13EOquH007708@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 3 Feb 2013 14:24:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246285 - stable/9/sys/fs/nfsclient X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 14:24:52 -0000 Author: kib Date: Sun Feb 3 14:24:52 2013 New Revision: 246285 URL: http://svnweb.freebsd.org/changeset/base/246285 Log: MFC r245977: Be conservative and do not try to consume more bytes than was requested from the server for the read operation. Modified: stable/9/sys/fs/nfsclient/nfs_clrpcops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfsclient/nfs_clrpcops.c ============================================================================== --- stable/9/sys/fs/nfsclient/nfs_clrpcops.c Sun Feb 3 12:17:49 2013 (r246284) +++ stable/9/sys/fs/nfsclient/nfs_clrpcops.c Sun Feb 3 14:24:52 2013 (r246285) @@ -1339,7 +1339,7 @@ nfsrpc_readrpc(vnode_t vp, struct uio *u NFSM_DISSECT(tl, u_int32_t *, NFSX_UNSIGNED); eof = fxdr_unsigned(int, *tl); } - NFSM_STRSIZ(retlen, rsize); + NFSM_STRSIZ(retlen, len); error = nfsm_mbufuio(nd, uiop, retlen); if (error) goto nfsmout; From owner-svn-src-stable@FreeBSD.ORG Sun Feb 3 18:14:40 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 22821B44; Sun, 3 Feb 2013 18:14:40 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EC253390; Sun, 3 Feb 2013 18:14:39 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r13IEddM079261; Sun, 3 Feb 2013 18:14:39 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r13IEcxt079247; Sun, 3 Feb 2013 18:14:38 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201302031814.r13IEcxt079247@svn.freebsd.org> From: Dmitry Chagin Date: Sun, 3 Feb 2013 18:14:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246290 - in stable/9/sys: amd64/linux32 compat/linux i386/linux modules/linux X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 18:14:40 -0000 Author: dchagin Date: Sun Feb 3 18:14:37 2013 New Revision: 246290 URL: http://svnweb.freebsd.org/changeset/base/246290 Log: MFC r235063 (by netchild@): - >500 static DTrace probes for the linuxulator - DTrace scripts to check for errors, performance, ... they serve mostly as examples of what you can do with the static probes with moderate load the scripts may be overwhelmed, excessive lock-tracing may influence program behavior (see the last design decission) Design decissions: - use "linuxulator" as the provider for the native bitsize; add the bitsize for the non-native emulation (e.g. "linuxuator32" on amd64) - Add probes only for locks which are acquired in one function and released in another function. Locks which are aquired and released in the same function should be easy to pair in the code, inter-function locking is more easy to verify in DTrace. - Probes for locks should be fired after locking and before releasing to prevent races (to provide data/function stability in DTrace, see the man-page of "dtrace -v ..." and the corresponding DTrace docs). Manual merge futex part of r227293 (by ed@): Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs. MFC r235078 (by uqs@): Fix make depend. Added: stable/9/sys/compat/linux/check_error.d - copied unchanged from r235063, head/sys/compat/linux/check_error.d stable/9/sys/compat/linux/check_internal_locks.d - copied unchanged from r235063, head/sys/compat/linux/check_internal_locks.d stable/9/sys/compat/linux/linux_dtrace.h - copied unchanged from r235063, head/sys/compat/linux/linux_dtrace.h stable/9/sys/compat/linux/stats_timing.d - copied unchanged from r235063, head/sys/compat/linux/stats_timing.d stable/9/sys/compat/linux/trace_futexes.d - copied unchanged from r235063, head/sys/compat/linux/trace_futexes.d Modified: stable/9/sys/amd64/linux32/linux.h stable/9/sys/amd64/linux32/linux32_dummy.c stable/9/sys/compat/linux/linux_emul.c stable/9/sys/compat/linux/linux_emul.h stable/9/sys/compat/linux/linux_fork.c stable/9/sys/compat/linux/linux_futex.c stable/9/sys/compat/linux/linux_mib.c stable/9/sys/compat/linux/linux_misc.c stable/9/sys/compat/linux/linux_sysctl.c stable/9/sys/compat/linux/linux_time.c stable/9/sys/compat/linux/linux_uid16.c stable/9/sys/compat/linux/linux_util.c stable/9/sys/compat/linux/linux_util.h stable/9/sys/i386/linux/linux.h stable/9/sys/i386/linux/linux_dummy.c stable/9/sys/modules/linux/Makefile Directory Properties: stable/9/sys/ (props changed) stable/9/sys/modules/ (props changed) Modified: stable/9/sys/amd64/linux32/linux.h ============================================================================== --- stable/9/sys/amd64/linux32/linux.h Sun Feb 3 17:16:32 2013 (r246289) +++ stable/9/sys/amd64/linux32/linux.h Sun Feb 3 18:14:37 2013 (r246290) @@ -42,6 +42,7 @@ extern u_char linux_debug_map[]; #define ldebug(name) isclr(linux_debug_map, LINUX_SYS_linux_ ## name) #define ARGS(nm, fmt) "linux(%ld): "#nm"("fmt")\n", (long)td->td_proc->p_pid #define LMSG(fmt) "linux(%ld): "fmt"\n", (long)td->td_proc->p_pid +#define LINUX_DTRACE linuxulator32 #ifdef MALLOC_DECLARE MALLOC_DECLARE(M_LINUX); Modified: stable/9/sys/amd64/linux32/linux32_dummy.c ============================================================================== --- stable/9/sys/amd64/linux32/linux32_dummy.c Sun Feb 3 17:16:32 2013 (r246289) +++ stable/9/sys/amd64/linux32/linux32_dummy.c Sun Feb 3 18:14:37 2013 (r246290) @@ -29,14 +29,23 @@ #include __FBSDID("$FreeBSD$"); +#include "opt_compat.h" +#include "opt_kdtrace.h" + #include +#include +#include #include #include #include #include +#include #include +/* DTrace init */ +LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); + DUMMY(stime); DUMMY(olduname); DUMMY(syslog); Copied: stable/9/sys/compat/linux/check_error.d (from r235063, head/sys/compat/linux/check_error.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/compat/linux/check_error.d Sun Feb 3 18:14:37 2013 (r246290, copy of r235063, head/sys/compat/linux/check_error.d) @@ -0,0 +1,144 @@ +#!/usr/sbin/dtrace -qs + +/*- + * Copyright (c) 2008-2012 Alexander Leidinger + * 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 + * in this position and unchanged. + * 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 ``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 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$ + */ + +/* + * Report error conditions: + * - emulation errors (unsupportet stuff, unknown stuff, ...) + * - kernel errors (resource shortage, ...) + * - programming errors (errors which can happen, but should not happen) + */ + +linuxulator*:dummy::not_implemented, +linuxulator*:emul:proc_exit:child_clear_tid_error, +linuxulator*:emul:proc_exit:futex_failed, +linuxulator*:emul:linux_schedtail:copyout_error, +linuxulator*:futex:futex_get:error, +linuxulator*:futex:futex_sleep:requeue_error, +linuxulator*:futex:futex_sleep:sleep_error, +linuxulator*:futex:futex_wait:copyin_error, +linuxulator*:futex:futex_wait:itimerfix_error, +linuxulator*:futex:futex_wait:sleep_error, +linuxulator*:futex:futex_atomic_op:missing_access_check, +linuxulator*:futex:futex_atomic_op:unimplemented_op, +linuxulator*:futex:futex_atomic_op:unimplemented_cmp, +linuxulator*:futex:linux_sys_futex:unimplemented_clockswitch, +linuxulator*:futex:linux_sys_futex:copyin_error, +linuxulator*:futex:linux_sys_futex:unhandled_efault, +linuxulator*:futex:linux_sys_futex:unimplemented_lock_pi, +linuxulator*:futex:linux_sys_futex:unimplemented_unlock_pi, +linuxulator*:futex:linux_sys_futex:unimplemented_trylock_pi, +linuxulator*:futex:linux_sys_futex:unimplemented_wait_requeue_pi, +linuxulator*:futex:linux_sys_futex:unimplemented_cmp_requeue_pi, +linuxulator*:futex:linux_sys_futex:unknown_operation, +linuxulator*:futex:linux_get_robust_list:copyout_error, +linuxulator*:futex:handle_futex_death:copyin_error, +linuxulator*:futex:fetch_robust_entry:copyin_error, +linuxulator*:futex:release_futexes:copyin_error, +linuxulator*:time:linux_clock_gettime:conversion_error, +linuxulator*:time:linux_clock_gettime:gettime_error, +linuxulator*:time:linux_clock_gettime:copyout_error, +linuxulator*:time:linux_clock_settime:conversion_error, +linuxulator*:time:linux_clock_settime:settime_error, +linuxulator*:time:linux_clock_settime:copyin_error, +linuxulator*:time:linux_clock_getres:conversion_error, +linuxulator*:time:linux_clock_getres:getres_error, +linuxulator*:time:linux_clock_getres:copyout_error, +linuxulator*:time:linux_nanosleep:conversion_error, +linuxulator*:time:linux_nanosleep:nanosleep_error, +linuxulator*:time:linux_nanosleep:copyout_error, +linuxulator*:time:linux_nanosleep:copyin_error, +linuxulator*:time:linux_clock_nanosleep:copyin_error, +linuxulator*:time:linux_clock_nanosleep:conversion_error, +linuxulator*:time:linux_clock_nanosleep:copyout_error, +linuxulator*:time:linux_clock_nanosleep:nanosleep_error, +linuxulator*:sysctl:handle_string:copyout_error, +linuxulator*:sysctl:linux_sysctl:copyin_error, +linuxulator*:mib:linux_sysctl_osname:sysctl_string_error, +linuxulator*:mib:linux_sysctl_osrelease:sysctl_string_error, +linuxulator*:mib:linux_sysctl_oss_version:sysctl_string_error, +linuxulator*:mib:linux_prison_create:vfs_copyopt_error, +linuxulator*:mib:linux_prison_check:vfs_copyopt_error, +linuxulator*:mib:linux_prison_check:vfs_getopt_error, +linuxulator*:mib:linux_prison_set:vfs_copyopt_error, +linuxulator*:mib:linux_prison_set:vfs_getopt_error, +linuxulator*:mib:linux_prison_get:vfs_setopt_error, +linuxulator*:mib:linux_prison_get:vfs_setopts_error +{ + printf("ERROR: %s in %s:%s:%s\n", probename, probeprov, probemod, probefunc); + stack(); + ustack(); +} + +linuxulator*:util:linux_driver_get_name_dev:nullcall, +linuxulator*:util:linux_driver_get_major_minor:nullcall, +linuxulator*:futex:linux_sys_futex:invalid_cmp_requeue_use, +linuxulator*:futex:linux_sys_futex:deprecated_requeue, +linuxulator*:futex:linux_set_robust_list:size_error, +linuxulator*:time:linux_clock_getres:nullcall +{ + printf("WARNING: %s:%s:%s:%s in application %s, maybe an application error?\n", probename, probeprov, probemod, probefunc, execname); + stack(); + ustack(); +} + +linuxulator*:util:linux_driver_get_major_minor:notfound +{ + printf("WARNING: Application %s failed to find %s in %s:%s:%s, this may or may not be a problem.\n", execname, stringof(args[0]), probename, probeprov, probemod); + stack(); + ustack(); +} + +linuxulator*:time:linux_to_native_clockid:unknown_clockid +{ + printf("INFO: Application %s tried to use unknown clockid %d. Please report this to freebsd-emulation@FreeBSD.org.\n", execname, arg0); +} + +linuxulator*:time:linux_to_native_clockid:unsupported_clockid, +linuxulator*:time:linux_clock_nanosleep:unsupported_clockid +{ + printf("WARNING: Application %s tried to use unsupported clockid (%d), this may or may not be a problem for the application.\nPatches to support this clockid are welcome on the freebsd-emulation@FreeBSD.org mailinglist.\n", execname, arg0); +} + +linuxulator*:time:linux_clock_nanosleep:unsupported_flags +{ + printf("WARNING: Application %s tried to use unsupported flags (%d), this may or may not be a problem for the application.\nPatches to support those flags are welcome on the freebsd-emulation@FreeBSD.org mailinglist.\n", execname, arg0); +} + +linuxulator*:sysctl:linux_sysctl:wrong_length +{ + printf("ERROR: Application %s issued a sysctl which failed the length restrictions.\nThe length passed is %d, the min length supported is 1 and the max length supported is %d.\n", execname, arg0, arg1); + stack(); + ustack(); +} + +linuxulator*:sysctl:linux_sysctl:unsupported_sysctl +{ + printf("ERROR: Application %s issued an unsupported sysctl (%s).\nPatches to support this sysctl are welcome on the freebsd-emulation@FreeBSD.org mailinglist.\n", execname, stringof(args[0])); +} Copied: stable/9/sys/compat/linux/check_internal_locks.d (from r235063, head/sys/compat/linux/check_internal_locks.d) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/compat/linux/check_internal_locks.d Sun Feb 3 18:14:37 2013 (r246290, copy of r235063, head/sys/compat/linux/check_internal_locks.d) @@ -0,0 +1,132 @@ +#!/usr/sbin/dtrace -qs + +/*- + * Copyright (c) 2008-2012 Alexander Leidinger + * 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 + * in this position and unchanged. + * 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 ``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 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$ + */ + +/** + * Check if the internal locks are correctly acquired/released: + * - no recursive locking (mtx locks, write locks) + * - no unlocking of already unlocked one + * + * Print stacktrace if a lock is longer locked than about 10sec or more. + */ + +#pragma D option dynvarsize=32m +#pragma D option specsize=32m + +BEGIN +{ + check["emul_lock"] = 0; + check["emul_shared_rlock"] = 0; + check["emul_shared_wlock"] = 0; + check["futex_mtx"] = 0; +} + +linuxulator*:locks:emul_lock:locked, +linuxulator*:locks:emul_shared_wlock:locked, +linuxulator*:locks:futex_mtx:locked +/check[probefunc] > 0/ +{ + printf("ERROR: recursive lock of %s (%p),", probefunc, arg0); + printf(" or missing SDT probe in kernel. Stack trace follows:"); + stack(); +} + +linuxulator*:locks:emul_lock:locked, +linuxulator*:locks:emul_shared_rlock:locked, +linuxulator*:locks:emul_shared_wlock:locked, +linuxulator*:locks:futex_mtx:locked +{ + ++check[probefunc]; + @stats[probefunc] = count(); + + ts[probefunc] = timestamp; + spec[probefunc] = speculation(); +} + +linuxulator*:locks:emul_lock:unlock, +linuxulator*:locks:emul_shared_rlock:unlock, +linuxulator*:locks:emul_shared_wlock:unlock, +linuxulator*:locks:futex_mtx:unlock +/check[probefunc] == 0/ +{ + printf("ERROR: unlock attemt of unlocked %s (%p),", probefunc, arg0); + printf(" missing SDT probe in kernel, or dtrace program started"); + printf(" while the %s was already held (race condition).", probefunc); + printf(" Stack trace follows:"); + stack(); +} + +linuxulator*:locks:emul_lock:unlock, +linuxulator*:locks:emul_shared_rlock:unlock, +linuxulator*:locks:emul_shared_wlock:unlock, +linuxulator*:locks:futex_mtx:unlock +{ + discard(spec[probefunc]); + spec[probefunc] = 0; + --check[probefunc]; +} + +/* Timeout handling */ + +tick-10s +/spec["emul_lock"] != 0 && timestamp - ts["emul_lock"] >= 9999999000/ +{ + commit(spec["emul_lock"]); + spec["emul_lock"] = 0; +} + +tick-10s +/spec["emul_shared_wlock"] != 0 && timestamp - ts["emul_shared_wlock"] >= 9999999000/ +{ + commit(spec["emul_shared_wlock"]); + spec["emul_shared_wlock"] = 0; +} + +tick-10s +/spec["emul_shared_rlock"] != 0 && timestamp - ts["emul_shared_rlock"] >= 9999999000/ +{ + commit(spec["emul_shared_rlock"]); + spec["emul_shared_rlock"] = 0; +} + +tick-10s +/spec["futex_mtx"] != 0 && timestamp - ts["futex_mtx"] >= 9999999000/ +{ + commit(spec["futex_mtx"]); + spec["futex_mtx"] = 0; +} + + +/* Statistics */ + +END +{ + printf("Number of locks per type:"); + printa(@stats); +} Copied: stable/9/sys/compat/linux/linux_dtrace.h (from r235063, head/sys/compat/linux/linux_dtrace.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/compat/linux/linux_dtrace.h Sun Feb 3 18:14:37 2013 (r246290, copy of r235063, head/sys/compat/linux/linux_dtrace.h) @@ -0,0 +1,95 @@ +/*- + * Copyright (c) 2008-2012 Alexander Leidinger + * 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 + * in this position and unchanged. + * 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 ``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 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$ + */ + +#ifndef _LINUX_DTRACE_H_ +#define _LINUX_DTRACE_H_ + +/** + * DTrace support macros for the linuxulator. + * + * Some wrapper macros to make it more easy to handle the linuxulator + * providers and to allow to make the name depend upon the bitsize. + * + * Basically this is the same as the normal SDT macros in sys/sdt.h. The + * difference is that the provider name is automatically inserted, and + * we do not use a different name for the probe-description. + */ + +#define LIN_SDT_PROVIDER_DEFINE(x) SDT_PROVIDER_DEFINE(x) +#define LIN_SDT_PROVIDER_DECLARE(x) SDT_PROVIDER_DECLARE(x) + +#define _LIN_SDT_PROBE_DECLARE(a, b, c, d) SDT_PROBE_DECLARE(a, b, c, d) +#define LIN_SDT_PROBE_DECLARE(a, b, c) _LIN_SDT_PROBE_DECLARE( \ + LINUX_DTRACE, a, b, c) + +#define _LIN_SDT_PROBE_DEFINE0(a, b, c, d) SDT_PROBE_DEFINE(a, \ + b, c, d, d) +#define LIN_SDT_PROBE_DEFINE0(a, b, c) _LIN_SDT_PROBE_DEFINE0(\ + LINUX_DTRACE, a, b, c) +#define _LIN_SDT_PROBE_DEFINE1(a, b, c, d, e) SDT_PROBE_DEFINE1(a, \ + b, c, d, d, e) +#define LIN_SDT_PROBE_DEFINE1(a, b, c, d) _LIN_SDT_PROBE_DEFINE1(\ + LINUX_DTRACE, a, b, c, d) +#define _LIN_SDT_PROBE_DEFINE2(a, b, c, d, e, f) SDT_PROBE_DEFINE2(a, \ + b, c, d, d, e, f) +#define LIN_SDT_PROBE_DEFINE2(a, b, c, d, e) _LIN_SDT_PROBE_DEFINE2(\ + LINUX_DTRACE, a, b, c, d, e) +#define _LIN_SDT_PROBE_DEFINE3(a, b, c, d, e, f, g) SDT_PROBE_DEFINE3(a, \ + b, c, d, d, e, f, g) +#define LIN_SDT_PROBE_DEFINE3(a, b, c, d, e, f) _LIN_SDT_PROBE_DEFINE3(\ + LINUX_DTRACE, a, b, c, d, e, f) +#define _LIN_SDT_PROBE_DEFINE4(a, b, c, d, e, f, g, h) SDT_PROBE_DEFINE4(a, \ + b, c, d, d, e, f, g, h) +#define LIN_SDT_PROBE_DEFINE4(a, b, c, d, e, f, g) _LIN_SDT_PROBE_DEFINE4(\ + LINUX_DTRACE, a, b, c, d, e, f, g) +#define _LIN_SDT_PROBE_DEFINE5(a, b, c, d, e, f, g, h, i) \ + SDT_PROBE_DEFINE5(a, b, c, d, d, e, f, g, h, i) +#define LIN_SDT_PROBE_DEFINE5(a, b, c, d, e, f, g, h) _LIN_SDT_PROBE_DEFINE5(\ + LINUX_DTRACE, a, b, c, d, e, f, g, h) + +#define _LIN_SDT_PROBE_ARGTYPE(a, b, c, d, e, f) SDT_PROBE_ARGTYPE(a, b,\ + c, d, e, f) +#define LIN_SDT_PROBE_ARGTYPE(a, b, c, d, e) _LIN_SDT_PROBE_ARGTYPE( \ + LINUX_DTRACE, a, b, c, d, e) + +#define LIN_SDT_PROBE0(a, b, c) SDT_PROBE1(LINUX_DTRACE, a, b, \ + c, 0) +#define LIN_SDT_PROBE1(a, b, c, d) SDT_PROBE1(LINUX_DTRACE, a, b, \ + c, d) +#define LIN_SDT_PROBE2(a, b, c, d, e) SDT_PROBE2(LINUX_DTRACE, a, b, \ + c, d, e) +#define LIN_SDT_PROBE3(a, b, c, d, e, f) SDT_PROBE3(LINUX_DTRACE, a, b, \ + c, d, e, f) +#define LIN_SDT_PROBE4(a, b, c, d, e, f, g) SDT_PROBE4(LINUX_DTRACE, a, b, \ + c, d, e, f, g) +#define _LIN_SDT_PROBE5(a, b, c, d, e, f, g, h, i) SDT_PROBE(a, b, c, d, \ + e, f, g, h, i) +#define LIN_SDT_PROBE5(a, b, c, d, e, f, g, h) _LIN_SDT_PROBE5(LINUX_DTRACE, \ + a, b, c, d, e, f, g, h) + +#endif /* _LINUX_DTRACE_H_ */ Modified: stable/9/sys/compat/linux/linux_emul.c ============================================================================== --- stable/9/sys/compat/linux/linux_emul.c Sun Feb 3 17:16:32 2013 (r246289) +++ stable/9/sys/compat/linux/linux_emul.c Sun Feb 3 18:14:37 2013 (r246290) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" +#include "opt_kdtrace.h" #include #include @@ -38,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -53,9 +55,64 @@ __FBSDID("$FreeBSD$"); #include #endif +#include #include #include +/** + * Special DTrace provider for the linuxulator. + * + * In this file we define the provider for the entire linuxulator. All + * modules (= files of the linuxulator) use it. + * + * We define a different name depending on the emulated bitsize, see + * ../..//linux{,32}/linux.h, e.g.: + * native bitsize = linuxulator + * amd64, 32bit emulation = linuxulator32 + */ +LIN_SDT_PROVIDER_DEFINE(LINUX_DTRACE); + +/** + * Special DTrace module "locks", it covers some linuxulator internal + * locks. + */ +LIN_SDT_PROBE_DEFINE1(locks, emul_lock, locked, "struct mtx *"); +LIN_SDT_PROBE_DEFINE1(locks, emul_lock, unlock, "struct mtx *"); +LIN_SDT_PROBE_DEFINE1(locks, emul_shared_rlock, locked, "struct sx *"); +LIN_SDT_PROBE_DEFINE1(locks, emul_shared_rlock, unlock, "struct sx *"); +LIN_SDT_PROBE_DEFINE1(locks, emul_shared_wlock, locked, "struct sx *"); +LIN_SDT_PROBE_DEFINE1(locks, emul_shared_wlock, unlock, "struct sx *"); + +/** + * DTrace probes in this module. + */ +LIN_SDT_PROBE_DEFINE2(emul, em_find, entry, "struct proc *", "int"); +LIN_SDT_PROBE_DEFINE0(emul, em_find, return); +LIN_SDT_PROBE_DEFINE3(emul, proc_init, entry, "struct thread *", "pid_t", + "int"); +LIN_SDT_PROBE_DEFINE0(emul, proc_init, create_thread); +LIN_SDT_PROBE_DEFINE0(emul, proc_init, fork); +LIN_SDT_PROBE_DEFINE0(emul, proc_init, exec); +LIN_SDT_PROBE_DEFINE0(emul, proc_init, return); +LIN_SDT_PROBE_DEFINE1(emul, proc_exit, entry, "struct proc *"); +LIN_SDT_PROBE_DEFINE0(emul, proc_exit, futex_failed); +LIN_SDT_PROBE_DEFINE3(emul, proc_exit, reparent, "pid_t", "pid_t", + "struct proc *"); +LIN_SDT_PROBE_DEFINE1(emul, proc_exit, child_clear_tid_error, "int"); +LIN_SDT_PROBE_DEFINE0(emul, proc_exit, return); +LIN_SDT_PROBE_DEFINE2(emul, proc_exec, entry, "struct proc *", + "struct image_params *"); +LIN_SDT_PROBE_DEFINE0(emul, proc_exec, return); +LIN_SDT_PROBE_DEFINE0(emul, linux_schedtail, entry); +LIN_SDT_PROBE_DEFINE1(emul, linux_schedtail, copyout_error, "int"); +LIN_SDT_PROBE_DEFINE0(emul, linux_schedtail, return); +LIN_SDT_PROBE_DEFINE1(emul, linux_set_tid_address, entry, "int *"); +LIN_SDT_PROBE_DEFINE0(emul, linux_set_tid_address, return); +LIN_SDT_PROBE_DEFINE2(emul, linux_kill_threads, entry, "struct thread *", + "int"); +LIN_SDT_PROBE_DEFINE1(emul, linux_kill_threads, kill, "pid_t"); +LIN_SDT_PROBE_DEFINE0(emul, linux_kill_threads, return); + struct sx emul_shared_lock; struct mtx emul_lock; @@ -65,6 +122,8 @@ em_find(struct proc *p, int locked) { struct linux_emuldata *em; + LIN_SDT_PROBE2(emul, em_find, entry, p, locked); + if (locked == EMUL_DOLOCK) EMUL_LOCK(&emul_lock); @@ -73,6 +132,7 @@ em_find(struct proc *p, int locked) if (em == NULL && locked == EMUL_DOLOCK) EMUL_UNLOCK(&emul_lock); + LIN_SDT_PROBE1(emul, em_find, return, em); return (em); } @@ -82,8 +142,10 @@ linux_proc_init(struct thread *td, pid_t struct linux_emuldata *em, *p_em; struct proc *p; + LIN_SDT_PROBE3(emul, proc_init, entry, td, child, flags); + if (child != 0) { - /* non-exec call */ + /* fork or create a thread */ em = malloc(sizeof *em, M_LINUX, M_WAITOK | M_ZERO); em->pid = child; em->pdeath_signal = 0; @@ -91,9 +153,12 @@ linux_proc_init(struct thread *td, pid_t em->robust_futexes = NULL; if (flags & LINUX_CLONE_THREAD) { /* handled later in the code */ + LIN_SDT_PROBE0(emul, proc_init, create_thread); } else { struct linux_emuldata_shared *s; + LIN_SDT_PROBE0(emul, proc_init, fork); + s = malloc(sizeof *s, M_LINUX, M_WAITOK | M_ZERO); s->refs = 1; s->group_pid = child; @@ -102,6 +167,9 @@ linux_proc_init(struct thread *td, pid_t em->shared = s; } } else { + /* exec */ + LIN_SDT_PROBE0(emul, proc_init, exec); + /* lookup the old one */ em = em_find(td->td_proc, EMUL_DOLOCK); KASSERT(em != NULL, ("proc_init: emuldata not found in exec case.\n")); @@ -136,8 +204,7 @@ linux_proc_init(struct thread *td, pid_t * rwlock held */ } - } - if (child != 0) { + EMUL_SHARED_WLOCK(&emul_shared_lock); LIST_INSERT_HEAD(&em->shared->threads, em, threads); EMUL_SHARED_WUNLOCK(&emul_shared_lock); @@ -149,6 +216,7 @@ linux_proc_init(struct thread *td, pid_t } else EMUL_UNLOCK(&emul_lock); + LIN_SDT_PROBE0(emul, proc_init, return); return (0); } @@ -164,6 +232,8 @@ linux_proc_exit(void *arg __unused, stru if (__predict_true(p->p_sysent != &elf_linux_sysvec)) return; + LIN_SDT_PROBE1(emul, proc_exit, entry, p); + release_futexes(p); /* find the emuldata */ @@ -173,6 +243,9 @@ linux_proc_exit(void *arg __unused, stru /* reparent all procs that are not a thread leader to initproc */ if (em->shared->group_pid != p->p_pid) { + LIN_SDT_PROBE3(emul, proc_exit, reparent, + em->shared->group_pid, p->p_pid, p); + child_clear_tid = em->child_clear_tid; EMUL_UNLOCK(&emul_lock); sx_xlock(&proctree_lock); @@ -208,7 +281,12 @@ linux_proc_exit(void *arg __unused, stru error = copyout(&null, child_clear_tid, sizeof(null)); if (error) { + LIN_SDT_PROBE1(emul, proc_exit, + child_clear_tid_error, error); + free(em, M_LINUX); + + LIN_SDT_PROBE0(emul, proc_exit, return); return; } @@ -224,8 +302,10 @@ linux_proc_exit(void *arg __unused, stru * this cannot happen at the moment and if this happens it * probably means there is a user space bug */ - if (error) + if (error) { + LIN_SDT_PROBE0(emul, proc_exit, futex_failed); printf(LMSG("futex stuff in proc_exit failed.\n")); + } } /* clean the stuff up */ @@ -250,6 +330,8 @@ linux_proc_exit(void *arg __unused, stru EMUL_UNLOCK(&emul_lock); } sx_xunlock(&proctree_lock); + + LIN_SDT_PROBE0(emul, proc_exit, return); } /* @@ -260,6 +342,9 @@ linux_proc_exit(void *arg __unused, stru void linux_proc_exec(void *arg __unused, struct proc *p, struct image_params *imgp) { + if (__predict_false(imgp->sysent == &elf_linux_sysvec)) { + LIN_SDT_PROBE2(emul, proc_exec, entry, p, imgp); + } if (__predict_false(imgp->sysent == &elf_linux_sysvec && p->p_sysent != &elf_linux_sysvec)) linux_proc_init(FIRST_THREAD_IN_PROC(p), p->p_pid, 0); @@ -297,6 +382,10 @@ linux_proc_exec(void *arg __unused, stru free(em, M_LINUX); } + + if (__predict_false(imgp->sysent == &elf_linux_sysvec)) { + LIN_SDT_PROBE0(emul, proc_exec, return); + } } void @@ -309,6 +398,8 @@ linux_schedtail(struct thread *td) p = td->td_proc; + LIN_SDT_PROBE1(emul, linux_schedtail, entry, p); + /* find the emuldata */ em = em_find(p, EMUL_DOLOCK); @@ -316,10 +407,18 @@ linux_schedtail(struct thread *td) child_set_tid = em->child_set_tid; EMUL_UNLOCK(&emul_lock); - if (child_set_tid != NULL) + if (child_set_tid != NULL) { error = copyout(&p->p_pid, (int *)child_set_tid, sizeof(p->p_pid)); + if (error != 0) { + LIN_SDT_PROBE1(emul, linux_schedtail, copyout_error, + error); + } + } + + LIN_SDT_PROBE0(emul, linux_schedtail, return); + return; } @@ -328,10 +427,7 @@ linux_set_tid_address(struct thread *td, { struct linux_emuldata *em; -#ifdef DEBUG - if (ldebug(set_tid_address)) - printf(ARGS(set_tid_address, "%p"), args->tidptr); -#endif + LIN_SDT_PROBE1(emul, linux_set_tid_address, entry, args->tidptr); /* find the emuldata */ em = em_find(td->td_proc, EMUL_DOLOCK); @@ -342,6 +438,8 @@ linux_set_tid_address(struct thread *td, td->td_retval[0] = td->td_proc->p_pid; EMUL_UNLOCK(&emul_lock); + + LIN_SDT_PROBE0(emul, linux_set_tid_address, return); return 0; } @@ -351,6 +449,8 @@ linux_kill_threads(struct thread *td, in struct linux_emuldata *em, *td_em, *tmp_em; struct proc *sp; + LIN_SDT_PROBE2(emul, linux_kill_threads, entry, td, sig); + td_em = em_find(td->td_proc, EMUL_DONTLOCK); KASSERT(td_em != NULL, ("linux_kill_threads: emuldata not found.\n")); @@ -364,9 +464,10 @@ linux_kill_threads(struct thread *td, in if ((sp->p_flag & P_WEXIT) == 0) kern_psignal(sp, sig); PROC_UNLOCK(sp); -#ifdef DEBUG - printf(LMSG("linux_kill_threads: kill PID %d\n"), em->pid); -#endif + + LIN_SDT_PROBE1(emul, linux_kill_threads, kill, em->pid); } EMUL_SHARED_RUNLOCK(&emul_shared_lock); + + LIN_SDT_PROBE0(emul, linux_kill_threads, return); } Modified: stable/9/sys/compat/linux/linux_emul.h ============================================================================== --- stable/9/sys/compat/linux/linux_emul.h Sun Feb 3 17:16:32 2013 (r246289) +++ stable/9/sys/compat/linux/linux_emul.h Sun Feb 3 18:14:37 2013 (r246290) @@ -64,13 +64,42 @@ struct linux_emuldata { struct linux_emuldata *em_find(struct proc *, int locked); -#define EMUL_LOCK(l) mtx_lock(l) -#define EMUL_UNLOCK(l) mtx_unlock(l) - -#define EMUL_SHARED_RLOCK(l) sx_slock(l) -#define EMUL_SHARED_RUNLOCK(l) sx_sunlock(l) -#define EMUL_SHARED_WLOCK(l) sx_xlock(l) -#define EMUL_SHARED_WUNLOCK(l) sx_xunlock(l) +/* + * DTrace probes for locks should be fired after locking and before releasing + * to prevent races (to provide data/function stability in dtrace, see the + * output of "dtrace -v ..." and the corresponding dtrace docs). + */ +#define EMUL_LOCK(l) do { \ + mtx_lock(l); \ + LIN_SDT_PROBE1(locks, emul_lock, \ + locked, l); \ + } while (0) +#define EMUL_UNLOCK(l) do { \ + LIN_SDT_PROBE1(locks, emul_lock, \ + unlock, l); \ + mtx_unlock(l); \ + } while (0) + +#define EMUL_SHARED_RLOCK(l) do { \ + sx_slock(l); \ + LIN_SDT_PROBE1(locks, emul_shared_rlock, \ + locked, l); \ + } while (0) +#define EMUL_SHARED_RUNLOCK(l) do { \ + LIN_SDT_PROBE1(locks, emul_shared_rlock, \ + unlock, l); \ + sx_sunlock(l); \ + } while (0) +#define EMUL_SHARED_WLOCK(l) do { \ + sx_xlock(l); \ + LIN_SDT_PROBE1(locks, emul_shared_wlock, \ + locked, l); \ + } while (0) +#define EMUL_SHARED_WUNLOCK(l) do { \ + LIN_SDT_PROBE1(locks, emul_shared_wlock, \ + unlock, l); \ + sx_xunlock(l); \ + } while (0) /* for em_find use */ #define EMUL_DOLOCK 1 Modified: stable/9/sys/compat/linux/linux_fork.c ============================================================================== --- stable/9/sys/compat/linux/linux_fork.c Sun Feb 3 17:16:32 2013 (r246289) +++ stable/9/sys/compat/linux/linux_fork.c Sun Feb 3 18:14:37 2013 (r246290) @@ -30,6 +30,7 @@ __FBSDID("$FreeBSD$"); #include "opt_compat.h" +#include "opt_kdtrace.h" #include #include @@ -38,6 +39,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include @@ -48,9 +50,17 @@ __FBSDID("$FreeBSD$"); #include #include #endif +#include #include #include +/* DTrace init */ +LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); + +/* Linuxulator-global DTrace probes */ +LIN_SDT_PROBE_DECLARE(locks, emul_lock, locked); +LIN_SDT_PROBE_DECLARE(locks, emul_lock, unlock); + int linux_fork(struct thread *td, struct linux_fork_args *args) Modified: stable/9/sys/compat/linux/linux_futex.c ============================================================================== --- stable/9/sys/compat/linux/linux_futex.c Sun Feb 3 17:16:32 2013 (r246289) +++ stable/9/sys/compat/linux/linux_futex.c Sun Feb 3 18:14:37 2013 (r246290) @@ -38,6 +38,7 @@ __KERNEL_RCSID(1, "$NetBSD: linux_futex. #endif #include "opt_compat.h" +#include "opt_kdtrace.h" #include #include @@ -51,6 +52,7 @@ __KERNEL_RCSID(1, "$NetBSD: linux_futex. #include #include #include +#include #include #include @@ -61,12 +63,133 @@ __KERNEL_RCSID(1, "$NetBSD: linux_futex. #include #include #endif +#include #include #include #include -MALLOC_DEFINE(M_FUTEX, "futex", "Linux futexes"); -MALLOC_DEFINE(M_FUTEX_WP, "futex wp", "Linux futexes wp"); +/* DTrace init */ +LIN_SDT_PROVIDER_DECLARE(LINUX_DTRACE); + +/* Linuxulator-global DTrace probes */ +LIN_SDT_PROBE_DECLARE(locks, emul_lock, locked); +LIN_SDT_PROBE_DECLARE(locks, emul_lock, unlock); + +/** + * Futex part for the special DTrace module "locks". + */ +LIN_SDT_PROBE_DEFINE1(locks, futex_mtx, locked, "struct mtx *"); +LIN_SDT_PROBE_DEFINE1(locks, futex_mtx, unlock, "struct mtx *"); + +/** + * Per futex probes. + */ +LIN_SDT_PROBE_DEFINE1(futex, futex, create, "struct sx *"); +LIN_SDT_PROBE_DEFINE1(futex, futex, destroy, "struct sx *"); + +/** + * DTrace probes in this module. + */ +LIN_SDT_PROBE_DEFINE2(futex, futex_put, entry, "struct futex *", + "struct waiting_proc *"); +LIN_SDT_PROBE_DEFINE3(futex, futex_put, destroy, "uint32_t *", "uint32_t", + "int"); +LIN_SDT_PROBE_DEFINE3(futex, futex_put, unlock, "uint32_t *", "uint32_t", + "int"); +LIN_SDT_PROBE_DEFINE0(futex, futex_put, return); +LIN_SDT_PROBE_DEFINE3(futex, futex_get0, entry, "uint32_t *", "struct futex **", + "uint32_t"); +LIN_SDT_PROBE_DEFINE1(futex, futex_get0, umtx_key_get_error, "int"); +LIN_SDT_PROBE_DEFINE3(futex, futex_get0, shared, "uint32_t *", "uint32_t", + "int"); +LIN_SDT_PROBE_DEFINE1(futex, futex_get0, null, "uint32_t *"); +LIN_SDT_PROBE_DEFINE3(futex, futex_get0, new, "uint32_t *", "uint32_t", "int"); +LIN_SDT_PROBE_DEFINE1(futex, futex_get0, return, "int"); +LIN_SDT_PROBE_DEFINE3(futex, futex_get, entry, "uint32_t *", + "struct waiting_proc **", "struct futex **"); +LIN_SDT_PROBE_DEFINE0(futex, futex_get, error); +LIN_SDT_PROBE_DEFINE1(futex, futex_get, return, "int"); +LIN_SDT_PROBE_DEFINE3(futex, futex_sleep, entry, "struct futex *", + "struct waiting_proc **", "int"); +LIN_SDT_PROBE_DEFINE5(futex, futex_sleep, requeue_error, "int", "uint32_t *", + "struct waiting_proc *", "uint32_t *", "uint32_t"); +LIN_SDT_PROBE_DEFINE3(futex, futex_sleep, sleep_error, "int", "uint32_t *", + "struct waiting_proc *"); +LIN_SDT_PROBE_DEFINE1(futex, futex_sleep, return, "int"); +LIN_SDT_PROBE_DEFINE3(futex, futex_wake, entry, "struct futex *", "int", + "uint32_t"); +LIN_SDT_PROBE_DEFINE3(futex, futex_wake, iterate, "uint32_t", + "struct waiting_proc *", "uin32_t"); +LIN_SDT_PROBE_DEFINE1(futex, futex_wake, wakeup, "struct waiting_proc *"); +LIN_SDT_PROBE_DEFINE1(futex, futex_wake, return, "int"); +LIN_SDT_PROBE_DEFINE4(futex, futex_requeue, entry, "struct futex *", "int", + "struct futex *", "int"); +LIN_SDT_PROBE_DEFINE1(futex, futex_requeue, wakeup, "struct waiting_proc *"); +LIN_SDT_PROBE_DEFINE3(futex, futex_requeue, requeue, "uint32_t *", + "struct waiting_proc *", "uint32_t"); +LIN_SDT_PROBE_DEFINE1(futex, futex_requeue, return, "int"); +LIN_SDT_PROBE_DEFINE4(futex, futex_wait, entry, "struct futex *", + "struct waiting_proc **", "struct l_timespec *", "uint32_t"); +LIN_SDT_PROBE_DEFINE1(futex, futex_wait, copyin_error, "int"); +LIN_SDT_PROBE_DEFINE1(futex, futex_wait, itimerfix_error, "int"); +LIN_SDT_PROBE_DEFINE1(futex, futex_wait, sleep_error, "int"); +LIN_SDT_PROBE_DEFINE1(futex, futex_wait, return, "int"); +LIN_SDT_PROBE_DEFINE3(futex, futex_atomic_op, entry, "struct thread *", + "int", "uint32_t"); +LIN_SDT_PROBE_DEFINE4(futex, futex_atomic_op, decoded_op, "int", "int", "int", + "int"); +LIN_SDT_PROBE_DEFINE0(futex, futex_atomic_op, missing_access_check); +LIN_SDT_PROBE_DEFINE1(futex, futex_atomic_op, unimplemented_op, "int"); +LIN_SDT_PROBE_DEFINE1(futex, futex_atomic_op, unimplemented_cmp, "int"); +LIN_SDT_PROBE_DEFINE1(futex, futex_atomic_op, return, "int"); +LIN_SDT_PROBE_DEFINE2(futex, linux_sys_futex, entry, "struct thread *", + "struct linux_sys_futex_args *"); +LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, unimplemented_clockswitch); +LIN_SDT_PROBE_DEFINE1(futex, linux_sys_futex, copyin_error, "int"); +LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, invalid_cmp_requeue_use); +LIN_SDT_PROBE_DEFINE3(futex, linux_sys_futex, debug_wait, "uint32_t *", + "uint32_t", "uint32_t"); +LIN_SDT_PROBE_DEFINE4(futex, linux_sys_futex, debug_wait_value_neq, + "uint32_t *", "uint32_t", "int", "uint32_t"); +LIN_SDT_PROBE_DEFINE3(futex, linux_sys_futex, debug_wake, "uint32_t *", + "uint32_t", "uint32_t"); +LIN_SDT_PROBE_DEFINE5(futex, linux_sys_futex, debug_cmp_requeue, "uint32_t *", + "uint32_t", "uint32_t", "uint32_t *", "struct l_timespec *"); +LIN_SDT_PROBE_DEFINE2(futex, linux_sys_futex, debug_cmp_requeue_value_neq, + "uint32_t", "int"); +LIN_SDT_PROBE_DEFINE5(futex, linux_sys_futex, debug_wake_op, "uint32_t *", + "int", "uint32_t", "uint32_t *", "uint32_t"); +LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, unhandled_efault); +LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, unimplemented_lock_pi); +LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, unimplemented_unlock_pi); +LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, unimplemented_trylock_pi); +LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, deprecated_requeue); +LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, unimplemented_wait_requeue_pi); +LIN_SDT_PROBE_DEFINE0(futex, linux_sys_futex, unimplemented_cmp_requeue_pi); +LIN_SDT_PROBE_DEFINE1(futex, linux_sys_futex, unknown_operation, "int"); +LIN_SDT_PROBE_DEFINE1(futex, linux_sys_futex, return, "int"); +LIN_SDT_PROBE_DEFINE2(futex, linux_set_robust_list, entry, "struct thread *", + "struct linux_set_robust_list_args *"); +LIN_SDT_PROBE_DEFINE0(futex, linux_set_robust_list, size_error); +LIN_SDT_PROBE_DEFINE1(futex, linux_set_robust_list, return, "int"); +LIN_SDT_PROBE_DEFINE2(futex, linux_get_robust_list, entry, "struct thread *", + "struct linux_get_robust_list_args *"); +LIN_SDT_PROBE_DEFINE1(futex, linux_get_robust_list, copyout_error, "int"); +LIN_SDT_PROBE_DEFINE1(futex, linux_get_robust_list, return, "int"); +LIN_SDT_PROBE_DEFINE3(futex, handle_futex_death, entry, "struct proc *", + "uint32_t *", "int"); +LIN_SDT_PROBE_DEFINE1(futex, handle_futex_death, copyin_error, "int"); +LIN_SDT_PROBE_DEFINE1(futex, handle_futex_death, return, "int"); +LIN_SDT_PROBE_DEFINE3(futex, fetch_robust_entry, entry, + "struct linux_robust_list **", "struct linux_robust_list **", "int *"); +LIN_SDT_PROBE_DEFINE1(futex, fetch_robust_entry, copyin_error, "int"); +LIN_SDT_PROBE_DEFINE1(futex, fetch_robust_entry, return, "int"); +LIN_SDT_PROBE_DEFINE1(futex, release_futexes, entry, "struct proc *"); +LIN_SDT_PROBE_DEFINE1(futex, release_futexes, copyin_error, "int"); +LIN_SDT_PROBE_DEFINE0(futex, release_futexes, return); + +static MALLOC_DEFINE(M_FUTEX, "futex", "Linux futexes"); +static MALLOC_DEFINE(M_FUTEX_WP, "futex wp", "Linux futexes wp"); struct futex; @@ -90,13 +213,30 @@ struct futex_list futex_list; #define FUTEX_LOCK(f) sx_xlock(&(f)->f_lck) #define FUTEX_UNLOCK(f) sx_xunlock(&(f)->f_lck) -#define FUTEX_INIT(f) sx_init_flags(&(f)->f_lck, "ftlk", SX_DUPOK) -#define FUTEX_DESTROY(f) sx_destroy(&(f)->f_lck) +#define FUTEX_INIT(f) do { \ + sx_init_flags(&(f)->f_lck, "ftlk", \ + SX_DUPOK); \ + LIN_SDT_PROBE1(futex, futex, create, \ + &(f)->f_lck); \ + } while (0) +#define FUTEX_DESTROY(f) do { \ + LIN_SDT_PROBE1(futex, futex, destroy, \ + &(f)->f_lck); \ + sx_destroy(&(f)->f_lck); \ + } while (0) #define FUTEX_ASSERT_LOCKED(f) sx_assert(&(f)->f_lck, SA_XLOCKED) struct mtx futex_mtx; /* protects the futex list */ -#define FUTEXES_LOCK mtx_lock(&futex_mtx) -#define FUTEXES_UNLOCK mtx_unlock(&futex_mtx) +#define FUTEXES_LOCK do { \ + mtx_lock(&futex_mtx); \ + LIN_SDT_PROBE1(locks, futex_mtx, \ + locked, &futex_mtx); \ + } while (0) +#define FUTEXES_UNLOCK do { \ + LIN_SDT_PROBE1(locks, futex_mtx, \ + unlock, &futex_mtx); \ + mtx_unlock(&futex_mtx); \ + } while (0) /* flags for futex_get() */ #define FUTEX_CREATE_WP 0x1 /* create waiting_proc */ @@ -123,6 +263,7 @@ int futex_xorl(int oparg, uint32_t *uadd static void futex_put(struct futex *f, struct waiting_proc *wp) { + LIN_SDT_PROBE2(futex, futex_put, entry, f, wp); FUTEX_ASSERT_LOCKED(f); *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Sun Feb 3 18:27:57 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B134F97; Sun, 3 Feb 2013 18:27:57 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9EFCE5E4; Sun, 3 Feb 2013 18:27:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r13IRvbp084385; Sun, 3 Feb 2013 18:27:57 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r13IRvEd084384; Sun, 3 Feb 2013 18:27:57 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201302031827.r13IRvEd084384@svn.freebsd.org> From: Dmitry Chagin Date: Sun, 3 Feb 2013 18:27:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246291 - stable/9/sys/compat/linux X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 18:27:57 -0000 Author: dchagin Date: Sun Feb 3 18:27:57 2013 New Revision: 246291 URL: http://svnweb.freebsd.org/changeset/base/246291 Log: MFC r240387 (by kevlo@): Remove redundant check. Modified: stable/9/sys/compat/linux/linux_file.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/compat/linux/linux_file.c ============================================================================== --- stable/9/sys/compat/linux/linux_file.c Sun Feb 3 18:14:37 2013 (r246290) +++ stable/9/sys/compat/linux/linux_file.c Sun Feb 3 18:27:57 2013 (r246291) @@ -381,11 +381,6 @@ getdents_common(struct thread *td, struc auio.uio_resid = buflen; auio.uio_offset = off; - if (cookies) { - free(cookies, M_TEMP); - cookies = NULL; - } - #ifdef MAC /* * Do directory search MAC check using non-cached credentials. From owner-svn-src-stable@FreeBSD.ORG Sun Feb 3 18:37:09 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2AE984F2; Sun, 3 Feb 2013 18:37:09 +0000 (UTC) (envelope-from dchagin@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 048BA696; Sun, 3 Feb 2013 18:37:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r13Ib8kB087319; Sun, 3 Feb 2013 18:37:08 GMT (envelope-from dchagin@svn.freebsd.org) Received: (from dchagin@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r13Ib8wb087318; Sun, 3 Feb 2013 18:37:08 GMT (envelope-from dchagin@svn.freebsd.org) Message-Id: <201302031837.r13Ib8wb087318@svn.freebsd.org> From: Dmitry Chagin Date: Sun, 3 Feb 2013 18:37:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246292 - stable/9/sys/compat/linux X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 03 Feb 2013 18:37:09 -0000 Author: dchagin Date: Sun Feb 3 18:37:08 2013 New Revision: 246292 URL: http://svnweb.freebsd.org/changeset/base/246292 Log: MFC r245908: Arithmetic on pointers takes into account the size of the type. Properly cast the pointer to avoid incorrect pointer scaling. Modified: stable/9/sys/compat/linux/linux_futex.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/compat/linux/linux_futex.c ============================================================================== --- stable/9/sys/compat/linux/linux_futex.c Sun Feb 3 18:27:57 2013 (r246291) +++ stable/9/sys/compat/linux/linux_futex.c Sun Feb 3 18:37:08 2013 (r246292) @@ -1203,7 +1203,7 @@ release_futexes(struct proc *p) if (entry != pending) if (handle_futex_death(p, - (uint32_t *)entry + futex_offset, pi)) { + (uint32_t *)((caddr_t)entry + futex_offset), pi)) { LIN_SDT_PROBE0(futex, release_futexes, return); return; } @@ -1222,7 +1222,7 @@ release_futexes(struct proc *p) } if (pending) - handle_futex_death(p, (uint32_t *)pending + futex_offset, pip); + handle_futex_death(p, (uint32_t *)((caddr_t)pending + futex_offset), pip); LIN_SDT_PROBE0(futex, release_futexes, return); } From owner-svn-src-stable@FreeBSD.ORG Mon Feb 4 00:34:34 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8EEC0563; Mon, 4 Feb 2013 00:34:34 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 645DB157; Mon, 4 Feb 2013 00:34:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r140YXOl006540; Mon, 4 Feb 2013 00:34:33 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r140YXFL006537; Mon, 4 Feb 2013 00:34:33 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302040034.r140YXFL006537@svn.freebsd.org> From: Eitan Adler Date: Mon, 4 Feb 2013 00:34:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246309 - stable/9/sbin/devd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 00:34:34 -0000 Author: eadler Date: Mon Feb 4 00:34:33 2013 New Revision: 246309 URL: http://svnweb.freebsd.org/changeset/base/246309 Log: MFC r243930: Constify where possible Approved by: cperciva (mentor, implicit) Modified: stable/9/sbin/devd/devd.cc stable/9/sbin/devd/devd.hh Directory Properties: stable/9/sbin/devd/ (props changed) Modified: stable/9/sbin/devd/devd.cc ============================================================================== --- stable/9/sbin/devd/devd.cc Sun Feb 3 23:54:30 2013 (r246308) +++ stable/9/sbin/devd/devd.cc Mon Feb 4 00:34:33 2013 (r246309) @@ -151,7 +151,7 @@ event_proc::add(eps *eps) } bool -event_proc::matches(config &c) +event_proc::matches(config &c) const { vector::const_iterator i; @@ -162,7 +162,7 @@ event_proc::matches(config &c) } bool -event_proc::run(config &c) +event_proc::run(config &c) const { vector::const_iterator i; @@ -426,7 +426,7 @@ config::parse_files_in_dir(const char *d class epv_greater { public: - int operator()(event_proc *const&l1, event_proc *const&l2) + int operator()(event_proc *const&l1, event_proc *const&l2) const { return (l1->get_priority() > l2->get_priority()); } @@ -567,7 +567,7 @@ config::get_variable(const string &var) } bool -config::is_id_char(char ch) +config::is_id_char(char ch) const { return (ch != '\0' && (isalpha(ch) || isdigit(ch) || ch == '_' || ch == '-')); Modified: stable/9/sbin/devd/devd.hh ============================================================================== --- stable/9/sbin/devd/devd.hh Sun Feb 3 23:54:30 2013 (r246308) +++ stable/9/sbin/devd/devd.hh Mon Feb 4 00:34:33 2013 (r246309) @@ -133,8 +133,8 @@ public: int get_priority() const { return (_prio); } void set_priority(int prio) { _prio = prio; } void add(eps *); - bool matches(config &); - bool run(config &); + bool matches(config &) const; + bool run(config &) const; private: int _prio; std::vector _epsvec; @@ -169,7 +169,7 @@ protected: void parse_one_file(const char *fn); void parse_files_in_dir(const char *dirname); void expand_one(const char *&src, std::string &dst); - bool is_id_char(char); + bool is_id_char(char) const; bool chop_var(char *&buffer, char *&lhs, char *&rhs); private: std::vector _dir_list; From owner-svn-src-stable@FreeBSD.ORG Mon Feb 4 00:34:35 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C8CE3564; Mon, 4 Feb 2013 00:34:35 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9A212158; Mon, 4 Feb 2013 00:34:35 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r140YZlP006602; Mon, 4 Feb 2013 00:34:35 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r140YZWO006594; Mon, 4 Feb 2013 00:34:35 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302040034.r140YZWO006594@svn.freebsd.org> From: Eitan Adler Date: Mon, 4 Feb 2013 00:34:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246310 - stable/8/sbin/devd X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 00:34:35 -0000 Author: eadler Date: Mon Feb 4 00:34:34 2013 New Revision: 246310 URL: http://svnweb.freebsd.org/changeset/base/246310 Log: MFC r243930: Constify where possible Approved by: cperciva (mentor, implicit) Modified: stable/8/sbin/devd/devd.cc stable/8/sbin/devd/devd.hh Directory Properties: stable/8/sbin/devd/ (props changed) Modified: stable/8/sbin/devd/devd.cc ============================================================================== --- stable/8/sbin/devd/devd.cc Mon Feb 4 00:34:33 2013 (r246309) +++ stable/8/sbin/devd/devd.cc Mon Feb 4 00:34:34 2013 (r246310) @@ -120,7 +120,7 @@ event_proc::add(eps *eps) } bool -event_proc::matches(config &c) +event_proc::matches(config &c) const { vector::const_iterator i; @@ -131,7 +131,7 @@ event_proc::matches(config &c) } bool -event_proc::run(config &c) +event_proc::run(config &c) const { vector::const_iterator i; @@ -343,7 +343,7 @@ config::parse_files_in_dir(const char *d class epv_greater { public: - int operator()(event_proc *const&l1, event_proc *const&l2) + int operator()(event_proc *const&l1, event_proc *const&l2) const { return (l1->get_priority() > l2->get_priority()); } @@ -477,7 +477,7 @@ config::get_variable(const string &var) } bool -config::is_id_char(char ch) +config::is_id_char(char ch) const { return (ch != '\0' && (isalpha(ch) || isdigit(ch) || ch == '_' || ch == '-')); Modified: stable/8/sbin/devd/devd.hh ============================================================================== --- stable/8/sbin/devd/devd.hh Mon Feb 4 00:34:33 2013 (r246309) +++ stable/8/sbin/devd/devd.hh Mon Feb 4 00:34:34 2013 (r246310) @@ -133,8 +133,8 @@ public: int get_priority() const { return (_prio); } void set_priority(int prio) { _prio = prio; } void add(eps *); - bool matches(config &); - bool run(config &); + bool matches(config &) const; + bool run(config &) const; private: int _prio; std::vector _epsvec; @@ -168,7 +168,7 @@ protected: void parse_one_file(const char *fn); void parse_files_in_dir(const char *dirname); void expand_one(const char *&src, std::string &dst); - bool is_id_char(char); + bool is_id_char(char) const; bool chop_var(char *&buffer, char *&lhs, char *&rhs); private: std::vector _dir_list; From owner-svn-src-stable@FreeBSD.ORG Mon Feb 4 00:34:36 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 5E880565; Mon, 4 Feb 2013 00:34:36 +0000 (UTC) (envelope-from eadler@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 387F7159; Mon, 4 Feb 2013 00:34:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r140YaoC006612; Mon, 4 Feb 2013 00:34:36 GMT (envelope-from eadler@svn.freebsd.org) Received: (from eadler@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r140YZbe006610; Mon, 4 Feb 2013 00:34:35 GMT (envelope-from eadler@svn.freebsd.org) Message-Id: <201302040034.r140YZbe006610@svn.freebsd.org> From: Eitan Adler Date: Mon, 4 Feb 2013 00:34:35 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r246311 - stable/7/sbin/devd X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 00:34:36 -0000 Author: eadler Date: Mon Feb 4 00:34:35 2013 New Revision: 246311 URL: http://svnweb.freebsd.org/changeset/base/246311 Log: MFC r243930: Constify where possible Approved by: cperciva (mentor, implicit) Modified: stable/7/sbin/devd/devd.cc stable/7/sbin/devd/devd.hh Directory Properties: stable/7/sbin/devd/ (props changed) Modified: stable/7/sbin/devd/devd.cc ============================================================================== --- stable/7/sbin/devd/devd.cc Mon Feb 4 00:34:34 2013 (r246310) +++ stable/7/sbin/devd/devd.cc Mon Feb 4 00:34:35 2013 (r246311) @@ -120,7 +120,7 @@ event_proc::add(eps *eps) } bool -event_proc::matches(config &c) +event_proc::matches(config &c) const { vector::const_iterator i; @@ -131,7 +131,7 @@ event_proc::matches(config &c) } bool -event_proc::run(config &c) +event_proc::run(config &c) const { vector::const_iterator i; @@ -342,7 +342,7 @@ config::parse_files_in_dir(const char *d class epv_greater { public: - int operator()(event_proc *const&l1, event_proc *const&l2) + int operator()(event_proc *const&l1, event_proc *const&l2) const { return (l1->get_priority() > l2->get_priority()); } @@ -476,7 +476,7 @@ config::get_variable(const string &var) } bool -config::is_id_char(char ch) +config::is_id_char(char ch) const { return (ch != '\0' && (isalpha(ch) || isdigit(ch) || ch == '_' || ch == '-')); Modified: stable/7/sbin/devd/devd.hh ============================================================================== --- stable/7/sbin/devd/devd.hh Mon Feb 4 00:34:34 2013 (r246310) +++ stable/7/sbin/devd/devd.hh Mon Feb 4 00:34:35 2013 (r246311) @@ -133,8 +133,8 @@ public: int get_priority() const { return (_prio); } void set_priority(int prio) { _prio = prio; } void add(eps *); - bool matches(config &); - bool run(config &); + bool matches(config &) const; + bool run(config &) const; private: int _prio; std::vector _epsvec; @@ -168,7 +168,7 @@ protected: void parse_one_file(const char *fn); void parse_files_in_dir(const char *dirname); void expand_one(const char *&src, std::string &dst); - bool is_id_char(char); + bool is_id_char(char) const; bool chop_var(char *&buffer, char *&lhs, char *&rhs); private: std::vector _dir_list; From owner-svn-src-stable@FreeBSD.ORG Mon Feb 4 15:51:29 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4A2DC62D; Mon, 4 Feb 2013 15:51:29 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2D8B5371; Mon, 4 Feb 2013 15:51:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r14FpTOW091298; Mon, 4 Feb 2013 15:51:29 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r14FpSxj091288; Mon, 4 Feb 2013 15:51:28 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201302041551.r14FpSxj091288@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 4 Feb 2013 15:51:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246321 - in stable/9/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 15:51:29 -0000 Author: des Date: Mon Feb 4 15:51:27 2013 New Revision: 246321 URL: http://svnweb.freebsd.org/changeset/base/246321 Log: MFH (r244992): remove firewire from GENERIC Modified: stable/9/sys/amd64/conf/GENERIC stable/9/sys/i386/conf/GENERIC stable/9/sys/ia64/conf/GENERIC stable/9/sys/pc98/conf/GENERIC stable/9/sys/powerpc/conf/GENERIC stable/9/sys/sparc64/conf/GENERIC Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/amd64/conf/GENERIC ============================================================================== --- stable/9/sys/amd64/conf/GENERIC Mon Feb 4 15:44:42 2013 (r246320) +++ stable/9/sys/amd64/conf/GENERIC Mon Feb 4 15:51:27 2013 (r246321) @@ -331,15 +331,6 @@ device ural # Ralink Technology RT2500 device urtw # Realtek RTL8187B/L wireless NICs device zyd # ZyDAS zd1211/zd1211b wireless NICs -# FireWire support -device firewire # FireWire bus code -# sbp(4) works for some systems but causes boot failure on others -#device sbp # SCSI over FireWire (Requires scbus and da) -device fwe # Ethernet over FireWire (non-standard!) -device fwip # IP over FireWire (RFC 2734,3146) -device dcons # Dumb console driver -device dcons_crom # Configuration ROM for dcons - # Sound support device sound # Generic sound driver (required) device snd_cmi # CMedia CMI8338/CMI8738 Modified: stable/9/sys/i386/conf/GENERIC ============================================================================== --- stable/9/sys/i386/conf/GENERIC Mon Feb 4 15:44:42 2013 (r246320) +++ stable/9/sys/i386/conf/GENERIC Mon Feb 4 15:51:27 2013 (r246321) @@ -344,15 +344,6 @@ device ural # Ralink Technology RT2500 device urtw # Realtek RTL8187B/L wireless NICs device zyd # ZyDAS zd1211/zd1211b wireless NICs -# FireWire support -device firewire # FireWire bus code -# sbp(4) works for some systems but causes boot failure on others -#device sbp # SCSI over FireWire (Requires scbus and da) -device fwe # Ethernet over FireWire (non-standard!) -device fwip # IP over FireWire (RFC 2734,3146) -device dcons # Dumb console driver -device dcons_crom # Configuration ROM for dcons - # Sound support device sound # Generic sound driver (required) device snd_cmi # CMedia CMI8338/CMI8738 Modified: stable/9/sys/ia64/conf/GENERIC ============================================================================== --- stable/9/sys/ia64/conf/GENERIC Mon Feb 4 15:44:42 2013 (r246320) +++ stable/9/sys/ia64/conf/GENERIC Mon Feb 4 15:51:27 2013 (r246321) @@ -64,7 +64,6 @@ options KDB # Kernel debugger related options KDB_TRACE # Print a stack trace for a panic # Various "busses" -device firewire # FireWire bus code device miibus # MII bus support (Ethernet) device pci # PCI bus support device scbus # SCSI bus (required for ATA/SCSI) Modified: stable/9/sys/pc98/conf/GENERIC ============================================================================== --- stable/9/sys/pc98/conf/GENERIC Mon Feb 4 15:44:42 2013 (r246320) +++ stable/9/sys/pc98/conf/GENERIC Mon Feb 4 15:51:27 2013 (r246321) @@ -269,7 +269,6 @@ device bpf # Berkeley packet filter #device zyd # ZyDAS zd1211/zd1211b wireless NICs # FireWire support -#device firewire # FireWire bus code #device sbp # SCSI over FireWire (Requires scbus and da) #device fwe # Ethernet over FireWire (non-standard!) Modified: stable/9/sys/powerpc/conf/GENERIC ============================================================================== --- stable/9/sys/powerpc/conf/GENERIC Mon Feb 4 15:44:42 2013 (r246320) +++ stable/9/sys/powerpc/conf/GENERIC Mon Feb 4 15:51:27 2013 (r246321) @@ -163,12 +163,6 @@ device cdce # Generic USB over Etherne device cue # CATC USB Ethernet device kue # Kawasaki LSI USB Ethernet -# FireWire support -device firewire # FireWire bus code -# sbp(4) works for some systems but causes boot failure on others -device sbp # SCSI over FireWire (Requires scbus and da) -device fwe # Ethernet over FireWire (non-standard!) - # Misc device iicbus # I2C bus code device kiic # Keywest I2C Modified: stable/9/sys/sparc64/conf/GENERIC ============================================================================== --- stable/9/sys/sparc64/conf/GENERIC Mon Feb 4 15:44:42 2013 (r246320) +++ stable/9/sys/sparc64/conf/GENERIC Mon Feb 4 15:51:27 2013 (r246321) @@ -253,15 +253,6 @@ device uath # Atheros AR5523 wireless device ural # Ralink Technology RT2500USB wireless NICs device zyd # ZyDAS zd1211/zd1211b wireless NICs -# FireWire support -device firewire # FireWire bus code -# sbp(4) works for some systems but causes boot failure on others -#device sbp # SCSI over FireWire (Requires scbus and da) -device fwe # Ethernet over FireWire (non-standard!) -device fwip # IP over FireWire (RFC 2734,3146) -device dcons # Dumb console driver -device dcons_crom # Configuration ROM for dcons - # Sound support device sound # Generic sound driver (required) device snd_audiocs # Crystal Semiconductor CS4231 From owner-svn-src-stable@FreeBSD.ORG Mon Feb 4 16:13:56 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5B48DDEF; Mon, 4 Feb 2013 16:13:56 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 345D56E1; Mon, 4 Feb 2013 16:13:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r14GDupG098543; Mon, 4 Feb 2013 16:13:56 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r14GDtO7098541; Mon, 4 Feb 2013 16:13:55 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201302041613.r14GDtO7098541@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 4 Feb 2013 16:13:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246322 - stable/9/tools/build/options X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 16:13:56 -0000 Author: des Date: Mon Feb 4 16:13:55 2013 New Revision: 246322 URL: http://svnweb.freebsd.org/changeset/base/246322 Log: MFH (r228082): add missing documentation for WITH_LIBCPLUSPLUS MFH (r228159): add missing documentation for WITH_CTF Added: stable/9/tools/build/options/WITH_CTF - copied unchanged from r228159, head/tools/build/options/WITH_CTF stable/9/tools/build/options/WITH_LIBCPLUSPLUS - copied unchanged from r228082, head/tools/build/options/WITH_LIBCPLUSPLUS Modified: Directory Properties: stable/9/tools/build/options/ (props changed) Copied: stable/9/tools/build/options/WITH_CTF (from r228159, head/tools/build/options/WITH_CTF) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/build/options/WITH_CTF Mon Feb 4 16:13:55 2013 (r246322, copy of r228159, head/tools/build/options/WITH_CTF) @@ -0,0 +1,4 @@ +.\" $FreeBSD$ +Set to compile with CTF (Compact C Type Format) data. +CTF data encapsulates a reduced form of debugging information +similar to DWARF and the venerable stabs and is required for DTrace. Copied: stable/9/tools/build/options/WITH_LIBCPLUSPLUS (from r228082, head/tools/build/options/WITH_LIBCPLUSPLUS) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/tools/build/options/WITH_LIBCPLUSPLUS Mon Feb 4 16:13:55 2013 (r246322, copy of r228082, head/tools/build/options/WITH_LIBCPLUSPLUS) @@ -0,0 +1,2 @@ +.\" $FreeBSD$ +Set to build libcxxrt and libc++. From owner-svn-src-stable@FreeBSD.ORG Mon Feb 4 16:20:14 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id A8E5910E; Mon, 4 Feb 2013 16:20:14 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 79F0271C; Mon, 4 Feb 2013 16:20:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r14GKE72099605; Mon, 4 Feb 2013 16:20:14 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r14GKEUu099604; Mon, 4 Feb 2013 16:20:14 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201302041620.r14GKEUu099604@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Mon, 4 Feb 2013 16:20:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246323 - stable/9/share/man/man5 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 16:20:14 -0000 Author: des Date: Mon Feb 4 16:20:13 2013 New Revision: 246323 URL: http://svnweb.freebsd.org/changeset/base/246323 Log: Regenerate Modified: stable/9/share/man/man5/src.conf.5 Modified: stable/9/share/man/man5/src.conf.5 ============================================================================== --- stable/9/share/man/man5/src.conf.5 Mon Feb 4 16:13:55 2013 (r246322) +++ stable/9/share/man/man5/src.conf.5 Mon Feb 4 16:20:13 2013 (r246323) @@ -1,7 +1,7 @@ .\" DO NOT EDIT-- this file is automatically generated. -.\" from FreeBSD: stable/9/tools/build/options/makeman 221733 2011-05-10 13:01:11Z ru +.\" from FreeBSD: stable/9/tools/build/options/makeman 236430 2012-06-02 02:26:37Z gjb .\" $FreeBSD$ -.Dd January 14, 2013 +.Dd February 4, 2013 .Dt SRC.CONF 5 .Os .Sh NAME @@ -207,7 +207,7 @@ and Set to enable the http statistics interface for named. This requires ports/textproc/libxml2 to be installed in /usr/local. .It Va WITHOUT_BINUTILS -.\" from FreeBSD: stable/9/tools/build/options/WITHOUT_BINUTILS 222090 2011-05-19 05:13:25Z imp +.\" from FreeBSD: stable/9/tools/build/options/WITHOUT_BINUTILS 235587 2012-05-18 02:00:01Z gjb Set to not install binutils (as, c++-filt, gconv, gnu-ar, gnu-randlib, ld, nm, objcopy, objdump, readelf, size and strip). .Bf -symbolic @@ -258,6 +258,8 @@ When set, it also enforces the following .Pp .Bl -item -compact .It +.Va WITHOUT_CTF +.It .Va WITHOUT_ZFS .El .It Va WITHOUT_CLANG @@ -284,7 +286,7 @@ amd64/amd64, i386/i386, pc98/i386, power .\" from FreeBSD: stable/9/tools/build/options/WITH_CLANG_EXTRAS 231919 2012-02-19 23:35:56Z dim Set to build additional clang and llvm tools, such as bugpoint. .It Va WITH_CLANG_IS_CC -.\" from FreeBSD: stable/9/tools/build/options/WITH_CLANG_IS_CC 233099 2012-03-17 22:29:05Z dim +.\" from FreeBSD: stable/9/tools/build/options/WITH_CLANG_IS_CC 235587 2012-05-18 02:00:01Z gjb Set to install the Clang C/C++ compiler as .Pa /usr/bin/cc , .Pa /usr/bin/c++ @@ -318,6 +320,11 @@ When set, the following options are also .Va WITH_GSSAPI is set explicitly) .El +.It Va WITH_CTF +.\" from FreeBSD: stable/9/tools/build/options/WITH_CTF 246322 2013-02-04 16:13:55Z des +Set to compile with CTF (Compact C Type Format) data. +CTF data encapsulates a reduced form of debugging information +similar to DWARF and the venerable stabs and is required for DTrace. .It Va WITHOUT_CTM .\" from FreeBSD: stable/9/tools/build/options/WITHOUT_CTM 183242 2008-09-21 22:02:26Z sam Set to not build @@ -583,6 +590,9 @@ and On amd64, set to not build 32-bit library set and a .Nm ld-elf32.so.1 runtime linker. +.It Va WITH_LIBCPLUSPLUS +.\" from FreeBSD: stable/9/tools/build/options/WITH_LIBCPLUSPLUS 246322 2013-02-04 16:13:55Z des +Set to build libcxxrt and libc++. .It Va WITHOUT_LIBPTHREAD .\" from FreeBSD: stable/9/tools/build/options/WITHOUT_LIBPTHREAD 188848 2009-02-20 11:09:55Z mtm Set to not build the @@ -740,16 +750,6 @@ Set to not build NLS catalogs. .\" from FreeBSD: stable/9/tools/build/options/WITHOUT_NLS_CATALOGS 156932 2006-03-21 07:50:50Z ru Set to not build NLS catalog support for .Xr csh 1 . -.It Va WITH_NMTREE -.\" from FreeBSD: head/tools/build/options/WITH_NMTREE 245241 2013-01-09 21:07:08Z brooks -Set to install -.Xr nmtree 8 -as -.Xr mtree 8 . -By default -.Xr fmtree 8 -is installed as -.Xr mtree 8 . .It Va WITHOUT_NS_CACHING .\" from FreeBSD: stable/9/tools/build/options/WITHOUT_NS_CACHING 172803 2007-10-19 14:01:25Z ru Set to disable name caching in the @@ -887,7 +887,7 @@ Set to not build the .Bx 4.4 legacy docs. .It Va WITH_SHARED_TOOLCHAIN -.\" from FreeBSD: stable/9/tools/build/options/WITH_SHARED_TOOLCHAIN 235398 2012-05-13 13:57:53Z kib +.\" from FreeBSD: stable/9/tools/build/options/WITH_SHARED_TOOLCHAIN 235587 2012-05-18 02:00:01Z gjb Set to build the toolchain binaries shared. The set includes .Xr cc 1 , @@ -1010,11 +1010,11 @@ protocols (usable only via 802.1X). .\" from FreeBSD: stable/9/tools/build/options/WITHOUT_ZFS 168409 2007-04-06 02:13:30Z pjd Set to not build ZFS file system. .It Va WITHOUT_ZONEINFO -.\" from FreeBSD: stable/9/tools/build/options/WITHOUT_ZONEINFO 171994 2007-08-27 20:01:08Z remko +.\" from FreeBSD: stable/9/tools/build/options/WITHOUT_ZONEINFO 235587 2012-05-18 02:00:01Z gjb Set to not build the timezone database. .El .Sh FILES -.Bl -tag -compact +.Bl -tag -compact -width Pa .It Pa /etc/src.conf .It Pa /usr/share/mk/bsd.own.mk .El From owner-svn-src-stable@FreeBSD.ORG Mon Feb 4 18:49:17 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 20ABED03; Mon, 4 Feb 2013 18:49:17 +0000 (UTC) (envelope-from gavin@FreeBSD.org) Received: from mail-gw11.york.ac.uk (mail-gw11.york.ac.uk [144.32.129.150]) by mx1.freebsd.org (Postfix) with ESMTP id DDC7D387; Mon, 4 Feb 2013 18:49:16 +0000 (UTC) Received: from ury.york.ac.uk ([144.32.108.81]:29038) by mail-gw11.york.ac.uk with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1U2R6K-0006vw-SO; Mon, 04 Feb 2013 18:49:08 +0000 Date: Mon, 4 Feb 2013 18:49:08 +0000 (GMT) From: Gavin Atkinson X-X-Sender: gavin@thunderhorn.york.ac.uk To: =?ISO-8859-15?Q?Dag-Erling_Sm=F8rgrav?= Subject: Re: svn commit: r246321 - in stable/9/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf In-Reply-To: <201302041551.r14FpSxj091288@svn.freebsd.org> Message-ID: References: <201302041551.r14FpSxj091288@svn.freebsd.org> User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="830102327-512815803-1360003748=:27206" Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 18:49:17 -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. --830102327-512815803-1360003748=:27206 Content-Type: TEXT/PLAIN; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE On Mon, 4 Feb 2013, Dag-Erling Sm=C3=B8rgrav wrote: > Author: des > Date: Mon Feb 4 15:51:27 2013 > New Revision: 246321 > URL: http://svnweb.freebsd.org/changeset/base/246321 >=20 > Log: > MFH (r244992): remove firewire from GENERIC Although I do think this merge is a good idea, I think that this deserves= =20 an entry in UPDATING, as it is a stable branch. Perhaps include "you can= =20 still load it as a module" or similar, but you could also say something=20 like "It has been removed as it has been one of the main causes of issue=20 with suspend/resume" and so use it as a chance to advertise that this will= =20 fix s/r for many users :-) Gavin --830102327-512815803-1360003748=:27206-- From owner-svn-src-stable@FreeBSD.ORG Mon Feb 4 19:22:46 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0C246E62; Mon, 4 Feb 2013 19:22:46 +0000 (UTC) (envelope-from des@des.no) Received: from smtp.des.no (smtp.des.no [194.63.250.102]) by mx1.freebsd.org (Postfix) with ESMTP id 9F0F881C; Mon, 4 Feb 2013 19:22:45 +0000 (UTC) Received: from ds4.des.no (smtp.des.no [194.63.250.102]) by smtp-int.des.no (Postfix) with ESMTP id CA9F56BC6; Mon, 4 Feb 2013 19:22:44 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 66ECBAD2F; Mon, 4 Feb 2013 20:22:44 +0100 (CET) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: Gavin Atkinson Subject: Re: svn commit: r246321 - in stable/9/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf References: <201302041551.r14FpSxj091288@svn.freebsd.org> Date: Mon, 04 Feb 2013 20:22:43 +0100 In-Reply-To: (Gavin Atkinson's message of "Mon, 4 Feb 2013 18:49:08 +0000 (GMT)") Message-ID: <8638xbnat8.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Feb 2013 19:22:46 -0000 Gavin Atkinson writes: > Although I do think this merge is a good idea, I think that this deserves= =20 > an entry in UPDATING, as it is a stable branch. Will do. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no From owner-svn-src-stable@FreeBSD.ORG Tue Feb 5 09:40:32 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A273756E; Tue, 5 Feb 2013 09:40:32 +0000 (UTC) (envelope-from luigi@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 85ABB875; Tue, 5 Feb 2013 09:40:32 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r159eWb3018783; Tue, 5 Feb 2013 09:40:32 GMT (envelope-from luigi@svn.freebsd.org) Received: (from luigi@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r159eVnK018775; Tue, 5 Feb 2013 09:40:31 GMT (envelope-from luigi@svn.freebsd.org) Message-Id: <201302050940.r159eVnK018775@svn.freebsd.org> From: Luigi Rizzo Date: Tue, 5 Feb 2013 09:40:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246355 - in stable/9/sys: dev/netmap net X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 09:40:32 -0000 Author: luigi Date: Tue Feb 5 09:40:31 2013 New Revision: 246355 URL: http://svnweb.freebsd.org/changeset/base/246355 Log: MFH: sync netmap with the version in HEAD Deleted: stable/9/sys/dev/netmap/netmap_mem1.c Modified: stable/9/sys/dev/netmap/if_em_netmap.h stable/9/sys/dev/netmap/if_igb_netmap.h stable/9/sys/dev/netmap/if_lem_netmap.h stable/9/sys/dev/netmap/if_re_netmap.h stable/9/sys/dev/netmap/netmap.c stable/9/sys/dev/netmap/netmap_kern.h stable/9/sys/dev/netmap/netmap_mem2.c stable/9/sys/net/netmap.h stable/9/sys/net/netmap_user.h Modified: stable/9/sys/dev/netmap/if_em_netmap.h ============================================================================== --- stable/9/sys/dev/netmap/if_em_netmap.h Tue Feb 5 05:16:02 2013 (r246354) +++ stable/9/sys/dev/netmap/if_em_netmap.h Tue Feb 5 09:40:31 2013 (r246355) @@ -171,7 +171,7 @@ em_netmap_txsync(struct ifnet *ifp, u_in u_int j, k, l, n = 0, lim = kring->nkr_num_slots - 1; /* generate an interrupt approximately every half ring */ - int report_frequency = kring->nkr_num_slots >> 1; + u_int report_frequency = kring->nkr_num_slots >> 1; k = ring->cur; if (k > lim) @@ -292,6 +292,8 @@ em_netmap_rxsync(struct ifnet *ifp, u_in l = rxr->next_to_check; j = netmap_idx_n2k(kring, l); if (netmap_no_pendintr || force_update) { + uint16_t slot_flags = kring->nkr_slot_flags; + for (n = 0; ; n++) { struct e1000_rx_desc *curr = &rxr->rx_base[l]; uint32_t staterr = le32toh(curr->status); @@ -299,6 +301,7 @@ em_netmap_rxsync(struct ifnet *ifp, u_in if ((staterr & E1000_RXD_STAT_DD) == 0) break; ring->slot[j].len = le16toh(curr->length); + ring->slot[j].flags = slot_flags; bus_dmamap_sync(rxr->rxtag, rxr->rx_buffers[l].map, BUS_DMASYNC_POSTREAD); j = (j == lim) ? 0 : j + 1; Modified: stable/9/sys/dev/netmap/if_igb_netmap.h ============================================================================== --- stable/9/sys/dev/netmap/if_igb_netmap.h Tue Feb 5 05:16:02 2013 (r246354) +++ stable/9/sys/dev/netmap/if_igb_netmap.h Tue Feb 5 09:40:31 2013 (r246355) @@ -125,7 +125,7 @@ igb_netmap_txsync(struct ifnet *ifp, u_i u_int j, k, l, n = 0, lim = kring->nkr_num_slots - 1; /* generate an interrupt approximately every half ring */ - int report_frequency = kring->nkr_num_slots >> 1; + u_int report_frequency = kring->nkr_num_slots >> 1; k = ring->cur; if (k > lim) @@ -263,6 +263,8 @@ igb_netmap_rxsync(struct ifnet *ifp, u_i l = rxr->next_to_check; j = netmap_idx_n2k(kring, l); if (netmap_no_pendintr || force_update) { + uint16_t slot_flags = kring->nkr_slot_flags; + for (n = 0; ; n++) { union e1000_adv_rx_desc *curr = &rxr->rx_base[l]; uint32_t staterr = le32toh(curr->wb.upper.status_error); @@ -270,6 +272,7 @@ igb_netmap_rxsync(struct ifnet *ifp, u_i if ((staterr & E1000_RXD_STAT_DD) == 0) break; ring->slot[j].len = le16toh(curr->wb.upper.length); + ring->slot[j].flags = slot_flags; bus_dmamap_sync(rxr->ptag, rxr->rx_buffers[l].pmap, BUS_DMASYNC_POSTREAD); j = (j == lim) ? 0 : j + 1; Modified: stable/9/sys/dev/netmap/if_lem_netmap.h ============================================================================== --- stable/9/sys/dev/netmap/if_lem_netmap.h Tue Feb 5 05:16:02 2013 (r246354) +++ stable/9/sys/dev/netmap/if_lem_netmap.h Tue Feb 5 09:40:31 2013 (r246355) @@ -253,6 +253,8 @@ lem_netmap_rxsync(struct ifnet *ifp, u_i l = adapter->next_rx_desc_to_check; j = netmap_idx_n2k(kring, l); if (netmap_no_pendintr || force_update) { + uint16_t slot_flags = kring->nkr_slot_flags; + for (n = 0; ; n++) { struct e1000_rx_desc *curr = &adapter->rx_desc_base[l]; uint32_t staterr = le32toh(curr->status); @@ -266,6 +268,7 @@ lem_netmap_rxsync(struct ifnet *ifp, u_i len = 0; } ring->slot[j].len = len; + ring->slot[j].flags = slot_flags; bus_dmamap_sync(adapter->rxtag, adapter->rx_buffer_area[l].map, BUS_DMASYNC_POSTREAD); Modified: stable/9/sys/dev/netmap/if_re_netmap.h ============================================================================== --- stable/9/sys/dev/netmap/if_re_netmap.h Tue Feb 5 05:16:02 2013 (r246354) +++ stable/9/sys/dev/netmap/if_re_netmap.h Tue Feb 5 09:40:31 2013 (r246355) @@ -245,6 +245,8 @@ re_netmap_rxsync(struct ifnet *ifp, u_in l = sc->rl_ldata.rl_rx_prodidx; /* next pkt to check */ j = netmap_idx_n2k(kring, l); /* the kring index */ if (netmap_no_pendintr || force_update) { + uint16_t slot_flags = kring->nkr_slot_flags; + for (n = kring->nr_hwavail; n < lim ; n++) { struct rl_desc *cur_rx = &sc->rl_ldata.rl_rx_list[l]; uint32_t rxstat = le32toh(cur_rx->rl_cmdstat); @@ -256,6 +258,7 @@ re_netmap_rxsync(struct ifnet *ifp, u_in /* XXX subtract crc */ total_len = (total_len < 4) ? 0 : total_len - 4; kring->ring->slot[j].len = total_len; + kring->ring->slot[j].flags = slot_flags; /* sync was in re_newbuf() */ bus_dmamap_sync(sc->rl_ldata.rl_rx_mtag, rxd[l].rx_dmamap, BUS_DMASYNC_POSTREAD); Modified: stable/9/sys/dev/netmap/netmap.c ============================================================================== --- stable/9/sys/dev/netmap/netmap.c Tue Feb 5 05:16:02 2013 (r246354) +++ stable/9/sys/dev/netmap/netmap.c Tue Feb 5 09:40:31 2013 (r246355) @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011 Matteo Landi, Luigi Rizzo. All rights reserved. + * Copyright (C) 2011-2012 Matteo Landi, Luigi Rizzo. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,6 +23,8 @@ * SUCH DAMAGE. */ +#define NM_BRIDGE + /* * This module supports memory mapped access to network devices, * see netmap(4). @@ -52,6 +54,16 @@ * transmit or receive queues (or all queues for a given interface). */ +#ifdef linux +#include "bsd_glue.h" +static netdev_tx_t linux_netmap_start(struct sk_buff *skb, struct net_device *dev); +#endif /* linux */ + +#ifdef __APPLE__ +#include "osx_glue.h" +#endif /* __APPLE__ */ + +#ifdef __FreeBSD__ #include /* prerequisite */ __FBSDID("$FreeBSD$"); @@ -78,21 +90,16 @@ __FBSDID("$FreeBSD$"); #include #include /* BIOCIMMEDIATE */ #include -#include -#include #include /* bus_dmamap_* */ MALLOC_DEFINE(M_NETMAP, "netmap", "Network memory map"); +#endif /* __FreeBSD__ */ -/* - * lock and unlock for the netmap memory allocator - */ -#define NMA_LOCK() mtx_lock(&nm_mem->nm_mtx); -#define NMA_UNLOCK() mtx_unlock(&nm_mem->nm_mtx); -struct netmap_mem_d; -static struct netmap_mem_d *nm_mem; /* Our memory allocator. */ +#include +#include u_int netmap_total_buffers; +u_int netmap_buf_size; char *netmap_buffer_base; /* address of an invalid buffer */ /* user-controlled variables */ @@ -105,16 +112,215 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, verbos 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 = 1; SYSCTL_INT(_dev_netmap, OID_AUTO, no_pendintr, CTLFLAG_RW, &netmap_no_pendintr, 0, "Always look for new received packets."); +int netmap_drop = 0; /* debugging */ +int netmap_flags = 0; /* debug flags */ +int netmap_fwd = 0; /* force transparent mode */ +int netmap_copy = 0; /* debugging, copy content */ + +SYSCTL_INT(_dev_netmap, OID_AUTO, drop, CTLFLAG_RW, &netmap_drop, 0 , ""); +SYSCTL_INT(_dev_netmap, OID_AUTO, flags, CTLFLAG_RW, &netmap_flags, 0 , ""); +SYSCTL_INT(_dev_netmap, OID_AUTO, fwd, CTLFLAG_RW, &netmap_fwd, 0 , ""); +SYSCTL_INT(_dev_netmap, OID_AUTO, copy, CTLFLAG_RW, &netmap_copy, 0 , ""); + +#ifdef NM_BRIDGE /* support for netmap bridge */ + +/* + * system parameters. + * + * All switched ports have prefix NM_NAME. + * The switch has a max of NM_BDG_MAXPORTS ports (often stored in a bitmap, + * so a practical upper bound is 64). + * Each tx ring is read-write, whereas rx rings are readonly (XXX not done yet). + * The virtual interfaces use per-queue lock instead of core lock. + * In the tx loop, we aggregate traffic in batches to make all operations + * faster. The batch size is NM_BDG_BATCH + */ +#define NM_NAME "vale" /* prefix for the interface */ +#define NM_BDG_MAXPORTS 16 /* up to 64 ? */ +#define NM_BRIDGE_RINGSIZE 1024 /* in the device */ +#define NM_BDG_HASH 1024 /* forwarding table entries */ +#define NM_BDG_BATCH 1024 /* entries in the forwarding buffer */ +#define NM_BRIDGES 4 /* number of bridges */ +int netmap_bridge = NM_BDG_BATCH; /* bridge batch size */ +SYSCTL_INT(_dev_netmap, OID_AUTO, bridge, CTLFLAG_RW, &netmap_bridge, 0 , ""); + +#ifdef linux +#define ADD_BDG_REF(ifp) (NA(ifp)->if_refcount++) +#define DROP_BDG_REF(ifp) (NA(ifp)->if_refcount-- <= 1) +#else /* !linux */ +#define ADD_BDG_REF(ifp) (ifp)->if_refcount++ +#define DROP_BDG_REF(ifp) refcount_release(&(ifp)->if_refcount) +#ifdef __FreeBSD__ +#include +#include +#endif /* __FreeBSD__ */ +#define prefetch(x) __builtin_prefetch(x) +#endif /* !linux */ + +static void bdg_netmap_attach(struct ifnet *ifp); +static int bdg_netmap_reg(struct ifnet *ifp, int onoff); +/* per-tx-queue entry */ +struct nm_bdg_fwd { /* forwarding entry for a bridge */ + void *buf; + uint64_t dst; /* dst mask */ + uint32_t src; /* src index ? */ + uint16_t len; /* src len */ +}; + +struct nm_hash_ent { + uint64_t mac; /* the top 2 bytes are the epoch */ + uint64_t ports; +}; + +/* + * Interfaces for a bridge are all in ports[]. + * The array has fixed size, an empty entry does not terminate + * the search. + */ +struct nm_bridge { + struct ifnet *bdg_ports[NM_BDG_MAXPORTS]; + int n_ports; + uint64_t act_ports; + int freelist; /* first buffer index */ + NM_SELINFO_T si; /* poll/select wait queue */ + NM_LOCK_T bdg_lock; /* protect the selinfo ? */ + + /* the forwarding table, MAC+ports */ + struct nm_hash_ent ht[NM_BDG_HASH]; + + int namelen; /* 0 means free */ + char basename[IFNAMSIZ]; +}; + +struct nm_bridge nm_bridges[NM_BRIDGES]; + +#define BDG_LOCK(b) mtx_lock(&(b)->bdg_lock) +#define BDG_UNLOCK(b) mtx_unlock(&(b)->bdg_lock) + +/* + * NA(ifp)->bdg_port port index + */ + +// XXX only for multiples of 64 bytes, non overlapped. +static inline void +pkt_copy(void *_src, void *_dst, int l) +{ + uint64_t *src = _src; + uint64_t *dst = _dst; + if (unlikely(l >= 1024)) { + bcopy(src, dst, l); + return; + } + for (; likely(l > 0); l-=64) { + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + *dst++ = *src++; + } +} + +/* + * locate a bridge among the existing ones. + * a ':' in the name terminates the bridge name. Otherwise, just NM_NAME. + * We assume that this is called with a name of at least NM_NAME chars. + */ +static struct nm_bridge * +nm_find_bridge(const char *name) +{ + int i, l, namelen, e; + struct nm_bridge *b = NULL; + + namelen = strlen(NM_NAME); /* base length */ + l = strlen(name); /* actual length */ + for (i = namelen + 1; i < l; i++) { + if (name[i] == ':') { + namelen = i; + break; + } + } + if (namelen >= IFNAMSIZ) + namelen = IFNAMSIZ; + ND("--- prefix is '%.*s' ---", namelen, name); + + /* use the first entry for locking */ + BDG_LOCK(nm_bridges); // XXX do better + for (e = -1, i = 1; i < NM_BRIDGES; i++) { + b = nm_bridges + i; + if (b->namelen == 0) + e = i; /* record empty slot */ + else if (strncmp(name, b->basename, namelen) == 0) { + ND("found '%.*s' at %d", namelen, name, i); + break; + } + } + if (i == NM_BRIDGES) { /* all full */ + if (e == -1) { /* no empty slot */ + b = NULL; + } else { + b = nm_bridges + e; + strncpy(b->basename, name, namelen); + b->namelen = namelen; + } + } + BDG_UNLOCK(nm_bridges); + return b; +} +#endif /* NM_BRIDGE */ + + +/* + * Fetch configuration from the device, to cope with dynamic + * reconfigurations after loading the module. + */ +static int +netmap_update_config(struct netmap_adapter *na) +{ + struct ifnet *ifp = na->ifp; + u_int txr, txd, rxr, rxd; + + txr = txd = rxr = rxd = 0; + if (na->nm_config) { + na->nm_config(ifp, &txr, &txd, &rxr, &rxd); + } else { + /* take whatever we had at init time */ + txr = na->num_tx_rings; + txd = na->num_tx_desc; + rxr = na->num_rx_rings; + rxd = na->num_rx_desc; + } + + if (na->num_tx_rings == txr && na->num_tx_desc == txd && + na->num_rx_rings == rxr && na->num_rx_desc == rxd) + return 0; /* nothing changed */ + if (netmap_verbose || na->refcount > 0) { + D("stored config %s: txring %d x %d, rxring %d x %d", + ifp->if_xname, + na->num_tx_rings, na->num_tx_desc, + na->num_rx_rings, na->num_rx_desc); + D("new config %s: txring %d x %d, rxring %d x %d", + ifp->if_xname, txr, txd, rxr, rxd); + } + if (na->refcount == 0) { + D("configuration changed (but fine)"); + na->num_tx_rings = txr; + na->num_tx_desc = txd; + na->num_rx_rings = rxr; + na->num_rx_desc = rxd; + return 0; + } + D("configuration changed while active, this is bad..."); + return 1; +} /*------------- memory allocator -----------------*/ #ifdef NETMAP_MEM2 @@ -124,23 +330,62 @@ SYSCTL_INT(_dev_netmap, OID_AUTO, no_pen #endif /* !NETMAP_MEM2 */ /*------------ end of memory allocator ----------*/ -/* Structure associated to each thread which registered an interface. */ + +/* Structure associated to each thread which registered an interface. + * + * The first 4 fields of this structure are written by NIOCREGIF and + * read by poll() and NIOC?XSYNC. + * There is low contention among writers (actually, a correct user program + * should have no contention among writers) and among writers and readers, + * so we use a single global lock to protect the structure initialization. + * Since initialization involves the allocation of memory, we reuse the memory + * allocator lock. + * Read access to the structure is lock free. Readers must check that + * np_nifp is not NULL before using the other fields. + * If np_nifp is NULL initialization has not been performed, so they should + * return an error to userlevel. + * + * The ref_done field is used to regulate access to the refcount in the + * memory allocator. The refcount must be incremented at most once for + * each open("/dev/netmap"). The increment is performed by the first + * function that calls netmap_get_memory() (currently called by + * mmap(), NIOCGINFO and NIOCREGIF). + * If the refcount is incremented, it is then decremented when the + * private structure is destroyed. + */ struct netmap_priv_d { - struct netmap_if *np_nifp; /* netmap interface descriptor. */ + struct netmap_if * volatile np_nifp; /* netmap interface descriptor. */ struct ifnet *np_ifp; /* device for which we hold a reference */ int np_ringid; /* from the ioctl */ u_int np_qfirst, np_qlast; /* range of rings to scan */ uint16_t np_txpoll; + + unsigned long ref_done; /* use with NMA_LOCK held */ }; +static int +netmap_get_memory(struct netmap_priv_d* p) +{ + int error = 0; + NMA_LOCK(); + if (!p->ref_done) { + error = netmap_memory_finalize(); + if (!error) + p->ref_done = 1; + } + NMA_UNLOCK(); + return error; +} + /* * File descriptor's private data destructor. * * Call nm_register(ifp,0) to stop netmap mode on the interface and * revert to normal operation. We expect that np_ifp has not gone. */ +/* call with NMA_LOCK held */ static void netmap_dtor_locked(void *data) { @@ -153,7 +398,8 @@ netmap_dtor_locked(void *data) if (na->refcount <= 0) { /* last instance */ u_int i, j, lim; - D("deleting last netmap instance for %s", ifp->if_xname); + if (netmap_verbose) + D("deleting last instance for %s", ifp->if_xname); /* * there is a race here with *_netmap_task() and * netmap_poll(), which don't run under NETMAP_REG_LOCK. @@ -180,7 +426,6 @@ netmap_dtor_locked(void *data) selwakeuppri(&na->tx_si, PI_NET); selwakeuppri(&na->rx_si, PI_NET); /* release all buffers */ - NMA_LOCK(); for (i = 0; i < na->num_tx_rings + 1; i++) { struct netmap_ring *ring = na->tx_rings[i].ring; lim = na->tx_rings[i].nkr_num_slots; @@ -200,30 +445,136 @@ netmap_dtor_locked(void *data) /* XXX kqueue(9) needed; these will mirror knlist_init. */ /* knlist_destroy(&na->tx_si.si_note); */ /* knlist_destroy(&na->rx_si.si_note); */ - NMA_UNLOCK(); netmap_free_rings(na); wakeup(na); } netmap_if_free(nifp); } +static void +nm_if_rele(struct ifnet *ifp) +{ +#ifndef NM_BRIDGE + if_rele(ifp); +#else /* NM_BRIDGE */ + int i, full; + struct nm_bridge *b; + + if (strncmp(ifp->if_xname, NM_NAME, sizeof(NM_NAME) - 1)) { + if_rele(ifp); + return; + } + if (!DROP_BDG_REF(ifp)) + return; + b = ifp->if_bridge; + BDG_LOCK(nm_bridges); + BDG_LOCK(b); + ND("want to disconnect %s from the bridge", ifp->if_xname); + full = 0; + for (i = 0; i < NM_BDG_MAXPORTS; i++) { + if (b->bdg_ports[i] == ifp) { + b->bdg_ports[i] = NULL; + bzero(ifp, sizeof(*ifp)); + free(ifp, M_DEVBUF); + break; + } + else if (b->bdg_ports[i] != NULL) + full = 1; + } + BDG_UNLOCK(b); + if (full == 0) { + ND("freeing bridge %d", b - nm_bridges); + b->namelen = 0; + } + BDG_UNLOCK(nm_bridges); + if (i == NM_BDG_MAXPORTS) + D("ouch, cannot find ifp to remove"); +#endif /* NM_BRIDGE */ +} static void netmap_dtor(void *data) { struct netmap_priv_d *priv = data; struct ifnet *ifp = priv->np_ifp; - struct netmap_adapter *na = NA(ifp); + struct netmap_adapter *na; - na->nm_lock(ifp, NETMAP_REG_LOCK, 0); - netmap_dtor_locked(data); - na->nm_lock(ifp, NETMAP_REG_UNLOCK, 0); + NMA_LOCK(); + if (ifp) { + na = NA(ifp); + na->nm_lock(ifp, NETMAP_REG_LOCK, 0); + netmap_dtor_locked(data); + na->nm_lock(ifp, NETMAP_REG_UNLOCK, 0); - if_rele(ifp); + nm_if_rele(ifp); + } + if (priv->ref_done) { + netmap_memory_deref(); + } + NMA_UNLOCK(); bzero(priv, sizeof(*priv)); /* XXX for safety */ free(priv, M_DEVBUF); } +#ifdef __FreeBSD__ +#include +#include +#include +#include +#include +#include + +static struct cdev_pager_ops saved_cdev_pager_ops; + +static int +netmap_dev_pager_ctor(void *handle, vm_ooffset_t size, vm_prot_t prot, + vm_ooffset_t foff, struct ucred *cred, u_short *color) +{ + if (netmap_verbose) + D("first mmap for %p", handle); + return saved_cdev_pager_ops.cdev_pg_ctor(handle, + size, prot, foff, cred, color); +} + +static void +netmap_dev_pager_dtor(void *handle) +{ + saved_cdev_pager_ops.cdev_pg_dtor(handle); + ND("ready to release memory for %p", handle); +} + + +static struct cdev_pager_ops netmap_cdev_pager_ops = { + .cdev_pg_ctor = netmap_dev_pager_ctor, + .cdev_pg_dtor = netmap_dev_pager_dtor, + .cdev_pg_fault = NULL, +}; + +static int +netmap_mmap_single(struct cdev *cdev, vm_ooffset_t *foff, + vm_size_t objsize, vm_object_t *objp, int prot) +{ + vm_object_t obj; + + ND("cdev %p foff %jd size %jd objp %p prot %d", cdev, + (intmax_t )*foff, (intmax_t )objsize, objp, prot); + obj = vm_pager_allocate(OBJT_DEVICE, cdev, objsize, prot, *foff, + curthread->td_ucred); + ND("returns obj %p", obj); + if (obj == NULL) + return EINVAL; + if (saved_cdev_pager_ops.cdev_pg_fault == NULL) { + ND("initialize cdev_pager_ops"); + saved_cdev_pager_ops = *(obj->un_pager.devp.ops); + netmap_cdev_pager_ops.cdev_pg_fault = + saved_cdev_pager_ops.cdev_pg_fault; + }; + obj->un_pager.devp.ops = &netmap_cdev_pager_ops; + *objp = obj; + return 0; +} +#endif /* __FreeBSD__ */ + /* * mmap(2) support for the "netmap" device. @@ -235,6 +586,7 @@ netmap_dtor(void *data) * Return 0 on success, -1 otherwise. */ +#ifdef __FreeBSD__ static int netmap_mmap(__unused struct cdev *dev, #if __FreeBSD_version < 900000 @@ -245,75 +597,222 @@ netmap_mmap(__unused struct cdev *dev, #endif ) { + int error = 0; + struct netmap_priv_d *priv; + if (nprot & PROT_EXEC) return (-1); // XXX -1 or EINVAL ? + error = devfs_get_cdevpriv((void **)&priv); + if (error == EBADF) { /* called on fault, memory is initialized */ + ND(5, "handling fault at ofs 0x%x", offset); + error = 0; + } else if (error == 0) /* make sure memory is set */ + error = netmap_get_memory(priv); + if (error) + return (error); + ND("request for offset 0x%x", (uint32_t)offset); *paddr = netmap_ofstophys(offset); - return (0); + return (*paddr ? 0 : ENOMEM); } +static int +netmap_close(struct cdev *dev, int fflag, int devtype, struct thread *td) +{ + if (netmap_verbose) + D("dev %p fflag 0x%x devtype %d td %p", + dev, fflag, devtype, td); + return 0; +} + +static int +netmap_open(struct cdev *dev, int oflags, int devtype, struct thread *td) +{ + struct netmap_priv_d *priv; + int error; + + priv = malloc(sizeof(struct netmap_priv_d), M_DEVBUF, + M_NOWAIT | M_ZERO); + if (priv == NULL) + return ENOMEM; + + error = devfs_set_cdevpriv(priv, netmap_dtor); + if (error) + return error; + + return 0; +} +#endif /* __FreeBSD__ */ + /* * Handlers for synchronization of the queues from/to the host. - * - * netmap_sync_to_host() passes packets up. We are called from a - * system call in user process context, and the only contention - * can be among multiple user threads erroneously calling - * this routine concurrently. In principle we should not even - * need to lock. + * Netmap has two operating modes: + * - in the default mode, the rings connected to the host stack are + * just another ring pair managed by userspace; + * - in transparent mode (XXX to be defined) incoming packets + * (from the host or the NIC) are marked as NS_FORWARD upon + * arrival, and the user application has a chance to reset the + * flag for packets that should be dropped. + * On the RXSYNC or poll(), packets in RX rings between + * kring->nr_kcur and ring->cur with NS_FORWARD still set are moved + * to the other side. + * The transfer NIC --> host is relatively easy, just encapsulate + * into mbufs and we are done. The host --> NIC side is slightly + * harder because there might not be room in the tx ring so it + * might take a while before releasing the buffer. + */ + +/* + * pass a chain of buffers to the host stack as coming from 'dst' */ static void -netmap_sync_to_host(struct netmap_adapter *na) +netmap_send_up(struct ifnet *dst, struct mbuf *head) { - struct netmap_kring *kring = &na->tx_rings[na->num_tx_rings]; - struct netmap_ring *ring = kring->ring; - struct mbuf *head = NULL, *tail = NULL, *m; - u_int k, n, lim = kring->nkr_num_slots - 1; + struct mbuf *m; - k = ring->cur; - if (k > lim) { - netmap_ring_reinit(kring); - return; + /* send packets up, outside the lock */ + while ((m = head) != NULL) { + head = head->m_nextpkt; + m->m_nextpkt = NULL; + if (netmap_verbose & NM_VERB_HOST) + D("sending up pkt %p size %d", m, MBUF_LEN(m)); + NM_SEND_UP(dst, m); } - // na->nm_lock(na->ifp, NETMAP_CORE_LOCK, 0); +} - /* Take packets from hwcur to cur and pass them up. +struct mbq { + struct mbuf *head; + struct mbuf *tail; + int count; +}; + +/* + * put a copy of the buffers marked NS_FORWARD into an mbuf chain. + * Run from hwcur to cur - reserved + */ +static void +netmap_grab_packets(struct netmap_kring *kring, struct mbq *q, int force) +{ + /* Take packets from hwcur to cur-reserved and pass them up. * In case of no buffers we give up. At the end of the loop, * the queue is drained in all cases. + * XXX handle reserved */ + int k = kring->ring->cur - kring->ring->reserved; + u_int n, lim = kring->nkr_num_slots - 1; + struct mbuf *m, *tail = q->tail; + + if (k < 0) + k = k + kring->nkr_num_slots; for (n = kring->nr_hwcur; n != k;) { - struct netmap_slot *slot = &ring->slot[n]; + struct netmap_slot *slot = &kring->ring->slot[n]; n = (n == lim) ? 0 : n + 1; + if ((slot->flags & NS_FORWARD) == 0 && !force) + continue; if (slot->len < 14 || slot->len > NETMAP_BUF_SIZE) { D("bad pkt at %d len %d", n, slot->len); continue; } - m = m_devget(NMB(slot), slot->len, 0, na->ifp, NULL); + slot->flags &= ~NS_FORWARD; // XXX needed ? + m = m_devget(NMB(slot), slot->len, 0, kring->na->ifp, NULL); if (m == NULL) break; if (tail) tail->m_nextpkt = m; else - head = m; + q->head = m; tail = m; + q->count++; m->m_nextpkt = NULL; } + q->tail = tail; +} + +/* + * called under main lock to send packets from the host to the NIC + * The host ring has packets from nr_hwcur to (cur - reserved) + * to be sent down. We scan the tx rings, which have just been + * flushed so nr_hwcur == cur. Pushing packets down means + * increment cur and decrement avail. + * XXX to be verified + */ +static void +netmap_sw_to_nic(struct netmap_adapter *na) +{ + struct netmap_kring *kring = &na->rx_rings[na->num_rx_rings]; + struct netmap_kring *k1 = &na->tx_rings[0]; + int i, howmany, src_lim, dst_lim; + + howmany = kring->nr_hwavail; /* XXX otherwise cur - reserved - nr_hwcur */ + + src_lim = kring->nkr_num_slots; + for (i = 0; howmany > 0 && i < na->num_tx_rings; i++, k1++) { + ND("%d packets left to ring %d (space %d)", howmany, i, k1->nr_hwavail); + dst_lim = k1->nkr_num_slots; + while (howmany > 0 && k1->ring->avail > 0) { + struct netmap_slot *src, *dst, tmp; + src = &kring->ring->slot[kring->nr_hwcur]; + dst = &k1->ring->slot[k1->ring->cur]; + tmp = *src; + src->buf_idx = dst->buf_idx; + src->flags = NS_BUF_CHANGED; + + dst->buf_idx = tmp.buf_idx; + dst->len = tmp.len; + dst->flags = NS_BUF_CHANGED; + ND("out len %d buf %d from %d to %d", + dst->len, dst->buf_idx, + kring->nr_hwcur, k1->ring->cur); + + if (++kring->nr_hwcur >= src_lim) + kring->nr_hwcur = 0; + howmany--; + kring->nr_hwavail--; + if (++k1->ring->cur >= dst_lim) + k1->ring->cur = 0; + k1->ring->avail--; + } + kring->ring->cur = kring->nr_hwcur; // XXX + k1++; + } +} + +/* + * netmap_sync_to_host() passes packets up. We are called from a + * system call in user process context, and the only contention + * can be among multiple user threads erroneously calling + * this routine concurrently. + */ +static void +netmap_sync_to_host(struct netmap_adapter *na) +{ + struct netmap_kring *kring = &na->tx_rings[na->num_tx_rings]; + struct netmap_ring *ring = kring->ring; + u_int k, lim = kring->nkr_num_slots - 1; + struct mbq q = { NULL, NULL }; + + k = ring->cur; + if (k > lim) { + netmap_ring_reinit(kring); + return; + } + // na->nm_lock(na->ifp, NETMAP_CORE_LOCK, 0); + + /* Take packets from hwcur to cur and pass them up. + * In case of no buffers we give up. At the end of the loop, + * the queue is drained in all cases. + */ + netmap_grab_packets(kring, &q, 1); kring->nr_hwcur = k; kring->nr_hwavail = ring->avail = lim; // na->nm_lock(na->ifp, NETMAP_CORE_UNLOCK, 0); - /* send packets up, outside the lock */ - while ((m = head) != NULL) { - head = head->m_nextpkt; - m->m_nextpkt = NULL; - if (netmap_verbose & NM_VERB_HOST) - D("sending up pkt %p size %d", m, MBUF_LEN(m)); - NM_SEND_UP(na->ifp, m); - } + netmap_send_up(na->ifp, q.head); } /* @@ -323,15 +822,19 @@ netmap_sync_to_host(struct netmap_adapte * * This routine also does the selrecord if called from the poll handler * (we know because td != NULL). + * + * NOTE: on linux, selrecord() is defined as a macro and uses pwait + * as an additional hidden argument. */ static void -netmap_sync_from_host(struct netmap_adapter *na, struct thread *td) +netmap_sync_from_host(struct netmap_adapter *na, struct thread *td, void *pwait) { struct netmap_kring *kring = &na->rx_rings[na->num_rx_rings]; struct netmap_ring *ring = kring->ring; u_int j, n, lim = kring->nkr_num_slots; u_int k = ring->cur, resvd = ring->reserved; + (void)pwait; /* disable unused warnings */ na->nm_lock(na->ifp, NETMAP_CORE_LOCK, 0); if (k >= lim) { netmap_ring_reinit(kring); @@ -370,15 +873,73 @@ netmap_sync_from_host(struct netmap_adap static int get_ifp(const char *name, struct ifnet **ifp) { +#ifdef NM_BRIDGE + struct ifnet *iter = NULL; + + do { + struct nm_bridge *b; + int i, l, cand = -1; + + if (strncmp(name, NM_NAME, sizeof(NM_NAME) - 1)) + break; + b = nm_find_bridge(name); + if (b == NULL) { + D("no bridges available for '%s'", name); + return (ENXIO); + } + /* XXX locking */ + BDG_LOCK(b); + /* lookup in the local list of ports */ + for (i = 0; i < NM_BDG_MAXPORTS; i++) { + iter = b->bdg_ports[i]; + if (iter == NULL) { + if (cand == -1) + cand = i; /* potential insert point */ + continue; + } + if (!strcmp(iter->if_xname, name)) { + ADD_BDG_REF(iter); + ND("found existing interface"); + BDG_UNLOCK(b); + break; + } + } + if (i < NM_BDG_MAXPORTS) /* already unlocked */ + break; + if (cand == -1) { + D("bridge full, cannot create new port"); +no_port: + BDG_UNLOCK(b); + *ifp = NULL; + return EINVAL; + } + ND("create new bridge port %s", name); + /* space for forwarding list after the ifnet */ + l = sizeof(*iter) + + sizeof(struct nm_bdg_fwd)*NM_BDG_BATCH ; + iter = malloc(l, M_DEVBUF, M_NOWAIT | M_ZERO); + if (!iter) + goto no_port; + strcpy(iter->if_xname, name); + bdg_netmap_attach(iter); + b->bdg_ports[cand] = iter; + iter->if_bridge = b; + ADD_BDG_REF(iter); + BDG_UNLOCK(b); + ND("attaching virtual bridge %p", b); + } while (0); + *ifp = iter; + if (! *ifp) +#endif /* NM_BRIDGE */ *ifp = ifunit_ref(name); if (*ifp == NULL) return (ENXIO); /* can do this if the capability exists and if_pspare[0] * points to the netmap descriptor. */ - if ((*ifp)->if_capabilities & IFCAP_NETMAP && NA(*ifp)) + if (NETMAP_CAPABLE(*ifp)) return 0; /* valid pointer, we hold the refcount */ - if_rele(*ifp); + nm_if_rele(*ifp); return EINVAL; // not NETMAP capable } @@ -402,7 +963,7 @@ netmap_ring_reinit(struct netmap_kring * u_int i, lim = kring->nkr_num_slots - 1; int errors = 0; - D("called for %s", kring->na->ifp->if_xname); + RD(10, "called for %s", kring->na->ifp->if_xname); if (ring->cur > lim) errors++; for (i = 0; i <= lim; i++) { @@ -424,9 +985,9 @@ netmap_ring_reinit(struct netmap_kring * int pos = kring - kring->na->tx_rings; int n = kring->na->num_tx_rings + 1; - D("total %d errors", errors); + RD(10, "total %d errors", errors); errors++; - D("%s %s[%d] reinit, cur %d -> %d avail %d -> %d", + RD(10, "%s %s[%d] reinit, cur %d -> %d avail %d -> %d", kring->na->ifp->if_xname, pos < n ? "TX" : "RX", pos < n ? pos : pos - n, ring->cur, kring->nr_hwcur, @@ -474,6 +1035,7 @@ netmap_set_ringid(struct netmap_priv_d * priv->np_txpoll = (ringid & NETMAP_NO_TX_POLL) ? 0 : 1; if (need_lock) na->nm_lock(ifp, NETMAP_CORE_UNLOCK, 0); + if (netmap_verbose) { if (ringid & NETMAP_SW_RING) D("ringid %s set to SW RING", ifp->if_xname); else if (ringid & NETMAP_HW_RING) @@ -481,6 +1043,7 @@ netmap_set_ringid(struct netmap_priv_d * priv->np_qfirst); else D("ringid %s set to all %d HW RINGS", ifp->if_xname, lim); + } return 0; } @@ -498,8 +1061,8 @@ netmap_set_ringid(struct netmap_priv_d * * Return 0 on success, errno otherwise. */ static int -netmap_ioctl(__unused struct cdev *dev, u_long cmd, caddr_t data, *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Tue Feb 5 09:50:33 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id D01F4C19; Tue, 5 Feb 2013 09:50:33 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A9E2990A; Tue, 5 Feb 2013 09:50:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r159oXMN020627; Tue, 5 Feb 2013 09:50:33 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r159oX1x020626; Tue, 5 Feb 2013 09:50:33 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302050950.r159oX1x020626@svn.freebsd.org> From: Xin LI Date: Tue, 5 Feb 2013 09:50:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246356 - in stable: 7/lib/libc/gen 8/lib/libc/gen 9/lib/libc/gen X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 09:50:33 -0000 Author: delphij Date: Tue Feb 5 09:50:33 2013 New Revision: 246356 URL: http://svnweb.freebsd.org/changeset/base/246356 Log: MFC r243758 (marcel): In globextend() when the pathv vector cannot be (re-)allocated, don't free and clear the gl_pathv pointer in the glob_t structure. Such breaks the invariant of the glob_t structure, as stated in the comment right in front of the globextend() function. If gl_pathv was non-NULL, then gl_pathc was > 0. Making gl_pathv a NULL pointer without also setting gl_pathc to 0 is wrong. Since we otherwise don't free the memory associated with a glob_t in error cases, it's unlikely that this change will cause a memory leak that wasn't already there to begin with. Callers of glob(3) must call globfree(3) irrespective of whether glob(3) returned an error or not. MFC r243759 (marcel): In globextend(), take advantage of the fact that realloc(NULL, size) is equivalent to malloc(size). This eliminates the conditional expression used for calling either realloc() or malloc() when realloc() will do all the time. Modified: stable/9/lib/libc/gen/glob.c Directory Properties: stable/9/lib/libc/ (props changed) Changes in other areas also in this revision: Modified: stable/7/lib/libc/gen/glob.c stable/8/lib/libc/gen/glob.c Directory Properties: stable/7/lib/libc/ (props changed) stable/8/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/glob.c ============================================================================== --- stable/9/lib/libc/gen/glob.c Tue Feb 5 09:40:31 2013 (r246355) +++ stable/9/lib/libc/gen/glob.c Tue Feb 5 09:50:33 2013 (r246356) @@ -715,16 +715,10 @@ globextend(const Char *path, glob_t *pgl } newsize = sizeof(*pathv) * (2 + pglob->gl_pathc + pglob->gl_offs); - pathv = pglob->gl_pathv ? - realloc((char *)pglob->gl_pathv, newsize) : - malloc(newsize); - if (pathv == NULL) { - if (pglob->gl_pathv) { - free(pglob->gl_pathv); - pglob->gl_pathv = NULL; - } + /* realloc(NULL, newsize) is equivalent to malloc(newsize). */ + pathv = realloc((void *)pglob->gl_pathv, newsize); + if (pathv == NULL) return(GLOB_NOSPACE); - } if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) { /* first time around -- clear initial gl_offs items */ From owner-svn-src-stable@FreeBSD.ORG Tue Feb 5 09:50:34 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 30D80C1A; Tue, 5 Feb 2013 09:50:34 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0A4BF90B; Tue, 5 Feb 2013 09:50:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r159oX4L020635; Tue, 5 Feb 2013 09:50:33 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r159oXOR020634; Tue, 5 Feb 2013 09:50:33 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302050950.r159oXOR020634@svn.freebsd.org> From: Xin LI Date: Tue, 5 Feb 2013 09:50:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246356 - in stable: 7/lib/libc/gen 8/lib/libc/gen 9/lib/libc/gen X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 09:50:34 -0000 Author: delphij Date: Tue Feb 5 09:50:33 2013 New Revision: 246356 URL: http://svnweb.freebsd.org/changeset/base/246356 Log: MFC r243758 (marcel): In globextend() when the pathv vector cannot be (re-)allocated, don't free and clear the gl_pathv pointer in the glob_t structure. Such breaks the invariant of the glob_t structure, as stated in the comment right in front of the globextend() function. If gl_pathv was non-NULL, then gl_pathc was > 0. Making gl_pathv a NULL pointer without also setting gl_pathc to 0 is wrong. Since we otherwise don't free the memory associated with a glob_t in error cases, it's unlikely that this change will cause a memory leak that wasn't already there to begin with. Callers of glob(3) must call globfree(3) irrespective of whether glob(3) returned an error or not. MFC r243759 (marcel): In globextend(), take advantage of the fact that realloc(NULL, size) is equivalent to malloc(size). This eliminates the conditional expression used for calling either realloc() or malloc() when realloc() will do all the time. Modified: stable/8/lib/libc/gen/glob.c Directory Properties: stable/8/lib/libc/ (props changed) Changes in other areas also in this revision: Modified: stable/7/lib/libc/gen/glob.c stable/9/lib/libc/gen/glob.c Directory Properties: stable/7/lib/libc/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/8/lib/libc/gen/glob.c ============================================================================== --- stable/8/lib/libc/gen/glob.c Tue Feb 5 09:40:31 2013 (r246355) +++ stable/8/lib/libc/gen/glob.c Tue Feb 5 09:50:33 2013 (r246356) @@ -710,16 +710,10 @@ globextend(const Char *path, glob_t *pgl } newsize = sizeof(*pathv) * (2 + pglob->gl_pathc + pglob->gl_offs); - pathv = pglob->gl_pathv ? - realloc((char *)pglob->gl_pathv, newsize) : - malloc(newsize); - if (pathv == NULL) { - if (pglob->gl_pathv) { - free(pglob->gl_pathv); - pglob->gl_pathv = NULL; - } + /* realloc(NULL, newsize) is equivalent to malloc(newsize). */ + pathv = realloc((void *)pglob->gl_pathv, newsize); + if (pathv == NULL) return(GLOB_NOSPACE); - } if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) { /* first time around -- clear initial gl_offs items */ From owner-svn-src-stable@FreeBSD.ORG Tue Feb 5 09:50:34 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 843EBC1B; Tue, 5 Feb 2013 09:50:34 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5E20990C; Tue, 5 Feb 2013 09:50:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r159oYXk020643; Tue, 5 Feb 2013 09:50:34 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r159oY0O020642; Tue, 5 Feb 2013 09:50:34 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302050950.r159oY0O020642@svn.freebsd.org> From: Xin LI Date: Tue, 5 Feb 2013 09:50:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r246356 - in stable: 7/lib/libc/gen 8/lib/libc/gen 9/lib/libc/gen X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 09:50:34 -0000 Author: delphij Date: Tue Feb 5 09:50:33 2013 New Revision: 246356 URL: http://svnweb.freebsd.org/changeset/base/246356 Log: MFC r243758 (marcel): In globextend() when the pathv vector cannot be (re-)allocated, don't free and clear the gl_pathv pointer in the glob_t structure. Such breaks the invariant of the glob_t structure, as stated in the comment right in front of the globextend() function. If gl_pathv was non-NULL, then gl_pathc was > 0. Making gl_pathv a NULL pointer without also setting gl_pathc to 0 is wrong. Since we otherwise don't free the memory associated with a glob_t in error cases, it's unlikely that this change will cause a memory leak that wasn't already there to begin with. Callers of glob(3) must call globfree(3) irrespective of whether glob(3) returned an error or not. MFC r243759 (marcel): In globextend(), take advantage of the fact that realloc(NULL, size) is equivalent to malloc(size). This eliminates the conditional expression used for calling either realloc() or malloc() when realloc() will do all the time. Modified: stable/7/lib/libc/gen/glob.c Directory Properties: stable/7/lib/libc/ (props changed) Changes in other areas also in this revision: Modified: stable/8/lib/libc/gen/glob.c stable/9/lib/libc/gen/glob.c Directory Properties: stable/8/lib/libc/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/7/lib/libc/gen/glob.c ============================================================================== --- stable/7/lib/libc/gen/glob.c Tue Feb 5 09:40:31 2013 (r246355) +++ stable/7/lib/libc/gen/glob.c Tue Feb 5 09:50:33 2013 (r246356) @@ -710,16 +710,10 @@ globextend(const Char *path, glob_t *pgl } newsize = sizeof(*pathv) * (2 + pglob->gl_pathc + pglob->gl_offs); - pathv = pglob->gl_pathv ? - realloc((char *)pglob->gl_pathv, newsize) : - malloc(newsize); - if (pathv == NULL) { - if (pglob->gl_pathv) { - free(pglob->gl_pathv); - pglob->gl_pathv = NULL; - } + /* realloc(NULL, newsize) is equivalent to malloc(newsize). */ + pathv = realloc((void *)pglob->gl_pathv, newsize); + if (pathv == NULL) return(GLOB_NOSPACE); - } if (pglob->gl_pathv == NULL && pglob->gl_offs > 0) { /* first time around -- clear initial gl_offs items */ From owner-svn-src-stable@FreeBSD.ORG Tue Feb 5 09:53:34 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 37EC11EC; Tue, 5 Feb 2013 09:53:34 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 23A29952; Tue, 5 Feb 2013 09:53:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r159rXbS022608; Tue, 5 Feb 2013 09:53:33 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r159rXe1022607; Tue, 5 Feb 2013 09:53:33 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302050953.r159rXe1022607@svn.freebsd.org> From: Xin LI Date: Tue, 5 Feb 2013 09:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246357 - in stable: 7/lib/libc/gen 8/lib/libc/gen 9/lib/libc/gen X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 09:53:34 -0000 Author: delphij Date: Tue Feb 5 09:53:32 2013 New Revision: 246357 URL: http://svnweb.freebsd.org/changeset/base/246357 Log: MFC r243779 (marcel): Protect against DoS attacks, such as being described in CVE-2010-2632. The changes were derived from what has been committed to NetBSD, with modifications. These are: 1. Preserve the existsing GLOB_LIMIT behaviour by including the number of matches to the set of parameters to limit. 2. Change some of the limits to avoid impacting normal use cases: GLOB_LIMIT_STRING - change from 65536 to ARG_MAX so that glob(3) can still provide a full command line of expanded names. GLOB_LIMIT_STAT - change from 128 to 1024 for no other reason than that 128 feels too low (it's not a limit that impacts the behaviour of the test program listed in CVE-2010-2632). GLOB_LIMIT_PATH - change from 1024 to 65536 so that glob(3) can still provide a fill command line of expanded names. 3. Protect against buffer overruns when we hit the GLOB_LIMIT_STAT or GLOB_LIMIT_READDIR limits. We append SEP and EOS to pathend in those cases. Return GLOB_ABORTED instead of GLOB_NOSPACE when we would otherwise overrun the buffer. This change also modifies the existing behaviour of glob(3) in case GLOB_LIMIT is specifies by limiting the *new* matches and not all matches. This is an important distinction when GLOB_APPEND is set or when the caller uses a non-zero gl_offs. Previously pre-existing matches or the value of gl_offs would be counted in the number of matches even though the man page states that glob(3) would return GLOB_NOSPACE when gl_matchc or more matches were found. The limits that cannot be circumvented are GLOB_LIMIT_STRING and GLOB_LIMIT_PATH all others can be crossed by simply calling glob(3) again and with GLOB_APPEND set. The entire description above applies only when GLOB_LIMIT has been specified of course. No limits apply when this flag isn't set! Obtained from: Juniper Networks, Inc Modified: stable/8/lib/libc/gen/glob.c Directory Properties: stable/8/lib/libc/ (props changed) Changes in other areas also in this revision: Modified: stable/7/lib/libc/gen/glob.c stable/9/lib/libc/gen/glob.c Directory Properties: stable/7/lib/libc/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/8/lib/libc/gen/glob.c ============================================================================== --- stable/8/lib/libc/gen/glob.c Tue Feb 5 09:50:33 2013 (r246356) +++ stable/8/lib/libc/gen/glob.c Tue Feb 5 09:53:32 2013 (r246357) @@ -89,6 +89,25 @@ __FBSDID("$FreeBSD$"); #include "collate.h" +/* + * glob(3) expansion limits. Stop the expansion if any of these limits + * is reached. This caps the runtime in the face of DoS attacks. See + * also CVE-2010-2632 + */ +#define GLOB_LIMIT_BRACE 128 /* number of brace calls */ +#define GLOB_LIMIT_PATH 65536 /* number of path elements */ +#define GLOB_LIMIT_READDIR 16384 /* number of readdirs */ +#define GLOB_LIMIT_STAT 1024 /* number of stat system calls */ +#define GLOB_LIMIT_STRING ARG_MAX /* maximum total size for paths */ + +struct glob_limit { + size_t l_brace_cnt; + size_t l_path_lim; + size_t l_readdir_cnt; + size_t l_stat_cnt; + size_t l_string_cnt; +}; + #define DOLLAR '$' #define DOT '.' #define EOS '\0' @@ -148,15 +167,18 @@ static const Char *g_strchr(const Char * static Char *g_strcat(Char *, const Char *); #endif static int g_stat(Char *, struct stat *, glob_t *); -static int glob0(const Char *, glob_t *, size_t *); -static int glob1(Char *, glob_t *, size_t *); -static int glob2(Char *, Char *, Char *, Char *, glob_t *, size_t *); -static int glob3(Char *, Char *, Char *, Char *, Char *, glob_t *, size_t *); -static int globextend(const Char *, glob_t *, size_t *); -static const Char * +static int glob0(const Char *, glob_t *, struct glob_limit *); +static int glob1(Char *, glob_t *, struct glob_limit *); +static int glob2(Char *, Char *, Char *, Char *, glob_t *, + struct glob_limit *); +static int glob3(Char *, Char *, Char *, Char *, Char *, glob_t *, + struct glob_limit *); +static int globextend(const Char *, glob_t *, struct glob_limit *); +static const Char * globtilde(const Char *, Char *, size_t, glob_t *); -static int globexp1(const Char *, glob_t *, size_t *); -static int globexp2(const Char *, const Char *, glob_t *, int *, size_t *); +static int globexp1(const Char *, glob_t *, struct glob_limit *); +static int globexp2(const Char *, const Char *, glob_t *, int *, + struct glob_limit *); static int match(Char *, Char *, Char *); #ifdef DEBUG static void qprintf(const char *, Char *); @@ -166,8 +188,8 @@ int glob(const char * __restrict pattern, int flags, int (*errfunc)(const char *, int), glob_t * __restrict pglob) { + struct glob_limit limit = { 0, 0, 0, 0, 0 }; const char *patnext; - size_t limit; Char *bufnext, *bufend, patbuf[MAXPATHLEN], prot; mbstate_t mbs; wchar_t wc; @@ -181,11 +203,10 @@ glob(const char * __restrict pattern, in pglob->gl_offs = 0; } if (flags & GLOB_LIMIT) { - limit = pglob->gl_matchc; - if (limit == 0) - limit = ARG_MAX; - } else - limit = 0; + limit.l_path_lim = pglob->gl_matchc; + if (limit.l_path_lim == 0) + limit.l_path_lim = GLOB_LIMIT_PATH; + } pglob->gl_flags = flags & ~GLOB_MAGCHAR; pglob->gl_errfunc = errfunc; pglob->gl_matchc = 0; @@ -238,11 +259,17 @@ glob(const char * __restrict pattern, in * characters */ static int -globexp1(const Char *pattern, glob_t *pglob, size_t *limit) +globexp1(const Char *pattern, glob_t *pglob, struct glob_limit *limit) { const Char* ptr = pattern; int rv; + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_brace_cnt++ >= GLOB_LIMIT_BRACE) { + errno = 0; + return (GLOB_NOSPACE); + } + /* Protect a single {}, for find(1), like csh */ if (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS) return glob0(pattern, pglob, limit); @@ -261,7 +288,8 @@ globexp1(const Char *pattern, glob_t *pg * If it fails then it tries to glob the rest of the pattern and returns. */ static int -globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv, size_t *limit) +globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv, + struct glob_limit *limit) { int i; Char *lm, *ls; @@ -431,7 +459,7 @@ globtilde(const Char *pattern, Char *pat * if things went well, nonzero if errors occurred. */ static int -glob0(const Char *pattern, glob_t *pglob, size_t *limit) +glob0(const Char *pattern, glob_t *pglob, struct glob_limit *limit) { const Char *qpatnext; int err; @@ -524,7 +552,7 @@ compare(const void *p, const void *q) } static int -glob1(Char *pattern, glob_t *pglob, size_t *limit) +glob1(Char *pattern, glob_t *pglob, struct glob_limit *limit) { Char pathbuf[MAXPATHLEN]; @@ -542,7 +570,7 @@ glob1(Char *pattern, glob_t *pglob, size */ static int glob2(Char *pathbuf, Char *pathend, Char *pathend_last, Char *pattern, - glob_t *pglob, size_t *limit) + glob_t *pglob, struct glob_limit *limit) { struct stat sb; Char *p, *q; @@ -558,6 +586,15 @@ glob2(Char *pathbuf, Char *pathend, Char if (g_lstat(pathbuf, &sb, pglob)) return(0); + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_stat_cnt++ >= GLOB_LIMIT_STAT) { + errno = 0; + if (pathend + 1 > pathend_last) + return (GLOB_ABORTED); + *pathend++ = SEP; + *pathend = EOS; + return (GLOB_NOSPACE); + } if (((pglob->gl_flags & GLOB_MARK) && pathend[-1] != SEP) && (S_ISDIR(sb.st_mode) || (S_ISLNK(sb.st_mode) && @@ -601,7 +638,7 @@ glob2(Char *pathbuf, Char *pathend, Char static int glob3(Char *pathbuf, Char *pathend, Char *pathend_last, Char *pattern, Char *restpattern, - glob_t *pglob, size_t *limit) + glob_t *pglob, struct glob_limit *limit) { struct dirent *dp; DIR *dirp; @@ -647,6 +684,19 @@ glob3(Char *pathbuf, Char *pathend, Char size_t clen; mbstate_t mbs; + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_readdir_cnt++ >= GLOB_LIMIT_READDIR) { + errno = 0; + if (pathend + 1 > pathend_last) + err = GLOB_ABORTED; + else { + *pathend++ = SEP; + *pathend = EOS; + err = GLOB_NOSPACE; + } + break; + } + /* Initial DOT must be matched literally. */ if (dp->d_name[0] == DOT && *pattern != DOT) continue; @@ -697,14 +747,15 @@ glob3(Char *pathbuf, Char *pathend, Char * gl_pathv points to (gl_offs + gl_pathc + 1) items. */ static int -globextend(const Char *path, glob_t *pglob, size_t *limit) +globextend(const Char *path, glob_t *pglob, struct glob_limit *limit) { char **pathv; size_t i, newsize, len; char *copy; const Char *p; - if (*limit && pglob->gl_pathc > *limit) { + if ((pglob->gl_flags & GLOB_LIMIT) && + pglob->gl_matchc > limit->l_path_lim) { errno = 0; return (GLOB_NOSPACE); } @@ -726,6 +777,12 @@ globextend(const Char *path, glob_t *pgl for (p = path; *p++;) continue; len = MB_CUR_MAX * (size_t)(p - path); /* XXX overallocation */ + limit->l_string_cnt += len; + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_string_cnt >= GLOB_LIMIT_STRING) { + errno = 0; + return (GLOB_NOSPACE); + } if ((copy = malloc(len)) != NULL) { if (g_Ctoc(path, copy, len)) { free(copy); From owner-svn-src-stable@FreeBSD.ORG Tue Feb 5 09:53:34 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 402F01ED; Tue, 5 Feb 2013 09:53:34 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 23A93953; Tue, 5 Feb 2013 09:53:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r159rX7K022602; Tue, 5 Feb 2013 09:53:33 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r159rXLU022601; Tue, 5 Feb 2013 09:53:33 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302050953.r159rXLU022601@svn.freebsd.org> From: Xin LI Date: Tue, 5 Feb 2013 09:53:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246357 - in stable: 7/lib/libc/gen 8/lib/libc/gen 9/lib/libc/gen X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 09:53:34 -0000 Author: delphij Date: Tue Feb 5 09:53:32 2013 New Revision: 246357 URL: http://svnweb.freebsd.org/changeset/base/246357 Log: MFC r243779 (marcel): Protect against DoS attacks, such as being described in CVE-2010-2632. The changes were derived from what has been committed to NetBSD, with modifications. These are: 1. Preserve the existsing GLOB_LIMIT behaviour by including the number of matches to the set of parameters to limit. 2. Change some of the limits to avoid impacting normal use cases: GLOB_LIMIT_STRING - change from 65536 to ARG_MAX so that glob(3) can still provide a full command line of expanded names. GLOB_LIMIT_STAT - change from 128 to 1024 for no other reason than that 128 feels too low (it's not a limit that impacts the behaviour of the test program listed in CVE-2010-2632). GLOB_LIMIT_PATH - change from 1024 to 65536 so that glob(3) can still provide a fill command line of expanded names. 3. Protect against buffer overruns when we hit the GLOB_LIMIT_STAT or GLOB_LIMIT_READDIR limits. We append SEP and EOS to pathend in those cases. Return GLOB_ABORTED instead of GLOB_NOSPACE when we would otherwise overrun the buffer. This change also modifies the existing behaviour of glob(3) in case GLOB_LIMIT is specifies by limiting the *new* matches and not all matches. This is an important distinction when GLOB_APPEND is set or when the caller uses a non-zero gl_offs. Previously pre-existing matches or the value of gl_offs would be counted in the number of matches even though the man page states that glob(3) would return GLOB_NOSPACE when gl_matchc or more matches were found. The limits that cannot be circumvented are GLOB_LIMIT_STRING and GLOB_LIMIT_PATH all others can be crossed by simply calling glob(3) again and with GLOB_APPEND set. The entire description above applies only when GLOB_LIMIT has been specified of course. No limits apply when this flag isn't set! Obtained from: Juniper Networks, Inc Modified: stable/9/lib/libc/gen/glob.c Directory Properties: stable/9/lib/libc/ (props changed) Changes in other areas also in this revision: Modified: stable/7/lib/libc/gen/glob.c stable/8/lib/libc/gen/glob.c Directory Properties: stable/7/lib/libc/ (props changed) stable/8/lib/libc/ (props changed) Modified: stable/9/lib/libc/gen/glob.c ============================================================================== --- stable/9/lib/libc/gen/glob.c Tue Feb 5 09:50:33 2013 (r246356) +++ stable/9/lib/libc/gen/glob.c Tue Feb 5 09:53:32 2013 (r246357) @@ -94,6 +94,25 @@ __FBSDID("$FreeBSD$"); #include "collate.h" +/* + * glob(3) expansion limits. Stop the expansion if any of these limits + * is reached. This caps the runtime in the face of DoS attacks. See + * also CVE-2010-2632 + */ +#define GLOB_LIMIT_BRACE 128 /* number of brace calls */ +#define GLOB_LIMIT_PATH 65536 /* number of path elements */ +#define GLOB_LIMIT_READDIR 16384 /* number of readdirs */ +#define GLOB_LIMIT_STAT 1024 /* number of stat system calls */ +#define GLOB_LIMIT_STRING ARG_MAX /* maximum total size for paths */ + +struct glob_limit { + size_t l_brace_cnt; + size_t l_path_lim; + size_t l_readdir_cnt; + size_t l_stat_cnt; + size_t l_string_cnt; +}; + #define DOLLAR '$' #define DOT '.' #define EOS '\0' @@ -153,15 +172,18 @@ static const Char *g_strchr(const Char * static Char *g_strcat(Char *, const Char *); #endif static int g_stat(Char *, struct stat *, glob_t *); -static int glob0(const Char *, glob_t *, size_t *); -static int glob1(Char *, glob_t *, size_t *); -static int glob2(Char *, Char *, Char *, Char *, glob_t *, size_t *); -static int glob3(Char *, Char *, Char *, Char *, Char *, glob_t *, size_t *); -static int globextend(const Char *, glob_t *, size_t *); -static const Char * +static int glob0(const Char *, glob_t *, struct glob_limit *); +static int glob1(Char *, glob_t *, struct glob_limit *); +static int glob2(Char *, Char *, Char *, Char *, glob_t *, + struct glob_limit *); +static int glob3(Char *, Char *, Char *, Char *, Char *, glob_t *, + struct glob_limit *); +static int globextend(const Char *, glob_t *, struct glob_limit *); +static const Char * globtilde(const Char *, Char *, size_t, glob_t *); -static int globexp1(const Char *, glob_t *, size_t *); -static int globexp2(const Char *, const Char *, glob_t *, int *, size_t *); +static int globexp1(const Char *, glob_t *, struct glob_limit *); +static int globexp2(const Char *, const Char *, glob_t *, int *, + struct glob_limit *); static int match(Char *, Char *, Char *); #ifdef DEBUG static void qprintf(const char *, Char *); @@ -171,8 +193,8 @@ int glob(const char * __restrict pattern, int flags, int (*errfunc)(const char *, int), glob_t * __restrict pglob) { + struct glob_limit limit = { 0, 0, 0, 0, 0 }; const char *patnext; - size_t limit; Char *bufnext, *bufend, patbuf[MAXPATHLEN], prot; mbstate_t mbs; wchar_t wc; @@ -186,11 +208,10 @@ glob(const char * __restrict pattern, in pglob->gl_offs = 0; } if (flags & GLOB_LIMIT) { - limit = pglob->gl_matchc; - if (limit == 0) - limit = ARG_MAX; - } else - limit = 0; + limit.l_path_lim = pglob->gl_matchc; + if (limit.l_path_lim == 0) + limit.l_path_lim = GLOB_LIMIT_PATH; + } pglob->gl_flags = flags & ~GLOB_MAGCHAR; pglob->gl_errfunc = errfunc; pglob->gl_matchc = 0; @@ -243,11 +264,17 @@ glob(const char * __restrict pattern, in * characters */ static int -globexp1(const Char *pattern, glob_t *pglob, size_t *limit) +globexp1(const Char *pattern, glob_t *pglob, struct glob_limit *limit) { const Char* ptr = pattern; int rv; + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_brace_cnt++ >= GLOB_LIMIT_BRACE) { + errno = 0; + return (GLOB_NOSPACE); + } + /* Protect a single {}, for find(1), like csh */ if (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS) return glob0(pattern, pglob, limit); @@ -266,7 +293,8 @@ globexp1(const Char *pattern, glob_t *pg * If it fails then it tries to glob the rest of the pattern and returns. */ static int -globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv, size_t *limit) +globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv, + struct glob_limit *limit) { int i; Char *lm, *ls; @@ -436,7 +464,7 @@ globtilde(const Char *pattern, Char *pat * if things went well, nonzero if errors occurred. */ static int -glob0(const Char *pattern, glob_t *pglob, size_t *limit) +glob0(const Char *pattern, glob_t *pglob, struct glob_limit *limit) { const Char *qpatnext; int err; @@ -529,7 +557,7 @@ compare(const void *p, const void *q) } static int -glob1(Char *pattern, glob_t *pglob, size_t *limit) +glob1(Char *pattern, glob_t *pglob, struct glob_limit *limit) { Char pathbuf[MAXPATHLEN]; @@ -547,7 +575,7 @@ glob1(Char *pattern, glob_t *pglob, size */ static int glob2(Char *pathbuf, Char *pathend, Char *pathend_last, Char *pattern, - glob_t *pglob, size_t *limit) + glob_t *pglob, struct glob_limit *limit) { struct stat sb; Char *p, *q; @@ -563,6 +591,15 @@ glob2(Char *pathbuf, Char *pathend, Char if (g_lstat(pathbuf, &sb, pglob)) return(0); + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_stat_cnt++ >= GLOB_LIMIT_STAT) { + errno = 0; + if (pathend + 1 > pathend_last) + return (GLOB_ABORTED); + *pathend++ = SEP; + *pathend = EOS; + return (GLOB_NOSPACE); + } if (((pglob->gl_flags & GLOB_MARK) && pathend[-1] != SEP) && (S_ISDIR(sb.st_mode) || (S_ISLNK(sb.st_mode) && @@ -606,7 +643,7 @@ glob2(Char *pathbuf, Char *pathend, Char static int glob3(Char *pathbuf, Char *pathend, Char *pathend_last, Char *pattern, Char *restpattern, - glob_t *pglob, size_t *limit) + glob_t *pglob, struct glob_limit *limit) { struct dirent *dp; DIR *dirp; @@ -652,6 +689,19 @@ glob3(Char *pathbuf, Char *pathend, Char size_t clen; mbstate_t mbs; + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_readdir_cnt++ >= GLOB_LIMIT_READDIR) { + errno = 0; + if (pathend + 1 > pathend_last) + err = GLOB_ABORTED; + else { + *pathend++ = SEP; + *pathend = EOS; + err = GLOB_NOSPACE; + } + break; + } + /* Initial DOT must be matched literally. */ if (dp->d_name[0] == DOT && *pattern != DOT) continue; @@ -702,14 +752,15 @@ glob3(Char *pathbuf, Char *pathend, Char * gl_pathv points to (gl_offs + gl_pathc + 1) items. */ static int -globextend(const Char *path, glob_t *pglob, size_t *limit) +globextend(const Char *path, glob_t *pglob, struct glob_limit *limit) { char **pathv; size_t i, newsize, len; char *copy; const Char *p; - if (*limit && pglob->gl_pathc > *limit) { + if ((pglob->gl_flags & GLOB_LIMIT) && + pglob->gl_matchc > limit->l_path_lim) { errno = 0; return (GLOB_NOSPACE); } @@ -731,6 +782,12 @@ globextend(const Char *path, glob_t *pgl for (p = path; *p++;) continue; len = MB_CUR_MAX * (size_t)(p - path); /* XXX overallocation */ + limit->l_string_cnt += len; + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_string_cnt >= GLOB_LIMIT_STRING) { + errno = 0; + return (GLOB_NOSPACE); + } if ((copy = malloc(len)) != NULL) { if (g_Ctoc(path, copy, len)) { free(copy); From owner-svn-src-stable@FreeBSD.ORG Tue Feb 5 09:53:34 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5A9C71EE; Tue, 5 Feb 2013 09:53:34 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 4B0BE954; Tue, 5 Feb 2013 09:53:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r159rYlq022616; Tue, 5 Feb 2013 09:53:34 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r159rYVK022614; Tue, 5 Feb 2013 09:53:34 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302050953.r159rYVK022614@svn.freebsd.org> From: Xin LI Date: Tue, 5 Feb 2013 09:53:34 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r246357 - in stable: 7/lib/libc/gen 8/lib/libc/gen 9/lib/libc/gen X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 09:53:34 -0000 Author: delphij Date: Tue Feb 5 09:53:32 2013 New Revision: 246357 URL: http://svnweb.freebsd.org/changeset/base/246357 Log: MFC r243779 (marcel): Protect against DoS attacks, such as being described in CVE-2010-2632. The changes were derived from what has been committed to NetBSD, with modifications. These are: 1. Preserve the existsing GLOB_LIMIT behaviour by including the number of matches to the set of parameters to limit. 2. Change some of the limits to avoid impacting normal use cases: GLOB_LIMIT_STRING - change from 65536 to ARG_MAX so that glob(3) can still provide a full command line of expanded names. GLOB_LIMIT_STAT - change from 128 to 1024 for no other reason than that 128 feels too low (it's not a limit that impacts the behaviour of the test program listed in CVE-2010-2632). GLOB_LIMIT_PATH - change from 1024 to 65536 so that glob(3) can still provide a fill command line of expanded names. 3. Protect against buffer overruns when we hit the GLOB_LIMIT_STAT or GLOB_LIMIT_READDIR limits. We append SEP and EOS to pathend in those cases. Return GLOB_ABORTED instead of GLOB_NOSPACE when we would otherwise overrun the buffer. This change also modifies the existing behaviour of glob(3) in case GLOB_LIMIT is specifies by limiting the *new* matches and not all matches. This is an important distinction when GLOB_APPEND is set or when the caller uses a non-zero gl_offs. Previously pre-existing matches or the value of gl_offs would be counted in the number of matches even though the man page states that glob(3) would return GLOB_NOSPACE when gl_matchc or more matches were found. The limits that cannot be circumvented are GLOB_LIMIT_STRING and GLOB_LIMIT_PATH all others can be crossed by simply calling glob(3) again and with GLOB_APPEND set. The entire description above applies only when GLOB_LIMIT has been specified of course. No limits apply when this flag isn't set! Obtained from: Juniper Networks, Inc Modified: stable/7/lib/libc/gen/glob.c Directory Properties: stable/7/lib/libc/ (props changed) Changes in other areas also in this revision: Modified: stable/8/lib/libc/gen/glob.c stable/9/lib/libc/gen/glob.c Directory Properties: stable/8/lib/libc/ (props changed) stable/9/lib/libc/ (props changed) Modified: stable/7/lib/libc/gen/glob.c ============================================================================== --- stable/7/lib/libc/gen/glob.c Tue Feb 5 09:50:33 2013 (r246356) +++ stable/7/lib/libc/gen/glob.c Tue Feb 5 09:53:32 2013 (r246357) @@ -89,6 +89,25 @@ __FBSDID("$FreeBSD$"); #include "collate.h" +/* + * glob(3) expansion limits. Stop the expansion if any of these limits + * is reached. This caps the runtime in the face of DoS attacks. See + * also CVE-2010-2632 + */ +#define GLOB_LIMIT_BRACE 128 /* number of brace calls */ +#define GLOB_LIMIT_PATH 65536 /* number of path elements */ +#define GLOB_LIMIT_READDIR 16384 /* number of readdirs */ +#define GLOB_LIMIT_STAT 1024 /* number of stat system calls */ +#define GLOB_LIMIT_STRING ARG_MAX /* maximum total size for paths */ + +struct glob_limit { + size_t l_brace_cnt; + size_t l_path_lim; + size_t l_readdir_cnt; + size_t l_stat_cnt; + size_t l_string_cnt; +}; + #define DOLLAR '$' #define DOT '.' #define EOS '\0' @@ -148,15 +167,18 @@ static Char *g_strchr(Char *, wchar_t); static Char *g_strcat(Char *, const Char *); #endif static int g_stat(Char *, struct stat *, glob_t *); -static int glob0(const Char *, glob_t *, size_t *); -static int glob1(Char *, glob_t *, size_t *); -static int glob2(Char *, Char *, Char *, Char *, glob_t *, size_t *); -static int glob3(Char *, Char *, Char *, Char *, Char *, glob_t *, size_t *); -static int globextend(const Char *, glob_t *, size_t *); -static const Char * +static int glob0(const Char *, glob_t *, struct glob_limit *); +static int glob1(Char *, glob_t *, struct glob_limit *); +static int glob2(Char *, Char *, Char *, Char *, glob_t *, + struct glob_limit *); +static int glob3(Char *, Char *, Char *, Char *, Char *, glob_t *, + struct glob_limit *); +static int globextend(const Char *, glob_t *, struct glob_limit *); +static const Char * globtilde(const Char *, Char *, size_t, glob_t *); -static int globexp1(const Char *, glob_t *, size_t *); -static int globexp2(const Char *, const Char *, glob_t *, int *, size_t *); +static int globexp1(const Char *, glob_t *, struct glob_limit *); +static int globexp2(const Char *, const Char *, glob_t *, int *, + struct glob_limit *); static int match(Char *, Char *, Char *); #ifdef DEBUG static void qprintf(const char *, Char *); @@ -166,8 +188,8 @@ int glob(const char * __restrict pattern, int flags, int (*errfunc)(const char *, int), glob_t * __restrict pglob) { + struct glob_limit limit = { 0, 0, 0, 0, 0 }; const char *patnext; - size_t limit; Char *bufnext, *bufend, patbuf[MAXPATHLEN], prot; mbstate_t mbs; wchar_t wc; @@ -181,11 +203,10 @@ glob(const char * __restrict pattern, in pglob->gl_offs = 0; } if (flags & GLOB_LIMIT) { - limit = pglob->gl_matchc; - if (limit == 0) - limit = ARG_MAX; - } else - limit = 0; + limit.l_path_lim = pglob->gl_matchc; + if (limit.l_path_lim == 0) + limit.l_path_lim = GLOB_LIMIT_PATH; + } pglob->gl_flags = flags & ~GLOB_MAGCHAR; pglob->gl_errfunc = errfunc; pglob->gl_matchc = 0; @@ -238,11 +259,17 @@ glob(const char * __restrict pattern, in * characters */ static int -globexp1(const Char *pattern, glob_t *pglob, size_t *limit) +globexp1(const Char *pattern, glob_t *pglob, struct glob_limit *limit) { const Char* ptr = pattern; int rv; + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_brace_cnt++ >= GLOB_LIMIT_BRACE) { + errno = 0; + return (GLOB_NOSPACE); + } + /* Protect a single {}, for find(1), like csh */ if (pattern[0] == LBRACE && pattern[1] == RBRACE && pattern[2] == EOS) return glob0(pattern, pglob, limit); @@ -261,7 +288,8 @@ globexp1(const Char *pattern, glob_t *pg * If it fails then it tries to glob the rest of the pattern and returns. */ static int -globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv, size_t *limit) +globexp2(const Char *ptr, const Char *pattern, glob_t *pglob, int *rv, + struct glob_limit *limit) { int i; Char *lm, *ls; @@ -431,7 +459,7 @@ globtilde(const Char *pattern, Char *pat * if things went well, nonzero if errors occurred. */ static int -glob0(const Char *pattern, glob_t *pglob, size_t *limit) +glob0(const Char *pattern, glob_t *pglob, struct glob_limit *limit) { const Char *qpatnext; int err; @@ -524,7 +552,7 @@ compare(const void *p, const void *q) } static int -glob1(Char *pattern, glob_t *pglob, size_t *limit) +glob1(Char *pattern, glob_t *pglob, struct glob_limit *limit) { Char pathbuf[MAXPATHLEN]; @@ -542,7 +570,7 @@ glob1(Char *pattern, glob_t *pglob, size */ static int glob2(Char *pathbuf, Char *pathend, Char *pathend_last, Char *pattern, - glob_t *pglob, size_t *limit) + glob_t *pglob, struct glob_limit *limit) { struct stat sb; Char *p, *q; @@ -558,6 +586,15 @@ glob2(Char *pathbuf, Char *pathend, Char if (g_lstat(pathbuf, &sb, pglob)) return(0); + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_stat_cnt++ >= GLOB_LIMIT_STAT) { + errno = 0; + if (pathend + 1 > pathend_last) + return (GLOB_ABORTED); + *pathend++ = SEP; + *pathend = EOS; + return (GLOB_NOSPACE); + } if (((pglob->gl_flags & GLOB_MARK) && pathend[-1] != SEP) && (S_ISDIR(sb.st_mode) || (S_ISLNK(sb.st_mode) && @@ -601,7 +638,7 @@ glob2(Char *pathbuf, Char *pathend, Char static int glob3(Char *pathbuf, Char *pathend, Char *pathend_last, Char *pattern, Char *restpattern, - glob_t *pglob, size_t *limit) + glob_t *pglob, struct glob_limit *limit) { struct dirent *dp; DIR *dirp; @@ -647,6 +684,19 @@ glob3(Char *pathbuf, Char *pathend, Char size_t clen; mbstate_t mbs; + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_readdir_cnt++ >= GLOB_LIMIT_READDIR) { + errno = 0; + if (pathend + 1 > pathend_last) + err = GLOB_ABORTED; + else { + *pathend++ = SEP; + *pathend = EOS; + err = GLOB_NOSPACE; + } + break; + } + /* Initial DOT must be matched literally. */ if (dp->d_name[0] == DOT && *pattern != DOT) continue; @@ -697,14 +747,15 @@ glob3(Char *pathbuf, Char *pathend, Char * gl_pathv points to (gl_offs + gl_pathc + 1) items. */ static int -globextend(const Char *path, glob_t *pglob, size_t *limit) +globextend(const Char *path, glob_t *pglob, struct glob_limit *limit) { char **pathv; size_t i, newsize, len; char *copy; const Char *p; - if (*limit && pglob->gl_pathc > *limit) { + if ((pglob->gl_flags & GLOB_LIMIT) && + pglob->gl_matchc > limit->l_path_lim) { errno = 0; return (GLOB_NOSPACE); } @@ -726,6 +777,12 @@ globextend(const Char *path, glob_t *pgl for (p = path; *p++;) continue; len = MB_CUR_MAX * (size_t)(p - path); /* XXX overallocation */ + limit->l_string_cnt += len; + if ((pglob->gl_flags & GLOB_LIMIT) && + limit->l_string_cnt >= GLOB_LIMIT_STRING) { + errno = 0; + return (GLOB_NOSPACE); + } if ((copy = malloc(len)) != NULL) { if (g_Ctoc(path, copy, len)) { free(copy); From owner-svn-src-stable@FreeBSD.ORG Tue Feb 5 14:53:06 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 375F5CC2; Tue, 5 Feb 2013 14:53:06 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1AFDEE35; Tue, 5 Feb 2013 14:53:06 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r15Er5jc016419; Tue, 5 Feb 2013 14:53:05 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r15Er52l016417; Tue, 5 Feb 2013 14:53:05 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201302051453.r15Er52l016417@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 5 Feb 2013 14:53:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246364 - stable/9/games/fortune/datfiles X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 14:53:06 -0000 Author: des Date: Tue Feb 5 14:53:05 2013 New Revision: 246364 URL: http://svnweb.freebsd.org/changeset/base/246364 Log: MFH r246362: remove political propaganda Modified: stable/9/games/fortune/datfiles/fortunes-o.real Directory Properties: stable/9/games/fortune/ (props changed) Modified: stable/9/games/fortune/datfiles/fortunes-o.real ============================================================================== --- stable/9/games/fortune/datfiles/fortunes-o.real Tue Feb 5 14:44:25 2013 (r246363) +++ stable/9/games/fortune/datfiles/fortunes-o.real Tue Feb 5 14:53:05 2013 (r246364) @@ -11437,233 +11437,6 @@ two new uses for sheep. Meat and wool. % Runners do it alone. % -Rush Limbaugh's 35 Undeniable Truths of Life: - -(1) The greatest threat to the human spirit is liberalism. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(10) Liberalism poisons the soul. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(11) Neither the United States, nor anyone else, "imposes" freedom on - the people of other nations. Freedom is not an imposition. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(12) Freedom is God-given. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(13) To dictatorships, peace means the absence of opposition. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(14) To free people, peace means the absence of threat. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(15) The Peace Movement in the United States was, whether by accident or - design, pro-communist. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(16) The collective knowledge and wisdom of seasoned citizens is the - most valuable, yet untapped, resource our young people have. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(17) The greatest football team in the history of civilization was the - Pittsburgh Steelers of 1975 through 1980. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(18) There is no such thing as "war atrocities." War is an atrocity. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(19) Regardless of the pain in our memories, nostalgia only reminds us - of the good times in our past. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(2) The single greatest threat to the free people of the world is posed - by the heinous idea of centralized government control. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(20) There is a God. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(21) Abortion is wrong. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(22) Morality is not defined by individual choice. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(23) Evolution cannot explain creation. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(24) Feminism was established so that unattractive women could have - easier access to the mainstream of society. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(25) Love is the only human emotion which cannot be controlled. You - either do or you don't. You can't fake it. (Except women, and - thank God they can.) - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(26) The only difference between Mikhail Gorbachev and previous Soviet - leaders is that he is alive. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(27) Soviet leaders were actually left-wing dictators. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(28) Abraham Lincoln saved this nation. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(29) The Los Angeles Raiders will never be the team they were when they - called Oakland home. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(3) Peace does not mean the elimination of nuclear weapons. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(30) The United States will again go to war. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(31) To more and more American intellectuals, a victorious United States - is a sinful United States. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(32) The fact that American intellectuals rue a victorious United States - is frightening and ominous. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(33) There will always be poor people. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(34) The fact that there will always be poor people is not the fault of - the rich. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(35) Rather than feel guilty as some do, you should thank God for making - you an American. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(4) Peace does not mean the absence of war. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(5) War is not obsolete. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(6) Ours is a world governed by the aggressive use of force. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(7) There is only one way to eliminate nuclear weapons. Use them. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(8) Peace cannot be achieved merely by developing an "understanding" - among peoples. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(9) Americans opposing America is not always sacred nor courageous ... - it is sometimes dangerous. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% Said a dainty young whore named Ms. Meggs, "The men like to spread my two legs, Then slip in between, From owner-svn-src-stable@FreeBSD.ORG Tue Feb 5 14:53:17 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 7E5F3DD7; Tue, 5 Feb 2013 14:53:17 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 622A8E38; Tue, 5 Feb 2013 14:53:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r15ErH4d016479; Tue, 5 Feb 2013 14:53:17 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r15ErHJk016478; Tue, 5 Feb 2013 14:53:17 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201302051453.r15ErHJk016478@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 5 Feb 2013 14:53:17 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246365 - stable/8/games/fortune/datfiles X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 14:53:17 -0000 Author: des Date: Tue Feb 5 14:53:16 2013 New Revision: 246365 URL: http://svnweb.freebsd.org/changeset/base/246365 Log: MFH r246362: remove political propaganda Modified: stable/8/games/fortune/datfiles/fortunes-o.real Directory Properties: stable/8/games/fortune/ (props changed) Modified: stable/8/games/fortune/datfiles/fortunes-o.real ============================================================================== --- stable/8/games/fortune/datfiles/fortunes-o.real Tue Feb 5 14:53:05 2013 (r246364) +++ stable/8/games/fortune/datfiles/fortunes-o.real Tue Feb 5 14:53:16 2013 (r246365) @@ -11437,233 +11437,6 @@ two new uses for sheep. Meat and wool. % Runners do it alone. % -Rush Limbaugh's 35 Undeniable Truths of Life: - -(1) The greatest threat to the human spirit is liberalism. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(10) Liberalism poisons the soul. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(11) Neither the United States, nor anyone else, "imposes" freedom on - the people of other nations. Freedom is not an imposition. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(12) Freedom is God-given. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(13) To dictatorships, peace means the absence of opposition. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(14) To free people, peace means the absence of threat. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(15) The Peace Movement in the United States was, whether by accident or - design, pro-communist. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(16) The collective knowledge and wisdom of seasoned citizens is the - most valuable, yet untapped, resource our young people have. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(17) The greatest football team in the history of civilization was the - Pittsburgh Steelers of 1975 through 1980. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(18) There is no such thing as "war atrocities." War is an atrocity. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(19) Regardless of the pain in our memories, nostalgia only reminds us - of the good times in our past. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(2) The single greatest threat to the free people of the world is posed - by the heinous idea of centralized government control. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(20) There is a God. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(21) Abortion is wrong. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(22) Morality is not defined by individual choice. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(23) Evolution cannot explain creation. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(24) Feminism was established so that unattractive women could have - easier access to the mainstream of society. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(25) Love is the only human emotion which cannot be controlled. You - either do or you don't. You can't fake it. (Except women, and - thank God they can.) - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(26) The only difference between Mikhail Gorbachev and previous Soviet - leaders is that he is alive. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(27) Soviet leaders were actually left-wing dictators. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(28) Abraham Lincoln saved this nation. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(29) The Los Angeles Raiders will never be the team they were when they - called Oakland home. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(3) Peace does not mean the elimination of nuclear weapons. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(30) The United States will again go to war. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(31) To more and more American intellectuals, a victorious United States - is a sinful United States. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(32) The fact that American intellectuals rue a victorious United States - is frightening and ominous. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(33) There will always be poor people. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(34) The fact that there will always be poor people is not the fault of - the rich. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(35) Rather than feel guilty as some do, you should thank God for making - you an American. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(4) Peace does not mean the absence of war. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(5) War is not obsolete. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(6) Ours is a world governed by the aggressive use of force. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(7) There is only one way to eliminate nuclear weapons. Use them. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(8) Peace cannot be achieved merely by developing an "understanding" - among peoples. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(9) Americans opposing America is not always sacred nor courageous ... - it is sometimes dangerous. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% Said a dainty young whore named Ms. Meggs, "The men like to spread my two legs, Then slip in between, From owner-svn-src-stable@FreeBSD.ORG Tue Feb 5 14:55:34 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E2642152; Tue, 5 Feb 2013 14:55:34 +0000 (UTC) (envelope-from des@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CBCFFE8C; Tue, 5 Feb 2013 14:55:34 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r15EtX36016857; Tue, 5 Feb 2013 14:55:33 GMT (envelope-from des@svn.freebsd.org) Received: (from des@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r15EtXrB016855; Tue, 5 Feb 2013 14:55:33 GMT (envelope-from des@svn.freebsd.org) Message-Id: <201302051455.r15EtXrB016855@svn.freebsd.org> From: Dag-Erling Smørgrav Date: Tue, 5 Feb 2013 14:55:33 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org Subject: svn commit: r246366 - stable/7/games/fortune/datfiles X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 14:55:35 -0000 Author: des Date: Tue Feb 5 14:55:33 2013 New Revision: 246366 URL: http://svnweb.freebsd.org/changeset/base/246366 Log: MFH r246362: remove political propaganda Modified: stable/7/games/fortune/datfiles/fortunes-o.real Directory Properties: stable/7/games/fortune/ (props changed) Modified: stable/7/games/fortune/datfiles/fortunes-o.real ============================================================================== --- stable/7/games/fortune/datfiles/fortunes-o.real Tue Feb 5 14:53:16 2013 (r246365) +++ stable/7/games/fortune/datfiles/fortunes-o.real Tue Feb 5 14:55:33 2013 (r246366) @@ -11437,233 +11437,6 @@ two new uses for sheep. Meat and wool. % Runners do it alone. % -Rush Limbaugh's 35 Undeniable Truths of Life: - -(1) The greatest threat to the human spirit is liberalism. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(10) Liberalism poisons the soul. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(11) Neither the United States, nor anyone else, "imposes" freedom on - the people of other nations. Freedom is not an imposition. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(12) Freedom is God-given. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(13) To dictatorships, peace means the absence of opposition. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(14) To free people, peace means the absence of threat. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(15) The Peace Movement in the United States was, whether by accident or - design, pro-communist. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(16) The collective knowledge and wisdom of seasoned citizens is the - most valuable, yet untapped, resource our young people have. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(17) The greatest football team in the history of civilization was the - Pittsburgh Steelers of 1975 through 1980. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(18) There is no such thing as "war atrocities." War is an atrocity. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(19) Regardless of the pain in our memories, nostalgia only reminds us - of the good times in our past. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(2) The single greatest threat to the free people of the world is posed - by the heinous idea of centralized government control. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(20) There is a God. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(21) Abortion is wrong. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(22) Morality is not defined by individual choice. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(23) Evolution cannot explain creation. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(24) Feminism was established so that unattractive women could have - easier access to the mainstream of society. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(25) Love is the only human emotion which cannot be controlled. You - either do or you don't. You can't fake it. (Except women, and - thank God they can.) - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(26) The only difference between Mikhail Gorbachev and previous Soviet - leaders is that he is alive. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(27) Soviet leaders were actually left-wing dictators. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(28) Abraham Lincoln saved this nation. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(29) The Los Angeles Raiders will never be the team they were when they - called Oakland home. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(3) Peace does not mean the elimination of nuclear weapons. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(30) The United States will again go to war. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(31) To more and more American intellectuals, a victorious United States - is a sinful United States. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(32) The fact that American intellectuals rue a victorious United States - is frightening and ominous. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(33) There will always be poor people. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(34) The fact that there will always be poor people is not the fault of - the rich. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(35) Rather than feel guilty as some do, you should thank God for making - you an American. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(4) Peace does not mean the absence of war. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(5) War is not obsolete. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(6) Ours is a world governed by the aggressive use of force. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(7) There is only one way to eliminate nuclear weapons. Use them. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(8) Peace cannot be achieved merely by developing an "understanding" - among peoples. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% -Rush Limbaugh's 35 Undeniable Truths of Life: - -(9) Americans opposing America is not always sacred nor courageous ... - it is sometimes dangerous. - - -- "The Limbaugh Letter," Copyright 1992, EFM Publishing, Inc. -% Said a dainty young whore named Ms. Meggs, "The men like to spread my two legs, Then slip in between, From owner-svn-src-stable@FreeBSD.ORG Tue Feb 5 19:10:51 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 05519E8; Tue, 5 Feb 2013 19:10:51 +0000 (UTC) (envelope-from dim@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DD3DA107; Tue, 5 Feb 2013 19:10:50 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r15JAobK097253; Tue, 5 Feb 2013 19:10:50 GMT (envelope-from dim@svn.freebsd.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r15JAoMn097251; Tue, 5 Feb 2013 19:10:50 GMT (envelope-from dim@svn.freebsd.org) Message-Id: <201302051910.r15JAoMn097251@svn.freebsd.org> From: Dimitry Andric Date: Tue, 5 Feb 2013 19:10:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246368 - in stable/9: gnu/lib/libsupc++ lib/libcxxrt X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Feb 2013 19:10:51 -0000 Author: dim Date: Tue Feb 5 19:10:50 2013 New Revision: 246368 URL: http://svnweb.freebsd.org/changeset/base/246368 Log: MFC r246028 (by theraven): Fix some symbol version mismatches between libstdc++ and libsupc++/libcxxrt that were causing the runtime and STL libraries to see different versions of various classes and functions when libstdc++ is used as a filter. Note: This changes the ABI for libcxxrt, but libcxxrt is currently only in -STABLE for testing and is not used by anything unless explicitly enabled by the end user. No default compiler configurations use it. libc++ will need to be recompiled after this change. make buildworld will do this automatically, but make in lib/libc++ will not necessarily work unless the new libcxxrt is installed first. PR: kern/171610, stand/175453 Reviewed by: kib MFC r246297: Add several missing symbols to libcxxrt's symbol version map, and remove a few duplicates. This should fix building world with -stdlib=libc++ after r246028. Submitted by: Yamaya Takashi Modified: stable/9/gnu/lib/libsupc++/Version.map stable/9/lib/libcxxrt/Version.map Directory Properties: stable/9/gnu/lib/libsupc++/ (props changed) stable/9/lib/libcxxrt/ (props changed) Modified: stable/9/gnu/lib/libsupc++/Version.map ============================================================================== --- stable/9/gnu/lib/libsupc++/Version.map Tue Feb 5 18:55:09 2013 (r246367) +++ stable/9/gnu/lib/libsupc++/Version.map Tue Feb 5 19:10:50 2013 (r246368) @@ -142,8 +142,37 @@ GLIBCXX_3.4 { _ZdaPvRKSt9nothrow_t; _ZdlPv; _ZdlPvRKSt9nothrow_t; + extern "C++" { + std::set_new_handler*; + std::set_terminate*; + std::set_unexpected*; + + std::bad_alloc; + std::bad_cast; + std::exception*; + + "typeinfo for std::bad_alloc"; + "typeinfo for std::bad_cast"; + "typeinfo for std::exception"; + + "typeinfo name for std::bad_alloc"; + "typeinfo name for std::bad_cast"; + "typeinfo name for std::exception"; + + "vtable for std::bad_alloc"; + "vtable for std::bad_cast"; + "vtable for std::exception"; + }; }; +GLIBCXX_3.4.9 { + extern "C++" { + "std::bad_alloc::what() const"; + "std::bad_cast::what() const"; + "std::bad_typeid::what() const"; + }; +} GLIBCXX_3.4; + CXXABI_1.3.1 { __cxa_get_exception_ptr; Modified: stable/9/lib/libcxxrt/Version.map ============================================================================== --- stable/9/lib/libcxxrt/Version.map Tue Feb 5 18:55:09 2013 (r246367) +++ stable/9/lib/libcxxrt/Version.map Tue Feb 5 19:10:50 2013 (r246368) @@ -208,19 +208,7 @@ CXXABI_1.3 { "typeinfo name for __cxxabiv1::__vmi_class_type_info"; "std::type_info::type_info(std::type_info const&)"; - "std::type_info::type_info(std::type_info const&)"; - "std::type_info::~type_info()"; - "std::type_info::~type_info()"; - "std::type_info::~type_info()"; "std::type_info::operator=(std::type_info const&)"; - "std::unexpected()"; - "std::get_terminate()"; - "std::set_terminate(void (*)())"; - "std::get_unexpected()"; - "std::set_unexpected(void (*)())"; - "std::set_new_handler(void (*)())"; - "std::uncaught_exception()"; - "std::terminate()"; # Extensions @@ -243,69 +231,22 @@ CXXABI_1.3.1 { CXXRT_1.0 { extern "C++" { - "std::bad_cast::what() const"; - "std::bad_typeid::what() const"; - "std::bad_alloc::what() const"; - "std::exception::what() const"; "std::type_info::name() const"; "std::type_info::before(std::type_info const&) const"; "std::type_info::operator==(std::type_info const&) const"; "std::type_info::operator!=(std::type_info const&) const"; - "std::bad_typeid::bad_typeid(std::bad_typeid const&)"; - "std::bad_typeid::bad_typeid()"; - "std::bad_typeid::bad_typeid(std::bad_typeid const&)"; - "std::bad_typeid::bad_typeid()"; - "std::bad_typeid::~bad_typeid()"; - "std::bad_typeid::~bad_typeid()"; - "std::bad_typeid::~bad_typeid()"; - "std::bad_typeid::operator=(std::bad_typeid const&)"; "std::bad_cast::bad_cast(std::bad_cast const&)"; "std::bad_cast::bad_cast()"; - "std::bad_cast::bad_cast(std::bad_cast const&)"; - "std::bad_cast::bad_cast()"; - "std::bad_cast::~bad_cast()"; - "std::bad_cast::~bad_cast()"; - "std::bad_cast::~bad_cast()"; "std::bad_cast::operator=(std::bad_cast const&)"; - "std::bad_alloc::bad_alloc(std::bad_alloc const&)"; - "std::bad_alloc::bad_alloc()"; - "std::bad_alloc::bad_alloc(std::bad_alloc const&)"; - "std::bad_alloc::bad_alloc()"; - "std::bad_alloc::~bad_alloc()"; - "std::bad_alloc::~bad_alloc()"; - "std::bad_alloc::~bad_alloc()"; - "std::bad_alloc::operator=(std::bad_alloc const&)"; - "std::exception::exception(std::exception const&)"; - "std::exception::exception()"; + "std::bad_typeid::bad_typeid(std::bad_typeid const&)"; + "std::bad_typeid::bad_typeid()"; + "std::bad_typeid::operator=(std::bad_typeid const&)"; "std::exception::exception(std::exception const&)"; "std::exception::exception()"; - "std::exception::~exception()"; - "std::exception::~exception()"; - "std::exception::~exception()"; "std::exception::operator=(std::exception const&)"; - - - "vtable for std::bad_typeid"; - "vtable for std::bad_cast"; - "vtable for std::bad_alloc"; - "vtable for std::exception"; - "vtable for std::type_info"; - "typeinfo for std::bad_typeid"; - "typeinfo for std::bad_cast"; - "typeinfo for std::bad_alloc"; - "typeinfo for std::exception"; - "typeinfo for std::type_info"; - "typeinfo name for std::bad_typeid"; - "typeinfo name for std::bad_cast"; - "typeinfo name for std::bad_alloc"; - "typeinfo name for std::exception"; - "typeinfo name for std::type_info"; - - "std::type_info::__is_function_p() const"; - "std::type_info::__do_upcast(__cxxabiv1::__class_type_info const*, void**) const"; - "std::type_info::__is_pointer_p() const"; - - + "std::bad_alloc::bad_alloc(std::bad_alloc const&)"; + "std::bad_alloc::bad_alloc()"; + "std::bad_alloc::operator=(std::bad_alloc const&)"; }; __cxa_allocate_dependent_exception; @@ -317,6 +258,7 @@ CXXRT_1.0 { } CXXABI_1.3.1; + GLIBCXX_3.4 { extern "C++" { "operator delete[](void*)"; @@ -327,5 +269,51 @@ GLIBCXX_3.4 { "operator new[](unsigned long)"; "operator new(unsigned long)"; "operator new(unsigned long, std::nothrow_t const&)"; + + "std::unexpected()"; + "std::get_terminate()"; + "std::get_unexpected()"; + "std::uncaught_exception()"; + "std::terminate()"; + + "std::type_info::~type_info()"; + "std::bad_cast::~bad_cast()"; + "std::bad_typeid::~bad_typeid()"; + "std::exception::~exception()"; + "std::bad_alloc::~bad_alloc()"; + + "std::exception::what() const"; + + std::set_new_handler*; + std::set_terminate*; + std::set_unexpected*; + std::type_info::__*; + + "vtable for std::bad_alloc"; + "vtable for std::bad_cast"; + "vtable for std::bad_typeid"; + "vtable for std::exception"; + "vtable for std::type_info"; + + "typeinfo for std::bad_alloc"; + "typeinfo for std::bad_typeid"; + "typeinfo for std::bad_cast"; + "typeinfo for std::exception"; + "typeinfo for std::type_info"; + "typeinfo name for std::bad_alloc"; + "typeinfo name for std::bad_typeid"; + "typeinfo name for std::bad_cast"; + "typeinfo name for std::exception"; + "typeinfo name for std::type_info"; + }; }; + +GLIBCXX_3.4.9 { + extern "C++" { + "std::bad_typeid::what() const"; + "std::bad_cast::what() const"; + "std::bad_alloc::what() const"; + }; +} GLIBCXX_3.4; + From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 00:42:24 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C6D6D5E8; Wed, 6 Feb 2013 00:42:24 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A47C619A; Wed, 6 Feb 2013 00:42:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r160gOaI003271; Wed, 6 Feb 2013 00:42:24 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r160gN3x003262; Wed, 6 Feb 2013 00:42:23 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302060042.r160gN3x003262@svn.freebsd.org> From: Xin LI Date: Wed, 6 Feb 2013 00:42:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246373 - stable/9/contrib/one-true-awk X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 00:42:24 -0000 Author: delphij Date: Wed Feb 6 00:42:23 2013 New Revision: 246373 URL: http://svnweb.freebsd.org/changeset/base/246373 Log: MFC: one-true-awk 20121220. Modified: stable/9/contrib/one-true-awk/FIXES stable/9/contrib/one-true-awk/main.c stable/9/contrib/one-true-awk/makefile stable/9/contrib/one-true-awk/proto.h stable/9/contrib/one-true-awk/run.c stable/9/contrib/one-true-awk/tran.c Directory Properties: stable/9/contrib/one-true-awk/ (props changed) Modified: stable/9/contrib/one-true-awk/FIXES ============================================================================== --- stable/9/contrib/one-true-awk/FIXES Wed Feb 6 00:01:28 2013 (r246372) +++ stable/9/contrib/one-true-awk/FIXES Wed Feb 6 00:42:23 2013 (r246373) @@ -25,6 +25,22 @@ THIS SOFTWARE. This file lists all bug fixes, changes, etc., made since the AWK book was sent to the printers in August, 1987. +Dec 20, 2012: + fiddled makefile to get correct yacc and bison flags. pick yacc + (linux) or bison (mac) as necessary. + + added __attribute__((__noreturn__)) to a couple of lines in + proto.h, to silence someone's enthusiastic checker. + + fixed obscure call by value bug in split(a[1],a) reported on + 9fans. the management of temporary values is just a mess; i + took a shortcut by making an extra string copy. thanks + to paul patience and arnold robbins for passing it on and for + proposed patches. + + tiny fiddle in setfval to eliminate -0 results in T.expr, which + has irritated me for 20+ years. + Aug 10, 2011: another fix to avoid core dump with delete(ARGV); again, many thanks to ruslan ermilov. Modified: stable/9/contrib/one-true-awk/main.c ============================================================================== --- stable/9/contrib/one-true-awk/main.c Wed Feb 6 00:01:28 2013 (r246372) +++ stable/9/contrib/one-true-awk/main.c Wed Feb 6 00:42:23 2013 (r246373) @@ -25,7 +25,7 @@ THIS SOFTWARE. #include __FBSDID("$FreeBSD$"); -const char *version = "version 20110810 (FreeBSD)"; +const char *version = "version 20121220 (FreeBSD)"; #define DEBUG #include Modified: stable/9/contrib/one-true-awk/makefile ============================================================================== --- stable/9/contrib/one-true-awk/makefile Wed Feb 6 00:01:28 2013 (r246372) +++ stable/9/contrib/one-true-awk/makefile Wed Feb 6 00:42:23 2013 (r246373) @@ -26,15 +26,15 @@ CFLAGS = -g CFLAGS = -O2 CFLAGS = -CC = gcc -Wall -g -CC = cc CC = gcc -Wall -g -Wwrite-strings CC = gcc -fprofile-arcs -ftest-coverage # then gcov f1.c; cat f1.c.gcov +CC = gcc -g -Wall -pedantic CC = gcc -O4 -Wall -pedantic -fno-strict-aliasing -YACC = bison -y -YACC = yacc -YFLAGS = -d +YACC = bison -d -y +YACC = yacc -d -S +#YFLAGS = -d -S + # -S uses sprintf in yacc parser instead of sprint OFILES = b.o main.o parse.o proctab.o tran.o lib.o run.o lex.o Modified: stable/9/contrib/one-true-awk/proto.h ============================================================================== --- stable/9/contrib/one-true-awk/proto.h Wed Feb 6 00:01:28 2013 (r246372) +++ stable/9/contrib/one-true-awk/proto.h Wed Feb 6 00:42:23 2013 (r246373) @@ -46,7 +46,7 @@ extern void freetr(Node *); extern int hexstr(uschar **); extern int quoted(uschar **); extern char *cclenter(const char *); -extern void overflo(const char *); +extern void overflo(const char *) __attribute__((__noreturn__)); extern void cfoll(fa *, Node *); extern int first(Node *); extern void follow(Node *); @@ -132,7 +132,7 @@ extern void fpecatch(int); extern void bracecheck(void); extern void bcheck2(int, int, int); extern void SYNTAX(const char *, ...); -extern void FATAL(const char *, ...); +extern void FATAL(const char *, ...) __attribute__((__noreturn__)); extern void WARNING(const char *, ...); extern void error(void); extern void eprint(void); Modified: stable/9/contrib/one-true-awk/run.c ============================================================================== --- stable/9/contrib/one-true-awk/run.c Wed Feb 6 00:01:28 2013 (r246372) +++ stable/9/contrib/one-true-awk/run.c Wed Feb 6 00:42:23 2013 (r246373) @@ -1213,13 +1213,13 @@ Cell *dopa2(Node **a, int n) /* a[0], a[ Cell *split(Node **a, int nnn) /* split(a[0], a[1], a[2]); a[3] is type */ { Cell *x = 0, *y, *ap; - char *s; + char *s, *origs; int sep; char *t, temp, num[50], *fs = 0; int n, tempstat, arg3type; y = execute(a[0]); /* source string */ - s = getsval(y); + origs = s = strdup(getsval(y)); arg3type = ptoi(a[3]); if (a[2] == 0) /* fs string */ fs = *FS; @@ -1339,6 +1339,7 @@ Cell *split(Node **a, int nnn) /* split( } tempfree(ap); tempfree(y); + free(origs); if (a[2] != 0 && arg3type == STRING) { tempfree(x); } Modified: stable/9/contrib/one-true-awk/tran.c ============================================================================== --- stable/9/contrib/one-true-awk/tran.c Wed Feb 6 00:01:28 2013 (r246372) +++ stable/9/contrib/one-true-awk/tran.c Wed Feb 6 00:42:23 2013 (r246373) @@ -298,6 +298,8 @@ Awkfloat setfval(Cell *vp, Awkfloat f) / xfree(vp->sval); /* free any previous string */ vp->tval &= ~STR; /* mark string invalid */ vp->tval |= NUM; /* mark number ok */ + if (f == -0) /* who would have thought this possible? */ + f = 0; dprintf( ("setfval %p: %s = %g, t=%o\n", (void*)vp, NN(vp->nval), f, vp->tval) ); return vp->fval = f; } From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 00:43:12 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0CF3C75E; Wed, 6 Feb 2013 00:43:12 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D89921A7; Wed, 6 Feb 2013 00:43:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r160hBR7003425; Wed, 6 Feb 2013 00:43:11 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r160hAJZ003418; Wed, 6 Feb 2013 00:43:10 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302060043.r160hAJZ003418@svn.freebsd.org> From: Xin LI Date: Wed, 6 Feb 2013 00:43:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246374 - stable/8/contrib/one-true-awk X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 00:43:12 -0000 Author: delphij Date: Wed Feb 6 00:43:10 2013 New Revision: 246374 URL: http://svnweb.freebsd.org/changeset/base/246374 Log: MFC: one-true-awk 20121220. Modified: stable/8/contrib/one-true-awk/FIXES stable/8/contrib/one-true-awk/main.c stable/8/contrib/one-true-awk/makefile stable/8/contrib/one-true-awk/proto.h stable/8/contrib/one-true-awk/run.c stable/8/contrib/one-true-awk/tran.c Directory Properties: stable/8/contrib/one-true-awk/ (props changed) Modified: stable/8/contrib/one-true-awk/FIXES ============================================================================== --- stable/8/contrib/one-true-awk/FIXES Wed Feb 6 00:42:23 2013 (r246373) +++ stable/8/contrib/one-true-awk/FIXES Wed Feb 6 00:43:10 2013 (r246374) @@ -25,6 +25,22 @@ THIS SOFTWARE. This file lists all bug fixes, changes, etc., made since the AWK book was sent to the printers in August, 1987. +Dec 20, 2012: + fiddled makefile to get correct yacc and bison flags. pick yacc + (linux) or bison (mac) as necessary. + + added __attribute__((__noreturn__)) to a couple of lines in + proto.h, to silence someone's enthusiastic checker. + + fixed obscure call by value bug in split(a[1],a) reported on + 9fans. the management of temporary values is just a mess; i + took a shortcut by making an extra string copy. thanks + to paul patience and arnold robbins for passing it on and for + proposed patches. + + tiny fiddle in setfval to eliminate -0 results in T.expr, which + has irritated me for 20+ years. + Aug 10, 2011: another fix to avoid core dump with delete(ARGV); again, many thanks to ruslan ermilov. Modified: stable/8/contrib/one-true-awk/main.c ============================================================================== --- stable/8/contrib/one-true-awk/main.c Wed Feb 6 00:42:23 2013 (r246373) +++ stable/8/contrib/one-true-awk/main.c Wed Feb 6 00:43:10 2013 (r246374) @@ -25,7 +25,7 @@ THIS SOFTWARE. #include __FBSDID("$FreeBSD$"); -const char *version = "version 20110810 (FreeBSD)"; +const char *version = "version 20121220 (FreeBSD)"; #define DEBUG #include Modified: stable/8/contrib/one-true-awk/makefile ============================================================================== --- stable/8/contrib/one-true-awk/makefile Wed Feb 6 00:42:23 2013 (r246373) +++ stable/8/contrib/one-true-awk/makefile Wed Feb 6 00:43:10 2013 (r246374) @@ -26,15 +26,15 @@ CFLAGS = -g CFLAGS = -O2 CFLAGS = -CC = gcc -Wall -g -CC = cc CC = gcc -Wall -g -Wwrite-strings CC = gcc -fprofile-arcs -ftest-coverage # then gcov f1.c; cat f1.c.gcov +CC = gcc -g -Wall -pedantic CC = gcc -O4 -Wall -pedantic -fno-strict-aliasing -YACC = bison -y -YACC = yacc -YFLAGS = -d +YACC = bison -d -y +YACC = yacc -d -S +#YFLAGS = -d -S + # -S uses sprintf in yacc parser instead of sprint OFILES = b.o main.o parse.o proctab.o tran.o lib.o run.o lex.o Modified: stable/8/contrib/one-true-awk/proto.h ============================================================================== --- stable/8/contrib/one-true-awk/proto.h Wed Feb 6 00:42:23 2013 (r246373) +++ stable/8/contrib/one-true-awk/proto.h Wed Feb 6 00:43:10 2013 (r246374) @@ -46,7 +46,7 @@ extern void freetr(Node *); extern int hexstr(uschar **); extern int quoted(uschar **); extern char *cclenter(const char *); -extern void overflo(const char *); +extern void overflo(const char *) __attribute__((__noreturn__)); extern void cfoll(fa *, Node *); extern int first(Node *); extern void follow(Node *); @@ -132,7 +132,7 @@ extern void fpecatch(int); extern void bracecheck(void); extern void bcheck2(int, int, int); extern void SYNTAX(const char *, ...); -extern void FATAL(const char *, ...); +extern void FATAL(const char *, ...) __attribute__((__noreturn__)); extern void WARNING(const char *, ...); extern void error(void); extern void eprint(void); Modified: stable/8/contrib/one-true-awk/run.c ============================================================================== --- stable/8/contrib/one-true-awk/run.c Wed Feb 6 00:42:23 2013 (r246373) +++ stable/8/contrib/one-true-awk/run.c Wed Feb 6 00:43:10 2013 (r246374) @@ -1213,13 +1213,13 @@ Cell *dopa2(Node **a, int n) /* a[0], a[ Cell *split(Node **a, int nnn) /* split(a[0], a[1], a[2]); a[3] is type */ { Cell *x = 0, *y, *ap; - char *s; + char *s, *origs; int sep; char *t, temp, num[50], *fs = 0; int n, tempstat, arg3type; y = execute(a[0]); /* source string */ - s = getsval(y); + origs = s = strdup(getsval(y)); arg3type = ptoi(a[3]); if (a[2] == 0) /* fs string */ fs = *FS; @@ -1339,6 +1339,7 @@ Cell *split(Node **a, int nnn) /* split( } tempfree(ap); tempfree(y); + free(origs); if (a[2] != 0 && arg3type == STRING) { tempfree(x); } Modified: stable/8/contrib/one-true-awk/tran.c ============================================================================== --- stable/8/contrib/one-true-awk/tran.c Wed Feb 6 00:42:23 2013 (r246373) +++ stable/8/contrib/one-true-awk/tran.c Wed Feb 6 00:43:10 2013 (r246374) @@ -298,6 +298,8 @@ Awkfloat setfval(Cell *vp, Awkfloat f) / xfree(vp->sval); /* free any previous string */ vp->tval &= ~STR; /* mark string invalid */ vp->tval |= NUM; /* mark number ok */ + if (f == -0) /* who would have thought this possible? */ + f = 0; dprintf( ("setfval %p: %s = %g, t=%o\n", (void*)vp, NN(vp->nval), f, vp->tval) ); return vp->fval = f; } From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 02:51:26 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 97475E67; Wed, 6 Feb 2013 02:51:26 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 71B7D7E1; Wed, 6 Feb 2013 02:51:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r162pQSI042069; Wed, 6 Feb 2013 02:51:26 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r162pQVQ042067; Wed, 6 Feb 2013 02:51:26 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201302060251.r162pQVQ042067@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 6 Feb 2013 02:51:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246376 - stable/9/sys/ufs/ufs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 02:51:26 -0000 Author: pfg Date: Wed Feb 6 02:51:25 2013 New Revision: 246376 URL: http://svnweb.freebsd.org/changeset/base/246376 Log: MFC r246299; UFS: Remove dead assignment. PR: kern/175794 Submitted by: Christoph Mallon Modified: stable/9/sys/ufs/ufs/ufs_lookup.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/9/sys/ufs/ufs/ufs_lookup.c Wed Feb 6 01:03:13 2013 (r246375) +++ stable/9/sys/ufs/ufs/ufs_lookup.c Wed Feb 6 02:51:25 2013 (r246376) @@ -1432,7 +1432,6 @@ ufs_checkpath(ino_t source_ino, ino_t pa return (0); if (target->i_number == ROOTINO) return (0); - error = 0; for (;;) { error = ufs_dir_dd_ino(vp, cred, &dd_ino); if (error != 0) From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 03:00:18 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E5477186; Wed, 6 Feb 2013 03:00:18 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D7D9282D; Wed, 6 Feb 2013 03:00:18 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1630Iq5043401; Wed, 6 Feb 2013 03:00:18 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1630Ir7043400; Wed, 6 Feb 2013 03:00:18 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201302060300.r1630Ir7043400@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Wed, 6 Feb 2013 03:00:18 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246377 - stable/8/sys/ufs/ufs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 03:00:19 -0000 Author: pfg Date: Wed Feb 6 03:00:18 2013 New Revision: 246377 URL: http://svnweb.freebsd.org/changeset/base/246377 Log: MFC r246299; UFS: Remove dead assignment. PR: kern/175794 Submitted by: Christoph Mallon Modified: stable/8/sys/ufs/ufs/ufs_lookup.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/ufs/ (props changed) Modified: stable/8/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/8/sys/ufs/ufs/ufs_lookup.c Wed Feb 6 02:51:25 2013 (r246376) +++ stable/8/sys/ufs/ufs/ufs_lookup.c Wed Feb 6 03:00:18 2013 (r246377) @@ -1415,7 +1415,6 @@ ufs_checkpath(ino_t source_ino, ino_t pa return (0); if (target->i_number == ROOTINO) return (0); - error = 0; for (;;) { error = ufs_dir_dd_ino(vp, cred, &dd_ino); if (error != 0) From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 07:20:09 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EB976813; Wed, 6 Feb 2013 07:20:09 +0000 (UTC) (envelope-from hrs@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DE79D246; Wed, 6 Feb 2013 07:20:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r167K9um021334; Wed, 6 Feb 2013 07:20:09 GMT (envelope-from hrs@svn.freebsd.org) Received: (from hrs@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r167K9jE021333; Wed, 6 Feb 2013 07:20:09 GMT (envelope-from hrs@svn.freebsd.org) Message-Id: <201302060720.r167K9jE021333@svn.freebsd.org> From: Hiroki Sato Date: Wed, 6 Feb 2013 07:20:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246386 - stable/9/sys/ia64/conf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 07:20:10 -0000 Author: hrs Date: Wed Feb 6 07:20:09 2013 New Revision: 246386 URL: http://svnweb.freebsd.org/changeset/base/246386 Log: MFC: Remove firewire devices missed in r244992. Modified: stable/9/sys/ia64/conf/GENERIC Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/ia64/conf/GENERIC ============================================================================== --- stable/9/sys/ia64/conf/GENERIC Wed Feb 6 06:44:42 2013 (r246385) +++ stable/9/sys/ia64/conf/GENERIC Wed Feb 6 07:20:09 2013 (r246386) @@ -167,11 +167,6 @@ device uslcom # SI Labs CP2101/CP2102 device uvisor # Visor and Palm devices device uvscom # USB serial support for DDI pocket's PHS -# FireWire support -device fwip # IP over FireWire (RFC 2734,3146) -# sbp(4) works for some systems but causes boot failure on others -#device sbp # SCSI over FireWire (need scbus & da) - # Various (pseudo) devices device ether # Ethernet support device faith # IPv6-to-IPv4 relaying (translation) From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 11:08:12 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 00CB1E70; Wed, 6 Feb 2013 11:08:11 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id DB0AC118; Wed, 6 Feb 2013 11:08:11 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r16B8BKf088653; Wed, 6 Feb 2013 11:08:11 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16B8BF1088652; Wed, 6 Feb 2013 11:08:11 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201302061108.r16B8BF1088652@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 6 Feb 2013 11:08:11 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246395 - stable/9/sys/dev/usb/controller X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 11:08:12 -0000 Author: hselasky Date: Wed Feb 6 11:08:11 2013 New Revision: 246395 URL: http://svnweb.freebsd.org/changeset/base/246395 Log: MFC r246113 and r246126: Add missing NULL pointer check. Reported by: Lars Engels Modified: stable/9/sys/dev/usb/controller/xhci.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/dev/ (props changed) Modified: stable/9/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/9/sys/dev/usb/controller/xhci.c Wed Feb 6 08:29:00 2013 (r246394) +++ stable/9/sys/dev/usb/controller/xhci.c Wed Feb 6 11:08:11 2013 (r246395) @@ -886,6 +886,12 @@ xhci_check_transfer(struct xhci_softc *s * a short packet also makes the transfer done */ if (td->remainder > 0) { + if (td->alt_next == NULL) { + DPRINTF( + "short TD has no alternate next\n"); + xhci_generic_done(xfer); + break; + } DPRINTF("TD has short pkt\n"); if (xfer->flags_int.short_frames_ok || xfer->flags_int.isochronous_xfr || From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 11:10:42 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C4CD3FF8; Wed, 6 Feb 2013 11:10:42 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id AC494132; Wed, 6 Feb 2013 11:10:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r16BAgRo090604; Wed, 6 Feb 2013 11:10:42 GMT (envelope-from hselasky@svn.freebsd.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16BAgiQ090602; Wed, 6 Feb 2013 11:10:42 GMT (envelope-from hselasky@svn.freebsd.org) Message-Id: <201302061110.r16BAgiQ090602@svn.freebsd.org> From: Hans Petter Selasky Date: Wed, 6 Feb 2013 11:10:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246396 - stable/8/sys/dev/usb/controller X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 11:10:42 -0000 Author: hselasky Date: Wed Feb 6 11:10:41 2013 New Revision: 246396 URL: http://svnweb.freebsd.org/changeset/base/246396 Log: MFC r246113 and r246126: Add missing NULL pointer check. Reported by: Lars Engels Modified: stable/8/sys/dev/usb/controller/xhci.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/dev/ (props changed) stable/8/sys/dev/usb/ (props changed) Modified: stable/8/sys/dev/usb/controller/xhci.c ============================================================================== --- stable/8/sys/dev/usb/controller/xhci.c Wed Feb 6 11:08:11 2013 (r246395) +++ stable/8/sys/dev/usb/controller/xhci.c Wed Feb 6 11:10:41 2013 (r246396) @@ -886,6 +886,12 @@ xhci_check_transfer(struct xhci_softc *s * a short packet also makes the transfer done */ if (td->remainder > 0) { + if (td->alt_next == NULL) { + DPRINTF( + "short TD has no alternate next\n"); + xhci_generic_done(xfer); + break; + } DPRINTF("TD has short pkt\n"); if (xfer->flags_int.short_frames_ok || xfer->flags_int.isochronous_xfr || From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 13:13:16 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 5430D784; Wed, 6 Feb 2013 13:13:16 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 46ED48FD; Wed, 6 Feb 2013 13:13:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r16DDGqt023752; Wed, 6 Feb 2013 13:13:16 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16DDGoY023751; Wed, 6 Feb 2013 13:13:16 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201302061313.r16DDGoY023751@svn.freebsd.org> From: Andrey Zonov Date: Wed, 6 Feb 2013 13:13:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246400 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 13:13:16 -0000 Author: zont Date: Wed Feb 6 13:13:15 2013 New Revision: 246400 URL: http://svnweb.freebsd.org/changeset/base/246400 Log: MFC r245457: - Detect when we are in KVM. Modified: stable/9/sys/kern/subr_param.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/subr_param.c ============================================================================== --- stable/9/sys/kern/subr_param.c Wed Feb 6 11:59:32 2013 (r246399) +++ stable/9/sys/kern/subr_param.c Wed Feb 6 13:13:15 2013 (r246400) @@ -159,6 +159,7 @@ static const char *const vm_bnames[] = { "Plex86", /* Plex86 */ "Bochs", /* Bochs */ "Xen", /* Xen */ + "Seabios", /* KVM */ NULL }; @@ -167,6 +168,7 @@ static const char *const vm_pnames[] = { "Virtual Machine", /* Microsoft VirtualPC */ "VirtualBox", /* Sun xVM VirtualBox */ "Parallels Virtual Platform", /* Parallels VM */ + "KVM", /* KVM */ NULL }; From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 13:14:31 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 68F0C923; Wed, 6 Feb 2013 13:14:31 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5673A914; Wed, 6 Feb 2013 13:14:31 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r16DEVrS023957; Wed, 6 Feb 2013 13:14:31 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16DEVOh023956; Wed, 6 Feb 2013 13:14:31 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201302061314.r16DEVOh023956@svn.freebsd.org> From: Andrey Zonov Date: Wed, 6 Feb 2013 13:14:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246401 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 13:14:31 -0000 Author: zont Date: Wed Feb 6 13:14:30 2013 New Revision: 246401 URL: http://svnweb.freebsd.org/changeset/base/246401 Log: MFC r245457: - Detect when we are in KVM. Modified: stable/8/sys/kern/subr_param.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/kern/ (props changed) Modified: stable/8/sys/kern/subr_param.c ============================================================================== --- stable/8/sys/kern/subr_param.c Wed Feb 6 13:13:15 2013 (r246400) +++ stable/8/sys/kern/subr_param.c Wed Feb 6 13:14:30 2013 (r246401) @@ -155,6 +155,7 @@ static const char *const vm_bnames[] = { "Plex86", /* Plex86 */ "Bochs", /* Bochs */ "Xen", /* Xen */ + "Seabios", /* KVM */ NULL }; @@ -163,6 +164,7 @@ static const char *const vm_pnames[] = { "Virtual Machine", /* Microsoft VirtualPC */ "VirtualBox", /* Sun xVM VirtualBox */ "Parallels Virtual Platform", /* Parallels VM */ + "KVM", /* KVM */ NULL }; From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 13:16:44 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 0C960CE3; Wed, 6 Feb 2013 13:16:44 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F379F93E; Wed, 6 Feb 2013 13:16:43 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r16DGh6Y024338; Wed, 6 Feb 2013 13:16:43 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16DGh6m024337; Wed, 6 Feb 2013 13:16:43 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201302061316.r16DGh6m024337@svn.freebsd.org> From: Andrey Zonov Date: Wed, 6 Feb 2013 13:16:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246402 - stable/9/usr.sbin/inetd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 13:16:44 -0000 Author: zont Date: Wed Feb 6 13:16:43 2013 New Revision: 246402 URL: http://svnweb.freebsd.org/changeset/base/246402 Log: MFC r245696: - Force inetd to have listen queue size to be set to the value of kern.ipc.somaxconn instead of hardcoded value 64. Modified: stable/9/usr.sbin/inetd/inetd.c Directory Properties: stable/9/usr.sbin/inetd/ (props changed) Modified: stable/9/usr.sbin/inetd/inetd.c ============================================================================== --- stable/9/usr.sbin/inetd/inetd.c Wed Feb 6 13:14:30 2013 (r246401) +++ stable/9/usr.sbin/inetd/inetd.c Wed Feb 6 13:16:43 2013 (r246402) @@ -1387,7 +1387,7 @@ setsockopt(fd, SOL_SOCKET, opt, (char *) } } if (sep->se_socktype == SOCK_STREAM) - listen(sep->se_fd, 64); + listen(sep->se_fd, -1); enable(sep); if (debug) { warnx("registered %s on %d", From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 13:17:42 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8C8DFEF6; Wed, 6 Feb 2013 13:17:42 +0000 (UTC) (envelope-from zont@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 7E92C95D; Wed, 6 Feb 2013 13:17:42 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r16DHgxs024484; Wed, 6 Feb 2013 13:17:42 GMT (envelope-from zont@svn.freebsd.org) Received: (from zont@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16DHgxf024483; Wed, 6 Feb 2013 13:17:42 GMT (envelope-from zont@svn.freebsd.org) Message-Id: <201302061317.r16DHgxf024483@svn.freebsd.org> From: Andrey Zonov Date: Wed, 6 Feb 2013 13:17:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246403 - stable/8/usr.sbin/inetd X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 13:17:42 -0000 Author: zont Date: Wed Feb 6 13:17:41 2013 New Revision: 246403 URL: http://svnweb.freebsd.org/changeset/base/246403 Log: MFC r245696: - Force inetd to have listen queue size to be set to the value of kern.ipc.somaxconn instead of hardcoded value 64. Modified: stable/8/usr.sbin/inetd/inetd.c Directory Properties: stable/8/usr.sbin/inetd/ (props changed) Modified: stable/8/usr.sbin/inetd/inetd.c ============================================================================== --- stable/8/usr.sbin/inetd/inetd.c Wed Feb 6 13:16:43 2013 (r246402) +++ stable/8/usr.sbin/inetd/inetd.c Wed Feb 6 13:17:41 2013 (r246403) @@ -1387,7 +1387,7 @@ setsockopt(fd, SOL_SOCKET, opt, (char *) } } if (sep->se_socktype == SOCK_STREAM) - listen(sep->se_fd, 64); + listen(sep->se_fd, -1); enable(sep); if (debug) { warnx("registered %s on %d", From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 13:49:57 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 0B07BB29; Wed, 6 Feb 2013 13:49:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F1BC6ACC; Wed, 6 Feb 2013 13:49:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r16DnuYi032654; Wed, 6 Feb 2013 13:49:56 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16DnuQ3032653; Wed, 6 Feb 2013 13:49:56 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302061349.r16DnuQ3032653@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 6 Feb 2013 13:49:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246404 - stable/9/sys/kern X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 13:49:57 -0000 Author: kib Date: Wed Feb 6 13:49:56 2013 New Revision: 246404 URL: http://svnweb.freebsd.org/changeset/base/246404 Log: MFC r246118: The case of pid == WAIT_MYPGRP for the kern_wait() is already handled in kern_wait6(), which is called by kern_wait(). Remove the redundand check, introduced in r243136, and add a comment noting this, to make the code less confusing. Modified: stable/9/sys/kern/kern_exit.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/kern/kern_exit.c ============================================================================== --- stable/9/sys/kern/kern_exit.c Wed Feb 6 13:17:41 2013 (r246403) +++ stable/9/sys/kern/kern_exit.c Wed Feb 6 13:49:56 2013 (r246404) @@ -1019,20 +1019,18 @@ kern_wait(struct thread *td, pid_t pid, struct rusage *rusage) { struct __wrusage wru, *wrup; - struct proc *q; idtype_t idtype; id_t id; int ret; + /* + * Translate the special pid values into the (idtype, pid) + * pair for kern_wait6. The WAIT_MYPGRP case is handled by + * kern_wait6() on its own. + */ if (pid == WAIT_ANY) { idtype = P_ALL; id = 0; - } else if (pid == WAIT_MYPGRP) { - idtype = P_PGID; - q = td->td_proc; - PROC_LOCK(q); - id = (id_t)q->p_pgid; - PROC_UNLOCK(q); } else if (pid < 0) { idtype = P_PGID; id = (id_t)-pid; @@ -1040,10 +1038,12 @@ kern_wait(struct thread *td, pid_t pid, idtype = P_PID; id = (id_t)pid; } + if (rusage != NULL) wrup = &wru; else wrup = NULL; + /* * For backward compatibility we implicitly add flags WEXITED * and WTRAPPED here. From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 13:54:00 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 32E78D53; Wed, 6 Feb 2013 13:54:00 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 01AD1AF4; Wed, 6 Feb 2013 13:54:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r16DrxB6034669; Wed, 6 Feb 2013 13:53:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16DrxgG034668; Wed, 6 Feb 2013 13:53:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302061353.r16DrxgG034668@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 6 Feb 2013 13:53:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246405 - stable/9/tools/test/pthread_vfork X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 13:54:00 -0000 Author: kib Date: Wed Feb 6 13:53:59 2013 New Revision: 246405 URL: http://svnweb.freebsd.org/changeset/base/246405 Log: MFC r246119: Rework the handling of the children for the pthread_vfork_test. The trivial handler for SIGCHLD is installed, and SIGCHLD is blocked, to not abandon our zombies to init(8). This way, the zombies are around slightly longer, allowing to actually exercise the logic for p_pwait use by the test. Modified: stable/9/tools/test/pthread_vfork/pthread_vfork_test.c Directory Properties: stable/9/tools/test/pthread_vfork/ (props changed) Modified: stable/9/tools/test/pthread_vfork/pthread_vfork_test.c ============================================================================== --- stable/9/tools/test/pthread_vfork/pthread_vfork_test.c Wed Feb 6 13:49:56 2013 (r246404) +++ stable/9/tools/test/pthread_vfork/pthread_vfork_test.c Wed Feb 6 13:53:59 2013 (r246405) @@ -29,6 +29,8 @@ #include __FBSDID("$FreeBSD$"); +#include +#include #include #include #include @@ -39,10 +41,11 @@ __FBSDID("$FreeBSD$"); #define NUM_THREADS 100 -void * -vfork_test(void *threadid) +static void * +vfork_test(void *threadid __unused) { - pid_t pid; + pid_t pid, wpid; + int status; for (;;) { pid = vfork(); @@ -50,10 +53,20 @@ vfork_test(void *threadid) _exit(0); else if (pid == -1) err(1, "Failed to vfork"); + else { + wpid = waitpid(pid, &status, 0); + if (wpid == -1) + err(1, "waitpid"); + } } return (NULL); } +static void +sighandler(int signo __unused) +{ +} + /* * This program invokes multiple threads and each thread calls * vfork() system call. @@ -63,19 +76,24 @@ main(void) { pthread_t threads[NUM_THREADS]; struct sigaction reapchildren; + sigset_t sigchld_mask; int rc, t; memset(&reapchildren, 0, sizeof(reapchildren)); - reapchildren.sa_handler = SIG_IGN; - - /* Automatically reap zombies. */ + reapchildren.sa_handler = sighandler; if (sigaction(SIGCHLD, &reapchildren, NULL) == -1) err(1, "Could not sigaction(SIGCHLD)"); + sigemptyset(&sigchld_mask); + sigaddset(&sigchld_mask, SIGCHLD); + if (sigprocmask(SIG_BLOCK, &sigchld_mask, NULL) == -1) + err(1, "sigprocmask"); + for (t = 0; t < NUM_THREADS; t++) { - rc = pthread_create(&threads[t], NULL, vfork_test, (void *)t); + rc = pthread_create(&threads[t], NULL, vfork_test, &t); if (rc) errc(1, rc, "pthread_create"); } + pause(); return (0); } From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 13:55:03 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 23B50EFB; Wed, 6 Feb 2013 13:55:03 +0000 (UTC) (envelope-from nyan@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 16661B1A; Wed, 6 Feb 2013 13:55:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r16Dt2B9034841; Wed, 6 Feb 2013 13:55:02 GMT (envelope-from nyan@svn.freebsd.org) Received: (from nyan@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16Dt2qp034840; Wed, 6 Feb 2013 13:55:02 GMT (envelope-from nyan@svn.freebsd.org) Message-Id: <201302061355.r16Dt2qp034840@svn.freebsd.org> From: Takahashi Yoshihiro Date: Wed, 6 Feb 2013 13:55:02 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246406 - stable/9/sys/pc98/conf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 13:55:03 -0000 Author: nyan Date: Wed Feb 6 13:55:02 2013 New Revision: 246406 URL: http://svnweb.freebsd.org/changeset/base/246406 Log: MFi386: Remove firewire devices. Modified: stable/9/sys/pc98/conf/GENERIC Modified: stable/9/sys/pc98/conf/GENERIC ============================================================================== --- stable/9/sys/pc98/conf/GENERIC Wed Feb 6 13:53:59 2013 (r246405) +++ stable/9/sys/pc98/conf/GENERIC Wed Feb 6 13:55:02 2013 (r246406) @@ -268,10 +268,6 @@ device bpf # Berkeley packet filter #device ural # Ralink Technology RT2500USB wireless NICs #device zyd # ZyDAS zd1211/zd1211b wireless NICs -# FireWire support -#device sbp # SCSI over FireWire (Requires scbus and da) -#device fwe # Ethernet over FireWire (non-standard!) - # Sound support #device sound # Generic sound driver (required) #device snd_mss # Microsoft Sound System From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 14:12:14 2013 Return-Path: Delivered-To: svn-src-stable@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 4A6DD62C; Wed, 6 Feb 2013 14:12:14 +0000 (UTC) (envelope-from ian@FreeBSD.org) Received: from duck.symmetricom.us (duck.symmetricom.us [206.168.13.214]) by mx1.freebsd.org (Postfix) with ESMTP id E0E0CD6C; Wed, 6 Feb 2013 14:12:13 +0000 (UTC) Received: from damnhippie.dyndns.org (daffy.symmetricom.us [206.168.13.218]) by duck.symmetricom.us (8.14.6/8.14.6) with ESMTP id r16ECDYw010769; Wed, 6 Feb 2013 07:12:13 -0700 (MST) (envelope-from ian@FreeBSD.org) Received: from [172.22.42.240] (revolution.hippie.lan [172.22.42.240]) by damnhippie.dyndns.org (8.14.3/8.14.3) with ESMTP id r16EC13g033243; Wed, 6 Feb 2013 07:12:01 -0700 (MST) (envelope-from ian@FreeBSD.org) Subject: Re: svn commit: r246402 - stable/9/usr.sbin/inetd From: Ian Lepore To: Andrey Zonov In-Reply-To: <201302061316.r16DGh6m024337@svn.freebsd.org> References: <201302061316.r16DGh6m024337@svn.freebsd.org> Content-Type: text/plain; charset="us-ascii" Date: Wed, 06 Feb 2013 07:12:00 -0700 Message-ID: <1360159920.93359.594.camel@revolution.hippie.lan> Mime-Version: 1.0 X-Mailer: Evolution 2.32.1 FreeBSD GNOME Team Port Content-Transfer-Encoding: 7bit Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 14:12:14 -0000 On Wed, 2013-02-06 at 13:16 +0000, Andrey Zonov wrote: > Author: zont > Date: Wed Feb 6 13:16:43 2013 > New Revision: 246402 > URL: http://svnweb.freebsd.org/changeset/base/246402 > > Log: > MFC r245696: > - Force inetd to have listen queue size to be set to the value of > kern.ipc.somaxconn instead of hardcoded value 64. > > Modified: > stable/9/usr.sbin/inetd/inetd.c > Directory Properties: > stable/9/usr.sbin/inetd/ (props changed) > > Modified: stable/9/usr.sbin/inetd/inetd.c > ============================================================================== > --- stable/9/usr.sbin/inetd/inetd.c Wed Feb 6 13:14:30 2013 (r246401) > +++ stable/9/usr.sbin/inetd/inetd.c Wed Feb 6 13:16:43 2013 (r246402) > @@ -1387,7 +1387,7 @@ setsockopt(fd, SOL_SOCKET, opt, (char *) > } > } > if (sep->se_socktype == SOCK_STREAM) > - listen(sep->se_fd, 64); > + listen(sep->se_fd, -1); > enable(sep); > if (debug) { > warnx("registered %s on %d", I recently discovered that the posix documentation for listen(2) states that a queue depth less than zero is to be treated as if zero were specified, and the behavior for zero is to minimize the length of the queue to the smallest value the implementation supports (with words that imply the desired (but not required) effect is to stop listening if possible). Given that, perhaps it's unwise to expand the amount of code we've got that relies on this freebsd-specific non-conformance? -- Ian From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 18:21:37 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 1FB03728; Wed, 6 Feb 2013 18:21:37 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EC006F5D; Wed, 6 Feb 2013 18:21:36 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r16ILa8E014154; Wed, 6 Feb 2013 18:21:36 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16ILaGE014152; Wed, 6 Feb 2013 18:21:36 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302061821.r16ILaGE014152@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Feb 2013 18:21:36 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246424 - stable/9/sys/cam/scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 18:21:37 -0000 Author: mav Date: Wed Feb 6 18:21:36 2013 New Revision: 246424 URL: http://svnweb.freebsd.org/changeset/base/246424 Log: MFC r238595, r238596: Add bunch of new ASC/ASCQ values from T10 site. Modified: stable/9/sys/cam/scsi/scsi_all.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_all.c Wed Feb 6 18:04:28 2013 (r246423) +++ stable/9/sys/cam/scsi/scsi_all.c Wed Feb 6 18:21:36 2013 (r246424) @@ -768,7 +768,7 @@ static struct asc_table_entry asc_table[ * * SCSI ASC/ASCQ Assignments * Numeric Sorted Listing - * as of 7/29/08 + * as of 5/20/12 * * D - DIRECT ACCESS DEVICE (SBC-2) device column key * .T - SEQUENTIAL ACCESS DEVICE (SSC) ------------------- @@ -854,6 +854,12 @@ static struct asc_table_entry asc_table[ /* DT R MAEBKV */ { SST(0x00, 0x1E, SS_RDEF, /* XXX TBD */ "Conflicting SA creation request") }, + /* DT B */ + { SST(0x00, 0x1F, SS_RDEF, /* XXX TBD */ + "Logical unit transitioning to another power condition") }, + /* DT P B */ + { SST(0x00, 0x20, SS_RDEF, /* XXX TBD */ + "Extended copy information available") }, /* D W O BK */ { SST(0x01, 0x00, SS_RDEF, "No index/sector signal") }, @@ -923,6 +929,33 @@ static struct asc_table_entry asc_table[ /* DT R MAEBKV */ { SST(0x04, 0x13, SS_RDEF, /* XXX TBD */ "Logical unit not ready, SA creation in progress") }, + /* D B */ + { SST(0x04, 0x14, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, space allocation in progress") }, + /* M */ + { SST(0x04, 0x15, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, robotics disabled") }, + /* M */ + { SST(0x04, 0x16, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, configuration required") }, + /* M */ + { SST(0x04, 0x17, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, calibration required") }, + /* M */ + { SST(0x04, 0x18, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, a door is open") }, + /* M */ + { SST(0x04, 0x19, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, operating in sequential mode") }, + /* DT B */ + { SST(0x04, 0x1A, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, START/STOP UNIT command in progress") }, + /* D B */ + { SST(0x04, 0x1B, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, sanitize in progress") }, + /* DT MAEB */ + { SST(0x04, 0x1C, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, additional power use not yet granted") }, /* DTL WROMAEBKVF */ { SST(0x05, 0x00, SS_RDEF, "Logical unit does not respond to selection") }, @@ -989,6 +1022,12 @@ static struct asc_table_entry asc_table[ /* DTLPWROMAEBKVF */ { SST(0x0B, 0x07, SS_RDEF, /* XXX TBD */ "Warning - degraded power to non-volatile cache") }, + /* DTLPWROMAEBKVF */ + { SST(0x0B, 0x08, SS_RDEF, /* XXX TBD */ + "Warning - power loss expected") }, + /* D */ + { SST(0x0B, 0x09, SS_RDEF, /* XXX TBD */ + "Warning - device statistics notification available") }, /* T R */ { SST(0x0C, 0x00, SS_RDEF, "Write error") }, @@ -1031,6 +1070,9 @@ static struct asc_table_entry asc_table[ /* DTLPWRO AEBKVF */ { SST(0x0C, 0x0D, SS_RDEF, /* XXX TBD */ "Write error - not enough unsolicited data") }, + /* DT W O BK */ + { SST(0x0C, 0x0E, SS_RDEF, /* XXX TBD */ + "Multiple write errors") }, /* R */ { SST(0x0C, 0x0F, SS_RDEF, /* XXX TBD */ "Defects in error window") }, @@ -1076,6 +1118,12 @@ static struct asc_table_entry asc_table[ /* DT W O */ { SST(0x10, 0x03, SS_RDEF, /* XXX TBD */ "Logical block reference tag check failed") }, + /* T */ + { SST(0x10, 0x04, SS_RDEF, /* XXX TBD */ + "Logical block protection error on recovered buffer data") }, + /* T */ + { SST(0x10, 0x05, SS_RDEF, /* XXX TBD */ + "Logical block protection method error") }, /* DT WRO BK */ { SST(0x11, 0x00, SS_FATAL|EIO, "Unrecovered read error") }, @@ -1280,6 +1328,9 @@ static struct asc_table_entry asc_table[ /* DT WRO BK */ { SST(0x1D, 0x00, SS_FATAL, "Miscompare during verify operation") }, + /* D B */ + { SST(0x1D, 0x01, SS_RDEF, /* XXX TBD */ + "Miscomparable verify of unmapped LBA") }, /* D W O BK */ { SST(0x1E, 0x00, SS_NOP | SSQ_PRINT_SENSE, "Recovered ID with ECC correction") }, @@ -1322,6 +1373,9 @@ static struct asc_table_entry asc_table[ /* DT PWROMAEBK */ { SST(0x20, 0x0B, SS_RDEF, /* XXX TBD */ "Access denied - ACL LUN conflict") }, + /* T */ + { SST(0x20, 0x0C, SS_FATAL | EINVAL, + "Illegal command when not in append-only mode") }, /* DT WRO BK */ { SST(0x21, 0x00, SS_FATAL | EINVAL, "Logical block address out of range") }, @@ -1337,6 +1391,39 @@ static struct asc_table_entry asc_table[ /* D */ { SST(0x22, 0x00, SS_FATAL | EINVAL, "Illegal function (use 20 00, 24 00, or 26 00)") }, + /* DT P B */ + { SST(0x23, 0x00, SS_RDEF, /* XXX TBD */ + "Invalid token operation, cause not reportable") }, + /* DT P B */ + { SST(0x23, 0x01, SS_RDEF, /* XXX TBD */ + "Invalid token operation, unsupported token type") }, + /* DT P B */ + { SST(0x23, 0x02, SS_RDEF, /* XXX TBD */ + "Invalid token operation, remote token usage not supported") }, + /* DT P B */ + { SST(0x23, 0x03, SS_RDEF, /* XXX TBD */ + "Invalid token operation, remote ROD token creation not supported") }, + /* DT P B */ + { SST(0x23, 0x04, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token unknown") }, + /* DT P B */ + { SST(0x23, 0x05, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token corrupt") }, + /* DT P B */ + { SST(0x23, 0x06, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token revoked") }, + /* DT P B */ + { SST(0x23, 0x07, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token expired") }, + /* DT P B */ + { SST(0x23, 0x08, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token cancelled") }, + /* DT P B */ + { SST(0x23, 0x09, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token deleted") }, + /* DT P B */ + { SST(0x23, 0x0A, SS_RDEF, /* XXX TBD */ + "Invalid token operation, invalid token length") }, /* DTLPWROMAEBKVF */ { SST(0x24, 0x00, SS_FATAL | EINVAL, "Invalid field in CDB") }, @@ -1445,6 +1532,9 @@ static struct asc_table_entry asc_table[ /* R F */ { SST(0x27, 0x06, SS_RDEF, /* XXX TBD */ "Conditional write protect") }, + /* D B */ + { SST(0x27, 0x07, SS_RDEF, /* XXX TBD */ + "Space allocation failed write protect") }, /* DTLPWROMAEBKVF */ { SST(0x28, 0x00, SS_FATAL | ENXIO, "Not ready to ready change, medium may have changed") }, @@ -1543,6 +1633,9 @@ static struct asc_table_entry asc_table[ /* DT R MAEBKV */ { SST(0x2A, 0x14, SS_RDEF, /* XXX TBD */ "SA creation capabilities data has changed") }, + /* T M V */ + { SST(0x2A, 0x15, SS_RDEF, /* XXX TBD */ + "Medium removal prevention preempted") }, /* DTLPWRO K */ { SST(0x2B, 0x00, SS_RDEF, "Copy cannot execute since host cannot disconnect") }, @@ -1582,6 +1675,9 @@ static struct asc_table_entry asc_table[ /* T */ { SST(0x2C, 0x0B, SS_RDEF, /* XXX TBD */ "Not reserved") }, + /* D */ + { SST(0x2C, 0x0C, SS_RDEF, /* XXX TBD */ + "ORWRITE generation does not match") }, /* T */ { SST(0x2D, 0x00, SS_RDEF, "Overwrite error on update in place") }, @@ -1645,6 +1741,9 @@ static struct asc_table_entry asc_table[ /* M */ { SST(0x30, 0x12, SS_RDEF, /* XXX TBD */ "Incompatible volume qualifier") }, + /* M */ + { SST(0x30, 0x13, SS_RDEF, /* XXX TBD */ + "Cleaning volume expired") }, /* DT WRO BK */ { SST(0x31, 0x00, SS_RDEF, "Medium format corrupted") }, @@ -1654,6 +1753,9 @@ static struct asc_table_entry asc_table[ /* R */ { SST(0x31, 0x02, SS_RDEF, /* XXX TBD */ "Zoned formatting failed due to spare linking") }, + /* D B */ + { SST(0x31, 0x03, SS_RDEF, /* XXX TBD */ + "SANITIZE command failed") }, /* D W O BK */ { SST(0x32, 0x00, SS_RDEF, "No defect spare location available") }, @@ -1702,6 +1804,9 @@ static struct asc_table_entry asc_table[ /* B */ { SST(0x38, 0x06, SS_RDEF, /* XXX TBD */ "ESN - device busy class event") }, + /* D */ + { SST(0x38, 0x07, SS_RDEF, /* XXX TBD */ + "Thin provisioning soft threshold reached") }, /* DTL WROMAE K */ { SST(0x39, 0x00, SS_RDEF, "Saving parameters not supported") }, @@ -1801,6 +1906,9 @@ static struct asc_table_entry asc_table[ /* M */ { SST(0x3B, 0x1B, SS_RDEF, /* XXX TBD */ "Data transfer device inserted") }, + /* T */ + { SST(0x3B, 0x1C, SS_RDEF, /* XXX TBD */ + "Too many logical objects on partition to support operation") }, /* DTLPWROMAE K */ { SST(0x3D, 0x00, SS_RDEF, "Invalid bits in IDENTIFY message") }, @@ -1904,6 +2012,9 @@ static struct asc_table_entry asc_table[ /* DTLPWROMAEBKVF */ { SST(0x44, 0x00, SS_RDEF, "Internal target failure") }, + /* DT P MAEBKVF */ + { SST(0x44, 0x01, SS_RDEF, /* XXX TBD */ + "Persistent reservation information lost") }, /* DT B */ { SST(0x44, 0x71, SS_RDEF, /* XXX TBD */ "ATA device failed set features") }, @@ -1967,6 +2078,27 @@ static struct asc_table_entry asc_table[ /* DT PWROMAEBK */ { SST(0x4B, 0x06, SS_RDEF, /* XXX TBD */ "Initiator response timeout") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x07, SS_RDEF, /* XXX TBD */ + "Connection lost") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x08, SS_RDEF, /* XXX TBD */ + "Data-in buffer overflow - data buffer size") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x09, SS_RDEF, /* XXX TBD */ + "Data-in buffer overflow - data buffer descriptor area") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x0A, SS_RDEF, /* XXX TBD */ + "Data-in buffer error") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x0B, SS_RDEF, /* XXX TBD */ + "Data-out buffer overflow - data buffer size") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x0C, SS_RDEF, /* XXX TBD */ + "Data-out buffer overflow - data buffer descriptor area") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x0D, SS_RDEF, /* XXX TBD */ + "Data-out buffer error") }, /* DTLPWROMAEBKVF */ { SST(0x4C, 0x00, SS_RDEF, "Logical unit failed self-configuration") }, @@ -2012,6 +2144,18 @@ static struct asc_table_entry asc_table[ /* T */ { SST(0x53, 0x04, SS_RDEF, /* XXX TBD */ "Medium thread or unthread failure") }, + /* M */ + { SST(0x53, 0x05, SS_RDEF, /* XXX TBD */ + "Volume identifier invalid") }, + /* T */ + { SST(0x53, 0x06, SS_RDEF, /* XXX TBD */ + "Volume identifier missing") }, + /* M */ + { SST(0x53, 0x07, SS_RDEF, /* XXX TBD */ + "Duplicate volume identifier") }, + /* M */ + { SST(0x53, 0x08, SS_RDEF, /* XXX TBD */ + "Element status unknown") }, /* P */ { SST(0x54, 0x00, SS_RDEF, "SCSI to host system interface failure") }, @@ -2048,6 +2192,15 @@ static struct asc_table_entry asc_table[ /* M */ { SST(0x55, 0x0A, SS_RDEF, /* XXX TBD */ "Data currently unavailable") }, + /* DTLPWROMAEBKVF */ + { SST(0x55, 0x0B, SS_RDEF, /* XXX TBD */ + "Insufficient power for operation") }, + /* DT P B */ + { SST(0x55, 0x0C, SS_RDEF, /* XXX TBD */ + "Insufficient resources to create ROD") }, + /* DT P B */ + { SST(0x55, 0x0D, SS_RDEF, /* XXX TBD */ + "Insufficient resources to create ROD token") }, /* R */ { SST(0x57, 0x00, SS_RDEF, "Unable to recover table-of-contents") }, @@ -2354,6 +2507,24 @@ static struct asc_table_entry asc_table[ /* DTLPWRO A K */ { SST(0x5E, 0x04, SS_RDEF, "Standby condition activated by command") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x05, SS_RDEF, + "Idle-B condition activated by timer") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x06, SS_RDEF, + "Idle-B condition activated by command") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x07, SS_RDEF, + "Idle-C condition activated by timer") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x08, SS_RDEF, + "Idle-C condition activated by command") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x09, SS_RDEF, + "Standby-Y condition activated by timer") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x0A, SS_RDEF, + "Standby-Y condition activated by command") }, /* B */ { SST(0x5E, 0x41, SS_RDEF, /* XXX TBD */ "Power state change to active") }, From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 18:22:53 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 108428A1; Wed, 6 Feb 2013 18:22:53 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EA740F6F; Wed, 6 Feb 2013 18:22:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r16IMqJb014395; Wed, 6 Feb 2013 18:22:52 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16IMqId014394; Wed, 6 Feb 2013 18:22:52 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302061822.r16IMqId014394@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Feb 2013 18:22:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246425 - stable/8/sys/cam/scsi X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 18:22:53 -0000 Author: mav Date: Wed Feb 6 18:22:52 2013 New Revision: 246425 URL: http://svnweb.freebsd.org/changeset/base/246425 Log: MFC r238595, r238596: Add bunch of new ASC/ASCQ values from T10 site. Modified: stable/8/sys/cam/scsi/scsi_all.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cam/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_all.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_all.c Wed Feb 6 18:21:36 2013 (r246424) +++ stable/8/sys/cam/scsi/scsi_all.c Wed Feb 6 18:22:52 2013 (r246425) @@ -753,7 +753,7 @@ static struct asc_table_entry asc_table[ * * SCSI ASC/ASCQ Assignments * Numeric Sorted Listing - * as of 7/29/08 + * as of 5/20/12 * * D - DIRECT ACCESS DEVICE (SBC-2) device column key * .T - SEQUENTIAL ACCESS DEVICE (SSC) ------------------- @@ -839,6 +839,12 @@ static struct asc_table_entry asc_table[ /* DT R MAEBKV */ { SST(0x00, 0x1E, SS_RDEF, /* XXX TBD */ "Conflicting SA creation request") }, + /* DT B */ + { SST(0x00, 0x1F, SS_RDEF, /* XXX TBD */ + "Logical unit transitioning to another power condition") }, + /* DT P B */ + { SST(0x00, 0x20, SS_RDEF, /* XXX TBD */ + "Extended copy information available") }, /* D W O BK */ { SST(0x01, 0x00, SS_RDEF, "No index/sector signal") }, @@ -908,6 +914,33 @@ static struct asc_table_entry asc_table[ /* DT R MAEBKV */ { SST(0x04, 0x13, SS_RDEF, /* XXX TBD */ "Logical unit not ready, SA creation in progress") }, + /* D B */ + { SST(0x04, 0x14, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, space allocation in progress") }, + /* M */ + { SST(0x04, 0x15, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, robotics disabled") }, + /* M */ + { SST(0x04, 0x16, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, configuration required") }, + /* M */ + { SST(0x04, 0x17, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, calibration required") }, + /* M */ + { SST(0x04, 0x18, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, a door is open") }, + /* M */ + { SST(0x04, 0x19, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, operating in sequential mode") }, + /* DT B */ + { SST(0x04, 0x1A, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, START/STOP UNIT command in progress") }, + /* D B */ + { SST(0x04, 0x1B, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, sanitize in progress") }, + /* DT MAEB */ + { SST(0x04, 0x1C, SS_RDEF, /* XXX TBD */ + "Logical unit not ready, additional power use not yet granted") }, /* DTL WROMAEBKVF */ { SST(0x05, 0x00, SS_RDEF, "Logical unit does not respond to selection") }, @@ -974,6 +1007,12 @@ static struct asc_table_entry asc_table[ /* DTLPWROMAEBKVF */ { SST(0x0B, 0x07, SS_RDEF, /* XXX TBD */ "Warning - degraded power to non-volatile cache") }, + /* DTLPWROMAEBKVF */ + { SST(0x0B, 0x08, SS_RDEF, /* XXX TBD */ + "Warning - power loss expected") }, + /* D */ + { SST(0x0B, 0x09, SS_RDEF, /* XXX TBD */ + "Warning - device statistics notification available") }, /* T R */ { SST(0x0C, 0x00, SS_RDEF, "Write error") }, @@ -1016,6 +1055,9 @@ static struct asc_table_entry asc_table[ /* DTLPWRO AEBKVF */ { SST(0x0C, 0x0D, SS_RDEF, /* XXX TBD */ "Write error - not enough unsolicited data") }, + /* DT W O BK */ + { SST(0x0C, 0x0E, SS_RDEF, /* XXX TBD */ + "Multiple write errors") }, /* R */ { SST(0x0C, 0x0F, SS_RDEF, /* XXX TBD */ "Defects in error window") }, @@ -1061,6 +1103,12 @@ static struct asc_table_entry asc_table[ /* DT W O */ { SST(0x10, 0x03, SS_RDEF, /* XXX TBD */ "Logical block reference tag check failed") }, + /* T */ + { SST(0x10, 0x04, SS_RDEF, /* XXX TBD */ + "Logical block protection error on recovered buffer data") }, + /* T */ + { SST(0x10, 0x05, SS_RDEF, /* XXX TBD */ + "Logical block protection method error") }, /* DT WRO BK */ { SST(0x11, 0x00, SS_RDEF, "Unrecovered read error") }, @@ -1265,6 +1313,9 @@ static struct asc_table_entry asc_table[ /* DT WRO BK */ { SST(0x1D, 0x00, SS_FATAL, "Miscompare during verify operation") }, + /* D B */ + { SST(0x1D, 0x01, SS_RDEF, /* XXX TBD */ + "Miscomparable verify of unmapped LBA") }, /* D W O BK */ { SST(0x1E, 0x00, SS_NOP | SSQ_PRINT_SENSE, "Recovered ID with ECC correction") }, @@ -1307,6 +1358,9 @@ static struct asc_table_entry asc_table[ /* DT PWROMAEBK */ { SST(0x20, 0x0B, SS_RDEF, /* XXX TBD */ "Access denied - ACL LUN conflict") }, + /* T */ + { SST(0x20, 0x0C, SS_FATAL | EINVAL, + "Illegal command when not in append-only mode") }, /* DT WRO BK */ { SST(0x21, 0x00, SS_FATAL | EINVAL, "Logical block address out of range") }, @@ -1322,6 +1376,39 @@ static struct asc_table_entry asc_table[ /* D */ { SST(0x22, 0x00, SS_FATAL | EINVAL, "Illegal function (use 20 00, 24 00, or 26 00)") }, + /* DT P B */ + { SST(0x23, 0x00, SS_RDEF, /* XXX TBD */ + "Invalid token operation, cause not reportable") }, + /* DT P B */ + { SST(0x23, 0x01, SS_RDEF, /* XXX TBD */ + "Invalid token operation, unsupported token type") }, + /* DT P B */ + { SST(0x23, 0x02, SS_RDEF, /* XXX TBD */ + "Invalid token operation, remote token usage not supported") }, + /* DT P B */ + { SST(0x23, 0x03, SS_RDEF, /* XXX TBD */ + "Invalid token operation, remote ROD token creation not supported") }, + /* DT P B */ + { SST(0x23, 0x04, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token unknown") }, + /* DT P B */ + { SST(0x23, 0x05, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token corrupt") }, + /* DT P B */ + { SST(0x23, 0x06, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token revoked") }, + /* DT P B */ + { SST(0x23, 0x07, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token expired") }, + /* DT P B */ + { SST(0x23, 0x08, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token cancelled") }, + /* DT P B */ + { SST(0x23, 0x09, SS_RDEF, /* XXX TBD */ + "Invalid token operation, token deleted") }, + /* DT P B */ + { SST(0x23, 0x0A, SS_RDEF, /* XXX TBD */ + "Invalid token operation, invalid token length") }, /* DTLPWROMAEBKVF */ { SST(0x24, 0x00, SS_FATAL | EINVAL, "Invalid field in CDB") }, @@ -1430,6 +1517,9 @@ static struct asc_table_entry asc_table[ /* R F */ { SST(0x27, 0x06, SS_RDEF, /* XXX TBD */ "Conditional write protect") }, + /* D B */ + { SST(0x27, 0x07, SS_RDEF, /* XXX TBD */ + "Space allocation failed write protect") }, /* DTLPWROMAEBKVF */ { SST(0x28, 0x00, SS_FATAL | ENXIO, "Not ready to ready change, medium may have changed") }, @@ -1528,6 +1618,9 @@ static struct asc_table_entry asc_table[ /* DT R MAEBKV */ { SST(0x2A, 0x14, SS_RDEF, /* XXX TBD */ "SA creation capabilities data has changed") }, + /* T M V */ + { SST(0x2A, 0x15, SS_RDEF, /* XXX TBD */ + "Medium removal prevention preempted") }, /* DTLPWRO K */ { SST(0x2B, 0x00, SS_RDEF, "Copy cannot execute since host cannot disconnect") }, @@ -1567,6 +1660,9 @@ static struct asc_table_entry asc_table[ /* T */ { SST(0x2C, 0x0B, SS_RDEF, /* XXX TBD */ "Not reserved") }, + /* D */ + { SST(0x2C, 0x0C, SS_RDEF, /* XXX TBD */ + "ORWRITE generation does not match") }, /* T */ { SST(0x2D, 0x00, SS_RDEF, "Overwrite error on update in place") }, @@ -1630,6 +1726,9 @@ static struct asc_table_entry asc_table[ /* M */ { SST(0x30, 0x12, SS_RDEF, /* XXX TBD */ "Incompatible volume qualifier") }, + /* M */ + { SST(0x30, 0x13, SS_RDEF, /* XXX TBD */ + "Cleaning volume expired") }, /* DT WRO BK */ { SST(0x31, 0x00, SS_RDEF, "Medium format corrupted") }, @@ -1639,6 +1738,9 @@ static struct asc_table_entry asc_table[ /* R */ { SST(0x31, 0x02, SS_RDEF, /* XXX TBD */ "Zoned formatting failed due to spare linking") }, + /* D B */ + { SST(0x31, 0x03, SS_RDEF, /* XXX TBD */ + "SANITIZE command failed") }, /* D W O BK */ { SST(0x32, 0x00, SS_RDEF, "No defect spare location available") }, @@ -1687,6 +1789,9 @@ static struct asc_table_entry asc_table[ /* B */ { SST(0x38, 0x06, SS_RDEF, /* XXX TBD */ "ESN - device busy class event") }, + /* D */ + { SST(0x38, 0x07, SS_RDEF, /* XXX TBD */ + "Thin provisioning soft threshold reached") }, /* DTL WROMAE K */ { SST(0x39, 0x00, SS_RDEF, "Saving parameters not supported") }, @@ -1786,6 +1891,9 @@ static struct asc_table_entry asc_table[ /* M */ { SST(0x3B, 0x1B, SS_RDEF, /* XXX TBD */ "Data transfer device inserted") }, + /* T */ + { SST(0x3B, 0x1C, SS_RDEF, /* XXX TBD */ + "Too many logical objects on partition to support operation") }, /* DTLPWROMAE K */ { SST(0x3D, 0x00, SS_RDEF, "Invalid bits in IDENTIFY message") }, @@ -1889,6 +1997,9 @@ static struct asc_table_entry asc_table[ /* DTLPWROMAEBKVF */ { SST(0x44, 0x00, SS_RDEF, "Internal target failure") }, + /* DT P MAEBKVF */ + { SST(0x44, 0x01, SS_RDEF, /* XXX TBD */ + "Persistent reservation information lost") }, /* DT B */ { SST(0x44, 0x71, SS_RDEF, /* XXX TBD */ "ATA device failed set features") }, @@ -1952,6 +2063,27 @@ static struct asc_table_entry asc_table[ /* DT PWROMAEBK */ { SST(0x4B, 0x06, SS_RDEF, /* XXX TBD */ "Initiator response timeout") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x07, SS_RDEF, /* XXX TBD */ + "Connection lost") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x08, SS_RDEF, /* XXX TBD */ + "Data-in buffer overflow - data buffer size") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x09, SS_RDEF, /* XXX TBD */ + "Data-in buffer overflow - data buffer descriptor area") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x0A, SS_RDEF, /* XXX TBD */ + "Data-in buffer error") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x0B, SS_RDEF, /* XXX TBD */ + "Data-out buffer overflow - data buffer size") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x0C, SS_RDEF, /* XXX TBD */ + "Data-out buffer overflow - data buffer descriptor area") }, + /* DT PWROMAEBK F */ + { SST(0x4B, 0x0D, SS_RDEF, /* XXX TBD */ + "Data-out buffer error") }, /* DTLPWROMAEBKVF */ { SST(0x4C, 0x00, SS_RDEF, "Logical unit failed self-configuration") }, @@ -1997,6 +2129,18 @@ static struct asc_table_entry asc_table[ /* T */ { SST(0x53, 0x04, SS_RDEF, /* XXX TBD */ "Medium thread or unthread failure") }, + /* M */ + { SST(0x53, 0x05, SS_RDEF, /* XXX TBD */ + "Volume identifier invalid") }, + /* T */ + { SST(0x53, 0x06, SS_RDEF, /* XXX TBD */ + "Volume identifier missing") }, + /* M */ + { SST(0x53, 0x07, SS_RDEF, /* XXX TBD */ + "Duplicate volume identifier") }, + /* M */ + { SST(0x53, 0x08, SS_RDEF, /* XXX TBD */ + "Element status unknown") }, /* P */ { SST(0x54, 0x00, SS_RDEF, "SCSI to host system interface failure") }, @@ -2033,6 +2177,15 @@ static struct asc_table_entry asc_table[ /* M */ { SST(0x55, 0x0A, SS_RDEF, /* XXX TBD */ "Data currently unavailable") }, + /* DTLPWROMAEBKVF */ + { SST(0x55, 0x0B, SS_RDEF, /* XXX TBD */ + "Insufficient power for operation") }, + /* DT P B */ + { SST(0x55, 0x0C, SS_RDEF, /* XXX TBD */ + "Insufficient resources to create ROD") }, + /* DT P B */ + { SST(0x55, 0x0D, SS_RDEF, /* XXX TBD */ + "Insufficient resources to create ROD token") }, /* R */ { SST(0x57, 0x00, SS_RDEF, "Unable to recover table-of-contents") }, @@ -2339,6 +2492,24 @@ static struct asc_table_entry asc_table[ /* DTLPWRO A K */ { SST(0x5E, 0x04, SS_RDEF, "Standby condition activated by command") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x05, SS_RDEF, + "Idle-B condition activated by timer") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x06, SS_RDEF, + "Idle-B condition activated by command") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x07, SS_RDEF, + "Idle-C condition activated by timer") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x08, SS_RDEF, + "Idle-C condition activated by command") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x09, SS_RDEF, + "Standby-Y condition activated by timer") }, + /* DTLPWRO A K */ + { SST(0x5E, 0x0A, SS_RDEF, + "Standby-Y condition activated by command") }, /* B */ { SST(0x5E, 0x41, SS_RDEF, /* XXX TBD */ "Power state change to active") }, From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 18:30:54 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id EF651A76; Wed, 6 Feb 2013 18:30:54 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E1366FB2; Wed, 6 Feb 2013 18:30:54 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r16IUsY5016932; Wed, 6 Feb 2013 18:30:54 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16IUslq016923; Wed, 6 Feb 2013 18:30:54 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302061830.r16IUslq016923@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Feb 2013 18:30:54 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246426 - stable/9/sys/cam/ctl X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 18:30:55 -0000 Author: mav Date: Wed Feb 6 18:30:53 2013 New Revision: 246426 URL: http://svnweb.freebsd.org/changeset/base/246426 Log: MFC r240948 (by trasz): Fix panic in CTL caused by trying to free invalid pointers passed by the userland process via the IOCTL interface. Modified: stable/9/sys/cam/ctl/ctl.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ctl/ctl.c ============================================================================== --- stable/9/sys/cam/ctl/ctl.c Wed Feb 6 18:22:52 2013 (r246425) +++ stable/9/sys/cam/ctl/ctl.c Wed Feb 6 18:30:53 2013 (r246426) @@ -2075,6 +2075,11 @@ ctl_copyin_args(int num_be_args, struct goto bailout; for (i = 0; i < num_be_args; i++) { + args[i].kname = NULL; + args[i].kvalue = NULL; + } + + for (i = 0; i < num_be_args; i++) { uint8_t *tmpptr; args[i].kname = ctl_copyin_alloc(args[i].name, From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 18:32:14 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 305F4BE1; Wed, 6 Feb 2013 18:32:14 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0899AFBD; Wed, 6 Feb 2013 18:32:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r16IWD4U017441; Wed, 6 Feb 2013 18:32:13 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16IWDlS017437; Wed, 6 Feb 2013 18:32:13 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302061832.r16IWDlS017437@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Feb 2013 18:32:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246427 - stable/9/sys/cam/ctl X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 18:32:14 -0000 Author: mav Date: Wed Feb 6 18:32:12 2013 New Revision: 246427 URL: http://svnweb.freebsd.org/changeset/base/246427 Log: MFC r240993 (by trasz): Remove useless NULL checks after M_WAITOK allocations. Modified: stable/9/sys/cam/ctl/ctl.c stable/9/sys/cam/ctl/ctl_backend_block.c stable/9/sys/cam/ctl/ctl_backend_ramdisk.c stable/9/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ctl/ctl.c ============================================================================== --- stable/9/sys/cam/ctl/ctl.c Wed Feb 6 18:30:53 2013 (r246426) +++ stable/9/sys/cam/ctl/ctl.c Wed Feb 6 18:32:12 2013 (r246427) @@ -1520,12 +1520,6 @@ ctl_ioctl_do_datamove(struct ctl_scsiio ext_sglist = (struct ctl_sg_entry *)malloc(ext_sglen, M_CTL, M_WAITOK); - if (ext_sglist == NULL) { - ctl_set_internal_failure(ctsio, - /*sks_valid*/ 0, - /*retry_count*/ 0); - return (CTL_RETVAL_COMPLETE); - } ext_sglist_malloced = 1; if (copyin(ctsio->ext_data_ptr, ext_sglist, ext_sglen) != 0) { @@ -2028,11 +2022,6 @@ ctl_copyin_alloc(void *user_addr, int le void *kptr; kptr = malloc(len, M_CTL, M_WAITOK | M_ZERO); - if (kptr == NULL) { - snprintf(error_str, error_str_len, "Cannot allocate %d bytes", - len); - return (NULL); - } if (copyin(user_addr, kptr, len) != 0) { snprintf(error_str, error_str_len, "Error copying %d bytes " @@ -2764,12 +2753,6 @@ ctl_ioctl(struct cdev *dev, u_long cmd, new_err_desc = malloc(sizeof(*new_err_desc), M_CTL, M_WAITOK | M_ZERO); - if (new_err_desc == NULL) { - printf("%s: CTL_ERROR_INJECT: error allocating %zu " - "bytes\n", __func__, sizeof(*new_err_desc)); - retval = ENOMEM; - break; - } bcopy(err_desc, new_err_desc, sizeof(*new_err_desc)); mtx_lock(&softc->ctl_lock); @@ -4203,11 +4186,6 @@ ctl_alloc_lun(struct ctl_softc *ctl_soft } if (ctl_lun == NULL) { lun = malloc(sizeof(*lun), M_CTL, M_WAITOK); - if (lun == NULL) { - be_lun->lun_config_status(lun->be_lun->be_lun, - CTL_LUN_CONFIG_FAILURE); - return (-ENOMEM); - } lun->flags = CTL_LUN_MALLOCED; } else lun = ctl_lun; @@ -5061,12 +5039,6 @@ ctl_scsi_release(struct ctl_scsiio *ctsi if (((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) && (length > 0)) { ctsio->kern_data_ptr = malloc(length, M_CTL, M_WAITOK); - if (ctsio->kern_data_ptr == NULL) { - ctsio->io_hdr.status = CTL_SCSI_ERROR; - ctsio->io_hdr.status = SCSI_STATUS_BUSY; - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } ctsio->kern_data_len = length; ctsio->kern_total_len = length; ctsio->kern_data_resid = 0; @@ -5202,12 +5174,6 @@ ctl_scsi_reserve(struct ctl_scsiio *ctsi if (((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) && (length > 0)) { ctsio->kern_data_ptr = malloc(length, M_CTL, M_WAITOK); - if (ctsio->kern_data_ptr == NULL) { - ctsio->io_hdr.status = CTL_SCSI_ERROR; - ctsio->io_hdr.status = SCSI_STATUS_BUSY; - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } ctsio->kern_data_len = length; ctsio->kern_total_len = length; ctsio->kern_data_resid = 0; @@ -5573,12 +5539,6 @@ ctl_format(struct ctl_scsiio *ctsio) if (((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) && (length > 0)) { ctsio->kern_data_ptr = malloc(length, M_CTL, M_WAITOK); - if (ctsio->kern_data_ptr == NULL) { - ctsio->io_hdr.status = CTL_SCSI_ERROR; - ctsio->io_hdr.status = SCSI_STATUS_BUSY; - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } ctsio->kern_data_len = length; ctsio->kern_total_len = length; ctsio->kern_data_resid = 0; @@ -6368,11 +6328,6 @@ ctl_mode_select(struct ctl_scsiio *ctsio */ if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { ctsio->kern_data_ptr = malloc(param_len, M_CTL, M_WAITOK); - if (ctsio->kern_data_ptr == NULL) { - ctl_set_busy(ctsio); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } ctsio->kern_data_len = param_len; ctsio->kern_total_len = param_len; ctsio->kern_data_resid = 0; @@ -6607,12 +6562,6 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) #endif ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK); - if (ctsio->kern_data_ptr == NULL) { - ctsio->io_hdr.status = CTL_SCSI_ERROR; - ctsio->scsi_status = SCSI_STATUS_BUSY; - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } ctsio->kern_sg_entries = 0; ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; @@ -6794,12 +6743,6 @@ ctl_read_capacity(struct ctl_scsiio *cts lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK); - if (ctsio->kern_data_ptr == NULL) { - ctsio->io_hdr.status = CTL_SCSI_ERROR; - ctsio->scsi_status = SCSI_STATUS_BUSY; - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } data = (struct scsi_read_capacity_data *)ctsio->kern_data_ptr; ctsio->residual = 0; ctsio->kern_data_len = sizeof(*data); @@ -6864,12 +6807,6 @@ ctl_read_capacity_16(struct ctl_scsiio * lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK); - if (ctsio->kern_data_ptr == NULL) { - ctsio->io_hdr.status = CTL_SCSI_ERROR; - ctsio->scsi_status = SCSI_STATUS_BUSY; - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } data = (struct scsi_read_capacity_data_long *)ctsio->kern_data_ptr; if (sizeof(*data) < alloc_len) { @@ -6977,12 +6914,6 @@ ctl_maintenance_in(struct ctl_scsiio *ct alloc_len = scsi_4btoul(cdb->length); ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK); - if (ctsio->kern_data_ptr == NULL) { - ctsio->io_hdr.status = CTL_SCSI_ERROR; - ctsio->scsi_status = SCSI_STATUS_BUSY; - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } memset(ctsio->kern_data_ptr, 0, total_len); ctsio->kern_sg_entries = 0; @@ -7138,12 +7069,6 @@ retry: mtx_unlock(&softc->ctl_lock); ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK); - if (ctsio->kern_data_ptr == NULL) { - ctsio->io_hdr.status = CTL_SCSI_ERROR; - ctsio->scsi_status = SCSI_STATUS_BUSY; - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } if (total_len < alloc_len) { ctsio->residual = alloc_len - total_len; @@ -7876,11 +7801,6 @@ ctl_persistent_reserve_out(struct ctl_sc if ((ctsio->io_hdr.flags & CTL_FLAG_ALLOCATED) == 0) { ctsio->kern_data_ptr = malloc(param_len, M_CTL, M_WAITOK); - if (ctsio->kern_data_ptr == NULL) { - ctl_set_busy(ctsio); - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } ctsio->kern_data_len = param_len; ctsio->kern_total_len = param_len; ctsio->kern_data_resid = 0; @@ -8692,13 +8612,6 @@ ctl_report_luns(struct ctl_scsiio *ctsio (num_luns * sizeof(struct scsi_report_luns_lundata)); ctsio->kern_data_ptr = malloc(lun_datalen, M_CTL, M_WAITOK); - if (ctsio->kern_data_ptr == NULL) { - ctsio->io_hdr.status = CTL_SCSI_ERROR; - ctsio->scsi_status = SCSI_STATUS_BUSY; - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } - lun_data = (struct scsi_report_luns_data *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; @@ -8821,12 +8734,6 @@ ctl_request_sense(struct ctl_scsiio *cts sense_format = SSD_TYPE_FIXED; ctsio->kern_data_ptr = malloc(sizeof(*sense_ptr), M_CTL, M_WAITOK); - if (ctsio->kern_data_ptr == NULL) { - ctsio->io_hdr.status = CTL_SCSI_ERROR; - ctsio->scsi_status = SCSI_STATUS_BUSY; - ctl_done((union ctl_io *)ctsio); - return (CTL_RETVAL_COMPLETE); - } sense_ptr = (struct scsi_sense_data *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; Modified: stable/9/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_backend_block.c Wed Feb 6 18:30:53 2013 (r246426) +++ stable/9/sys/cam/ctl/ctl_backend_block.c Wed Feb 6 18:32:12 2013 (r246427) @@ -376,9 +376,6 @@ ctl_grow_beio(struct ctl_be_block_softc beio = (struct ctl_be_block_io *)malloc(sizeof(*beio), M_CTLBLK, M_WAITOK | M_ZERO); - if (beio == NULL) - break; - bzero(beio, sizeof(*beio)); beio->softc = softc; mtx_lock(&softc->lock); @@ -1092,15 +1089,6 @@ ctl_be_block_dispatch(struct ctl_be_bloc */ beio->sg_segs[i].len = min(MAXPHYS, len_left); beio->sg_segs[i].addr = uma_zalloc(be_lun->lun_zone, M_WAITOK); - /* - * uma_zalloc() can in theory return NULL even with M_WAITOK - * if it can't pull more memory into the zone. - */ - if (beio->sg_segs[i].addr == NULL) { - ctl_set_busy(&io->scsiio); - ctl_complete_beio(beio); - return; - } DPRINTF("segment %d addr %p len %zd\n", i, beio->sg_segs[i].addr, beio->sg_segs[i].len); @@ -1660,13 +1648,6 @@ ctl_be_block_create(struct ctl_be_block_ be_lun = malloc(sizeof(*be_lun), M_CTLBLK, M_ZERO | M_WAITOK); - if (be_lun == NULL) { - snprintf(req->error_str, sizeof(req->error_str), - "%s: error allocating %zd bytes", __func__, - sizeof(*be_lun)); - goto bailout_error; - } - be_lun->softc = softc; STAILQ_INIT(&be_lun->input_queue); STAILQ_INIT(&be_lun->config_write_queue); @@ -1705,12 +1686,6 @@ ctl_be_block_create(struct ctl_be_block_ be_lun->dev_path = malloc(file_arg->vallen, M_CTLBLK, M_WAITOK | M_ZERO); - if (be_lun->dev_path == NULL) { - snprintf(req->error_str, sizeof(req->error_str), - "%s: error allocating %d bytes", __func__, - file_arg->vallen); - goto bailout_error; - } strlcpy(be_lun->dev_path, (char *)file_arg->value, file_arg->vallen); Modified: stable/9/sys/cam/ctl/ctl_backend_ramdisk.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_backend_ramdisk.c Wed Feb 6 18:30:53 2013 (r246426) +++ stable/9/sys/cam/ctl/ctl_backend_ramdisk.c Wed Feb 6 18:32:12 2013 (r246427) @@ -134,7 +134,7 @@ ctl_backend_ramdisk_init(void) { struct ctl_be_ramdisk_softc *softc; #ifdef CTL_RAMDISK_PAGES - int i, j; + int i; #endif @@ -151,17 +151,8 @@ ctl_backend_ramdisk_init(void) softc->ramdisk_pages = (uint8_t **)malloc(sizeof(uint8_t *) * softc->num_pages, M_RAMDISK, M_WAITOK); - for (i = 0; i < softc->num_pages; i++) { + for (i = 0; i < softc->num_pages; i++) softc->ramdisk_pages[i] = malloc(PAGE_SIZE, M_RAMDISK,M_WAITOK); - if (softc->ramdisk_pages[i] == NULL) { - for (j = 0; j < i; j++) { - free(softc->ramdisk_pages[j], M_RAMDISK); - } - free(softc->ramdisk_pages, M_RAMDISK); - panic("RAMDisk initialization failed\n"); - return (1); /* NOTREACHED */ - } - } #else softc->ramdisk_buffer = (uint8_t *)malloc(softc->rd_size, M_RAMDISK, M_WAITOK); @@ -313,13 +304,6 @@ ctl_backend_ramdisk_submit(union ctl_io io->scsiio.kern_data_ptr = malloc(sizeof(struct ctl_sg_entry) * num_sg_entries, M_RAMDISK, M_WAITOK); - if (io->scsiio.kern_data_ptr == NULL) { - ctl_set_internal_failure(&io->scsiio, - /*sks_valid*/ 0, - /*retry_count*/ 0); - ctl_done(io); - return (CTL_RETVAL_COMPLETE); - } sg_entries = (struct ctl_sg_entry *)io->scsiio.kern_data_ptr; for (i = 0, len_filled = 0; i < num_sg_entries; i++, len_filled += PAGE_SIZE) { Modified: stable/9/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/9/sys/cam/ctl/scsi_ctl.c Wed Feb 6 18:30:53 2013 (r246426) +++ stable/9/sys/cam/ctl/scsi_ctl.c Wed Feb 6 18:32:12 2013 (r246427) @@ -1694,11 +1694,6 @@ ctlfe_onoffline(void *arg, int online) return; } ccb = (union ccb *)malloc(sizeof(*ccb), M_TEMP, M_WAITOK | M_ZERO); - if (ccb == NULL) { - printf("%s: unable to malloc CCB!\n", __func__); - xpt_free_path(path); - return; - } xpt_setup_ccb(&ccb->ccb_h, path, /*priority*/ 1); sim = xpt_path_sim(path); @@ -1900,12 +1895,6 @@ ctlfe_lun_enable(void *arg, struct ctl_i } softc = malloc(sizeof(*softc), M_CTLFE, M_WAITOK | M_ZERO); - if (softc == NULL) { - printf("%s: could not allocate %zd bytes for softc\n", - __func__, sizeof(*softc)); - xpt_free_path(path); - return (1); - } sim = xpt_path_sim(path); mtx_lock(sim->mtx); periph = cam_periph_find(path, "ctl"); From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 18:36:28 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id F2BCEED; Wed, 6 Feb 2013 18:36:27 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D65C4D3; Wed, 6 Feb 2013 18:36:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r16IaR3g018227; Wed, 6 Feb 2013 18:36:27 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16IaRCr018224; Wed, 6 Feb 2013 18:36:27 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302061836.r16IaRCr018224@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Feb 2013 18:36:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246429 - in stable/9/sys/cam: ctl scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 18:36:28 -0000 Author: mav Date: Wed Feb 6 18:36:26 2013 New Revision: 246429 URL: http://svnweb.freebsd.org/changeset/base/246429 Log: MFC r242174: Remove several uses of numeric priorities from immediate CCB setups. Modified: stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c stable/9/sys/cam/ctl/scsi_ctl.c stable/9/sys/cam/scsi/scsi_da.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c Wed Feb 6 18:33:32 2013 (r246428) +++ stable/9/sys/cam/ctl/ctl_frontend_cam_sim.c Wed Feb 6 18:36:26 2013 (r246429) @@ -240,7 +240,7 @@ cfcs_init(void) goto bailout; } - xpt_setup_ccb(&csa.ccb_h, softc->path, /*priority*/ 5); + xpt_setup_ccb(&csa.ccb_h, softc->path, CAM_PRIORITY_NONE); csa.ccb_h.func_code = XPT_SASYNC_CB; csa.event_enable = AC_LOST_DEVICE; csa.callback = cfcs_async; Modified: stable/9/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/9/sys/cam/ctl/scsi_ctl.c Wed Feb 6 18:33:32 2013 (r246428) +++ stable/9/sys/cam/ctl/scsi_ctl.c Wed Feb 6 18:36:26 2013 (r246429) @@ -334,7 +334,7 @@ ctlfeasync(void *callback_arg, uint32_t return; } xpt_setup_ccb(&ccb->ccb_h, cpi->ccb_h.path, - /*priority*/ 1); + CAM_PRIORITY_NONE); sim = xpt_path_sim(cpi->ccb_h.path); @@ -571,7 +571,7 @@ ctlferegister(struct cam_periph *periph, callout_init_mtx(&softc->dma_callout, sim->mtx, /*flags*/ 0); periph->softc = softc; - xpt_setup_ccb(&en_lun_ccb.ccb_h, periph->path, /*priority*/ 1); + xpt_setup_ccb(&en_lun_ccb.ccb_h, periph->path, CAM_PRIORITY_NONE); en_lun_ccb.ccb_h.func_code = XPT_EN_LUN; en_lun_ccb.cel.grp6_len = 0; en_lun_ccb.cel.grp7_len = 0; @@ -668,7 +668,7 @@ ctlfeoninvalidate(struct cam_periph *per softc = (struct ctlfe_lun_softc *)periph->softc; - xpt_setup_ccb(&en_lun_ccb.ccb_h, periph->path, /*priority*/ 1); + xpt_setup_ccb(&en_lun_ccb.ccb_h, periph->path, CAM_PRIORITY_NONE); en_lun_ccb.ccb_h.func_code = XPT_EN_LUN; en_lun_ccb.cel.grp6_len = 0; en_lun_ccb.cel.grp7_len = 0; @@ -1694,7 +1694,7 @@ ctlfe_onoffline(void *arg, int online) return; } ccb = (union ccb *)malloc(sizeof(*ccb), M_TEMP, M_WAITOK | M_ZERO); - xpt_setup_ccb(&ccb->ccb_h, path, /*priority*/ 1); + xpt_setup_ccb(&ccb->ccb_h, path, CAM_PRIORITY_NONE); sim = xpt_path_sim(path); Modified: stable/9/sys/cam/scsi/scsi_da.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_da.c Wed Feb 6 18:33:32 2013 (r246428) +++ stable/9/sys/cam/scsi/scsi_da.c Wed Feb 6 18:36:26 2013 (r246429) @@ -1459,7 +1459,7 @@ dasysctlinit(void *context, int pending) * Add some addressing info. */ memset(&cts, 0, sizeof (cts)); - xpt_setup_ccb(&cts.ccb_h, periph->path, /*priority*/1); + xpt_setup_ccb(&cts.ccb_h, periph->path, CAM_PRIORITY_NONE); cts.ccb_h.func_code = XPT_GET_TRAN_SETTINGS; cts.type = CTS_TYPE_CURRENT_SETTINGS; cam_periph_lock(periph); From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 18:40:08 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9198D3DB; Wed, 6 Feb 2013 18:40:08 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 83BE4108; Wed, 6 Feb 2013 18:40:08 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r16Ie8P4019362; Wed, 6 Feb 2013 18:40:08 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16Ie8Nh019250; Wed, 6 Feb 2013 18:40:08 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302061840.r16Ie8Nh019250@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Feb 2013 18:40:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246431 - in stable/9/sys/cam: . scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 18:40:08 -0000 Author: mav Date: Wed Feb 6 18:40:07 2013 New Revision: 246431 URL: http://svnweb.freebsd.org/changeset/base/246431 Log: MFC r242175: Remove priority enforcement from xpt_ation(). It is not good and even not safe in some cases to reduce CCB priority after it was scheduled with high priority. This fixes reproducible deadlock when command sent through the pass interface while ATA XPT recovers from command timeout. Instead of that enforce priority at passioctl(). libcam provides no obvious interface to specify CCB priority and so much (all?) code specifies zero (highest) priority. This change limits pass CCBs priority to NORMAL run level, allowing XPT to complete bus and device recovery after reset before running any payload. Modified: stable/9/sys/cam/cam.h stable/9/sys/cam/cam_xpt.c stable/9/sys/cam/scsi/scsi_pass.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam.h ============================================================================== --- stable/9/sys/cam/cam.h Wed Feb 6 18:37:46 2013 (r246430) +++ stable/9/sys/cam/cam.h Wed Feb 6 18:40:07 2013 (r246431) @@ -83,6 +83,7 @@ typedef struct { #define CAM_PRIORITY_NORMAL ((CAM_RL_NORMAL << 8) + 0x80) #define CAM_PRIORITY_NONE (u_int32_t)-1 #define CAM_PRIORITY_TO_RL(x) ((x) >> 8) +#define CAM_RL_TO_PRIORITY(x) ((x) << 8) u_int32_t generation; int index; #define CAM_UNQUEUED_INDEX -1 Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Wed Feb 6 18:37:46 2013 (r246430) +++ stable/9/sys/cam/cam_xpt.c Wed Feb 6 18:40:07 2013 (r246431) @@ -2466,9 +2466,6 @@ xpt_action(union ccb *start_ccb) CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("xpt_action\n")); start_ccb->ccb_h.status = CAM_REQ_INPROG; - /* Compatibility for RL-unaware code. */ - if (CAM_PRIORITY_TO_RL(start_ccb->ccb_h.pinfo.priority) == 0) - start_ccb->ccb_h.pinfo.priority += CAM_PRIORITY_NORMAL - 1; (*(start_ccb->ccb_h.path->bus->xport->action))(start_ccb); } Modified: stable/9/sys/cam/scsi/scsi_pass.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_pass.c Wed Feb 6 18:37:46 2013 (r246430) +++ stable/9/sys/cam/scsi/scsi_pass.c Wed Feb 6 18:40:07 2013 (r246431) @@ -521,6 +521,7 @@ passioctl(struct cdev *dev, u_long cmd, struct cam_periph *periph; struct pass_softc *softc; int error; + uint32_t priority; periph = (struct cam_periph *)dev->si_drv1; if (periph == NULL) @@ -553,6 +554,11 @@ passioctl(struct cdev *dev, u_long cmd, break; } + /* Compatibility for RL/priority-unaware code. */ + priority = inccb->ccb_h.pinfo.priority; + if (priority < CAM_RL_TO_PRIORITY(CAM_RL_NORMAL)) + priority += CAM_RL_TO_PRIORITY(CAM_RL_NORMAL); + /* * Non-immediate CCBs need a CCB from the per-device pool * of CCBs, which is scheduled by the transport layer. @@ -561,15 +567,14 @@ passioctl(struct cdev *dev, u_long cmd, */ if ((inccb->ccb_h.func_code & XPT_FC_QUEUED) && ((inccb->ccb_h.func_code & XPT_FC_USER_CCB) == 0)) { - ccb = cam_periph_getccb(periph, - inccb->ccb_h.pinfo.priority); + ccb = cam_periph_getccb(periph, priority); ccb_malloced = 0; } else { ccb = xpt_alloc_ccb_nowait(); if (ccb != NULL) xpt_setup_ccb(&ccb->ccb_h, periph->path, - inccb->ccb_h.pinfo.priority); + priority); ccb_malloced = 1; } From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 18:41:13 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DB6A657C; Wed, 6 Feb 2013 18:41:13 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B4A0F11B; Wed, 6 Feb 2013 18:41:13 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r16IfDSh020630; Wed, 6 Feb 2013 18:41:13 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16IfDgh020627; Wed, 6 Feb 2013 18:41:13 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302061841.r16IfDgh020627@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Feb 2013 18:41:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246432 - in stable/8/sys/cam: . scsi X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 18:41:13 -0000 Author: mav Date: Wed Feb 6 18:41:12 2013 New Revision: 246432 URL: http://svnweb.freebsd.org/changeset/base/246432 Log: MFC r242175: Remove priority enforcement from xpt_ation(). It is not good and even not safe in some cases to reduce CCB priority after it was scheduled with high priority. This fixes reproducible deadlock when command sent through the pass interface while ATA XPT recovers from command timeout. Instead of that enforce priority at passioctl(). libcam provides no obvious interface to specify CCB priority and so much (all?) code specifies zero (highest) priority. This change limits pass CCBs priority to NORMAL run level, allowing XPT to complete bus and device recovery after reset before running any payload. Modified: stable/8/sys/cam/cam.h stable/8/sys/cam/cam_xpt.c stable/8/sys/cam/scsi/scsi_pass.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cam/ (props changed) Modified: stable/8/sys/cam/cam.h ============================================================================== --- stable/8/sys/cam/cam.h Wed Feb 6 18:40:07 2013 (r246431) +++ stable/8/sys/cam/cam.h Wed Feb 6 18:41:12 2013 (r246432) @@ -83,6 +83,7 @@ typedef struct { #define CAM_PRIORITY_NORMAL ((CAM_RL_NORMAL << 8) + 0x80) #define CAM_PRIORITY_NONE (u_int32_t)-1 #define CAM_PRIORITY_TO_RL(x) ((x) >> 8) +#define CAM_RL_TO_PRIORITY(x) ((x) << 8) u_int32_t generation; int index; #define CAM_UNQUEUED_INDEX -1 Modified: stable/8/sys/cam/cam_xpt.c ============================================================================== --- stable/8/sys/cam/cam_xpt.c Wed Feb 6 18:40:07 2013 (r246431) +++ stable/8/sys/cam/cam_xpt.c Wed Feb 6 18:41:12 2013 (r246432) @@ -2413,9 +2413,6 @@ xpt_action(union ccb *start_ccb) CAM_DEBUG(start_ccb->ccb_h.path, CAM_DEBUG_TRACE, ("xpt_action\n")); start_ccb->ccb_h.status = CAM_REQ_INPROG; - /* Compatibility for RL-unaware code. */ - if (CAM_PRIORITY_TO_RL(start_ccb->ccb_h.pinfo.priority) == 0) - start_ccb->ccb_h.pinfo.priority += CAM_PRIORITY_NORMAL - 1; (*(start_ccb->ccb_h.path->bus->xport->action))(start_ccb); } Modified: stable/8/sys/cam/scsi/scsi_pass.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_pass.c Wed Feb 6 18:40:07 2013 (r246431) +++ stable/8/sys/cam/scsi/scsi_pass.c Wed Feb 6 18:41:12 2013 (r246432) @@ -428,6 +428,7 @@ passioctl(struct cdev *dev, u_long cmd, struct cam_periph *periph; struct pass_softc *softc; int error; + uint32_t priority; periph = (struct cam_periph *)dev->si_drv1; if (periph == NULL) @@ -460,6 +461,11 @@ passioctl(struct cdev *dev, u_long cmd, break; } + /* Compatibility for RL/priority-unaware code. */ + priority = inccb->ccb_h.pinfo.priority; + if (priority < CAM_RL_TO_PRIORITY(CAM_RL_NORMAL)) + priority += CAM_RL_TO_PRIORITY(CAM_RL_NORMAL); + /* * Non-immediate CCBs need a CCB from the per-device pool * of CCBs, which is scheduled by the transport layer. @@ -468,15 +474,14 @@ passioctl(struct cdev *dev, u_long cmd, */ if ((inccb->ccb_h.func_code & XPT_FC_QUEUED) && ((inccb->ccb_h.func_code & XPT_FC_USER_CCB) == 0)) { - ccb = cam_periph_getccb(periph, - inccb->ccb_h.pinfo.priority); + ccb = cam_periph_getccb(periph, priority); ccb_malloced = 0; } else { ccb = xpt_alloc_ccb_nowait(); if (ccb != NULL) xpt_setup_ccb(&ccb->ccb_h, periph->path, - inccb->ccb_h.pinfo.priority); + priority); ccb_malloced = 1; } From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 22:07:41 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CE993B9; Wed, 6 Feb 2013 22:07:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B2464E5A; Wed, 6 Feb 2013 22:07:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r16M7flq083048; Wed, 6 Feb 2013 22:07:41 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16M7d92083023; Wed, 6 Feb 2013 22:07:39 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302062207.r16M7d92083023@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Feb 2013 22:07:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246437 - in stable/9: share/examples/ses share/examples/ses/sesd share/examples/ses/srcs sys/cam/scsi sys/conf sys/fs/devfs sys/modules/cam usr.bin/kdump X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 22:07:41 -0000 Author: mav Date: Wed Feb 6 22:07:38 2013 New Revision: 246437 URL: http://svnweb.freebsd.org/changeset/base/246437 Log: MFC r235911, r235980, r238739, r238740, r238894, r239213, r241488, r241952, r242173, r242621, r242634, r242638, r242647, r242720, r244418, r244508, r245891: Revamp the CAM enclosure services driver. This updated driver uses an in-kernel daemon to track state changes and publishes physical path location information for disk elements into the CAM device database. Sponsored by: Spectra Logic Corporation Sponsored by: iXsystems, Inc. Added: stable/9/sys/cam/scsi/scsi_enc.c - copied, changed from r235911, head/sys/cam/scsi/scsi_enc.c stable/9/sys/cam/scsi/scsi_enc.h - copied unchanged from r235911, head/sys/cam/scsi/scsi_enc.h stable/9/sys/cam/scsi/scsi_enc_internal.h - copied unchanged from r235911, head/sys/cam/scsi/scsi_enc_internal.h stable/9/sys/cam/scsi/scsi_enc_safte.c - copied, changed from r235911, head/sys/cam/scsi/scsi_enc_safte.c stable/9/sys/cam/scsi/scsi_enc_ses.c - copied, changed from r235911, head/sys/cam/scsi/scsi_enc_ses.c Deleted: stable/9/sys/cam/scsi/scsi_ses.c Modified: stable/9/share/examples/ses/Makefile.inc stable/9/share/examples/ses/sesd/sesd.0 stable/9/share/examples/ses/srcs/eltsub.c stable/9/share/examples/ses/srcs/getencstat.c stable/9/share/examples/ses/srcs/getnobj.c stable/9/share/examples/ses/srcs/getobjmap.c stable/9/share/examples/ses/srcs/getobjstat.c stable/9/share/examples/ses/srcs/inienc.c stable/9/share/examples/ses/srcs/sesd.c stable/9/share/examples/ses/srcs/setencstat.c stable/9/share/examples/ses/srcs/setobjstat.c stable/9/sys/cam/scsi/scsi_pt.c stable/9/sys/cam/scsi/scsi_ses.h stable/9/sys/conf/files stable/9/sys/fs/devfs/devfs_vnops.c stable/9/sys/modules/cam/Makefile stable/9/usr.bin/kdump/mkioctls Directory Properties: stable/9/share/examples/ses/ (props changed) stable/9/sys/ (props changed) stable/9/sys/conf/ (props changed) stable/9/sys/fs/ (props changed) stable/9/sys/modules/ (props changed) stable/9/usr.bin/kdump/ (props changed) Modified: stable/9/share/examples/ses/Makefile.inc ============================================================================== --- stable/9/share/examples/ses/Makefile.inc Wed Feb 6 19:16:25 2013 (r246436) +++ stable/9/share/examples/ses/Makefile.inc Wed Feb 6 22:07:38 2013 (r246437) @@ -32,7 +32,6 @@ # mjacob@feral.com # -CFLAGS+= -I/usr/include/cam/scsi -DSESINC="" BINDIR?= /usr/sbin CLEANFILES+= ${MAN} Modified: stable/9/share/examples/ses/sesd/sesd.0 ============================================================================== --- stable/9/share/examples/ses/sesd/sesd.0 Wed Feb 6 19:16:25 2013 (r246436) +++ stable/9/share/examples/ses/sesd/sesd.0 Wed Feb 6 22:07:38 2013 (r246437) @@ -31,7 +31,7 @@ .\" .\" $FreeBSD$ .\" -.Dd February 21, 2000 +.Dd November 5, 2012 .Dt SESD 8 .Os .Sh NAME @@ -39,6 +39,7 @@ .Nd monitor SCSI Environmental Services Devices .Sh SYNOPSIS .Nm +.Op Fl c .Op Fl d .Op Fl t Ar poll-interval .Ar device @@ -57,7 +58,9 @@ poll each device for a change in state. .Pp The following options may be used: .Bl -tag -width Ds -.It Fl p Ar poll-interval +.It Fl c +Try to clear enclosure status after read. +.It Fl t Ar poll-interval Change the interval of polling from the default 30 seconds to the number of seconds specified. .It Fl d Modified: stable/9/share/examples/ses/srcs/eltsub.c ============================================================================== --- stable/9/share/examples/ses/srcs/eltsub.c Wed Feb 6 19:16:25 2013 (r246436) +++ stable/9/share/examples/ses/srcs/eltsub.c Wed Feb 6 22:07:38 2013 (r246437) @@ -33,10 +33,13 @@ */ #include +#include +#include #include #include #include -#include SESINC +#include +#include #include "eltsub.h" @@ -46,79 +49,82 @@ geteltnm(int type) static char rbuf[132]; switch (type) { - case SESTYP_UNSPECIFIED: + case ELMTYP_UNSPECIFIED: sprintf(rbuf, "Unspecified"); break; - case SESTYP_DEVICE: - sprintf(rbuf, "Device"); + case ELMTYP_DEVICE: + sprintf(rbuf, "Device Slot"); break; - case SESTYP_POWER: - sprintf(rbuf, "Power supply"); + case ELMTYP_POWER: + sprintf(rbuf, "Power Supply"); break; - case SESTYP_FAN: - sprintf(rbuf, "Cooling element"); + case ELMTYP_FAN: + sprintf(rbuf, "Cooling"); break; - case SESTYP_THERM: - sprintf(rbuf, "Temperature sensors"); + case ELMTYP_THERM: + sprintf(rbuf, "Temperature Sensors"); break; - case SESTYP_DOORLOCK: + case ELMTYP_DOORLOCK: sprintf(rbuf, "Door Lock"); break; - case SESTYP_ALARM: + case ELMTYP_ALARM: sprintf(rbuf, "Audible alarm"); break; - case SESTYP_ESCC: - sprintf(rbuf, "Enclosure services controller electronics"); + case ELMTYP_ESCC: + sprintf(rbuf, "Enclosure Services Controller Electronics"); break; - case SESTYP_SCC: - sprintf(rbuf, "SCC controller electronics"); + case ELMTYP_SCC: + sprintf(rbuf, "SCC Controller Electronics"); break; - case SESTYP_NVRAM: - sprintf(rbuf, "Nonvolatile cache"); + case ELMTYP_NVRAM: + sprintf(rbuf, "Nonvolatile Cache"); break; - case SESTYP_UPS: - sprintf(rbuf, "Uninterruptible power supply"); + case ELMTYP_INV_OP_REASON: + sprintf(rbuf, "Invalid Operation Reason"); break; - case SESTYP_DISPLAY: + case ELMTYP_UPS: + sprintf(rbuf, "Uninterruptible Power Supply"); + break; + case ELMTYP_DISPLAY: sprintf(rbuf, "Display"); break; - case SESTYP_KEYPAD: - sprintf(rbuf, "Key pad entry device"); + case ELMTYP_KEYPAD: + sprintf(rbuf, "Key Pad Entry"); break; - case SESTYP_ENCLOSURE: + case ELMTYP_ENCLOSURE: sprintf(rbuf, "Enclosure"); break; - case SESTYP_SCSIXVR: - sprintf(rbuf, "SCSI port/transceiver"); + case ELMTYP_SCSIXVR: + sprintf(rbuf, "SCSI Port/Transceiver"); break; - case SESTYP_LANGUAGE: + case ELMTYP_LANGUAGE: sprintf(rbuf, "Language"); break; - case SESTYP_COMPORT: + case ELMTYP_COMPORT: sprintf(rbuf, "Communication Port"); break; - case SESTYP_VOM: + case ELMTYP_VOM: sprintf(rbuf, "Voltage Sensor"); break; - case SESTYP_AMMETER: + case ELMTYP_AMMETER: sprintf(rbuf, "Current Sensor"); break; - case SESTYP_SCSI_TGT: - sprintf(rbuf, "SCSI target port"); + case ELMTYP_SCSI_TGT: + sprintf(rbuf, "SCSI Target Port"); break; - case SESTYP_SCSI_INI: - sprintf(rbuf, "SCSI initiator port"); + case ELMTYP_SCSI_INI: + sprintf(rbuf, "SCSI Initiator Port"); break; - case SESTYP_SUBENC: - sprintf(rbuf, "Simple sub-enclosure"); + case ELMTYP_SUBENC: + sprintf(rbuf, "Simple Subenclosure"); break; - case SESTYP_ARRAY: - sprintf(rbuf, "Array device"); + case ELMTYP_ARRAY_DEV: + sprintf(rbuf, "Array Device Slot"); break; - case SESTYP_SASEXPANDER: + case ELMTYP_SAS_EXP: sprintf(rbuf, "SAS Expander"); break; - case SESTYP_SASCONNECTOR: + case ELMTYP_SAS_CONN: sprintf(rbuf, "SAS Connector"); break; default: @@ -134,31 +140,34 @@ scode2ascii(u_char code) static char rbuf[32]; switch (code & 0xf) { case SES_OBJSTAT_UNSUPPORTED: - sprintf(rbuf, "status not supported"); + sprintf(rbuf, "Unsupported"); break; case SES_OBJSTAT_OK: - sprintf(rbuf, "ok"); + sprintf(rbuf, "OK"); break; case SES_OBJSTAT_CRIT: - sprintf(rbuf, "critical"); + sprintf(rbuf, "Critical"); break; case SES_OBJSTAT_NONCRIT: - sprintf(rbuf, "non-critical"); + sprintf(rbuf, "Noncritical"); break; case SES_OBJSTAT_UNRECOV: - sprintf(rbuf, "unrecoverable"); + sprintf(rbuf, "Unrecoverable"); break; case SES_OBJSTAT_NOTINSTALLED: - sprintf(rbuf, "not installed"); + sprintf(rbuf, "Not Installed"); break; case SES_OBJSTAT_UNKNOWN: - sprintf(rbuf, "unknown status"); + sprintf(rbuf, "Unknown"); break; case SES_OBJSTAT_NOTAVAIL: - sprintf(rbuf, "status not available"); + sprintf(rbuf, "Not Available"); + break; + case SES_OBJSTAT_NOACCESS: + sprintf(rbuf, "No Access Allowed"); break; default: - sprintf(rbuf, "unknown status code %x", code & 0xf); + sprintf(rbuf, "", code & 0xf); break; } return (rbuf); @@ -171,7 +180,11 @@ stat2ascii(int eletype __unused, u_char static char ebuf[256], *scode; scode = scode2ascii(cstat[0]); - sprintf(ebuf, "Status=%s (bytes=0x%02x 0x%02x 0x%02x 0x%02x)", - scode, cstat[0], cstat[1], cstat[2], cstat[3]); + sprintf(ebuf, "status: %s%s%s%s (0x%02x 0x%02x 0x%02x 0x%02x)", + scode, + (cstat[0] & 0x40) ? ", Prd.Fail" : "", + (cstat[0] & 0x20) ? ", Disabled" : "", + (cstat[0] & 0x10) ? ", Swapped" : "", + cstat[0], cstat[1], cstat[2], cstat[3]); return (ebuf); } Modified: stable/9/share/examples/ses/srcs/getencstat.c ============================================================================== --- stable/9/share/examples/ses/srcs/getencstat.c Wed Feb 6 19:16:25 2013 (r246436) +++ stable/9/share/examples/ses/srcs/getencstat.c Wed Feb 6 22:07:38 2013 (r246437) @@ -33,20 +33,25 @@ */ #include +#include +#include #include #include #include #include #include -#include SESINC +#include +#include #include "eltsub.h" int main(int a, char **v) { - ses_object *objp; - ses_objstat ob; + encioc_element_t *objp; + encioc_elm_status_t ob; + encioc_elm_desc_t objd; + encioc_elm_devnames_t objdn; int fd, nobj, f, i, verbose, quiet, errors; u_char estat; @@ -73,13 +78,13 @@ main(int a, char **v) perror(*v); continue; } - if (ioctl(fd, SESIOC_GETNOBJ, (caddr_t) &nobj) < 0) { - perror("SESIOC_GETNOBJ"); + if (ioctl(fd, ENCIOC_GETNELM, (caddr_t) &nobj) < 0) { + perror("ENCIOC_GETNELM"); (void) close(fd); continue; } - if (ioctl(fd, SESIOC_GETENCSTAT, (caddr_t) &estat) < 0) { - perror("SESIOC_GETENCSTAT"); + if (ioctl(fd, ENCIOC_GETENCSTAT, (caddr_t) &estat) < 0) { + perror("ENCIOC_GETENCSTAT"); (void) close(fd); continue; } @@ -113,38 +118,64 @@ main(int a, char **v) } } fprintf(stdout, ">\n"); - objp = calloc(nobj, sizeof (ses_object)); + objp = calloc(nobj, sizeof (encioc_element_t)); if (objp == NULL) { perror("calloc"); (void) close(fd); continue; } - if (ioctl(fd, SESIOC_GETOBJMAP, (caddr_t) objp) < 0) { - perror("SESIOC_GETOBJMAP"); + if (ioctl(fd, ENCIOC_GETELMMAP, (caddr_t) objp) < 0) { + perror("ENCIOC_GETELMMAP"); (void) close(fd); continue; } for (i = 0; i < nobj; i++) { - ob.obj_id = objp[i].obj_id; - if (ioctl(fd, SESIOC_GETOBJSTAT, (caddr_t) &ob) < 0) { - perror("SESIOC_GETOBJSTAT"); + ob.elm_idx = objp[i].elm_idx; + if (ioctl(fd, ENCIOC_GETELMSTAT, (caddr_t) &ob) < 0) { + perror("ENCIOC_GETELMSTAT"); (void) close(fd); break; } - if ((ob.cstat[0] & 0xf) == SES_OBJSTAT_OK) { - if (verbose) { - fprintf(stdout, - "Element 0x%x: %s OK (%s)\n", - ob.obj_id, - geteltnm(objp[i].object_type), - stat2ascii(objp[i].object_type, - ob.cstat)); - } + bzero(&objd, sizeof(objd)); + objd.elm_idx = objp[i].elm_idx; + objd.elm_desc_len = UINT16_MAX; + objd.elm_desc_str = calloc(UINT16_MAX, sizeof(char)); + if (objd.elm_desc_str == NULL) { + perror("calloc"); + (void) close(fd); continue; } - fprintf(stdout, "Element 0x%x: %s, %s\n", - ob.obj_id, geteltnm(objp[i].object_type), - stat2ascii(objp[i].object_type, ob.cstat)); + if (ioctl(fd, ENCIOC_GETELMDESC, (caddr_t)&objd) < 0) { + perror("ENCIOC_GETELMDESC"); + (void) close(fd); + break; + } + bzero(&objdn, sizeof(objdn)); + objdn.elm_idx = objp[i].elm_idx; + objdn.elm_names_size = 128; + objdn.elm_devnames = calloc(128, sizeof(char)); + if (objdn.elm_devnames == NULL) { + perror("calloc"); + (void) close(fd); + break; + } + /* + * This ioctl isn't critical and has a good chance + * of returning -1. + */ + (void)ioctl(fd, ENCIOC_GETELMDEVNAMES, (caddr_t)&objdn); + fprintf(stdout, "Element 0x%x: %s", ob.elm_idx, + geteltnm(objp[i].elm_type)); + fprintf(stdout, ", %s", + stat2ascii(objp[i].elm_type, ob.cstat)); + if (objd.elm_desc_len > 0) + fprintf(stdout, ", descriptor: '%s'", + objd.elm_desc_str); + if (objdn.elm_names_len > 0) + fprintf(stdout, ", dev: '%s'", + objdn.elm_devnames); + fprintf(stdout, "\n"); + free(objdn.elm_devnames); } free(objp); (void) close(fd); Modified: stable/9/share/examples/ses/srcs/getnobj.c ============================================================================== --- stable/9/share/examples/ses/srcs/getnobj.c Wed Feb 6 19:16:25 2013 (r246436) +++ stable/9/share/examples/ses/srcs/getnobj.c Wed Feb 6 22:07:38 2013 (r246437) @@ -33,12 +33,15 @@ */ #include +#include +#include #include #include #include #include #include -#include SESINC +#include +#include int main(int argc, char **argv) Modified: stable/9/share/examples/ses/srcs/getobjmap.c ============================================================================== --- stable/9/share/examples/ses/srcs/getobjmap.c Wed Feb 6 19:16:25 2013 (r246436) +++ stable/9/share/examples/ses/srcs/getobjmap.c Wed Feb 6 22:07:38 2013 (r246437) @@ -33,11 +33,14 @@ */ #include +#include +#include #include #include #include #include -#include SESINC +#include +#include #include "eltsub.h" Modified: stable/9/share/examples/ses/srcs/getobjstat.c ============================================================================== --- stable/9/share/examples/ses/srcs/getobjstat.c Wed Feb 6 19:16:25 2013 (r246436) +++ stable/9/share/examples/ses/srcs/getobjstat.c Wed Feb 6 22:07:38 2013 (r246437) @@ -32,11 +32,14 @@ * mjacob@feral.com */ #include +#include +#include #include #include #include #include -#include SESINC +#include +#include int main(int a, char **v) Modified: stable/9/share/examples/ses/srcs/inienc.c ============================================================================== --- stable/9/share/examples/ses/srcs/inienc.c Wed Feb 6 19:16:25 2013 (r246436) +++ stable/9/share/examples/ses/srcs/inienc.c Wed Feb 6 22:07:38 2013 (r246437) @@ -33,11 +33,14 @@ */ #include +#include +#include #include #include #include #include -#include SESINC +#include +#include int main(int a, char **v) Modified: stable/9/share/examples/ses/srcs/sesd.c ============================================================================== --- stable/9/share/examples/ses/srcs/sesd.c Wed Feb 6 19:16:25 2013 (r246436) +++ stable/9/share/examples/ses/srcs/sesd.c Wed Feb 6 22:07:38 2013 (r246437) @@ -32,14 +32,18 @@ * mjacob@feral.com */ #include +#include +#include #include #include #include #include #include #include +#include #include -#include SESINC +#include +#include #define ALLSTAT (SES_ENCSTAT_UNRECOV | SES_ENCSTAT_CRITICAL | \ SES_ENCSTAT_NONCRITICAL | SES_ENCSTAT_INFO) @@ -52,29 +56,33 @@ int main(int a, char **v) { static const char *usage = - "usage: %s [ -d ] [ -t pollinterval ] device [ device ]\n"; - int fd, polltime, dev, devbase, nodaemon; - ses_encstat stat, *carray; + "usage: %s [ -c ] [ -d ] [ -t pollinterval ] device [ device ]\n"; + int fd, polltime, dev, nodaemon, clear, c; + encioc_enc_status_t stat, nstat, *carray; if (a < 2) { fprintf(stderr, usage, *v); return (1); } - devbase = 1; - - if (strcmp(v[1], "-d") == 0) { - nodaemon = 1; - devbase++; - } else { - nodaemon = 0; - } - - if (a > 2 && strcmp(v[2], "-t") == 0) { - devbase += 2; - polltime = atoi(v[3]); - } else { - polltime = 30; + nodaemon = 0; + polltime = 30; + clear = 0; + while ((c = getopt(a, v, "cdt:")) != -1) { + switch (c) { + case 'c': + clear = 1; + break; + case 'd': + nodaemon = 1; + break; + case 't': + polltime = atoi(optarg); + break; + default: + fprintf(stderr, usage, *v); + return (1); + } } carray = malloc(a); @@ -82,20 +90,20 @@ main(int a, char **v) perror("malloc"); return (1); } - for (dev = devbase; dev < a; dev++) - carray[dev] = (ses_encstat) -1; + for (dev = optind; dev < a; dev++) + carray[dev] = (encioc_enc_status_t) -1; /* * Check to make sure we can open all devices */ - for (dev = devbase; dev < a; dev++) { + for (dev = optind; dev < a; dev++) { fd = open(v[dev], O_RDWR); if (fd < 0) { perror(v[dev]); return (1); } - if (ioctl(fd, SESIOC_INIT, NULL) < 0) { - fprintf(stderr, "%s: SESIOC_INIT fails- %s\n", + if (ioctl(fd, ENCIOC_INIT, NULL) < 0) { + fprintf(stderr, "%s: ENCIOC_INIT fails- %s\n", v[dev], strerror(errno)); return (1); } @@ -112,7 +120,7 @@ main(int a, char **v) } for (;;) { - for (dev = devbase; dev < a; dev++) { + for (dev = optind; dev < a; dev++) { fd = open(v[dev], O_RDWR); if (fd < 0) { syslog(LOG_ERR, "%s: %m", v[dev]); @@ -122,12 +130,20 @@ main(int a, char **v) /* * Get the actual current enclosure status. */ - if (ioctl(fd, SESIOC_GETENCSTAT, (caddr_t) &stat) < 0) { + if (ioctl(fd, ENCIOC_GETENCSTAT, (caddr_t) &stat) < 0) { syslog(LOG_ERR, - "%s: SESIOC_GETENCSTAT- %m", v[dev]); + "%s: ENCIOC_GETENCSTAT- %m", v[dev]); (void) close(fd); continue; } + if (stat != 0 && clear) { + nstat = 0; + if (ioctl(fd, ENCIOC_SETENCSTAT, + (caddr_t) &nstat) < 0) { + syslog(LOG_ERR, + "%s: ENCIOC_SETENCSTAT- %m", v[dev]); + } + } (void) close(fd); if (stat == carray[dev]) @@ -139,9 +155,8 @@ main(int a, char **v) "%s: Enclosure Status OK", v[dev]); } if (stat & SES_ENCSTAT_INFO) { - syslog(LOG_INFO, - "%s: Enclosure Status Has Information", - v[dev]); + syslog(LOG_NOTICE, + "%s: Enclosure Has Information", v[dev]); } if (stat & SES_ENCSTAT_NONCRITICAL) { syslog(LOG_WARNING, Modified: stable/9/share/examples/ses/srcs/setencstat.c ============================================================================== --- stable/9/share/examples/ses/srcs/setencstat.c Wed Feb 6 19:16:25 2013 (r246436) +++ stable/9/share/examples/ses/srcs/setencstat.c Wed Feb 6 22:07:38 2013 (r246437) @@ -33,18 +33,21 @@ */ #include +#include +#include #include #include #include #include -#include SESINC +#include +#include int main(int a, char **v) { int fd; long val; - ses_encstat stat; + encioc_enc_status_t stat; if (a != 3) { fprintf(stderr, "usage: %s device enclosure_status\n", *v); @@ -57,9 +60,9 @@ main(int a, char **v) } val = strtol(v[2], NULL, 0); - stat = (ses_encstat) val; - if (ioctl(fd, SESIOC_SETENCSTAT, (caddr_t) &stat) < 0) { - perror("SESIOC_SETENCSTAT"); + stat = (encioc_enc_status_t)val; + if (ioctl(fd, ENCIOC_SETENCSTAT, (caddr_t) &stat) < 0) { + perror("ENCIOC_SETENCSTAT"); } (void) close(fd); return (0); Modified: stable/9/share/examples/ses/srcs/setobjstat.c ============================================================================== --- stable/9/share/examples/ses/srcs/setobjstat.c Wed Feb 6 19:16:25 2013 (r246436) +++ stable/9/share/examples/ses/srcs/setobjstat.c Wed Feb 6 22:07:38 2013 (r246437) @@ -33,18 +33,21 @@ */ #include +#include +#include #include #include #include #include -#include SESINC +#include +#include int main(int a, char **v) { int fd; int i; - ses_objstat obj; + encioc_elm_status_t obj; long cvt; char *x; @@ -64,7 +67,7 @@ usage: if (x == v[2]) { goto usage; } - obj.obj_id = cvt; + obj.elm_idx = cvt; for (i = 0; i < 4; i++) { x = v[3 + i]; cvt = strtol(v[3 + i], &x, 0); @@ -73,8 +76,8 @@ usage: } obj.cstat[i] = cvt; } - if (ioctl(fd, SESIOC_SETOBJSTAT, (caddr_t) &obj) < 0) { - perror("SESIOC_SETOBJSTAT"); + if (ioctl(fd, ENCIOC_SETELMSTAT, (caddr_t) &obj) < 0) { + perror("ENCIOC_SETELMSTAT"); } (void) close(fd); return (0); Copied and modified: stable/9/sys/cam/scsi/scsi_enc.c (from r235911, head/sys/cam/scsi/scsi_enc.c) ============================================================================== --- head/sys/cam/scsi/scsi_enc.c Thu May 24 14:07:44 2012 (r235911, copy source) +++ stable/9/sys/cam/scsi/scsi_enc.c Wed Feb 6 22:07:38 2013 (r246437) @@ -56,15 +56,10 @@ __FBSDID("$FreeBSD$"); #include #include -#include - MALLOC_DEFINE(M_SCSIENC, "SCSI ENC", "SCSI ENC buffers"); /* Enclosure type independent driver */ -#define SEN_ID "UNISYS SUN_SEN" -#define SEN_ID_LEN 24 - static d_open_t enc_open; static d_close_t enc_close; static d_ioctl_t enc_ioctl; @@ -136,15 +131,8 @@ enc_oninvalidate(struct cam_periph *peri */ enc->enc_flags |= ENC_FLAG_SHUTDOWN; if (enc->enc_daemon != NULL) { - /* Signal and wait for the ses daemon to terminate. */ + /* Signal the ses daemon to terminate. */ wakeup(enc->enc_daemon); - /* - * We're called with the SIM mutex held, but we're dropping - * the update mutex here on sleep. So we have to manually - * drop the SIM mutex. - */ - cam_periph_sleep(enc->periph, enc->enc_daemon, - PUSER, "thtrm", 0); } callout_drain(&enc->status_updater); @@ -567,7 +555,7 @@ enc_runcmd(struct enc_softc *enc, char * cdbl = IOCDBLEN; } - ccb = cam_periph_getccb(enc->periph, 1); + ccb = cam_periph_getccb(enc->periph, CAM_PRIORITY_NORMAL); if (enc->enc_type == ENC_SEMB_SES || enc->enc_type == ENC_SEMB_SAFT) { tdlen = min(dlen, 1020); tdlen = (tdlen + 3) & ~3; @@ -635,9 +623,8 @@ enc_log(struct enc_softc *enc, const cha /* * Is this a device that supports enclosure services? * - * It's a a pretty simple ruleset- if it is device type 0x0D (13), it's - * an ENC device. If it happens to be an old UNISYS SEN device, we can - * handle that too. + * It's a a pretty simple ruleset- if it is device type + * 0x0D (13), it's an ENCLOSURE device. */ #define SAFTE_START 44 @@ -664,13 +651,9 @@ enc_type(struct ccb_getdev *cgd) iqd = (unsigned char *)&cgd->inq_data; buflen = min(sizeof(cgd->inq_data), SID_ADDITIONAL_LENGTH(&cgd->inq_data)); - if (buflen < 8+SEN_ID_LEN) - return (ENC_NONE); if ((iqd[0] & 0x1f) == T_ENCLOSURE) { - if (STRNCMP(&iqd[8], SEN_ID, SEN_ID_LEN) == 0) { - return (ENC_SEN); - } else if ((iqd[2] & 0x7) > 2) { + if ((iqd[2] & 0x7) > 2) { return (ENC_SES); } else { return (ENC_SES_SCSI2); @@ -839,6 +822,7 @@ enc_daemon(void *arg) } enc->enc_daemon = NULL; cam_periph_unlock(enc->periph); + cam_periph_release(enc->periph); kproc_exit(0); } @@ -849,6 +833,9 @@ enc_kproc_init(enc_softc_t *enc) callout_init_mtx(&enc->status_updater, enc->periph->sim->mtx, 0); + if (cam_periph_acquire(enc->periph) != CAM_REQ_CMP) + return (ENXIO); + result = kproc_create(enc_daemon, enc, &enc->enc_daemon, /*flags*/0, /*stackpgs*/0, "enc_daemon%d", enc->periph->unit_number); @@ -857,7 +844,8 @@ enc_kproc_init(enc_softc_t *enc) cam_periph_lock(enc->periph); enc->enc_vec.poll_status(enc); cam_periph_unlock(enc->periph); - } + } else + cam_periph_release(enc->periph); return (result); } @@ -887,11 +875,6 @@ enc_ctor(struct cam_periph *periph, void char *tname; cgd = (struct ccb_getdev *)arg; - if (periph == NULL) { - printf("enc_ctor: periph was NULL!!\n"); - goto out; - } - if (cgd == NULL) { printf("enc_ctor: no getdev CCB, can't register device\n"); goto out; @@ -920,7 +903,6 @@ enc_ctor(struct cam_periph *periph, void case ENC_SEMB_SAFT: err = safte_softc_init(enc); break; - case ENC_SEN: case ENC_NONE: default: ENC_FREE(enc); @@ -955,7 +937,7 @@ enc_ctor(struct cam_periph *periph, void err = enc_kproc_init(enc); if (err) { xpt_print(periph->path, - "error %d string enc_daemon\n", err); + "error %d starting enc_daemon\n", err); goto out; } } @@ -987,9 +969,6 @@ enc_ctor(struct cam_periph *periph, void case ENC_SES_PASSTHROUGH: tname = "ENC Passthrough Device"; break; - case ENC_SEN: - tname = "UNISYS SEN Device (NOT HANDLED YET)"; - break; case ENC_SAFT: tname = "SAF-TE Compliant Device"; break; Copied: stable/9/sys/cam/scsi/scsi_enc.h (from r235911, head/sys/cam/scsi/scsi_enc.h) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/sys/cam/scsi/scsi_enc.h Wed Feb 6 22:07:38 2013 (r246437, copy of r235911, head/sys/cam/scsi/scsi_enc.h) @@ -0,0 +1,219 @@ +/* $FreeBSD$ */ +/*- + * Copyright (c) 2000 by Matthew Jacob + * 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, + * without modification, immediately at the beginning of the file. + * 2. The name of the author may not be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * Alternatively, this software may be distributed under the terms of the + * the GNU Public License ("GPL"). + * + * 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. + * + */ +#ifndef _SCSI_ENC_H_ +#define _SCSI_ENC_H_ + +#include + +#define ENCIOC ('s' - 040) +#define ENCIOC_GETNELM _IO(ENCIOC, 1) +#define ENCIOC_GETELMMAP _IO(ENCIOC, 2) +#define ENCIOC_GETENCSTAT _IO(ENCIOC, 3) +#define ENCIOC_SETENCSTAT _IO(ENCIOC, 4) +#define ENCIOC_GETELMSTAT _IO(ENCIOC, 5) +#define ENCIOC_SETELMSTAT _IO(ENCIOC, 6) +#define ENCIOC_GETTEXT _IO(ENCIOC, 7) +#define ENCIOC_INIT _IO(ENCIOC, 8) +#define ENCIOC_GETELMDESC _IO(ENCIOC, 9) +#define ENCIOC_GETELMDEVNAMES _IO(ENCIOC, 10) +#define ENCIOC_GETSTRING _IO(ENCIOC, 11) +#define ENCIOC_SETSTRING _IO(ENCIOC, 12) + +/* + * Platform Independent Definitions for enclosure devices. + */ +/* + * SCSI Based Environmental Services Application Defines + * + * Based almost entirely on SCSI-3 ENC Revision 8A specification, + * but slightly abstracted as the underlying device may in fact + * be a SAF-TE or vendor unique device. + */ +/* + * ENC Driver Operations: + * (The defines themselves are platform and access method specific) + * + * ENCIOC_GETNELM + * ENCIOC_GETELMMAP + * ENCIOC_GETENCSTAT + * ENCIOC_SETENCSTAT + * ENCIOC_GETELMSTAT + * ENCIOC_SETELMSTAT + * ENCIOC_INIT + * + * + * An application finds out how many elements an enclosure instance + * is managing by performing a ENCIOC_GETNELM operation. It then + * performs a ENCIOC_GETELMMAP to get the map that contains the + * elment identifiers for all elements (see encioc_element_t below). + * This information is static. + * + * The application may perform ENCIOC_GETELMSTAT operations to retrieve + * status on an element (see the enc_elm_status_t structure below), + * ENCIOC_SETELMSTAT operations to set status for an element. + * + * Similarly, overall enclosure status me be fetched or set via + * ENCIOC_GETENCSTAT or ENCIOC_SETENCSTAT operations (see encioc_enc_status_t + * below). + * + * Readers should note that there is nothing that requires either a set + * or a clear operation to actually latch and do anything in the target. + * + * A ENCIOC_INIT operation causes the enclosure to be initialized. + */ + +/* Element Types */ +typedef enum { + ELMTYP_UNSPECIFIED = 0x00, + ELMTYP_DEVICE = 0x01, + ELMTYP_POWER = 0x02, + ELMTYP_FAN = 0x03, + ELMTYP_THERM = 0x04, + ELMTYP_DOORLOCK = 0x05, + ELMTYP_ALARM = 0x06, + ELMTYP_ESCC = 0x07, /* Enclosure SCC */ + ELMTYP_SCC = 0x08, /* SCC */ + ELMTYP_NVRAM = 0x09, + ELMTYP_INV_OP_REASON = 0x0a, + ELMTYP_UPS = 0x0b, + ELMTYP_DISPLAY = 0x0c, + ELMTYP_KEYPAD = 0x0d, + ELMTYP_ENCLOSURE = 0x0e, + ELMTYP_SCSIXVR = 0x0f, + ELMTYP_LANGUAGE = 0x10, + ELMTYP_COMPORT = 0x11, + ELMTYP_VOM = 0x12, + ELMTYP_AMMETER = 0x13, + ELMTYP_SCSI_TGT = 0x14, + ELMTYP_SCSI_INI = 0x15, + ELMTYP_SUBENC = 0x16, + ELMTYP_ARRAY_DEV = 0x17, + ELMTYP_SAS_EXP = 0x18, /* SAS expander */ + ELMTYP_SAS_CONN = 0x19 /* SAS connector */ +} elm_type_t; + +typedef struct encioc_element { + /* Element Index */ + unsigned int elm_idx; + + /* ID of SubEnclosure containing Element*/ + unsigned int elm_subenc_id; + + /* Element Type */ + elm_type_t elm_type; +} encioc_element_t; + +/* + * Overall Enclosure Status + */ +typedef unsigned char encioc_enc_status_t; + +/* + * Element Status + */ +typedef struct encioc_elm_status { + unsigned int elm_idx; + unsigned char cstat[4]; +} encioc_elm_status_t; + +/* + * ENC String structure, for StringIn and StringOut commands; use this with + * the ENCIOC_GETSTRING and ENCIOC_SETSTRING ioctls. + */ +typedef struct encioc_string { + size_t bufsiz; /* IN/OUT: length of string provided/returned */ +#define ENC_STRING_MAX 0xffff + uint8_t *buf; /* IN/OUT: string */ +} encioc_string_t; + +/*============================================================================*/ + +/* + * SES v2 r20 6.1.10 (pg 39) - Element Descriptor diagnostic page + * Tables 21, 22, and 23 + */ +typedef struct encioc_elm_desc { + unsigned int elm_idx; /* IN: elment requested */ + uint16_t elm_desc_len; /* IN: buffer size; OUT: bytes written */ + char *elm_desc_str; /* IN/OUT: buffer for descriptor data */ +} encioc_elm_desc_t; + +/* + * ENCIOC_GETELMDEVNAMES: + * ioctl structure to get an element's device names, if available + */ +typedef struct encioc_elm_devnames { + unsigned int elm_idx; /* IN: element index */ + size_t elm_names_size;/* IN: size of elm_devnames */ + size_t elm_names_len; /* OUT: actual size returned */ + /* + * IN/OUT: comma separated list of peripheral driver + * instances servicing this element. + */ + char *elm_devnames; +} encioc_elm_devnames_t; + +/* ioctl structure for requesting FC info for a port */ +typedef struct encioc_elm_fc_port { + unsigned int elm_idx; + unsigned int port_idx; + struct ses_elm_fc_port port_data; +} encioc_elm_fc_port_t; *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 22:22:16 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3972F3C3; Wed, 6 Feb 2013 22:22:16 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0896CEF9; Wed, 6 Feb 2013 22:22:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r16MMFqi088750; Wed, 6 Feb 2013 22:22:15 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16MMF2U088748; Wed, 6 Feb 2013 22:22:15 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302062222.r16MMF2U088748@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Feb 2013 22:22:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246438 - in stable/9/sys/cam: . scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 22:22:16 -0000 Author: mav Date: Wed Feb 6 22:22:15 2013 New Revision: 246438 URL: http://svnweb.freebsd.org/changeset/base/246438 Log: MFC r241503: XPT_DEV_MATCH is probably the only xpt_action() method that is called without holding SIM lock. It really doesn't need that lock, but adding it removes that specific exception, allowing to assert locking there later. Modified: stable/9/sys/cam/cam_xpt.c stable/9/sys/cam/scsi/scsi_enc_ses.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Wed Feb 6 22:07:38 2013 (r246437) +++ stable/9/sys/cam/cam_xpt.c Wed Feb 6 22:22:15 2013 (r246438) @@ -582,7 +582,9 @@ xptioctl(struct cdev *dev, u_long cmd, c /* * This is an immediate CCB, we can send it on directly. */ + CAM_SIM_LOCK(xpt_path_sim(xpt_periph->path)); xpt_action(inccb); + CAM_SIM_UNLOCK(xpt_path_sim(xpt_periph->path)); /* * Map the buffers back into user space. @@ -2815,6 +2817,11 @@ xpt_action_default(union ccb *start_ccb) position_type = CAM_DEV_POS_PDRV; } + /* + * Note that we drop the SIM lock here, because the EDT + * traversal code needs to do its own locking. + */ + CAM_SIM_UNLOCK(xpt_path_sim(cdm->ccb_h.path)); switch(position_type & CAM_DEV_POS_TYPEMASK) { case CAM_DEV_POS_EDT: xptedtmatch(cdm); @@ -2826,6 +2833,7 @@ xpt_action_default(union ccb *start_ccb) cdm->status = CAM_DEV_MATCH_ERROR; break; } + CAM_SIM_LOCK(xpt_path_sim(cdm->ccb_h.path)); if (cdm->status == CAM_DEV_MATCH_ERROR) start_ccb->ccb_h.status = CAM_REQ_CMP_ERR; Modified: stable/9/sys/cam/scsi/scsi_enc_ses.c ============================================================================== --- stable/9/sys/cam/scsi/scsi_enc_ses.c Wed Feb 6 22:07:38 2013 (r246437) +++ stable/9/sys/cam/scsi/scsi_enc_ses.c Wed Feb 6 22:22:15 2013 (r246438) @@ -901,9 +901,10 @@ ses_path_iter_devid_callback(enc_softc_t device_pattern->data.devid_pat.id_len); memset(&cdm, 0, sizeof(cdm)); - if (xpt_create_path(&cdm.ccb_h.path, /*periph*/NULL, CAM_XPT_PATH_ID, - CAM_TARGET_WILDCARD, - CAM_LUN_WILDCARD) != CAM_REQ_CMP) + if (xpt_create_path_unlocked(&cdm.ccb_h.path, /*periph*/NULL, + CAM_XPT_PATH_ID, + CAM_TARGET_WILDCARD, + CAM_LUN_WILDCARD) != CAM_REQ_CMP) return; cdm.ccb_h.func_code = XPT_DEV_MATCH; @@ -913,8 +914,11 @@ ses_path_iter_devid_callback(enc_softc_t cdm.match_buf_len = sizeof(match_result); cdm.matches = &match_result; + sim = xpt_path_sim(cdm.ccb_h.path); + CAM_SIM_LOCK(sim); xpt_action((union ccb *)&cdm); xpt_free_path(cdm.ccb_h.path); + CAM_SIM_UNLOCK(sim); if ((cdm.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP || (cdm.status != CAM_DEV_MATCH_LAST From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 22:25:29 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 132FE57C; Wed, 6 Feb 2013 22:25:29 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EACF0F22; Wed, 6 Feb 2013 22:25:28 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r16MPSev089273; Wed, 6 Feb 2013 22:25:28 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16MPSd1089271; Wed, 6 Feb 2013 22:25:28 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302062225.r16MPSd1089271@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Feb 2013 22:25:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246439 - stable/9/sys/cam/ctl X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 22:25:29 -0000 Author: mav Date: Wed Feb 6 22:25:28 2013 New Revision: 246439 URL: http://svnweb.freebsd.org/changeset/base/246439 Log: MFC r242358 (by trasz): Use M_ZERO instead of explicit memsets and bzeros. Modified: stable/9/sys/cam/ctl/ctl.c stable/9/sys/cam/ctl/ctl_backend_block.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ctl/ctl.c ============================================================================== --- stable/9/sys/cam/ctl/ctl.c Wed Feb 6 22:22:15 2013 (r246438) +++ stable/9/sys/cam/ctl/ctl.c Wed Feb 6 22:25:28 2013 (r246439) @@ -957,11 +957,10 @@ ctl_init(void) if (ctl_disable != 0) return; - control_softc = malloc(sizeof(*control_softc), M_DEVBUF, M_WAITOK); + control_softc = malloc(sizeof(*control_softc), M_DEVBUF, + M_WAITOK | M_ZERO); softc = control_softc; - memset(softc, 0, sizeof(*softc)); - softc->dev = make_dev(&ctl_cdevsw, 0, UID_ROOT, GID_OPERATOR, 0600, "cam/ctl"); @@ -3271,14 +3270,13 @@ ctl_pool_create(struct ctl_softc *ctl_so retval = 0; - pool = (struct ctl_io_pool *)malloc(sizeof(*pool), M_CTL, M_NOWAIT); + pool = (struct ctl_io_pool *)malloc(sizeof(*pool), M_CTL, + M_NOWAIT | M_ZERO); if (pool == NULL) { retval = -ENOMEM; goto bailout; } - memset(pool, 0, sizeof(*pool)); - pool->type = pool_type; pool->ctl_softc = ctl_softc; @@ -6561,7 +6559,7 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) header_len, page_len, total_len); #endif - ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); ctsio->kern_sg_entries = 0; ctsio->kern_data_resid = 0; ctsio->kern_rel_offset = 0; @@ -6574,7 +6572,6 @@ ctl_mode_sense(struct ctl_scsiio *ctsio) ctsio->kern_data_len = alloc_len; ctsio->kern_total_len = alloc_len; } - memset(ctsio->kern_data_ptr, 0, total_len); switch (ctsio->cdb[0]) { case MODE_SENSE_6: { @@ -6742,7 +6739,7 @@ ctl_read_capacity(struct ctl_scsiio *cts lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK | M_ZERO); data = (struct scsi_read_capacity_data *)ctsio->kern_data_ptr; ctsio->residual = 0; ctsio->kern_data_len = sizeof(*data); @@ -6751,8 +6748,6 @@ ctl_read_capacity(struct ctl_scsiio *cts ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; - memset(data, 0, sizeof(*data)); - /* * If the maximum LBA is greater than 0xfffffffe, the user must * issue a SERVICE ACTION IN (16) command, with the read capacity @@ -6806,7 +6801,7 @@ ctl_read_capacity_16(struct ctl_scsiio * lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; - ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(sizeof(*data), M_CTL, M_WAITOK | M_ZERO); data = (struct scsi_read_capacity_data_long *)ctsio->kern_data_ptr; if (sizeof(*data) < alloc_len) { @@ -6822,8 +6817,6 @@ ctl_read_capacity_16(struct ctl_scsiio * ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; - memset(data, 0, sizeof(*data)); - scsi_u64to8b(lun->be_lun->maxlba, data->addr); /* XXX KDM this may not be 512 bytes... */ scsi_ulto4b(lun->be_lun->blocksize, data->length); @@ -6913,8 +6906,7 @@ ctl_maintenance_in(struct ctl_scsiio *ct alloc_len = scsi_4btoul(cdb->length); - ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK); - memset(ctsio->kern_data_ptr, 0, total_len); + ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); ctsio->kern_sg_entries = 0; @@ -7068,7 +7060,7 @@ retry: } mtx_unlock(&softc->ctl_lock); - ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(total_len, M_CTL, M_WAITOK | M_ZERO); if (total_len < alloc_len) { ctsio->residual = alloc_len - total_len; @@ -7084,8 +7076,6 @@ retry: ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; - memset(ctsio->kern_data_ptr, 0, total_len); - mtx_lock(&softc->ctl_lock); switch (cdb->action) { case SPRI_RK: { // read keys @@ -8611,7 +8601,7 @@ ctl_report_luns(struct ctl_scsiio *ctsio lun_datalen = sizeof(*lun_data) + (num_luns * sizeof(struct scsi_report_luns_lundata)); - ctsio->kern_data_ptr = malloc(lun_datalen, M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(lun_datalen, M_CTL, M_WAITOK | M_ZERO); lun_data = (struct scsi_report_luns_data *)ctsio->kern_data_ptr; ctsio->kern_sg_entries = 0; @@ -8630,8 +8620,6 @@ ctl_report_luns(struct ctl_scsiio *ctsio initidx = ctl_get_initindex(&ctsio->io_hdr.nexus); - memset(lun_data, 0, lun_datalen); - /* * We set this to the actual data length, regardless of how much * space we actually have to return results. If the user looks at @@ -8907,7 +8895,7 @@ ctl_inquiry_evpd_supported(struct ctl_sc * XXX KDM GFP_??? We probably don't want to wait here, * unless we end up having a process/thread context. */ - ctsio->kern_data_ptr = malloc(sup_page_size, M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(sup_page_size, M_CTL, M_WAITOK | M_ZERO); if (ctsio->kern_data_ptr == NULL) { ctsio->io_hdr.status = CTL_SCSI_ERROR; ctsio->scsi_status = SCSI_STATUS_BUSY; @@ -8930,8 +8918,6 @@ ctl_inquiry_evpd_supported(struct ctl_sc ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; - memset(pages, 0, sup_page_size); - /* * The control device is always connected. The disk device, on the * other hand, may not be online all the time. Need to change this @@ -8971,7 +8957,7 @@ ctl_inquiry_evpd_serial(struct ctl_scsii lun = (struct ctl_lun *)ctsio->io_hdr.ctl_private[CTL_PRIV_LUN].ptr; /* XXX KDM which malloc flags here?? */ - ctsio->kern_data_ptr = malloc(sizeof(*sn_ptr), M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(sizeof(*sn_ptr), M_CTL, M_WAITOK | M_ZERO); if (ctsio->kern_data_ptr == NULL) { ctsio->io_hdr.status = CTL_SCSI_ERROR; ctsio->scsi_status = SCSI_STATUS_BUSY; @@ -8994,8 +8980,6 @@ ctl_inquiry_evpd_serial(struct ctl_scsii ctsio->kern_rel_offset = 0; ctsio->kern_sg_entries = 0; - memset(sn_ptr, 0, sizeof(*sn_ptr)); - /* * The control device is always connected. The disk device, on the * other hand, may not be online all the time. Need to change this @@ -9065,7 +9049,7 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio sizeof(struct scsi_vpd_id_trgt_port_grp_id); /* XXX KDM which malloc flags here ?? */ - ctsio->kern_data_ptr = malloc(devid_len, M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(devid_len, M_CTL, M_WAITOK | M_ZERO); if (ctsio->kern_data_ptr == NULL) { ctsio->io_hdr.status = CTL_SCSI_ERROR; ctsio->scsi_status = SCSI_STATUS_BUSY; @@ -9096,7 +9080,6 @@ ctl_inquiry_evpd_devid(struct ctl_scsiio CTL_WWPN_LEN); desc3 = (struct scsi_vpd_id_descriptor *)(&desc2->identifier[0] + sizeof(struct scsi_vpd_id_rel_trgt_port_id)); - memset(devid_ptr, 0, devid_len); /* * The control device is always connected. The disk device, on the @@ -9296,7 +9279,7 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio * that much. */ /* XXX KDM what malloc flags should we use here?? */ - ctsio->kern_data_ptr = malloc(sizeof(*inq_ptr), M_CTL, M_WAITOK); + ctsio->kern_data_ptr = malloc(sizeof(*inq_ptr), M_CTL, M_WAITOK | M_ZERO); if (ctsio->kern_data_ptr == NULL) { ctsio->io_hdr.status = CTL_SCSI_ERROR; ctsio->scsi_status = SCSI_STATUS_BUSY; @@ -9318,8 +9301,6 @@ ctl_inquiry_std(struct ctl_scsiio *ctsio ctsio->kern_total_len = alloc_len; } - memset(inq_ptr, 0, sizeof(*inq_ptr)); - /* * If we have a LUN configured, report it as connected. Otherwise, * report that it is offline or no device is supported, depending Modified: stable/9/sys/cam/ctl/ctl_backend_block.c ============================================================================== --- stable/9/sys/cam/ctl/ctl_backend_block.c Wed Feb 6 22:22:15 2013 (r246438) +++ stable/9/sys/cam/ctl/ctl_backend_block.c Wed Feb 6 22:25:28 2013 (r246439) @@ -376,7 +376,6 @@ ctl_grow_beio(struct ctl_be_block_softc beio = (struct ctl_be_block_io *)malloc(sizeof(*beio), M_CTLBLK, M_WAITOK | M_ZERO); - bzero(beio, sizeof(*beio)); beio->softc = softc; mtx_lock(&softc->lock); STAILQ_INSERT_TAIL(&softc->beio_free_queue, beio, links); From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 22:30:41 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 10B4E767; Wed, 6 Feb 2013 22:30:41 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 02B1FF67; Wed, 6 Feb 2013 22:30:41 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r16MUee0090166; Wed, 6 Feb 2013 22:30:40 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16MUetE090164; Wed, 6 Feb 2013 22:30:40 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302062230.r16MUetE090164@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Feb 2013 22:30:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246440 - stable/9/sys/cam X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 22:30:41 -0000 Author: mav Date: Wed Feb 6 22:30:40 2013 New Revision: 246440 URL: http://svnweb.freebsd.org/changeset/base/246440 Log: MFC r244001 (by ken): Fix a panic during CAM EDT traversal. The problem was a race condition between the EDT traversal used by things like 'camcontrol devlist', and CAM peripheral driver removal. The EDT traversal code holds the CAM topology lock, and wants to show devices that have been invalidated. It acquires a reference to the peripheral to make sure the peripheral it is examining doesn't go away. However, because the peripheral removal code in camperiphfree() drops the CAM topology lock to call the peripheral's destructor routine, we can run into a situation where the EDT traversal increments the peripheral reference count after free process is already in progress. At that point, the reference count is ignored, because it was 0 when we started the process. Fix this race by setting a flag, CAM_PERIPH_FREE, that I previously added and checked in xptperiphtraverse() and xptpdperiphtravsere(), but failed to use. If the EDT traversal code sees that flag, it will know that the peripheral free process has already started, and that it should not access that peripheral. Also, fix an inconsistency in the locking between xptpdperiphtraverse() and xptperiphtraverse(). They now both hold the CAM topology lock while calling the peripheral traversal function. cam_xpt.c: Change xptperiphtraverse() to hold the CAM topology lock across calls to the traversal function. Take out the comment in xptpdperiphtraverse() that referenced the locking inconsistency. cam_periph.c: Set the CAM_PERIPH_FREE flag when we are in the process of freeing a peripheral driver. Sponsored by: Spectra Logic Corporation Modified: stable/9/sys/cam/cam_periph.c stable/9/sys/cam/cam_xpt.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/cam_periph.c ============================================================================== --- stable/9/sys/cam/cam_periph.c Wed Feb 6 22:25:28 2013 (r246439) +++ stable/9/sys/cam/cam_periph.c Wed Feb 6 22:30:40 2013 (r246440) @@ -615,6 +615,14 @@ camperiphfree(struct cam_periph *periph) } /* + * We need to set this flag before dropping the topology lock, to + * let anyone who is traversing the list that this peripheral is + * about to be freed, and there will be no more reference count + * checks. + */ + periph->flags |= CAM_PERIPH_FREE; + + /* * The peripheral destructor semantics dictate calling with only the * SIM mutex held. Since it might sleep, it should not be called * with the topology lock held. Modified: stable/9/sys/cam/cam_xpt.c ============================================================================== --- stable/9/sys/cam/cam_xpt.c Wed Feb 6 22:25:28 2013 (r246439) +++ stable/9/sys/cam/cam_xpt.c Wed Feb 6 22:30:40 2013 (r246440) @@ -2178,8 +2178,8 @@ xptperiphtraverse(struct cam_ed *device, * invalidated, but not peripherals that are scheduled to * be freed. So instead of calling cam_periph_acquire(), * which will fail if the periph has been invalidated, we - * just check for the free flag here. If it is free, we - * skip to the next periph. + * just check for the free flag here. If it is in the + * process of being freed, we skip to the next periph. */ if (periph->flags & CAM_PERIPH_FREE) { next_periph = SLIST_NEXT(periph, periph_links); @@ -2192,16 +2192,9 @@ xptperiphtraverse(struct cam_ed *device, */ periph->refcount++; - xpt_unlock_buses(); - retval = tr_func(periph, arg); /* - * We need the lock for list traversal. - */ - xpt_lock_buses(); - - /* * Grab the next peripheral before we release this one, so * our next pointer is still valid. */ @@ -2283,11 +2276,6 @@ xptpdperiphtraverse(struct periph_driver */ periph->refcount++; - /* - * XXX KDM we have the toplogy lock here, but in - * xptperiphtraverse(), we drop it before calling the - * traversal function. Which is correct? - */ retval = tr_func(periph, arg); /* From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 22:32:46 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 47003909; Wed, 6 Feb 2013 22:32:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 36C31F8A; Wed, 6 Feb 2013 22:32:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r16MWknB091955; Wed, 6 Feb 2013 22:32:46 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16MWkvD091954; Wed, 6 Feb 2013 22:32:46 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302062232.r16MWkvD091954@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Feb 2013 22:32:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246441 - stable/9/sys/cam/ctl X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 22:32:46 -0000 Author: mav Date: Wed Feb 6 22:32:45 2013 New Revision: 246441 URL: http://svnweb.freebsd.org/changeset/base/246441 Log: MFC r244016 (by ken): Make sure we hold the SIM lock when calling xpt_free_path(). Sponsored by: Spectra Logic Corporation Modified: stable/9/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/9/sys/cam/ctl/scsi_ctl.c Wed Feb 6 22:30:40 2013 (r246440) +++ stable/9/sys/cam/ctl/scsi_ctl.c Wed Feb 6 22:32:45 2013 (r246441) @@ -1822,8 +1822,6 @@ ctlfe_onoffline(void *arg, int online) xpt_action(ccb); - CAM_SIM_UNLOCK(sim); - if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) { printf("%s: SIM %s (path id %d) target %s failed with " "status %#x\n", @@ -1836,9 +1834,12 @@ ctlfe_onoffline(void *arg, int online) (online != 0) ? "enable" : "disable"); } - free(ccb, M_TEMP); xpt_free_path(path); + CAM_SIM_UNLOCK(sim); + + free(ccb, M_TEMP); + return; } @@ -1920,10 +1921,10 @@ ctlfe_lun_enable(void *arg, struct ctl_i 0, softc); - mtx_unlock(sim->mtx); - xpt_free_path(path); + mtx_unlock(sim->mtx); + return (0); } From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 22:39:46 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2A253EA9; Wed, 6 Feb 2013 22:39:46 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0571F28; Wed, 6 Feb 2013 22:39:46 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r16Mdjep093291; Wed, 6 Feb 2013 22:39:45 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r16MdjAg093290; Wed, 6 Feb 2013 22:39:45 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302062239.r16MdjAg093290@svn.freebsd.org> From: Alexander Motin Date: Wed, 6 Feb 2013 22:39:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246442 - stable/9/sys/cam/ctl X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 22:39:46 -0000 Author: mav Date: Wed Feb 6 22:39:45 2013 New Revision: 246442 URL: http://svnweb.freebsd.org/changeset/base/246442 Log: MFC r236426 (by mjacob): Print FC PortID as a hex number. This makes it easy to figure out domain, etc.. Zero ATIO and INOTify allocations. It makes for much less guesswork when looking at the structure and seeing 'deadc0de' present. Modified: stable/9/sys/cam/ctl/scsi_ctl.c Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cam/ctl/scsi_ctl.c ============================================================================== --- stable/9/sys/cam/ctl/scsi_ctl.c Wed Feb 6 22:32:45 2013 (r246441) +++ stable/9/sys/cam/ctl/scsi_ctl.c Wed Feb 6 22:39:45 2013 (r246442) @@ -499,7 +499,7 @@ ctlfeasync(void *callback_arg, uint32_t dev_chg = (struct ac_device_changed *)ac->contract_data; - printf("%s: WWPN %#jx port %u path %u target %u %s\n", + printf("%s: WWPN %#jx port 0x%06x path %u target %u %s\n", __func__, dev_chg->wwpn, dev_chg->port, xpt_path_path_id(path), dev_chg->target, (dev_chg->arrived == 0) ? "left" : "arrived"); @@ -590,7 +590,7 @@ ctlferegister(struct cam_periph *periph, union ccb *new_ccb; new_ccb = (union ccb *)malloc(sizeof(*new_ccb), M_CTLFE, - M_NOWAIT); + M_ZERO|M_NOWAIT); if (new_ccb == NULL) { status = CAM_RESRC_UNAVAIL; break; @@ -624,7 +624,7 @@ ctlferegister(struct cam_periph *periph, union ccb *new_ccb; new_ccb = (union ccb *)malloc(sizeof(*new_ccb), M_CTLFE, - M_NOWAIT); + M_ZERO|M_NOWAIT); if (new_ccb == NULL) { status = CAM_RESRC_UNAVAIL; break; From owner-svn-src-stable@FreeBSD.ORG Wed Feb 6 23:51:09 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E356F309; Wed, 6 Feb 2013 23:51:09 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 382FD3F3; Wed, 6 Feb 2013 23:51:09 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r16Np0JY070420; Thu, 7 Feb 2013 01:51:00 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.4 kib.kiev.ua r16Np0JY070420 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r16Np0d3070419; Thu, 7 Feb 2013 01:51:00 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 7 Feb 2013 01:51:00 +0200 From: Konstantin Belousov To: Alexander Motin Subject: Re: svn commit: r246437 - in stable/9: share/examples/ses share/examples/ses/sesd share/examples/ses/srcs sys/cam/scsi sys/conf sys/fs/devfs sys/modules/cam usr.bin/kdump Message-ID: <20130206235100.GD2522@kib.kiev.ua> References: <201302062207.r16M7d92083023@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="mF1peDl4f1TE7z5s" Content-Disposition: inline In-Reply-To: <201302062207.r16M7d92083023@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Feb 2013 23:51:10 -0000 --mF1peDl4f1TE7z5s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Feb 06, 2013 at 10:07:39PM +0000, Alexander Motin wrote: > Author: mav > Date: Wed Feb 6 22:07:38 2013 > New Revision: 246437 > URL: http://svnweb.freebsd.org/changeset/base/246437 >=20 > Log: > MFC r235911, r235980, r238739, r238740, r238894, r239213, r241488, r241= 952, > r242173, r242621, r242634, r242638, r242647, r242720, r244418, r244508, > r245891: > Revamp the CAM enclosure services driver. > This updated driver uses an in-kernel daemon to track state changes and > publishes physical path location information for disk elements into the > CAM device database. > =20 > Sponsored by: Spectra Logic Corporation > Sponsored by: iXsystems, Inc. >=20 > Added: > stable/9/sys/cam/scsi/scsi_enc.c > - copied, changed from r235911, head/sys/cam/scsi/scsi_enc.c > stable/9/sys/cam/scsi/scsi_enc.h > - copied unchanged from r235911, head/sys/cam/scsi/scsi_enc.h > stable/9/sys/cam/scsi/scsi_enc_internal.h > - copied unchanged from r235911, head/sys/cam/scsi/scsi_enc_internal= =2Eh > stable/9/sys/cam/scsi/scsi_enc_safte.c > - copied, changed from r235911, head/sys/cam/scsi/scsi_enc_safte.c > stable/9/sys/cam/scsi/scsi_enc_ses.c > - copied, changed from r235911, head/sys/cam/scsi/scsi_enc_ses.c > Deleted: > stable/9/sys/cam/scsi/scsi_ses.c > Modified: > stable/9/share/examples/ses/Makefile.inc > stable/9/share/examples/ses/sesd/sesd.0 > stable/9/share/examples/ses/srcs/eltsub.c > stable/9/share/examples/ses/srcs/getencstat.c > stable/9/share/examples/ses/srcs/getnobj.c > stable/9/share/examples/ses/srcs/getobjmap.c > stable/9/share/examples/ses/srcs/getobjstat.c > stable/9/share/examples/ses/srcs/inienc.c > stable/9/share/examples/ses/srcs/sesd.c > stable/9/share/examples/ses/srcs/setencstat.c > stable/9/share/examples/ses/srcs/setobjstat.c > stable/9/sys/cam/scsi/scsi_pt.c > stable/9/sys/cam/scsi/scsi_ses.h > stable/9/sys/conf/files > stable/9/sys/fs/devfs/devfs_vnops.c > stable/9/sys/modules/cam/Makefile > stable/9/usr.bin/kdump/mkioctls Why is this code kept and developed in the share/examples ? --mF1peDl4f1TE7z5s Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJREuxkAAoJEJDCuSvBvK1BNjAP/3kppr0JUW2+/kf2/FfppUc0 L7fwsEkAbPEL9wFCwgTzixA8pcIlT7FOH5z2uyCUyH5bZKD1/e0HwE/iliWm5hDZ ZpvxRJOwtyksaZaWZx9rqA7MT03S0G1HxTR0J+pz39k8ssnL3eUktKXPNmEz3bgA AxDHCqAS2wa0CNF9U8SeqYWFxuqEnP/JK4PEobJZU5RM8MNL07YMLsLYp4xVytrr mbUbNl6HQlLJsFt6eNs/RilGVT9FJ3xLEmhHWgTmzaFnpsGt0Is0InhiWOAClK38 WlVSZ3WukiPJkcxyOeh5QNkjDqs+IQ/0gkzAQ+WNAgs/nYR91vhZA0qHtqA+wsLX OowF61WeIg2aZG4gGw+SjpU/SMgQcKNlF6yZNOVzhK43aoKXl9FVrA83C/HBnzJr w9QhMH/9+m8KA1lnz6qdNR+X7JjtM3hY740hJw+l4qx7jYtfNdiWYweyIeTueO1w 5o4N9sVVmDEe/AkPrRlFiINyQFEYAwAsDDybspIbd0yTQqw/evUeE5gXkG8/Fl1T WGxc4kyrKSbcUv45TzJSGSCGvN1vTIzFYmpUBdX/kdEwqyEvkZ9jRz4kcyB94fXt H2LaORiNBI6I86em9ziZG80BmrJ/Q9thdSMmZGu0/HHXS28gHHWJQpkP1yccBH88 B0BAbW/K7RKqdMvpS4qY =/5c/ -----END PGP SIGNATURE----- --mF1peDl4f1TE7z5s-- From owner-svn-src-stable@FreeBSD.ORG Thu Feb 7 00:19:01 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id DA9FE93D; Thu, 7 Feb 2013 00:19:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 4853E724; Thu, 7 Feb 2013 00:19:01 +0000 (UTC) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.14.6/8.14.6) with ESMTP id r170Iv7s073260; Thu, 7 Feb 2013 02:18:57 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.4 kib.kiev.ua r170Iv7s073260 Received: (from kostik@localhost) by tom.home (8.14.6/8.14.6/Submit) id r170IvQk073259; Thu, 7 Feb 2013 02:18:57 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Thu, 7 Feb 2013 02:18:57 +0200 From: Konstantin Belousov To: Alexander Motin Subject: Re: svn commit: r246437 - in stable/9: share/examples/ses share/examples/ses/sesd share/examples/ses/srcs sys/cam/scsi sys/conf sys/fs/devfs sys/modules/cam usr.bin/kdump Message-ID: <20130207001857.GE2522@kib.kiev.ua> References: <201302062207.r16M7d92083023@svn.freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NcuWGV+7VxnbytuS" Content-Disposition: inline In-Reply-To: <201302062207.r16M7d92083023@svn.freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 00:19:01 -0000 --NcuWGV+7VxnbytuS Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Feb 06, 2013 at 10:07:39PM +0000, Alexander Motin wrote: > stable/9/sys/fs/devfs/devfs_vnops.c Did you forgot to merge r235922 ? --NcuWGV+7VxnbytuS Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iQIcBAEBAgAGBQJREvLwAAoJEJDCuSvBvK1Bm3wQAJ4Mv9uTQ5mcXA7KcN2pqXoO Jjp92Poi0pqA8y/ngZlHlROk5JQTfi4wS1II3nt/UjztTym93FD1wJl6gt25Ss/E 66JgJJOHQ3Ympb8IRqE2MWkzntgTB6h+8XAzVt1hW6Y9QxxzlcqCGhdGFIwSmyYi rwcsGl0qOVb7ifvJe1p4k6qhb2F0HnvTuQnk6bJG4NQvrqwXO/SpPsaI4TfxvuKT 8+6CtBrf1BKB02MEzt10Q8k/5TiFHf78RiRBn/fL2i3KJBERX5nczUu8NuLL+dNN sGISYFjnR7nq1S+tJEUA8Y3969XcEa+Jp8JqYdz49ogq9SSajbO79MSafYHjqg/X r5AMOulfCUPagPjHw/m1lFkhkpyJiifvBUNm2xF5BZgxazK+W1ZRwXx2Yq1MQRQJ s2blw6xhBz3b8kMJ94q8BdiY0uAoQPQaG3SU6YIS5TxUdGsvnUhhqbOZhdyAoBmq z7iV5N4DontIeZveEMkrXM/9AiaEnZAYF0dWlpRDTypfXhbRtxXCVGS0S0T6pYJ8 xE7qe+W9eGqKlhz4N5p6MYyVPeJ/SqdzQEG4yny1Tf2cXnETit/sma0UMsCD9ZSk eBhpwoJJmpuf6tYgS7jPTpps9KmP9BvWJH699vuTd3pYJfWpJv038UCSdo8ujogQ mu440BnDTw3DL/e9WjwQ =ENB0 -----END PGP SIGNATURE----- --NcuWGV+7VxnbytuS-- From owner-svn-src-stable@FreeBSD.ORG Thu Feb 7 04:49:29 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B79B12FE; Thu, 7 Feb 2013 04:49:29 +0000 (UTC) (envelope-from bjk@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8B388D8; Thu, 7 Feb 2013 04:49:29 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r174nTfS004774; Thu, 7 Feb 2013 04:49:29 GMT (envelope-from bjk@svn.freebsd.org) Received: (from bjk@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r174nTWD004773; Thu, 7 Feb 2013 04:49:29 GMT (envelope-from bjk@svn.freebsd.org) Message-Id: <201302070449.r174nTWD004773@svn.freebsd.org> From: Benjamin Kaduk Date: Thu, 7 Feb 2013 04:49:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246451 - stable/9/usr.sbin/gssd X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 04:49:29 -0000 Author: bjk (doc committer) Date: Thu Feb 7 04:49:28 2013 New Revision: 246451 URL: http://svnweb.freebsd.org/changeset/base/246451 Log: MFC r245051: Grammar fixes and some wordsmithing Discussed with: rmacklem Approved by: hrs (mentor) Modified: stable/9/usr.sbin/gssd/gssd.8 Directory Properties: stable/9/usr.sbin/gssd/ (props changed) Modified: stable/9/usr.sbin/gssd/gssd.8 ============================================================================== --- stable/9/usr.sbin/gssd/gssd.8 Thu Feb 7 02:15:25 2013 (r246450) +++ stable/9/usr.sbin/gssd/gssd.8 Thu Feb 7 04:49:28 2013 (r246451) @@ -25,7 +25,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 22, 2012 +.Dd December 30, 2012 .Dt GSSD 8 .Os .Sh NAME @@ -53,25 +53,22 @@ will not fork when it starts. Look for an appropriate credential cache file in this list of directories. The list should be full pathnames from root, separated by ':' characters. Usually this list will simply be "/tmp". -Without this option, the +Without this option, .Nm -daemon assumes that the credential cache file is called /tmp/krb5cc_, +assumes that the credential cache file is called /tmp/krb5cc_, where is the effective uid for the RPC caller. .It Fl c Ar file-substring Set a file-substring for the credential cache file names. Only files with this substring embedded in their names will be -selected as candidates when the +selected as candidates when .Fl s has been specified. If not specified, it defaults to "krb5cc_". .It Fl r Ar preferred-realm -Set a preferred Kerberos realm for the search of the directory list for -a credentials cache file. -When set, files with TGT credentials for this realm will be selected over -other credential files. -This option is only meaningful when the -.Fl s -option has been specified. +Use Kerberos credentials for this realm when searching for +credentials in directories specified with +.Fl s . +If not specified, the default Kerberos realm will be used. .El .Sh FILES .Bl -tag -width ".Pa /etc/krb5.keytab" -compact From owner-svn-src-stable@FreeBSD.ORG Thu Feb 7 08:27:49 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 2C14D4DA; Thu, 7 Feb 2013 08:27:49 +0000 (UTC) (envelope-from mav@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 0198DC12; Thu, 7 Feb 2013 08:27:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r178RmjK070291; Thu, 7 Feb 2013 08:27:48 GMT (envelope-from mav@svn.freebsd.org) Received: (from mav@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r178RmIW070290; Thu, 7 Feb 2013 08:27:48 GMT (envelope-from mav@svn.freebsd.org) Message-Id: <201302070827.r178RmIW070290@svn.freebsd.org> From: Alexander Motin Date: Thu, 7 Feb 2013 08:27:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246455 - stable/9/sys/fs/devfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 08:27:49 -0000 Author: mav Date: Thu Feb 7 08:27:48 2013 New Revision: 246455 URL: http://svnweb.freebsd.org/changeset/base/246455 Log: MFC r235922: Revert devfs part of r235911. I was unaware about old but unfinished discussion between kib@ and gibbs@ about it. Modified: stable/9/sys/fs/devfs/devfs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/devfs/devfs_vnops.c ============================================================================== --- stable/9/sys/fs/devfs/devfs_vnops.c Thu Feb 7 08:20:03 2013 (r246454) +++ stable/9/sys/fs/devfs/devfs_vnops.c Thu Feb 7 08:27:48 2013 (r246455) @@ -1276,53 +1276,8 @@ static int devfs_readlink(struct vop_readlink_args *ap) { struct devfs_dirent *de; - struct cdev_priv *cdp; de = ap->a_vp->v_data; - cdp = de->de_cdp; - - if (cdp != NULL && (cdp->cdp_c.si_flags & SI_ALIAS) != 0) { - struct devfs_mount *dmp; - struct prison *pr; - char *mp; - int mp_len; - int pr_path_len; - int err; - - /* - * For device aliases, construct an absolute symlink (to - * shorten its length and avoid the ugliness of a relative - * link) by prepending the fully qualified path to the root - * of this devfs. For a non-jailed process, the devfs root - * is our mount point. For a jailed process, we must remove - * any jail prefix in our mount point so that our response - * matches the user process's world view. - */ - dmp = VFSTODEVFS(ap->a_vp->v_mount); - mp = dmp->dm_mount->mnt_stat.f_mntonname; - mp_len = strlen(mp); - - pr = ap->a_cred->cr_prison; - pr_path_len = strlen(pr->pr_path); - - if (strncmp(pr->pr_path, mp, pr_path_len) == 0 - && mp[pr_path_len] == '/') { - mp += pr_path_len; - mp_len -= pr_path_len; - } - - err = uiomove(mp, mp_len, ap->a_uio); - if (err != 0) - return (err); - - /* - * Devfs cannot be the root file system, so its - * mount point must always be terminated by a '/'. - */ - err = uiomove("/", 1, ap->a_uio); - if (err != 0) - return (err); - } return (uiomove(de->de_symlink, strlen(de->de_symlink), ap->a_uio)); } From owner-svn-src-stable@FreeBSD.ORG Thu Feb 7 08:28:15 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id CA61B641; Thu, 7 Feb 2013 08:28:15 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-la0-x232.google.com (la-in-x0232.1e100.net [IPv6:2a00:1450:4010:c03::232]) by mx1.freebsd.org (Postfix) with ESMTP id C3D34C1A; Thu, 7 Feb 2013 08:28:14 +0000 (UTC) Received: by mail-la0-f50.google.com with SMTP id ec20so2330084lab.37 for ; Thu, 07 Feb 2013 00:28:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=iTT1vyUOqQh1aPTjjhXIRGk4rDULL6StAfQf7FQ5vG0=; b=uTkD3N238Boon86YmXoGA1GUocVqlcLNccddoh1/q6Yv3G3pL+Zbr2jXooNtUgVeVH QMdIkjVqJkHSwUd4lUfZG/VNdRZJFNzmjOtxCExRexk9mbQ/V267kxWhkcOIfgqz+ZfE SdC8WV5wy/YoMCbJmrIuz5Pmh+ZG0xxWSmJ6+/5NLVYX6pbRoakN9vwxo97LVDrdiwmC GkPmA7D6QKBZUFFe0zQmbIQOm0G8/GfXknrk4ETZc8VK30BwT1r3Y4lGa5YBP8uWmpJZ OIU6/fZo9yLuFhNJGDoUUu0toeefTHCaMsCD1Vre3xiF2LG+zXFQppkJARl0YMTDxPVN FCeg== X-Received: by 10.112.99.197 with SMTP id es5mr413523lbb.30.1360225693820; Thu, 07 Feb 2013 00:28:13 -0800 (PST) Received: from mavbook.mavhome.dp.ua (mavhome.mavhome.dp.ua. [213.227.240.37]) by mx.google.com with ESMTPS id b13sm5324726lbd.10.2013.02.07.00.28.11 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 07 Feb 2013 00:28:12 -0800 (PST) Sender: Alexander Motin Message-ID: <51136599.2030107@FreeBSD.org> Date: Thu, 07 Feb 2013 10:28:09 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130125 Thunderbird/17.0.2 MIME-Version: 1.0 To: Konstantin Belousov Subject: Re: svn commit: r246437 - in stable/9: share/examples/ses share/examples/ses/sesd share/examples/ses/srcs sys/cam/scsi sys/conf sys/fs/devfs sys/modules/cam usr.bin/kdump References: <201302062207.r16M7d92083023@svn.freebsd.org> <20130207001857.GE2522@kib.kiev.ua> In-Reply-To: <20130207001857.GE2522@kib.kiev.ua> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-stable@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, svn-src-stable-9@freebsd.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 08:28:15 -0000 On 07.02.2013 02:18, Konstantin Belousov wrote: > On Wed, Feb 06, 2013 at 10:07:39PM +0000, Alexander Motin wrote: >> stable/9/sys/fs/devfs/devfs_vnops.c > > Did you forgot to merge r235922 ? Yes, sorry, fixed. -- Alexander Motin From owner-svn-src-stable@FreeBSD.ORG Thu Feb 7 11:09:17 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 13F76F3F; Thu, 7 Feb 2013 11:09:17 +0000 (UTC) (envelope-from pluknet@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 01C0373E; Thu, 7 Feb 2013 11:09:17 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r17B9GJI019167; Thu, 7 Feb 2013 11:09:16 GMT (envelope-from pluknet@svn.freebsd.org) Received: (from pluknet@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r17B9GG2019165; Thu, 7 Feb 2013 11:09:16 GMT (envelope-from pluknet@svn.freebsd.org) Message-Id: <201302071109.r17B9GG2019165@svn.freebsd.org> From: Sergey Kandaurov Date: Thu, 7 Feb 2013 11:09:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246463 - stable/8/sys/kern X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 Feb 2013 11:09:17 -0000 Author: pluknet Date: Thu Feb 7 11:09:16 2013 New Revision: 246463 URL: http://svnweb.freebsd.org/changeset/base/246463 Log: MFC r226043 (manually): Remove assertion against empty NFSv4 ACLs. An empty ACL is not exactly valid - we don't allow for setting it on a file, for example - but it's not something we should assert on. For STABLE kernel, it changes nothing, because it's not compiled with INVARIANTS. If it was, it would fix crashes. It also fixes an assert in libc encountered with NFSv4 without nfsuserd(8) running. Approved by: trasz Modified: stable/8/sys/kern/subr_acl_nfs4.c Directory Properties: stable/8/sys/ (props changed) Modified: stable/8/sys/kern/subr_acl_nfs4.c ============================================================================== --- stable/8/sys/kern/subr_acl_nfs4.c Thu Feb 7 11:08:03 2013 (r246462) +++ stable/8/sys/kern/subr_acl_nfs4.c Thu Feb 7 11:09:16 2013 (r246463) @@ -105,7 +105,6 @@ _acl_denies(const struct acl *aclp, int if (denied_explicitly != NULL) *denied_explicitly = 0; - KASSERT(aclp->acl_cnt > 0, ("aclp->acl_cnt > 0")); KASSERT(aclp->acl_cnt <= ACL_MAX_ENTRIES, ("aclp->acl_cnt <= ACL_MAX_ENTRIES")); @@ -730,7 +729,6 @@ acl_nfs4_sync_mode_from_acl(mode_t *_mod mode_t old_mode = *_mode, mode = 0, seen = 0; const struct acl_entry *entry; - KASSERT(aclp->acl_cnt > 0, ("aclp->acl_cnt > 0")); KASSERT(aclp->acl_cnt <= ACL_MAX_ENTRIES, ("aclp->acl_cnt <= ACL_MAX_ENTRIES")); @@ -856,7 +854,6 @@ acl_nfs4_compute_inherited_acl(const str struct acl_entry *entry, *copy; KASSERT(child_aclp->acl_cnt == 0, ("child_aclp->acl_cnt == 0")); - KASSERT(parent_aclp->acl_cnt > 0, ("parent_aclp->acl_cnt > 0")); KASSERT(parent_aclp->acl_cnt <= ACL_MAX_ENTRIES, ("parent_aclp->acl_cnt <= ACL_MAX_ENTRIES")); From owner-svn-src-stable@FreeBSD.ORG Fri Feb 8 07:59:14 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 7609BBB1; Fri, 8 Feb 2013 07:59:14 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5E302AA1; Fri, 8 Feb 2013 07:59:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r187xEn2002577; Fri, 8 Feb 2013 07:59:14 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r187xE8f002576; Fri, 8 Feb 2013 07:59:14 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302080759.r187xE8f002576@svn.freebsd.org> From: Andriy Gapon Date: Fri, 8 Feb 2013 07:59:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246533 - stable/9/sys/cddl/compat/opensolaris/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 07:59:14 -0000 Author: avg Date: Fri Feb 8 07:59:13 2013 New Revision: 246533 URL: http://svnweb.freebsd.org/changeset/base/246533 Log: MFC r246244: solaris compat: remove KM_ZERO Modified: stable/9/sys/cddl/compat/opensolaris/sys/kmem.h Directory Properties: stable/9/sys/ (props changed) Modified: stable/9/sys/cddl/compat/opensolaris/sys/kmem.h ============================================================================== --- stable/9/sys/cddl/compat/opensolaris/sys/kmem.h Fri Feb 8 07:49:54 2013 (r246532) +++ stable/9/sys/cddl/compat/opensolaris/sys/kmem.h Fri Feb 8 07:59:13 2013 (r246533) @@ -45,7 +45,6 @@ MALLOC_DECLARE(M_SOLARIS); #define KM_SLEEP M_WAITOK #define KM_PUSHPAGE M_WAITOK #define KM_NOSLEEP M_NOWAIT -#define KM_ZERO M_ZERO #define KM_NODEBUG M_NODUMP #define KMC_NOTOUCH 0 #define KMC_NODEBUG UMA_ZONE_NODUMP From owner-svn-src-stable@FreeBSD.ORG Fri Feb 8 08:03:03 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id E2A24E83; Fri, 8 Feb 2013 08:03:03 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id D4E30AD1; Fri, 8 Feb 2013 08:03:03 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r18833PI004971; Fri, 8 Feb 2013 08:03:03 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r188337Z004970; Fri, 8 Feb 2013 08:03:03 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302080803.r188337Z004970@svn.freebsd.org> From: Andriy Gapon Date: Fri, 8 Feb 2013 08:03:03 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246534 - stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 08:03:04 -0000 Author: avg Date: Fri Feb 8 08:03:03 2013 New Revision: 246534 URL: http://svnweb.freebsd.org/changeset/base/246534 Log: MFC r246242: zfs: add MODULE_VERSION for zfsctrl Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Feb 8 07:59:13 2013 (r246533) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Feb 8 08:03:03 2013 (r246534) @@ -5517,5 +5517,6 @@ static moduledata_t zfs_mod = { 0 }; DECLARE_MODULE(zfsctrl, zfs_mod, SI_SUB_VFS, SI_ORDER_ANY); +MODULE_VERSION(zfsctrl, 1); MODULE_DEPEND(zfsctrl, opensolaris, 1, 1, 1); MODULE_DEPEND(zfsctrl, krpc, 1, 1, 1); From owner-svn-src-stable@FreeBSD.ORG Fri Feb 8 08:03:19 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 6A698FB3; Fri, 8 Feb 2013 08:03:19 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5D783AD7; Fri, 8 Feb 2013 08:03:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1883JdJ005052; Fri, 8 Feb 2013 08:03:19 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1883J69005051; Fri, 8 Feb 2013 08:03:19 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201302080803.r1883J69005051@svn.freebsd.org> From: Andriy Gapon Date: Fri, 8 Feb 2013 08:03:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246535 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 08:03:19 -0000 Author: avg Date: Fri Feb 8 08:03:18 2013 New Revision: 246535 URL: http://svnweb.freebsd.org/changeset/base/246535 Log: MFC r246242: zfs: add MODULE_VERSION for zfsctr Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Feb 8 08:03:03 2013 (r246534) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_ioctl.c Fri Feb 8 08:03:18 2013 (r246535) @@ -5517,5 +5517,6 @@ static moduledata_t zfs_mod = { 0 }; DECLARE_MODULE(zfsctrl, zfs_mod, SI_SUB_VFS, SI_ORDER_ANY); +MODULE_VERSION(zfsctrl, 1); MODULE_DEPEND(zfsctrl, opensolaris, 1, 1, 1); MODULE_DEPEND(zfsctrl, krpc, 1, 1, 1); From owner-svn-src-stable@FreeBSD.ORG Fri Feb 8 10:20:01 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 9737DECF; Fri, 8 Feb 2013 10:20:01 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8A6259E9; Fri, 8 Feb 2013 10:20:01 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r18AK1OE047761; Fri, 8 Feb 2013 10:20:01 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18AK1Tm047760; Fri, 8 Feb 2013 10:20:01 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302081020.r18AK1Tm047760@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 8 Feb 2013 10:20:01 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246539 - stable/9/sys/fs/nfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 10:20:01 -0000 Author: kib Date: Fri Feb 8 10:20:00 2013 New Revision: 246539 URL: http://svnweb.freebsd.org/changeset/base/246539 Log: MFC r246213: Assert that the mbuf in the chain has sane length. Modified: stable/9/sys/fs/nfs/nfs_commonsubs.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/nfs/nfs_commonsubs.c ============================================================================== --- stable/9/sys/fs/nfs/nfs_commonsubs.c Fri Feb 8 09:54:53 2013 (r246538) +++ stable/9/sys/fs/nfs/nfs_commonsubs.c Fri Feb 8 10:20:00 2013 (r246539) @@ -199,6 +199,7 @@ nfsm_mbufuio(struct nfsrv_descript *nd, } mbufcp = NFSMTOD(mp, caddr_t); len = mbuf_len(mp); + KASSERT(len > 0, ("len %d", len)); } xfer = (left > len) ? len : left; #ifdef notdef From owner-svn-src-stable@FreeBSD.ORG Fri Feb 8 10:25:24 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id E0EF31A0; Fri, 8 Feb 2013 10:25:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id CF607A1C; Fri, 8 Feb 2013 10:25:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r18APO73050145; Fri, 8 Feb 2013 10:25:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18APOnU050144; Fri, 8 Feb 2013 10:25:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302081025.r18APOnU050144@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 8 Feb 2013 10:25:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246540 - stable/9/sys/fs/msdosfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 10:25:25 -0000 Author: kib Date: Fri Feb 8 10:25:24 2013 New Revision: 246540 URL: http://svnweb.freebsd.org/changeset/base/246540 Log: MFC r246215: Fix a backwards comment in markvoldirty(). Modified: stable/9/sys/fs/msdosfs/msdosfs_fat.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- stable/9/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 8 10:20:00 2013 (r246539) +++ stable/9/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 8 10:25:24 2013 (r246540) @@ -1114,7 +1114,7 @@ extendfile(dep, count, bpp, ncp, flags) * Routine to mark a FAT16 or FAT32 volume as "clean" or "dirty" by * manipulating the upper bit of the FAT entry for cluster 1. Note that * this bit is not defined for FAT12 volumes, which are always assumed to - * be dirty. + * be clean. * * The fatentry() routine only works on cluster numbers that a file could * occupy, so it won't manipulate the entry for cluster 1. So we have to do From owner-svn-src-stable@FreeBSD.ORG Fri Feb 8 10:30:05 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 553CA51E; Fri, 8 Feb 2013 10:30:05 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 48506A60; Fri, 8 Feb 2013 10:30:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r18AU5s1050826; Fri, 8 Feb 2013 10:30:05 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18AU5An050824; Fri, 8 Feb 2013 10:30:05 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302081030.r18AU5An050824@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 8 Feb 2013 10:30:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246541 - stable/9/sys/fs/msdosfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 10:30:05 -0000 Author: kib Date: Fri Feb 8 10:30:04 2013 New Revision: 246541 URL: http://svnweb.freebsd.org/changeset/base/246541 Log: MFC r246216: The mountmsdosfs() function had an insane sanity test, remove it. Modified: stable/9/sys/fs/msdosfs/msdosfs_vfsops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- stable/9/sys/fs/msdosfs/msdosfs_vfsops.c Fri Feb 8 10:25:24 2013 (r246540) +++ stable/9/sys/fs/msdosfs/msdosfs_vfsops.c Fri Feb 8 10:30:04 2013 (r246541) @@ -553,8 +553,7 @@ mountmsdosfs(struct vnode *devvp, struct } if (pmp->pm_RootDirEnts == 0) { - if (pmp->pm_Sectors - || pmp->pm_FATsecs + if (pmp->pm_FATsecs || getushort(b710->bpbFSVers)) { error = EINVAL; #ifdef MSDOSFS_DEBUG From owner-svn-src-stable@FreeBSD.ORG Fri Feb 8 10:34:07 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id EDACA6F7; Fri, 8 Feb 2013 10:34:07 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B032EA8F; Fri, 8 Feb 2013 10:34:07 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r18AY7DA053007; Fri, 8 Feb 2013 10:34:07 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18AY7gB053006; Fri, 8 Feb 2013 10:34:07 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302081034.r18AY7gB053006@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 8 Feb 2013 10:34:07 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246542 - stable/9/sys/fs/msdosfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 10:34:08 -0000 Author: kib Date: Fri Feb 8 10:34:07 2013 New Revision: 246542 URL: http://svnweb.freebsd.org/changeset/base/246542 Log: MFC r246217: Fix the corruption of the ".." entry for the directory moved to a subdirectory of the root on FAT32. Modified: stable/9/sys/fs/msdosfs/msdosfs_vnops.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- stable/9/sys/fs/msdosfs/msdosfs_vnops.c Fri Feb 8 10:30:04 2013 (r246541) +++ stable/9/sys/fs/msdosfs/msdosfs_vnops.c Fri Feb 8 10:34:07 2013 (r246542) @@ -973,7 +973,7 @@ msdosfs_rename(ap) u_char to_count; int doingdirectory = 0, newparent = 0; int error; - u_long cn; + u_long cn, pcl; daddr_t bn; struct denode *fddep; /* from file's parent directory */ struct msdosfsmount *pmp; @@ -1246,9 +1246,12 @@ abortit: goto bad; } dotdotp = (struct direntry *)bp->b_data + 1; - putushort(dotdotp->deStartCluster, dp->de_StartCluster); + pcl = dp->de_StartCluster; + if (FAT32(pmp) && pcl == pmp->pm_rootdirblk) + pcl = MSDOSFSROOT; + putushort(dotdotp->deStartCluster, pcl); if (FAT32(pmp)) - putushort(dotdotp->deHighClust, dp->de_StartCluster >> 16); + putushort(dotdotp->deHighClust, pcl >> 16); if (DOINGASYNC(fvp)) bdwrite(bp); else if ((error = bwrite(bp)) != 0) { @@ -1369,8 +1372,13 @@ msdosfs_mkdir(ap) putushort(denp[0].deMDate, ndirent.de_MDate); putushort(denp[0].deMTime, ndirent.de_MTime); pcl = pdep->de_StartCluster; + /* + * Although the root directory has a non-magic starting cluster + * number for FAT32, chkdsk and fsck_msdosfs still require + * references to it in dotdot entries to be magic. + */ if (FAT32(pmp) && pcl == pmp->pm_rootdirblk) - pcl = 0; + pcl = MSDOSFSROOT; putushort(denp[1].deStartCluster, pcl); putushort(denp[1].deCDate, ndirent.de_CDate); putushort(denp[1].deCTime, ndirent.de_CTime); @@ -1380,7 +1388,7 @@ msdosfs_mkdir(ap) putushort(denp[1].deMTime, ndirent.de_MTime); if (FAT32(pmp)) { putushort(denp[0].deHighClust, newcluster >> 16); - putushort(denp[1].deHighClust, pdep->de_StartCluster >> 16); + putushort(denp[1].deHighClust, pcl >> 16); } if (DOINGASYNC(ap->a_dvp)) From owner-svn-src-stable@FreeBSD.ORG Fri Feb 8 10:38:13 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 02C8DABF; Fri, 8 Feb 2013 10:38:13 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id E961AAB8; Fri, 8 Feb 2013 10:38:12 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r18AcCfw053576; Fri, 8 Feb 2013 10:38:12 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18AcCcK053575; Fri, 8 Feb 2013 10:38:12 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302081038.r18AcCcK053575@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 8 Feb 2013 10:38:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246543 - stable/9/sys/fs/msdosfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 10:38:13 -0000 Author: kib Date: Fri Feb 8 10:38:12 2013 New Revision: 246543 URL: http://svnweb.freebsd.org/changeset/base/246543 Log: MFC r246218: Backup FATs were sometimes marked dirty by copying their first block from the primary FAT, and then they were not marked clean on unmount. Force marking them clean when appropriate. Modified: stable/9/sys/fs/msdosfs/msdosfs_fat.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- stable/9/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 8 10:34:07 2013 (r246542) +++ stable/9/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 8 10:38:12 2013 (r246543) @@ -321,8 +321,8 @@ updatefats(pmp, bp, fatbn) struct buf *bp; u_long fatbn; { - int i; struct buf *bpn; + int cleanfat, i; #ifdef MSDOSFS_DEBUG printf("updatefats(pmp %p, bp %p, fatbn %lu)\n", pmp, bp, fatbn); @@ -362,12 +362,23 @@ updatefats(pmp, bp, fatbn) * filesystem was mounted. If synch is asked for then use * bwrite()'s and really slow things down. */ + if (fatbn != pmp->pm_fatblk || FAT12(pmp)) + cleanfat = 0; + else if (FAT16(pmp)) + cleanfat = 16; + else + cleanfat = 32; for (i = 1; i < pmp->pm_FATs; i++) { fatbn += pmp->pm_FATsecs; /* getblk() never fails */ bpn = getblk(pmp->pm_devvp, fatbn, bp->b_bcount, 0, 0, 0); bcopy(bp->b_data, bpn->b_data, bp->b_bcount); + /* Force the clean bit on in the other copies. */ + if (cleanfat == 16) + ((u_int8_t *)bpn->b_data)[3] |= 0x80; + else if (cleanfat == 32) + ((u_int8_t *)bpn->b_data)[7] |= 0x08; if (pmp->pm_flags & MSDOSFSMNT_WAITONFAT) bwrite(bpn); else From owner-svn-src-stable@FreeBSD.ORG Fri Feb 8 10:41:51 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id CD368C45; Fri, 8 Feb 2013 10:41:51 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id A7ABAADD; Fri, 8 Feb 2013 10:41:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r18Afpsq055657; Fri, 8 Feb 2013 10:41:51 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18AfpT0055656; Fri, 8 Feb 2013 10:41:51 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302081041.r18AfpT0055656@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 8 Feb 2013 10:41:51 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246544 - stable/9/sys/fs/msdosfs X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 10:41:51 -0000 Author: kib Date: Fri Feb 8 10:41:51 2013 New Revision: 246544 URL: http://svnweb.freebsd.org/changeset/base/246544 Log: MFC r246219: Use MNT_SYNCHRONOUS to decide to write the FAT updates syncrhonously. Modified: stable/9/sys/fs/msdosfs/msdosfs_fat.c Directory Properties: stable/9/sys/ (props changed) stable/9/sys/fs/ (props changed) Modified: stable/9/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- stable/9/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 8 10:38:12 2013 (r246543) +++ stable/9/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 8 10:41:51 2013 (r246544) @@ -379,7 +379,7 @@ updatefats(pmp, bp, fatbn) ((u_int8_t *)bpn->b_data)[3] |= 0x80; else if (cleanfat == 32) ((u_int8_t *)bpn->b_data)[7] |= 0x08; - if (pmp->pm_flags & MSDOSFSMNT_WAITONFAT) + if (pmp->pm_mountp->mnt_flag & MNT_SYNCHRONOUS) bwrite(bpn); else bdwrite(bpn); @@ -389,7 +389,7 @@ updatefats(pmp, bp, fatbn) /* * Write out the first (or current) fat last. */ - if (pmp->pm_flags & MSDOSFSMNT_WAITONFAT) + if (pmp->pm_mountp->mnt_flag & MNT_SYNCHRONOUS) bwrite(bp); else bdwrite(bp); From owner-svn-src-stable@FreeBSD.ORG Fri Feb 8 11:10:27 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 326729B8; Fri, 8 Feb 2013 11:10:27 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 24E54D0F; Fri, 8 Feb 2013 11:10:27 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r18BARcT063323; Fri, 8 Feb 2013 11:10:27 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18BAQju063321; Fri, 8 Feb 2013 11:10:26 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302081110.r18BAQju063321@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 8 Feb 2013 11:10:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246545 - stable/8/sys/fs/msdosfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 11:10:27 -0000 Author: kib Date: Fri Feb 8 11:10:26 2013 New Revision: 246545 URL: http://svnweb.freebsd.org/changeset/base/246545 Log: MFC r246215: Fix a backwards comment in markvoldirty(). Modified: stable/8/sys/fs/msdosfs/msdosfs_fat.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/fs/ (props changed) Modified: stable/8/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- stable/8/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 8 10:41:51 2013 (r246544) +++ stable/8/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 8 11:10:26 2013 (r246545) @@ -1114,7 +1114,7 @@ extendfile(dep, count, bpp, ncp, flags) * Routine to mark a FAT16 or FAT32 volume as "clean" or "dirty" by * manipulating the upper bit of the FAT entry for cluster 1. Note that * this bit is not defined for FAT12 volumes, which are always assumed to - * be dirty. + * be clean. * * The fatentry() routine only works on cluster numbers that a file could * occupy, so it won't manipulate the entry for cluster 1. So we have to do From owner-svn-src-stable@FreeBSD.ORG Fri Feb 8 11:14:24 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4C8A0CDB; Fri, 8 Feb 2013 11:14:24 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3DEDCD4E; Fri, 8 Feb 2013 11:14:24 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r18BEO9t065375; Fri, 8 Feb 2013 11:14:24 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18BEOYu065374; Fri, 8 Feb 2013 11:14:24 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302081114.r18BEOYu065374@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 8 Feb 2013 11:14:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246547 - stable/8/sys/fs/msdosfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 11:14:24 -0000 Author: kib Date: Fri Feb 8 11:14:23 2013 New Revision: 246547 URL: http://svnweb.freebsd.org/changeset/base/246547 Log: MFC r246216: The mountmsdosfs() function had an insane sanity test, remove it. Modified: stable/8/sys/fs/msdosfs/msdosfs_vfsops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/fs/ (props changed) Modified: stable/8/sys/fs/msdosfs/msdosfs_vfsops.c ============================================================================== --- stable/8/sys/fs/msdosfs/msdosfs_vfsops.c Fri Feb 8 11:14:01 2013 (r246546) +++ stable/8/sys/fs/msdosfs/msdosfs_vfsops.c Fri Feb 8 11:14:23 2013 (r246547) @@ -551,8 +551,7 @@ mountmsdosfs(struct vnode *devvp, struct } if (pmp->pm_RootDirEnts == 0) { - if (pmp->pm_Sectors - || pmp->pm_FATsecs + if (pmp->pm_FATsecs || getushort(b710->bpbFSVers)) { error = EINVAL; #ifdef MSDOSFS_DEBUG From owner-svn-src-stable@FreeBSD.ORG Fri Feb 8 11:15:57 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id C2B62E6F; Fri, 8 Feb 2013 11:15:57 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9A820D6C; Fri, 8 Feb 2013 11:15:57 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r18BFvlN065655; Fri, 8 Feb 2013 11:15:57 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18BFvSW065654; Fri, 8 Feb 2013 11:15:57 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302081115.r18BFvSW065654@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 8 Feb 2013 11:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246548 - stable/8/sys/fs/msdosfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 11:15:57 -0000 Author: kib Date: Fri Feb 8 11:15:57 2013 New Revision: 246548 URL: http://svnweb.freebsd.org/changeset/base/246548 Log: MFC r246217: Fix the corruption of the ".." entry for the directory moved to a subdirectory of the root on FAT32. Modified: stable/8/sys/fs/msdosfs/msdosfs_vnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/fs/ (props changed) Modified: stable/8/sys/fs/msdosfs/msdosfs_vnops.c ============================================================================== --- stable/8/sys/fs/msdosfs/msdosfs_vnops.c Fri Feb 8 11:14:23 2013 (r246547) +++ stable/8/sys/fs/msdosfs/msdosfs_vnops.c Fri Feb 8 11:15:57 2013 (r246548) @@ -974,7 +974,7 @@ msdosfs_rename(ap) u_char to_count; int doingdirectory = 0, newparent = 0; int error; - u_long cn; + u_long cn, pcl; daddr_t bn; struct denode *fddep; /* from file's parent directory */ struct msdosfsmount *pmp; @@ -1247,9 +1247,12 @@ abortit: goto bad; } dotdotp = (struct direntry *)bp->b_data + 1; - putushort(dotdotp->deStartCluster, dp->de_StartCluster); + pcl = dp->de_StartCluster; + if (FAT32(pmp) && pcl == pmp->pm_rootdirblk) + pcl = MSDOSFSROOT; + putushort(dotdotp->deStartCluster, pcl); if (FAT32(pmp)) - putushort(dotdotp->deHighClust, dp->de_StartCluster >> 16); + putushort(dotdotp->deHighClust, pcl >> 16); if (fvp->v_mount->mnt_flag & MNT_ASYNC) bdwrite(bp); else if ((error = bwrite(bp)) != 0) { @@ -1370,8 +1373,13 @@ msdosfs_mkdir(ap) putushort(denp[0].deMDate, ndirent.de_MDate); putushort(denp[0].deMTime, ndirent.de_MTime); pcl = pdep->de_StartCluster; + /* + * Although the root directory has a non-magic starting cluster + * number for FAT32, chkdsk and fsck_msdosfs still require + * references to it in dotdot entries to be magic. + */ if (FAT32(pmp) && pcl == pmp->pm_rootdirblk) - pcl = 0; + pcl = MSDOSFSROOT; putushort(denp[1].deStartCluster, pcl); putushort(denp[1].deCDate, ndirent.de_CDate); putushort(denp[1].deCTime, ndirent.de_CTime); @@ -1381,7 +1389,7 @@ msdosfs_mkdir(ap) putushort(denp[1].deMTime, ndirent.de_MTime); if (FAT32(pmp)) { putushort(denp[0].deHighClust, newcluster >> 16); - putushort(denp[1].deHighClust, pdep->de_StartCluster >> 16); + putushort(denp[1].deHighClust, pcl >> 16); } if (ap->a_dvp->v_mount->mnt_flag & MNT_ASYNC) From owner-svn-src-stable@FreeBSD.ORG Fri Feb 8 11:17:48 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 39AC26C; Fri, 8 Feb 2013 11:17:48 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2AADFD88; Fri, 8 Feb 2013 11:17:48 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r18BHmof065941; Fri, 8 Feb 2013 11:17:48 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18BHms8065940; Fri, 8 Feb 2013 11:17:48 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302081117.r18BHms8065940@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 8 Feb 2013 11:17:48 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246549 - stable/8/sys/fs/msdosfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 11:17:48 -0000 Author: kib Date: Fri Feb 8 11:17:47 2013 New Revision: 246549 URL: http://svnweb.freebsd.org/changeset/base/246549 Log: MFC r246218: Backup FATs were sometimes marked dirty by copying their first block from the primary FAT, and then they were not marked clean on unmount. Force marking them clean when appropriate. Modified: stable/8/sys/fs/msdosfs/msdosfs_fat.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/fs/ (props changed) Modified: stable/8/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- stable/8/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 8 11:15:57 2013 (r246548) +++ stable/8/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 8 11:17:47 2013 (r246549) @@ -321,8 +321,8 @@ updatefats(pmp, bp, fatbn) struct buf *bp; u_long fatbn; { - int i; struct buf *bpn; + int cleanfat, i; #ifdef MSDOSFS_DEBUG printf("updatefats(pmp %p, bp %p, fatbn %lu)\n", pmp, bp, fatbn); @@ -362,12 +362,23 @@ updatefats(pmp, bp, fatbn) * filesystem was mounted. If synch is asked for then use * bwrite()'s and really slow things down. */ + if (fatbn != pmp->pm_fatblk || FAT12(pmp)) + cleanfat = 0; + else if (FAT16(pmp)) + cleanfat = 16; + else + cleanfat = 32; for (i = 1; i < pmp->pm_FATs; i++) { fatbn += pmp->pm_FATsecs; /* getblk() never fails */ bpn = getblk(pmp->pm_devvp, fatbn, bp->b_bcount, 0, 0, 0); bcopy(bp->b_data, bpn->b_data, bp->b_bcount); + /* Force the clean bit on in the other copies. */ + if (cleanfat == 16) + ((u_int8_t *)bpn->b_data)[3] |= 0x80; + else if (cleanfat == 32) + ((u_int8_t *)bpn->b_data)[7] |= 0x08; if (pmp->pm_flags & MSDOSFSMNT_WAITONFAT) bwrite(bpn); else From owner-svn-src-stable@FreeBSD.ORG Fri Feb 8 11:19:44 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4487C21A; Fri, 8 Feb 2013 11:19:44 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 36FDBDA2; Fri, 8 Feb 2013 11:19:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r18BJiSj066232; Fri, 8 Feb 2013 11:19:44 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18BJiJr066231; Fri, 8 Feb 2013 11:19:44 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201302081119.r18BJiJr066231@svn.freebsd.org> From: Konstantin Belousov Date: Fri, 8 Feb 2013 11:19:44 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246550 - stable/8/sys/fs/msdosfs X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 11:19:44 -0000 Author: kib Date: Fri Feb 8 11:19:43 2013 New Revision: 246550 URL: http://svnweb.freebsd.org/changeset/base/246550 Log: MFC r246219: Use MNT_SYNCHRONOUS to decide to write the FAT updates syncrhonously. Modified: stable/8/sys/fs/msdosfs/msdosfs_fat.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/fs/ (props changed) Modified: stable/8/sys/fs/msdosfs/msdosfs_fat.c ============================================================================== --- stable/8/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 8 11:17:47 2013 (r246549) +++ stable/8/sys/fs/msdosfs/msdosfs_fat.c Fri Feb 8 11:19:43 2013 (r246550) @@ -379,7 +379,7 @@ updatefats(pmp, bp, fatbn) ((u_int8_t *)bpn->b_data)[3] |= 0x80; else if (cleanfat == 32) ((u_int8_t *)bpn->b_data)[7] |= 0x08; - if (pmp->pm_flags & MSDOSFSMNT_WAITONFAT) + if (pmp->pm_mountp->mnt_flag & MNT_SYNCHRONOUS) bwrite(bpn); else bdwrite(bpn); @@ -389,7 +389,7 @@ updatefats(pmp, bp, fatbn) /* * Write out the first (or current) fat last. */ - if (pmp->pm_flags & MSDOSFSMNT_WAITONFAT) + if (pmp->pm_mountp->mnt_flag & MNT_SYNCHRONOUS) bwrite(bp); else bdwrite(bp); From owner-svn-src-stable@FreeBSD.ORG Fri Feb 8 22:13:20 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id C98A4CB2; Fri, 8 Feb 2013 22:13:20 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id B8F833F7; Fri, 8 Feb 2013 22:13:20 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r18MDK0H062796; Fri, 8 Feb 2013 22:13:20 GMT (envelope-from jlh@svn.freebsd.org) Received: (from jlh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18MDK4d062795; Fri, 8 Feb 2013 22:13:20 GMT (envelope-from jlh@svn.freebsd.org) Message-Id: <201302082213.r18MDK4d062795@svn.freebsd.org> From: Jeremie Le Hen Date: Fri, 8 Feb 2013 22:13:20 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246566 - stable/9/usr.bin/stdbuf X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 22:13:20 -0000 Author: jlh Date: Fri Feb 8 22:13:20 2013 New Revision: 246566 URL: http://svnweb.freebsd.org/changeset/base/246566 Log: MFC r245418: Allow commands without any additional arguments, as stated in the manpage. While here, exit early when there is nothing to do. PR: 168415 Submitted by: Zhihao Yuan (initial version) MFC r245419: Remove stray tabs. Submitted by: kib Modified: stable/9/usr.bin/stdbuf/stdbuf.c Directory Properties: stable/9/usr.bin/stdbuf/ (props changed) Modified: stable/9/usr.bin/stdbuf/stdbuf.c ============================================================================== --- stable/9/usr.bin/stdbuf/stdbuf.c Fri Feb 8 21:15:47 2013 (r246565) +++ stable/9/usr.bin/stdbuf/stdbuf.c Fri Feb 8 22:13:20 2013 (r246566) @@ -39,7 +39,7 @@ extern char *__progname; static void usage(int s) { - + fprintf(stderr, "Usage: %s [-e 0|L|] [-i 0|L|] [-o 0|L|] " " [args ...]\n", __progname); exit(s); @@ -72,8 +72,8 @@ main(int argc, char *argv[]) } argc -= optind; argv += optind; - if (argc < 2) - usage(0); + if (argc == 0) + exit(0); if (ibuf != NULL && setenv("_STDBUF_I", ibuf, 1) == -1) warn("Failed to set environment variable: %s=%s", @@ -94,7 +94,7 @@ main(int argc, char *argv[]) if (i < 0 || putenv(preload1) == -1) warn("Failed to set environment variable: LD_PRELOAD"); - + preload0 = getenv("LD_32_PRELOAD"); if (preload0 == NULL) i = asprintf(&preload1, "LD_32_PRELOAD=" LIBSTDBUF32); From owner-svn-src-stable@FreeBSD.ORG Fri Feb 8 22:23:23 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 3E8331B0; Fri, 8 Feb 2013 22:23:23 +0000 (UTC) (envelope-from jlh@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 30FBF677; Fri, 8 Feb 2013 22:23:23 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r18MNNYd065933; Fri, 8 Feb 2013 22:23:23 GMT (envelope-from jlh@svn.freebsd.org) Received: (from jlh@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r18MNNbe065932; Fri, 8 Feb 2013 22:23:23 GMT (envelope-from jlh@svn.freebsd.org) Message-Id: <201302082223.r18MNNbe065932@svn.freebsd.org> From: Jeremie Le Hen Date: Fri, 8 Feb 2013 22:23:23 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246567 - stable/8/usr.bin/stdbuf X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Feb 2013 22:23:23 -0000 Author: jlh Date: Fri Feb 8 22:23:22 2013 New Revision: 246567 URL: http://svnweb.freebsd.org/changeset/base/246567 Log: MFC r245418: Allow commands without any additional arguments, as stated in the manpage. While here, exit early when there is nothing to do. PR: 168415 Submitted by: Zhihao Yuan (initial version) MFC r245419: Remove stray tabs. Submitted by: kib Modified: stable/8/usr.bin/stdbuf/stdbuf.c Directory Properties: stable/8/usr.bin/stdbuf/ (props changed) Modified: stable/8/usr.bin/stdbuf/stdbuf.c ============================================================================== --- stable/8/usr.bin/stdbuf/stdbuf.c Fri Feb 8 22:13:20 2013 (r246566) +++ stable/8/usr.bin/stdbuf/stdbuf.c Fri Feb 8 22:23:22 2013 (r246567) @@ -39,7 +39,7 @@ extern char *__progname; static void usage(int s) { - + fprintf(stderr, "Usage: %s [-e 0|L|] [-i 0|L|] [-o 0|L|] " " [args ...]\n", __progname); exit(s); @@ -72,8 +72,8 @@ main(int argc, char *argv[]) } argc -= optind; argv += optind; - if (argc < 2) - usage(0); + if (argc == 0) + exit(0); if (ibuf != NULL && setenv("_STDBUF_I", ibuf, 1) == -1) warn("Failed to set environment variable: %s=%s", @@ -94,7 +94,7 @@ main(int argc, char *argv[]) if (i < 0 || putenv(preload1) == -1) warn("Failed to set environment variable: LD_PRELOAD"); - + preload0 = getenv("LD_32_PRELOAD"); if (preload0 == NULL) i = asprintf(&preload1, "LD_32_PRELOAD=" LIBSTDBUF32); From owner-svn-src-stable@FreeBSD.ORG Sat Feb 9 00:29:38 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4F762BA2; Sat, 9 Feb 2013 00:29:38 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 23811C11; Sat, 9 Feb 2013 00:29:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r190Tc3x002550; Sat, 9 Feb 2013 00:29:38 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r190TbeQ002546; Sat, 9 Feb 2013 00:29:37 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302090029.r190TbeQ002546@svn.freebsd.org> From: Xin LI Date: Sat, 9 Feb 2013 00:29:37 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246574 - in stable/9: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 00:29:38 -0000 Author: delphij Date: Sat Feb 9 00:29:36 2013 New Revision: 246574 URL: http://svnweb.freebsd.org/changeset/base/246574 Log: MFC r245264: The current ZFS code expects ddt_zap_count to always succeed by asserting the underlying zap_count() to return no errors. However, it is possible that the pool reaches to such a state where zap_count would return error, leading to panics when a pool is imported. This commit changes the ddt_zap_count to return error returned from zap_count and handle the error appropriately. With this change, it's now possible to let zpool rollback damaged transaction groups and import the pool. Obtained from: ZFS on Linux github (e8fd45a0f975c6b8ae8cd644714fc21f14fac2bf) Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Directory Properties: stable/9/cddl/ (props changed) stable/9/cddl/contrib/opensolaris/ (props changed) stable/9/sys/ (props changed) stable/9/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Fri Feb 8 23:59:21 2013 (r246573) +++ stable/9/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Feb 9 00:29:36 2013 (r246574) @@ -704,7 +704,9 @@ dump_ddt(ddt_t *ddt, enum ddt_type type, return; ASSERT(error == 0); - if ((count = ddt_object_count(ddt, type, class)) == 0) + error = ddt_object_count(ddt, type, class, &count); + ASSERT(error == 0); + if (count == 0) return; dspace = doi.doi_physical_blocks_512 << 9; Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c Fri Feb 8 23:59:21 2013 (r246573) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c Sat Feb 9 00:29:36 2013 (r246574) @@ -89,12 +89,13 @@ ddt_object_destroy(ddt_t *ddt, enum ddt_ spa_t *spa = ddt->ddt_spa; objset_t *os = ddt->ddt_os; uint64_t *objectp = &ddt->ddt_object[type][class]; + uint64_t count; char name[DDT_NAMELEN]; ddt_object_name(ddt, type, class, name); ASSERT(*objectp != 0); - ASSERT(ddt_object_count(ddt, type, class) == 0); + VERIFY(ddt_object_count(ddt, type, class, &count) == 0 && count == 0); ASSERT(ddt_histogram_empty(&ddt->ddt_histogram[type][class])); VERIFY(zap_remove(os, DMU_POOL_DIRECTORY_OBJECT, name, tx) == 0); VERIFY(zap_remove(os, spa->spa_ddt_stat_object, name, tx) == 0); @@ -109,6 +110,7 @@ ddt_object_load(ddt_t *ddt, enum ddt_typ { ddt_object_t *ddo = &ddt->ddt_object_stats[type][class]; dmu_object_info_t doi; + uint64_t count; char name[DDT_NAMELEN]; int error; @@ -129,7 +131,11 @@ ddt_object_load(ddt_t *ddt, enum ddt_typ */ VERIFY(ddt_object_info(ddt, type, class, &doi) == 0); - ddo->ddo_count = ddt_object_count(ddt, type, class); + error = ddt_object_count(ddt, type, class, &count); + if (error) + return error; + + ddo->ddo_count = count; ddo->ddo_dspace = doi.doi_physical_blocks_512 << 9; ddo->ddo_mspace = doi.doi_fill_count * doi.doi_data_block_size; @@ -143,6 +149,7 @@ ddt_object_sync(ddt_t *ddt, enum ddt_typ { ddt_object_t *ddo = &ddt->ddt_object_stats[type][class]; dmu_object_info_t doi; + uint64_t count; char name[DDT_NAMELEN]; ddt_object_name(ddt, type, class, name); @@ -155,8 +162,9 @@ ddt_object_sync(ddt_t *ddt, enum ddt_typ * Cache DDT statistics; this is the only time they'll change. */ VERIFY(ddt_object_info(ddt, type, class, &doi) == 0); + VERIFY(ddt_object_count(ddt, type, class, &count) == 0); - ddo->ddo_count = ddt_object_count(ddt, type, class); + ddo->ddo_count = count; ddo->ddo_dspace = doi.doi_physical_blocks_512 << 9; ddo->ddo_mspace = doi.doi_fill_count * doi.doi_data_block_size; } @@ -213,13 +221,13 @@ ddt_object_walk(ddt_t *ddt, enum ddt_typ ddt->ddt_object[type][class], dde, walk)); } -uint64_t -ddt_object_count(ddt_t *ddt, enum ddt_type type, enum ddt_class class) +int +ddt_object_count(ddt_t *ddt, enum ddt_type type, enum ddt_class class, uint64_t *count) { ASSERT(ddt_object_exists(ddt, type, class)); return (ddt_ops[type]->ddt_op_count(ddt->ddt_os, - ddt->ddt_object[type][class])); + ddt->ddt_object[type][class], count)); } int @@ -1079,11 +1087,13 @@ ddt_sync_table(ddt_t *ddt, dmu_tx_t *tx, } for (enum ddt_type type = 0; type < DDT_TYPES; type++) { - uint64_t count = 0; + uint64_t add, count = 0; for (enum ddt_class class = 0; class < DDT_CLASSES; class++) { if (ddt_object_exists(ddt, type, class)) { ddt_object_sync(ddt, type, class, tx); - count += ddt_object_count(ddt, type, class); + VERIFY(ddt_object_count(ddt, type, class, + &add) == 0); + count += add; } } for (enum ddt_class class = 0; class < DDT_CLASSES; class++) { Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c Fri Feb 8 23:59:21 2013 (r246573) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c Sat Feb 9 00:29:36 2013 (r246574) @@ -133,14 +133,11 @@ ddt_zap_walk(objset_t *os, uint64_t obje return (error); } -static uint64_t -ddt_zap_count(objset_t *os, uint64_t object) +static int +ddt_zap_count(objset_t *os, uint64_t object, uint64_t *count) { - uint64_t count = 0; - VERIFY(zap_count(os, object, &count) == 0); - - return (count); + return (zap_count(os, object, count)); } const ddt_ops_t ddt_zap_ops = { Modified: stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h ============================================================================== --- stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Fri Feb 8 23:59:21 2013 (r246573) +++ stable/9/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Sat Feb 9 00:29:36 2013 (r246574) @@ -163,7 +163,7 @@ typedef struct ddt_ops { dmu_tx_t *tx); int (*ddt_op_walk)(objset_t *os, uint64_t object, ddt_entry_t *dde, uint64_t *walk); - uint64_t (*ddt_op_count)(objset_t *os, uint64_t object); + int (*ddt_op_count)(objset_t *os, uint64_t object, uint64_t *count); } ddt_ops_t; #define DDT_NAMELEN 80 @@ -172,8 +172,8 @@ extern void ddt_object_name(ddt_t *ddt, enum ddt_class cls, char *name); extern int ddt_object_walk(ddt_t *ddt, enum ddt_type type, enum ddt_class cls, uint64_t *walk, ddt_entry_t *dde); -extern uint64_t ddt_object_count(ddt_t *ddt, enum ddt_type type, - enum ddt_class cls); +extern int ddt_object_count(ddt_t *ddt, enum ddt_type type, + enum ddt_class class, uint64_t *count); extern int ddt_object_info(ddt_t *ddt, enum ddt_type type, enum ddt_class cls, dmu_object_info_t *); extern boolean_t ddt_object_exists(ddt_t *ddt, enum ddt_type type, From owner-svn-src-stable@FreeBSD.ORG Sat Feb 9 01:08:51 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4E96D7DD; Sat, 9 Feb 2013 01:08:51 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3F9E5E51; Sat, 9 Feb 2013 01:08:51 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r1918pf1014623; Sat, 9 Feb 2013 01:08:51 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r1918okl014615; Sat, 9 Feb 2013 01:08:50 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201302090108.r1918okl014615@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 9 Feb 2013 01:08:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246576 - in stable/9/usr.sbin/crunch: crunchgen crunchide examples X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 01:08:51 -0000 Author: pfg Date: Sat Feb 9 01:08:49 2013 New Revision: 246576 URL: http://svnweb.freebsd.org/changeset/base/246576 Log: MFC r237574, r237625, r246256; crunch: Sync some NetBSD changes. crunchide: Apr 11, 2009: fix some -Wsign-compare issues. Sep 20, 1999: Free the right thing. crunchgen: Apr 14, 2009: Fix some WARNS=4 issues (-Wshadow -Wcast-qual) Oct 30, 2004: Add (unsigned char) cast to ctype functions Feb 5, 2001: fix nested extern. examples: Aug 30, 2007: NetBSD 36867 - trsp references are deprecated In order to merge this I also had to merge some previous changes: - Ensure crunchen uses the same make binary as the rest of the build. - Some amount of style(9): function definitions, header ordering, and $FreeBSD$. Modified: stable/9/usr.sbin/crunch/crunchgen/crunched_main.c stable/9/usr.sbin/crunch/crunchgen/crunchgen.c stable/9/usr.sbin/crunch/crunchide/crunchide.c stable/9/usr.sbin/crunch/crunchide/exec_elf32.c stable/9/usr.sbin/crunch/examples/really-big.conf Directory Properties: stable/9/usr.sbin/crunch/ (props changed) Modified: stable/9/usr.sbin/crunch/crunchgen/crunched_main.c ============================================================================== --- stable/9/usr.sbin/crunch/crunchgen/crunched_main.c Sat Feb 9 00:35:28 2013 (r246575) +++ stable/9/usr.sbin/crunch/crunchgen/crunched_main.c Sat Feb 9 01:08:49 2013 (r246576) @@ -22,8 +22,6 @@ * Author: James da Silva, Systems Design and Analysis Group * Computer Science Department * University of Maryland at College Park - * - * $FreeBSD$ */ /* * crunched_main.c - main program for crunched binaries, it branches to a @@ -33,6 +31,10 @@ * or calls one of them based on argv[1]. This allows the testing of * the crunched binary without creating all the links. */ + +#include +__FBSDID("$FreeBSD$"); + #include #include #include @@ -45,7 +47,8 @@ struct stub { extern char *__progname; extern struct stub entry_points[]; -int main(int argc, char **argv, char **envp) +int +main(int argc, char **argv, char **envp) { char *slash, *basename; struct stub *ep; @@ -68,7 +71,8 @@ int main(int argc, char **argv, char **e } -int crunched_here(char *path) +int +crunched_here(char *path) { char *slash, *basename; struct stub *ep; @@ -83,7 +87,8 @@ int crunched_here(char *path) } -int crunched_main(int argc, char **argv, char **envp) +int +crunched_main(int argc, char **argv, char **envp) { char *slash; struct stub *ep; @@ -99,7 +104,8 @@ int crunched_main(int argc, char **argv, } -int crunched_usage() +int +crunched_usage() { int columns, len; struct stub *ep; @@ -122,4 +128,3 @@ int crunched_usage() } /* end of crunched_main.c */ - Modified: stable/9/usr.sbin/crunch/crunchgen/crunchgen.c ============================================================================== --- stable/9/usr.sbin/crunch/crunchgen/crunchgen.c Sat Feb 9 00:35:28 2013 (r246575) +++ stable/9/usr.sbin/crunch/crunchgen/crunchgen.c Sat Feb 9 01:08:49 2013 (r246576) @@ -22,8 +22,6 @@ * Author: James da Silva, Systems Design and Analysis Group * Computer Science Department * University of Maryland at College Park - * - * $FreeBSD$ */ /* * ======================================================================== @@ -32,9 +30,12 @@ * Generates a Makefile and main C file for a crunched executable, * from specs given in a .conf file. */ -#include -#include + +#include +__FBSDID("$FreeBSD$"); + #include +#include #include #include @@ -92,6 +93,7 @@ char outmkname[MAXPATHLEN], outcfname[MA char tempfname[MAXPATHLEN], cachename[MAXPATHLEN], curfilename[MAXPATHLEN]; char outhdrname[MAXPATHLEN] ; /* user-supplied header for *.mk */ char *objprefix; /* where are the objects ? */ +char *path_make; int linenum = -1; int goterror = 0; @@ -103,22 +105,24 @@ int list_mode; /* general library routines */ -void status(char *str); +void status(const char *str); void out_of_memory(void); void add_string(strlst_t **listp, char *str); -int is_dir(char *pathname); -int is_nonempty_file(char *pathname); +int is_dir(const char *pathname); +int is_nonempty_file(const char *pathname); int subtract_strlst(strlst_t **lista, strlst_t **listb); int in_list(strlst_t **listp, char *str); -/* helper routines for main() */ + +extern char *crunched_skel[]; void usage(void); void parse_conf_file(void); void gen_outputs(void); -int main(int argc, char **argv) +int +main(int argc, char **argv) { char *p; int optc; @@ -127,6 +131,10 @@ int main(int argc, char **argv) readcache = 1; *outmkname = *outcfname = *execfname = '\0'; + path_make = getenv("MAKE"); + if (path_make == NULL || *path_make == '\0') + path_make = "make"; + p = getenv("MAKEOBJDIRPREFIX"); if (p == NULL || *p == '\0') objprefix = "/usr/obj"; /* default */ @@ -218,7 +226,8 @@ int main(int argc, char **argv) } -void usage(void) +void +usage(void) { fprintf(stderr, "%s%s\n\t%s%s\n", "usage: crunchgen [-foq] ", "[-h ] [-m ]", @@ -237,7 +246,7 @@ void usage(void) /* helper routines for parse_conf_file */ void parse_one_file(char *filename); -void parse_line(char *line, int *fc, char **fv, int nf); +void parse_line(char *pline, int *fc, char **fv, int nf); void add_srcdirs(int argc, char **argv); void add_progs(int argc, char **argv); void add_link(int argc, char **argv); @@ -250,7 +259,8 @@ prog_t *find_prog(char *str); void add_prog(char *progname); -void parse_conf_file(void) +void +parse_conf_file(void) { if (!is_nonempty_file(infilename)) errx(1, "fatal: input file \"%s\" not found", infilename); @@ -263,7 +273,8 @@ void parse_conf_file(void) } -void parse_one_file(char *filename) +void +parse_one_file(char *filename) { char *fieldv[MAXFIELDS]; int fieldc; @@ -329,15 +340,16 @@ void parse_one_file(char *filename) } -void parse_line(char *line, int *fc, char **fv, int nf) +void +parse_line(char *pline, int *fc, char **fv, int nf) { char *p; - p = line; + p = pline; *fc = 0; while (1) { - while (isspace(*p)) + while (isspace((unsigned char)*p)) p++; if (*p == '\0' || *p == '#') @@ -346,7 +358,7 @@ void parse_line(char *line, int *fc, cha if (*fc < nf) fv[(*fc)++] = p; - while (*p && !isspace(*p) && *p != '#') + while (*p && !isspace((unsigned char)*p) && *p != '#') p++; if (*p == '\0' || *p == '#') @@ -360,7 +372,8 @@ void parse_line(char *line, int *fc, cha } -void add_srcdirs(int argc, char **argv) +void +add_srcdirs(int argc, char **argv) { int i; @@ -376,7 +389,8 @@ void add_srcdirs(int argc, char **argv) } -void add_progs(int argc, char **argv) +void +add_progs(int argc, char **argv) { int i; @@ -385,7 +399,8 @@ void add_progs(int argc, char **argv) } -void add_prog(char *progname) +void +add_prog(char *progname) { prog_t *p1, *p2; @@ -426,7 +441,8 @@ void add_prog(char *progname) } -void add_link(int argc, char **argv) +void +add_link(int argc, char **argv) { int i; prog_t *p = find_prog(argv[1]); @@ -447,7 +463,8 @@ void add_link(int argc, char **argv) } -void add_libs(int argc, char **argv) +void +add_libs(int argc, char **argv) { int i; @@ -461,7 +478,8 @@ void add_libs(int argc, char **argv) } -void add_libs_so(int argc, char **argv) +void +add_libs_so(int argc, char **argv) { int i; @@ -475,7 +493,8 @@ void add_libs_so(int argc, char **argv) } -void add_buildopts(int argc, char **argv) +void +add_buildopts(int argc, char **argv) { int i; @@ -484,7 +503,8 @@ void add_buildopts(int argc, char **argv } -void add_special(int argc, char **argv) +void +add_special(int argc, char **argv) { int i; prog_t *p = find_prog(argv[1]); @@ -586,7 +606,8 @@ char *genident(char *str); char *dir_search(char *progname); -void gen_outputs(void) +void +gen_outputs(void) { prog_t *p; @@ -599,13 +620,15 @@ void gen_outputs(void) gen_output_makefile(); status(""); fprintf(stderr, - "Run \"make -f %s\" to build crunched binary.\n", outmkname); + "Run \"%s -f %s\" to build crunched binary.\n", + path_make, outmkname); } /* * run the makefile for the program to find which objects are necessary */ -void fillin_program(prog_t *p) +void +fillin_program(prog_t *p) { char path[MAXPATHLEN]; char line[MAXLINELEN]; @@ -680,7 +703,8 @@ void fillin_program(prog_t *p) p->goterror = 1; } -void fillin_program_objs(prog_t *p, char *path) +void +fillin_program_objs(prog_t *p, char *path) { char *obj, *cp; int fd, rc; @@ -720,16 +744,16 @@ void fillin_program_objs(prog_t *p, char fprintf(f, "loop:\n\t@echo 'OBJS= '${%s}\n", objvar); fprintf(f, "crunchgen_objs:\n" - "\t@cd %s && make -f %s $(BUILDOPTS) $(%s_OPTS)", - p->srcdir, tempfname, p->ident); + "\t@cd %s && %s -f %s $(BUILDOPTS) $(%s_OPTS)", + p->srcdir, path_make, tempfname, p->ident); for (s = p->buildopts; s != NULL; s = s->next) fprintf(f, " %s", s->str); fprintf(f, " loop\n"); fclose(f); - snprintf(line, MAXLINELEN, "cd %s && make -f %s -B crunchgen_objs", - p->srcdir, tempfname); + snprintf(line, MAXLINELEN, "cd %s && %s -f %s -B crunchgen_objs", + p->srcdir, path_make, tempfname); if ((f = popen(line, "r")) == NULL) { warn("submake pipe"); goterror = 1; @@ -744,17 +768,17 @@ void fillin_program_objs(prog_t *p, char } cp = line + 6; - while (isspace(*cp)) + while (isspace((unsigned char)*cp)) cp++; while(*cp) { obj = cp; - while (*cp && !isspace(*cp)) + while (*cp && !isspace((unsigned char)*cp)) cp++; if (*cp) *cp++ = '\0'; add_string(&p->objs, obj); - while (isspace(*cp)) + while (isspace((unsigned char)*cp)) cp++; } } @@ -767,7 +791,8 @@ void fillin_program_objs(prog_t *p, char unlink(tempfname); } -void remove_error_progs(void) +void +remove_error_progs(void) { prog_t *p1, *p2; @@ -788,7 +813,8 @@ void remove_error_progs(void) } } -void gen_specials_cache(void) +void +gen_specials_cache(void) { FILE *cachef; prog_t *p; @@ -828,7 +854,8 @@ void gen_specials_cache(void) } -void gen_output_makefile(void) +void +gen_output_makefile(void) { prog_t *p; FILE *outmk; @@ -858,9 +885,9 @@ void gen_output_makefile(void) } -void gen_output_cfile(void) +void +gen_output_cfile(void) { - extern char *crunched_skel[]; char **cp; FILE *outcf; prog_t *p; @@ -918,7 +945,7 @@ char *genident(char *str) for (d = s = n; *s != '\0'; s++) { if (*s == '-') *d++ = '_'; - else if (*s == '_' || isalnum(*s)) + else if (*s == '_' || isalnum((unsigned char)*s)) *d++ = *s; } *d = '\0'; @@ -946,7 +973,8 @@ char *dir_search(char *progname) } -void top_makefile_rules(FILE *outmk) +void +top_makefile_rules(FILE *outmk) { prog_t *p; @@ -1004,7 +1032,8 @@ void top_makefile_rules(FILE *outmk) } -void prog_makefile_rules(FILE *outmk, prog_t *p) +void +prog_makefile_rules(FILE *outmk, prog_t *p) { strlst_t *lst; @@ -1089,7 +1118,8 @@ void prog_makefile_rules(FILE *outmk, pr fprintf(outmk, "%s.lo\n", p->name); } -void output_strlst(FILE *outf, strlst_t *lst) +void +output_strlst(FILE *outf, strlst_t *lst) { for (; lst != NULL; lst = lst->next) if ( strlen(lst->str) ) @@ -1104,7 +1134,8 @@ void output_strlst(FILE *outf, strlst_t * */ -void status(char *str) +void +status(const char *str) { static int lastlen = 0; int len, spaces; @@ -1123,13 +1154,15 @@ void status(char *str) } -void out_of_memory(void) +void +out_of_memory(void) { err(1, "%s: %d: out of memory, stopping", infilename, linenum); } -void add_string(strlst_t **listp, char *str) +void +add_string(strlst_t **listp, char *str) { strlst_t *p1, *p2; @@ -1153,7 +1186,8 @@ void add_string(strlst_t **listp, char * p1->next = p2; } -int subtract_strlst(strlst_t **lista, strlst_t **listb) +int +subtract_strlst(strlst_t **lista, strlst_t **listb) { int subtract_count = 0; strlst_t *p1; @@ -1166,7 +1200,8 @@ int subtract_strlst(strlst_t **lista, st return subtract_count; } -int in_list(strlst_t **listp, char *str) +int +in_list(strlst_t **listp, char *str) { strlst_t *p1; for (p1 = *listp; p1 != NULL; p1 = p1->next) @@ -1175,7 +1210,8 @@ int in_list(strlst_t **listp, char *str) return 0; } -int is_dir(char *pathname) +int +is_dir(const char *pathname) { struct stat buf; @@ -1185,7 +1221,8 @@ int is_dir(char *pathname) return S_ISDIR(buf.st_mode); } -int is_nonempty_file(char *pathname) +int +is_nonempty_file(const char *pathname) { struct stat buf; Modified: stable/9/usr.sbin/crunch/crunchide/crunchide.c ============================================================================== --- stable/9/usr.sbin/crunch/crunchide/crunchide.c Sat Feb 9 00:35:28 2013 (r246575) +++ stable/9/usr.sbin/crunch/crunchide/crunchide.c Sat Feb 9 01:08:49 2013 (r246576) @@ -1,5 +1,4 @@ /* $NetBSD: crunchide.c,v 1.8 1997/11/01 06:51:45 lukem Exp $ */ -/* $FreeBSD$ */ /* * Copyright (c) 1997 Christopher G. Demetriou. All rights reserved. * Copyright (c) 1994 University of Maryland @@ -59,20 +58,22 @@ * that the final crunched binary BSS size is the max of all the * component programs' BSS sizes, rather than their sum. */ + #include #ifndef lint __RCSID("$NetBSD: crunchide.c,v 1.8 1997/11/01 06:51:45 lukem Exp $"); #endif +__FBSDID("$FreeBSD$"); +#include +#include +#include #include #include #include #include #include #include -#include -#include -#include #include "extern.h" @@ -89,9 +90,8 @@ int verbose; int main(int, char *[]); -int main(argc, argv) -int argc; -char **argv; +int +main(int argc, char **argv) { int ch, errors; @@ -127,7 +127,8 @@ char **argv; return errors; } -void usage(void) +void +usage(void) { fprintf(stderr, "usage: %s [-k ] [-f ] ...\n", @@ -142,7 +143,8 @@ struct keep { char *sym; } *keep_list; -void add_to_keep_list(char *symbol) +void +add_to_keep_list(char *symbol) { struct keep *newp, *prevp, *curp; int cmp; @@ -167,7 +169,8 @@ void add_to_keep_list(char *symbol) else keep_list = newp; } -int in_keep_list(const char *symbol) +int +in_keep_list(const char *symbol) { struct keep *curp; int cmp; @@ -180,7 +183,8 @@ int in_keep_list(const char *symbol) return curp && cmp == 0; } -void add_file_to_keep_list(char *filename) +void +add_file_to_keep_list(char *filename) { FILE *keepf; char symbol[1024]; @@ -222,7 +226,8 @@ struct { #endif }; -int hide_syms(const char *filename) +int +hide_syms(const char *filename) { int fd, i, n, rv; Modified: stable/9/usr.sbin/crunch/crunchide/exec_elf32.c ============================================================================== --- stable/9/usr.sbin/crunch/crunchide/exec_elf32.c Sat Feb 9 00:35:28 2013 (r246575) +++ stable/9/usr.sbin/crunch/crunchide/exec_elf32.c Sat Feb 9 01:08:49 2013 (r246576) @@ -31,7 +31,7 @@ #include #ifndef lint #if 0 -__RCSID("$NetBSD: exec_elf32.c,v 1.4 1997/08/12 06:07:24 mikel Exp $"); +__RCSID("$NetBSD: exec_elf32.c,v 1.6 1999/09/20 04:12:16 christos Exp $"); #endif #endif __FBSDID("$FreeBSD$"); @@ -98,7 +98,7 @@ xreadatoff(int fd, void *buf, off_t off, perror(fn); return -1; } - if ((rv = read(fd, buf, size)) != size) { + if ((size_t)(rv = read(fd, buf, size)) != size) { fprintf(stderr, "%s: read error: %s\n", fn, rv == -1 ? strerror(errno) : "short read"); return -1; @@ -115,7 +115,7 @@ xwriteatoff(int fd, void *buf, off_t off perror(fn); return -1; } - if ((rv = write(fd, buf, size)) != size) { + if ((size_t)(rv = write(fd, buf, size)) != size) { fprintf(stderr, "%s: write error: %s\n", fn, rv == -1 ? strerror(errno) : "short write"); return -1; @@ -162,7 +162,7 @@ ELFNAMEEND(check)(int fd, const char *fn */ if (fstat(fd, &sb) == -1) return 0; - if (sb.st_size < sizeof eh) + if (sb.st_size < (off_t)(sizeof eh)) return 0; if (read(fd, &eh, sizeof eh) != sizeof eh) return 0; @@ -305,7 +305,7 @@ ELFNAMEEND(hide)(int fd, const char *fn) if ((symtabp = xmalloc(xewtoh(symtabshdr->sh_size), fn, "symbol table")) == NULL) goto bad; - if (xreadatoff(fd, symtabp, xewtoh(symtabshdr->sh_offset), + if ((size_t)xreadatoff(fd, symtabp, xewtoh(symtabshdr->sh_offset), xewtoh(symtabshdr->sh_size), fn) != xewtoh(symtabshdr->sh_size)) goto bad; @@ -313,7 +313,7 @@ ELFNAMEEND(hide)(int fd, const char *fn) if ((strtabp = xmalloc(xewtoh(strtabshdr->sh_size), fn, "string table")) == NULL) goto bad; - if (xreadatoff(fd, strtabp, xewtoh(strtabshdr->sh_offset), + if ((size_t)xreadatoff(fd, strtabp, xewtoh(strtabshdr->sh_offset), xewtoh(strtabshdr->sh_size), fn) != xewtoh(strtabshdr->sh_size)) goto bad; @@ -370,7 +370,7 @@ ELFNAMEEND(hide)(int fd, const char *fn) if (xwriteatoff(fd, shdrp, xewtoh(ehdr.e_shoff), shdrsize, fn) != shdrsize) goto bad; - if (xwriteatoff(fd, symtabp, xewtoh(symtabshdr->sh_offset), + if ((size_t)xwriteatoff(fd, symtabp, xewtoh(symtabshdr->sh_offset), xewtoh(symtabshdr->sh_size), fn) != xewtoh(symtabshdr->sh_size)) goto bad; /* write new symbol table strings */ @@ -384,7 +384,7 @@ out: if (symtabp != NULL) free(symtabp); if (strtabp != NULL) - free(strtabp); + free(nstrtabp); return (rv); bad: Modified: stable/9/usr.sbin/crunch/examples/really-big.conf ============================================================================== --- stable/9/usr.sbin/crunch/examples/really-big.conf Sat Feb 9 00:35:28 2013 (r246575) +++ stable/9/usr.sbin/crunch/examples/really-big.conf Sat Feb 9 01:08:49 2013 (r246576) @@ -72,7 +72,7 @@ progs dev_mkdb diskpart edquota flcopy g progs iostat iteconfig kvm_mkdb mtree named portmap pppd progs pstat pwd_mkdb quot quotaon rarpd rbootd repquota rmt rpc.bootparamd progs rwhod sa spray sysctl syslogd tcpdump -progs traceroute trpt trsp update vipw vnconfig ypbind yppoll ypset +progs traceroute trpt update vipw vnconfig ypbind yppoll ypset special amd srcdir /usr/src/usr.sbin/amd/amd special amd objs vers.amd.o afs_ops.o am_ops.o clock.o util.o xutil.o efs_ops.o mapc.o info_file.o info_hes.o info_ndbm.o info_passwd.o info_nis.o info_union.o map.o srvr_afs.o srvr_nfs.o mntfs.o misc_rpc.o mount_fs.o mtab.o mtab_bsd.o nfs_ops.o nfs_prot_svc.o nfs_start.o nfs_subr.o opts.o pfs_ops.o rpc_fwd.o sched.o sfs_ops.o amq_svc.o amq_subr.o umount_fs.o host_ops.o nfsx_ops.o ufs_ops.o ifs_ops.o amd.o get_args.o restart.o wire.o From owner-svn-src-stable@FreeBSD.ORG Sat Feb 9 01:38:45 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 17EE8C7E; Sat, 9 Feb 2013 01:38:45 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id EF39CF4F; Sat, 9 Feb 2013 01:38:44 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r191ci8g023478; Sat, 9 Feb 2013 01:38:44 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r191ch7I023470; Sat, 9 Feb 2013 01:38:43 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302090138.r191ch7I023470@svn.freebsd.org> From: Xin LI Date: Sat, 9 Feb 2013 01:38:43 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246577 - in stable/8: cddl/compat/opensolaris/include sys/cddl/compat/opensolaris/sys sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 01:38:45 -0000 Author: delphij Date: Sat Feb 9 01:38:43 2013 New Revision: 246577 URL: http://svnweb.freebsd.org/changeset/base/246577 Log: MFC r222950 (gibbs): Remove C constructs that are incompatible with C++ from various OpenSolaris and ZFS header files. These changes are sufficient to allow a C++ program to use the libzfs library. Note: The majority of these files already included 'extern "C"' declarations, so the intention of providing C++ compatibility already existed even if it wasn't provided. cddl/compat/opensolaris/include/assert.h: Wrap our compatibility assert implementation in 'extern "C"'. Since this is a compatibility header I matched the Solaris style of doing this explicitly rather than rely on FreeBSD's __BEGIN/END_DECLS macro. sys/cddl/compat/opensolaris/sys/kstat.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h: sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h: Rename parameters in function declarations that conflict with C++ keywords. This was the solution preferred by members of the Illumos community. sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h: In C, nested structures are visible in the global namespace, but in C++, they take on the namespace of the structure in which they are contained. Flatten nested structure definitions within struct zfs_cmd so these structures are visible in the global namespace when compiled in both languages. Sponsored by: Spectra Logic Corporation Modified: stable/8/cddl/compat/opensolaris/include/assert.h stable/8/sys/cddl/compat/opensolaris/sys/kstat.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Directory Properties: stable/8/cddl/ (props changed) stable/8/cddl/compat/opensolaris/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/compat/opensolaris/include/assert.h ============================================================================== --- stable/8/cddl/compat/opensolaris/include/assert.h Sat Feb 9 01:08:49 2013 (r246576) +++ stable/8/cddl/compat/opensolaris/include/assert.h Sat Feb 9 01:38:43 2013 (r246577) @@ -43,6 +43,10 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif + static __inline void __assert(const char *expr, const char *file, int line) { @@ -52,4 +56,9 @@ __assert(const char *expr, const char *f abort(); /* NOTREACHED */ } + +#ifdef __cplusplus +} +#endif + #endif /* !_ASSERT_H_ */ Modified: stable/8/sys/cddl/compat/opensolaris/sys/kstat.h ============================================================================== --- stable/8/sys/cddl/compat/opensolaris/sys/kstat.h Sat Feb 9 01:08:49 2013 (r246576) +++ stable/8/sys/cddl/compat/opensolaris/sys/kstat.h Sat Feb 9 01:38:43 2013 (r246577) @@ -58,7 +58,7 @@ typedef struct kstat_named { } value; } kstat_named_t; -kstat_t *kstat_create(char *module, int instance, char *name, char *class, +kstat_t *kstat_create(char *module, int instance, char *name, char *cls, uchar_t type, ulong_t ndata, uchar_t flags); void kstat_install(kstat_t *ksp); void kstat_delete(kstat_t *ksp); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Sat Feb 9 01:08:49 2013 (r246576) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/arc.h Sat Feb 9 01:38:43 2013 (r246577) @@ -38,8 +38,8 @@ extern "C" { typedef struct arc_buf_hdr arc_buf_hdr_t; typedef struct arc_buf arc_buf_t; -typedef void arc_done_func_t(zio_t *zio, arc_buf_t *buf, void *private); -typedef int arc_evict_func_t(void *private); +typedef void arc_done_func_t(zio_t *zio, arc_buf_t *buf, void *priv); +typedef int arc_evict_func_t(void *priv); /* generic arc_done_func_t's which you can use */ arc_done_func_t arc_bcopy_func; @@ -104,17 +104,17 @@ int arc_referenced(arc_buf_t *buf); #endif int arc_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, arc_buf_t *pbuf, - arc_done_func_t *done, void *private, int priority, int zio_flags, + arc_done_func_t *done, void *priv, int priority, int zio_flags, uint32_t *arc_flags, const zbookmark_t *zb); int arc_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bp, - arc_done_func_t *done, void *private, int priority, int flags, + arc_done_func_t *done, void *priv, int priority, int flags, uint32_t *arc_flags, const zbookmark_t *zb); zio_t *arc_write(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, arc_buf_t *buf, boolean_t l2arc, const zio_prop_t *zp, - arc_done_func_t *ready, arc_done_func_t *done, void *private, + arc_done_func_t *ready, arc_done_func_t *done, void *priv, int priority, int zio_flags, const zbookmark_t *zb); -void arc_set_callback(arc_buf_t *buf, arc_evict_func_t *func, void *private); +void arc_set_callback(arc_buf_t *buf, arc_evict_func_t *func, void *priv); int arc_buf_evict(arc_buf_t *buf); void arc_flush(spa_t *spa); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Sat Feb 9 01:08:49 2013 (r246576) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Sat Feb 9 01:38:43 2013 (r246577) @@ -169,15 +169,15 @@ typedef struct ddt_ops { #define DDT_NAMELEN 80 extern void ddt_object_name(ddt_t *ddt, enum ddt_type type, - enum ddt_class class, char *name); + enum ddt_class cls, char *name); extern int ddt_object_walk(ddt_t *ddt, enum ddt_type type, - enum ddt_class class, uint64_t *walk, ddt_entry_t *dde); + enum ddt_class cls, uint64_t *walk, ddt_entry_t *dde); extern uint64_t ddt_object_count(ddt_t *ddt, enum ddt_type type, - enum ddt_class class); + enum ddt_class cls); extern int ddt_object_info(ddt_t *ddt, enum ddt_type type, - enum ddt_class class, dmu_object_info_t *); + enum ddt_class cls, dmu_object_info_t *); extern boolean_t ddt_object_exists(ddt_t *ddt, enum ddt_type type, - enum ddt_class class); + enum ddt_class cls); extern void ddt_bp_fill(const ddt_phys_t *ddp, blkptr_t *bp, uint64_t txg); @@ -235,7 +235,7 @@ extern void ddt_unload(spa_t *spa); extern void ddt_sync(spa_t *spa, uint64_t txg); extern int ddt_walk(spa_t *spa, ddt_bookmark_t *ddb, ddt_entry_t *dde); extern int ddt_object_update(ddt_t *ddt, enum ddt_type type, - enum ddt_class class, ddt_entry_t *dde, dmu_tx_t *tx); + enum ddt_class cls, ddt_entry_t *dde, dmu_tx_t *tx); extern const ddt_ops_t ddt_zap_ops; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Sat Feb 9 01:08:49 2013 (r246576) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/dsl_pool.h Sat Feb 9 01:38:43 2013 (r246577) @@ -135,10 +135,10 @@ void dsl_free(dsl_pool_t *dp, uint64_t t void dsl_free_sync(zio_t *pio, dsl_pool_t *dp, uint64_t txg, const blkptr_t *bpp); int dsl_read(zio_t *pio, spa_t *spa, const blkptr_t *bpp, arc_buf_t *pbuf, - arc_done_func_t *done, void *private, int priority, int zio_flags, + arc_done_func_t *done, void *priv, int priority, int zio_flags, uint32_t *arc_flags, const zbookmark_t *zb); int dsl_read_nolock(zio_t *pio, spa_t *spa, const blkptr_t *bpp, - arc_done_func_t *done, void *private, int priority, int zio_flags, + arc_done_func_t *done, void *priv, int priority, int zio_flags, uint32_t *arc_flags, const zbookmark_t *zb); void dsl_pool_create_origin(dsl_pool_t *dp, dmu_tx_t *tx); void dsl_pool_upgrade_clones(dsl_pool_t *dp, dmu_tx_t *tx); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Sat Feb 9 01:08:49 2013 (r246576) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/spa.h Sat Feb 9 01:38:43 2013 (r246577) @@ -658,7 +658,7 @@ extern void spa_history_log_version(spa_ /* error handling */ struct zbookmark; extern void spa_log_error(spa_t *spa, zio_t *zio); -extern void zfs_ereport_post(const char *class, spa_t *spa, vdev_t *vd, +extern void zfs_ereport_post(const char *cls, spa_t *spa, vdev_t *vd, zio_t *zio, uint64_t stateoroffset, uint64_t length); extern void zfs_post_remove(spa_t *spa, vdev_t *vd); extern void zfs_post_state_change(spa_t *spa, vdev_t *vd); Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Sat Feb 9 01:08:49 2013 (r246576) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zfs_ioctl.h Sat Feb 9 01:38:43 2013 (r246577) @@ -115,6 +115,87 @@ typedef enum drr_headertype { /* * zfs ioctl command structure */ +struct drr_begin { + uint64_t drr_magic; + uint64_t drr_versioninfo; /* was drr_version */ + uint64_t drr_creation_time; + dmu_objset_type_t drr_type; + uint32_t drr_flags; + uint64_t drr_toguid; + uint64_t drr_fromguid; + char drr_toname[MAXNAMELEN]; +}; + +struct drr_end { + zio_cksum_t drr_checksum; + uint64_t drr_toguid; +}; + +struct drr_object { + uint64_t drr_object; + dmu_object_type_t drr_type; + dmu_object_type_t drr_bonustype; + uint32_t drr_blksz; + uint32_t drr_bonuslen; + uint8_t drr_checksumtype; + uint8_t drr_compress; + uint8_t drr_pad[6]; + uint64_t drr_toguid; + /* bonus content follows */ +}; + +struct drr_freeobjects { + uint64_t drr_firstobj; + uint64_t drr_numobjs; + uint64_t drr_toguid; +}; + +struct drr_write { + uint64_t drr_object; + dmu_object_type_t drr_type; + uint32_t drr_pad; + uint64_t drr_offset; + uint64_t drr_length; + uint64_t drr_toguid; + uint8_t drr_checksumtype; + uint8_t drr_checksumflags; + uint8_t drr_pad2[6]; + ddt_key_t drr_key; /* deduplication key */ + /* content follows */ +}; + +struct drr_free { + uint64_t drr_object; + uint64_t drr_offset; + uint64_t drr_length; + uint64_t drr_toguid; +}; + +struct drr_write_byref { + /* where to put the data */ + uint64_t drr_object; + uint64_t drr_offset; + uint64_t drr_length; + uint64_t drr_toguid; + /* where to find the prior copy of the data */ + uint64_t drr_refguid; + uint64_t drr_refobject; + uint64_t drr_refoffset; + /* properties of the data */ + uint8_t drr_checksumtype; + uint8_t drr_checksumflags; + uint8_t drr_pad2[6]; + ddt_key_t drr_key; /* deduplication key */ +}; + +struct drr_spill { + uint64_t drr_object; + uint64_t drr_length; + uint64_t drr_toguid; + uint64_t drr_pad[4]; /* needed for crypto */ + /* spill data follows */ +}; + typedef struct dmu_replay_record { enum { DRR_BEGIN, DRR_OBJECT, DRR_FREEOBJECTS, @@ -123,79 +204,14 @@ typedef struct dmu_replay_record { } drr_type; uint32_t drr_payloadlen; union { - struct drr_begin { - uint64_t drr_magic; - uint64_t drr_versioninfo; /* was drr_version */ - uint64_t drr_creation_time; - dmu_objset_type_t drr_type; - uint32_t drr_flags; - uint64_t drr_toguid; - uint64_t drr_fromguid; - char drr_toname[MAXNAMELEN]; - } drr_begin; - struct drr_end { - zio_cksum_t drr_checksum; - uint64_t drr_toguid; - } drr_end; - struct drr_object { - uint64_t drr_object; - dmu_object_type_t drr_type; - dmu_object_type_t drr_bonustype; - uint32_t drr_blksz; - uint32_t drr_bonuslen; - uint8_t drr_checksumtype; - uint8_t drr_compress; - uint8_t drr_pad[6]; - uint64_t drr_toguid; - /* bonus content follows */ - } drr_object; - struct drr_freeobjects { - uint64_t drr_firstobj; - uint64_t drr_numobjs; - uint64_t drr_toguid; - } drr_freeobjects; - struct drr_write { - uint64_t drr_object; - dmu_object_type_t drr_type; - uint32_t drr_pad; - uint64_t drr_offset; - uint64_t drr_length; - uint64_t drr_toguid; - uint8_t drr_checksumtype; - uint8_t drr_checksumflags; - uint8_t drr_pad2[6]; - ddt_key_t drr_key; /* deduplication key */ - /* content follows */ - } drr_write; - struct drr_free { - uint64_t drr_object; - uint64_t drr_offset; - uint64_t drr_length; - uint64_t drr_toguid; - } drr_free; - struct drr_write_byref { - /* where to put the data */ - uint64_t drr_object; - uint64_t drr_offset; - uint64_t drr_length; - uint64_t drr_toguid; - /* where to find the prior copy of the data */ - uint64_t drr_refguid; - uint64_t drr_refobject; - uint64_t drr_refoffset; - /* properties of the data */ - uint8_t drr_checksumtype; - uint8_t drr_checksumflags; - uint8_t drr_pad2[6]; - ddt_key_t drr_key; /* deduplication key */ - } drr_write_byref; - struct drr_spill { - uint64_t drr_object; - uint64_t drr_length; - uint64_t drr_toguid; - uint64_t drr_pad[4]; /* needed for crypto */ - /* spill data follows */ - } drr_spill; + struct drr_begin drr_begin; + struct drr_end drr_end; + struct drr_object drr_object; + struct drr_freeobjects drr_freeobjects; + struct drr_write drr_write; + struct drr_free drr_free; + struct drr_write_byref drr_write_byref; + struct drr_spill drr_spill; } drr_u; } dmu_replay_record_t; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Sat Feb 9 01:08:49 2013 (r246576) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/zio.h Sat Feb 9 01:38:43 2013 (r246577) @@ -439,22 +439,22 @@ struct zio { }; extern zio_t *zio_null(zio_t *pio, spa_t *spa, vdev_t *vd, - zio_done_func_t *done, void *private, enum zio_flag flags); + zio_done_func_t *done, void *priv, enum zio_flag flags); extern zio_t *zio_root(spa_t *spa, - zio_done_func_t *done, void *private, enum zio_flag flags); + zio_done_func_t *done, void *priv, enum zio_flag flags); extern zio_t *zio_read(zio_t *pio, spa_t *spa, const blkptr_t *bp, void *data, - uint64_t size, zio_done_func_t *done, void *private, + uint64_t size, zio_done_func_t *done, void *priv, int priority, enum zio_flag flags, const zbookmark_t *zb); extern zio_t *zio_write(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, void *data, uint64_t size, const zio_prop_t *zp, - zio_done_func_t *ready, zio_done_func_t *done, void *private, + zio_done_func_t *ready, zio_done_func_t *done, void *priv, int priority, enum zio_flag flags, const zbookmark_t *zb); extern zio_t *zio_rewrite(zio_t *pio, spa_t *spa, uint64_t txg, blkptr_t *bp, - void *data, uint64_t size, zio_done_func_t *done, void *private, + void *data, uint64_t size, zio_done_func_t *done, void *priv, int priority, enum zio_flag flags, zbookmark_t *zb); extern void zio_write_override(zio_t *zio, blkptr_t *bp, int copies, @@ -464,19 +464,20 @@ extern void zio_free(spa_t *spa, uint64_ extern zio_t *zio_claim(zio_t *pio, spa_t *spa, uint64_t txg, const blkptr_t *bp, - zio_done_func_t *done, void *private, enum zio_flag flags); + zio_done_func_t *done, void *priv, enum zio_flag flags); extern zio_t *zio_ioctl(zio_t *pio, spa_t *spa, vdev_t *vd, int cmd, - zio_done_func_t *done, void *private, int priority, enum zio_flag flags); + zio_done_func_t *done, void *priv, int priority, + enum zio_flag flags); extern zio_t *zio_read_phys(zio_t *pio, vdev_t *vd, uint64_t offset, uint64_t size, void *data, int checksum, - zio_done_func_t *done, void *private, int priority, enum zio_flag flags, + zio_done_func_t *done, void *priv, int priority, enum zio_flag flags, boolean_t labels); extern zio_t *zio_write_phys(zio_t *pio, vdev_t *vd, uint64_t offset, uint64_t size, void *data, int checksum, - zio_done_func_t *done, void *private, int priority, enum zio_flag flags, + zio_done_func_t *done, void *priv, int priority, enum zio_flag flags, boolean_t labels); extern zio_t *zio_free_sync(zio_t *pio, spa_t *spa, uint64_t txg, @@ -507,11 +508,11 @@ extern void zio_resubmit_stage_async(voi extern zio_t *zio_vdev_child_io(zio_t *zio, blkptr_t *bp, vdev_t *vd, uint64_t offset, void *data, uint64_t size, int type, int priority, - enum zio_flag flags, zio_done_func_t *done, void *private); + enum zio_flag flags, zio_done_func_t *done, void *priv); extern zio_t *zio_vdev_delegated_io(vdev_t *vd, uint64_t offset, void *data, uint64_t size, int type, int priority, - enum zio_flag flags, zio_done_func_t *done, void *private); + enum zio_flag flags, zio_done_func_t *done, void *priv); extern void zio_vdev_io_bypass(zio_t *zio); extern void zio_vdev_io_reissue(zio_t *zio); From owner-svn-src-stable@FreeBSD.ORG Sat Feb 9 01:41:23 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 8ADD9FC1; Sat, 9 Feb 2013 01:41:23 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id F17C9F65; Sat, 9 Feb 2013 01:41:22 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r191fMJc025457; Sat, 9 Feb 2013 01:41:22 GMT (envelope-from delphij@svn.freebsd.org) Received: (from delphij@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r191fMfi025453; Sat, 9 Feb 2013 01:41:22 GMT (envelope-from delphij@svn.freebsd.org) Message-Id: <201302090141.r191fMfi025453@svn.freebsd.org> From: Xin LI Date: Sat, 9 Feb 2013 01:41:22 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246578 - in stable/8: cddl/contrib/opensolaris/cmd/zdb sys/cddl/contrib/opensolaris/uts/common/fs/zfs sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 01:41:23 -0000 Author: delphij Date: Sat Feb 9 01:41:21 2013 New Revision: 246578 URL: http://svnweb.freebsd.org/changeset/base/246578 Log: MFC r245264: The current ZFS code expects ddt_zap_count to always succeed by asserting the underlying zap_count() to return no errors. However, it is possible that the pool reaches to such a state where zap_count would return error, leading to panics when a pool is imported. This commit changes the ddt_zap_count to return error returned from zap_count and handle the error appropriately. With this change, it's now possible to let zpool rollback damaged transaction groups and import the pool. Obtained from: ZFS on Linux github (e8fd45a0f975c6b8ae8cd644714fc21f14fac2bf) Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Directory Properties: stable/8/cddl/ (props changed) stable/8/cddl/contrib/opensolaris/ (props changed) stable/8/sys/ (props changed) stable/8/sys/cddl/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) Modified: stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c ============================================================================== --- stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Feb 9 01:38:43 2013 (r246577) +++ stable/8/cddl/contrib/opensolaris/cmd/zdb/zdb.c Sat Feb 9 01:41:21 2013 (r246578) @@ -704,7 +704,9 @@ dump_ddt(ddt_t *ddt, enum ddt_type type, return; ASSERT(error == 0); - if ((count = ddt_object_count(ddt, type, class)) == 0) + error = ddt_object_count(ddt, type, class, &count); + ASSERT(error == 0); + if (count == 0) return; dspace = doi.doi_physical_blocks_512 << 9; Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c Sat Feb 9 01:38:43 2013 (r246577) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt.c Sat Feb 9 01:41:21 2013 (r246578) @@ -89,12 +89,13 @@ ddt_object_destroy(ddt_t *ddt, enum ddt_ spa_t *spa = ddt->ddt_spa; objset_t *os = ddt->ddt_os; uint64_t *objectp = &ddt->ddt_object[type][class]; + uint64_t count; char name[DDT_NAMELEN]; ddt_object_name(ddt, type, class, name); ASSERT(*objectp != 0); - ASSERT(ddt_object_count(ddt, type, class) == 0); + VERIFY(ddt_object_count(ddt, type, class, &count) == 0 && count == 0); ASSERT(ddt_histogram_empty(&ddt->ddt_histogram[type][class])); VERIFY(zap_remove(os, DMU_POOL_DIRECTORY_OBJECT, name, tx) == 0); VERIFY(zap_remove(os, spa->spa_ddt_stat_object, name, tx) == 0); @@ -109,6 +110,7 @@ ddt_object_load(ddt_t *ddt, enum ddt_typ { ddt_object_t *ddo = &ddt->ddt_object_stats[type][class]; dmu_object_info_t doi; + uint64_t count; char name[DDT_NAMELEN]; int error; @@ -129,7 +131,11 @@ ddt_object_load(ddt_t *ddt, enum ddt_typ */ VERIFY(ddt_object_info(ddt, type, class, &doi) == 0); - ddo->ddo_count = ddt_object_count(ddt, type, class); + error = ddt_object_count(ddt, type, class, &count); + if (error) + return error; + + ddo->ddo_count = count; ddo->ddo_dspace = doi.doi_physical_blocks_512 << 9; ddo->ddo_mspace = doi.doi_fill_count * doi.doi_data_block_size; @@ -143,6 +149,7 @@ ddt_object_sync(ddt_t *ddt, enum ddt_typ { ddt_object_t *ddo = &ddt->ddt_object_stats[type][class]; dmu_object_info_t doi; + uint64_t count; char name[DDT_NAMELEN]; ddt_object_name(ddt, type, class, name); @@ -155,8 +162,9 @@ ddt_object_sync(ddt_t *ddt, enum ddt_typ * Cache DDT statistics; this is the only time they'll change. */ VERIFY(ddt_object_info(ddt, type, class, &doi) == 0); + VERIFY(ddt_object_count(ddt, type, class, &count) == 0); - ddo->ddo_count = ddt_object_count(ddt, type, class); + ddo->ddo_count = count; ddo->ddo_dspace = doi.doi_physical_blocks_512 << 9; ddo->ddo_mspace = doi.doi_fill_count * doi.doi_data_block_size; } @@ -213,13 +221,13 @@ ddt_object_walk(ddt_t *ddt, enum ddt_typ ddt->ddt_object[type][class], dde, walk)); } -uint64_t -ddt_object_count(ddt_t *ddt, enum ddt_type type, enum ddt_class class) +int +ddt_object_count(ddt_t *ddt, enum ddt_type type, enum ddt_class class, uint64_t *count) { ASSERT(ddt_object_exists(ddt, type, class)); return (ddt_ops[type]->ddt_op_count(ddt->ddt_os, - ddt->ddt_object[type][class])); + ddt->ddt_object[type][class], count)); } int @@ -1079,11 +1087,13 @@ ddt_sync_table(ddt_t *ddt, dmu_tx_t *tx, } for (enum ddt_type type = 0; type < DDT_TYPES; type++) { - uint64_t count = 0; + uint64_t add, count = 0; for (enum ddt_class class = 0; class < DDT_CLASSES; class++) { if (ddt_object_exists(ddt, type, class)) { ddt_object_sync(ddt, type, class, tx); - count += ddt_object_count(ddt, type, class); + VERIFY(ddt_object_count(ddt, type, class, + &add) == 0); + count += add; } } for (enum ddt_class class = 0; class < DDT_CLASSES; class++) { Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c Sat Feb 9 01:38:43 2013 (r246577) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/ddt_zap.c Sat Feb 9 01:41:21 2013 (r246578) @@ -133,14 +133,11 @@ ddt_zap_walk(objset_t *os, uint64_t obje return (error); } -static uint64_t -ddt_zap_count(objset_t *os, uint64_t object) +static int +ddt_zap_count(objset_t *os, uint64_t object, uint64_t *count) { - uint64_t count = 0; - VERIFY(zap_count(os, object, &count) == 0); - - return (count); + return (zap_count(os, object, count)); } const ddt_ops_t ddt_zap_ops = { Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h ============================================================================== --- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Sat Feb 9 01:38:43 2013 (r246577) +++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/sys/ddt.h Sat Feb 9 01:41:21 2013 (r246578) @@ -163,7 +163,7 @@ typedef struct ddt_ops { dmu_tx_t *tx); int (*ddt_op_walk)(objset_t *os, uint64_t object, ddt_entry_t *dde, uint64_t *walk); - uint64_t (*ddt_op_count)(objset_t *os, uint64_t object); + int (*ddt_op_count)(objset_t *os, uint64_t object, uint64_t *count); } ddt_ops_t; #define DDT_NAMELEN 80 @@ -172,8 +172,8 @@ extern void ddt_object_name(ddt_t *ddt, enum ddt_class cls, char *name); extern int ddt_object_walk(ddt_t *ddt, enum ddt_type type, enum ddt_class cls, uint64_t *walk, ddt_entry_t *dde); -extern uint64_t ddt_object_count(ddt_t *ddt, enum ddt_type type, - enum ddt_class cls); +extern int ddt_object_count(ddt_t *ddt, enum ddt_type type, + enum ddt_class class, uint64_t *count); extern int ddt_object_info(ddt_t *ddt, enum ddt_type type, enum ddt_class cls, dmu_object_info_t *); extern boolean_t ddt_object_exists(ddt_t *ddt, enum ddt_type type, From owner-svn-src-stable@FreeBSD.ORG Sat Feb 9 02:57:38 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 69AEE995; Sat, 9 Feb 2013 02:57:38 +0000 (UTC) (envelope-from pfg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 501151F8; Sat, 9 Feb 2013 02:57:38 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r192vcaj047413; Sat, 9 Feb 2013 02:57:38 GMT (envelope-from pfg@svn.freebsd.org) Received: (from pfg@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r192vcUt047412; Sat, 9 Feb 2013 02:57:38 GMT (envelope-from pfg@svn.freebsd.org) Message-Id: <201302090257.r192vcUt047412@svn.freebsd.org> From: "Pedro F. Giffuni" Date: Sat, 9 Feb 2013 02:57:38 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246580 - stable/9/usr.sbin/crunch/crunchide X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 02:57:38 -0000 Author: pfg Date: Sat Feb 9 02:57:37 2013 New Revision: 246580 URL: http://svnweb.freebsd.org/changeset/base/246580 Log: MFC r246278; crunch: some more NetBSD syncing. Obtained from: NetBSD Modified: stable/9/usr.sbin/crunch/crunchide/exec_elf32.c Directory Properties: stable/9/usr.sbin/crunch/ (props changed) Modified: stable/9/usr.sbin/crunch/crunchide/exec_elf32.c ============================================================================== --- stable/9/usr.sbin/crunch/crunchide/exec_elf32.c Sat Feb 9 02:42:01 2013 (r246579) +++ stable/9/usr.sbin/crunch/crunchide/exec_elf32.c Sat Feb 9 02:57:37 2013 (r246580) @@ -384,6 +384,8 @@ out: if (symtabp != NULL) free(symtabp); if (strtabp != NULL) + free(strtabp); + if (nstrtabp != NULL) free(nstrtabp); return (rv); From owner-svn-src-stable@FreeBSD.ORG Sat Feb 9 06:11:47 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 8C123D2D; Sat, 9 Feb 2013 06:11:47 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 664AA9E3; Sat, 9 Feb 2013 06:11:47 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r196BlAe006905; Sat, 9 Feb 2013 06:11:47 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r196BkPt006896; Sat, 9 Feb 2013 06:11:46 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201302090611.r196BkPt006896@svn.freebsd.org> From: Bryan Venteicher Date: Sat, 9 Feb 2013 06:11:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246582 - in stable/9/sys/dev/virtio: . balloon block network pci scsi X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 06:11:47 -0000 Author: bryanv Date: Sat Feb 9 06:11:45 2013 New Revision: 246582 URL: http://svnweb.freebsd.org/changeset/base/246582 Log: MFC r238072,r238360,r240430,r241469,r241470,r241495,r244136,r244200 Sync VirtIO with HEAD. - r238072: Do not include in the local headers. - r238360: Various VirtIO improvements - r240430: No need to leak these into the includer's namespace. - r241469: virtqueue: Fix non-indirect virtqueues - r241470: Add Virtio SCSI driver - r241495: Fix build with PAE enabled - r244136: Remove duplicated lines - r244200: Start taskqueues threads after attach cannot fail Approved by: grehan (mentor) Added: stable/9/sys/dev/virtio/scsi/ - copied from r241470, head/sys/dev/virtio/scsi/ Modified: stable/9/sys/dev/virtio/balloon/virtio_balloon.c stable/9/sys/dev/virtio/balloon/virtio_balloon.h stable/9/sys/dev/virtio/block/virtio_blk.c stable/9/sys/dev/virtio/block/virtio_blk.h stable/9/sys/dev/virtio/network/if_vtnet.c stable/9/sys/dev/virtio/network/virtio_net.h stable/9/sys/dev/virtio/pci/virtio_pci.c stable/9/sys/dev/virtio/pci/virtio_pci.h stable/9/sys/dev/virtio/scsi/virtio_scsi.c stable/9/sys/dev/virtio/virtio.c stable/9/sys/dev/virtio/virtio.h stable/9/sys/dev/virtio/virtio_ring.h stable/9/sys/dev/virtio/virtqueue.c stable/9/sys/dev/virtio/virtqueue.h Modified: stable/9/sys/dev/virtio/balloon/virtio_balloon.c ============================================================================== --- stable/9/sys/dev/virtio/balloon/virtio_balloon.c Sat Feb 9 04:13:45 2013 (r246581) +++ stable/9/sys/dev/virtio/balloon/virtio_balloon.c Sat Feb 9 06:11:45 2013 (r246582) @@ -412,7 +412,6 @@ vtballoon_send_page_frames(struct vtball * interrupt handler will wake us up. */ VTBALLOON_LOCK(sc); - while ((c = virtqueue_dequeue(vq, NULL)) == NULL) msleep_spin(sc, VTBALLOON_MTX(sc), "vtbspf", 0); VTBALLOON_UNLOCK(sc); Modified: stable/9/sys/dev/virtio/balloon/virtio_balloon.h ============================================================================== --- stable/9/sys/dev/virtio/balloon/virtio_balloon.h Sat Feb 9 04:13:45 2013 (r246581) +++ stable/9/sys/dev/virtio/balloon/virtio_balloon.h Sat Feb 9 06:11:45 2013 (r246582) @@ -31,8 +31,6 @@ #ifndef _VIRTIO_BALLOON_H #define _VIRTIO_BALLOON_H -#include - /* Feature bits. */ #define VIRTIO_BALLOON_F_MUST_TELL_HOST 0x1 /* Tell before reclaiming pages */ #define VIRTIO_BALLOON_F_STATS_VQ 0x2 /* Memory stats virtqueue */ Modified: stable/9/sys/dev/virtio/block/virtio_blk.c ============================================================================== --- stable/9/sys/dev/virtio/block/virtio_blk.c Sat Feb 9 04:13:45 2013 (r246581) +++ stable/9/sys/dev/virtio/block/virtio_blk.c Sat Feb 9 06:11:45 2013 (r246582) @@ -42,7 +42,6 @@ __FBSDID("$FreeBSD$"); #include #include -#include #include #include @@ -119,7 +118,7 @@ static int vtblk_shutdown(device_t); static int vtblk_open(struct disk *); static int vtblk_close(struct disk *); static int vtblk_ioctl(struct disk *, u_long, void *, int, - struct thread *); + struct thread *); static int vtblk_dump(void *, void *, vm_offset_t, off_t, size_t); static void vtblk_strategy(struct bio *); @@ -193,7 +192,7 @@ TUNABLE_INT("hw.vtblk.no_ident", &vtblk_ mtx_assert(VTBLK_MTX((_sc)), MA_NOTOWNED) #define VTBLK_DISK_NAME "vtbd" -#define VTBLK_QUIESCE_TIMEOUT (30 * hz) +#define VTBLK_QUIESCE_TIMEOUT (30 * hz) /* * Each block request uses at least two segments - one for the header @@ -201,8 +200,6 @@ TUNABLE_INT("hw.vtblk.no_ident", &vtblk_ */ #define VTBLK_MIN_SEGMENTS 2 -static uma_zone_t vtblk_req_zone; - static device_method_t vtblk_methods[] = { /* Device methods. */ DEVMETHOD(device_probe, vtblk_probe), @@ -236,19 +233,8 @@ vtblk_modevent(module_t mod, int type, v switch (type) { case MOD_LOAD: - vtblk_req_zone = uma_zcreate("vtblk_request", - sizeof(struct vtblk_request), - NULL, NULL, NULL, NULL, 0, 0); - break; case MOD_QUIESCE: case MOD_UNLOAD: - if (uma_zone_get_cur(vtblk_req_zone) > 0) - error = EBUSY; - else if (type == MOD_UNLOAD) { - uma_zdestroy(vtblk_req_zone); - vtblk_req_zone = NULL; - } - break; case MOD_SHUTDOWN: break; default: @@ -316,7 +302,7 @@ vtblk_attach(device_t dev) } sc->vtblk_max_nsegs = vtblk_maximum_segments(sc, &blkcfg); - if (sc->vtblk_max_nsegs <= VTBLK_MIN_SEGMENTS) { + if (sc->vtblk_max_nsegs <= VTBLK_MIN_SEGMENTS) { error = EINVAL; device_printf(dev, "fewer than minimum number of segments " "allowed: %d\n", sc->vtblk_max_nsegs); @@ -352,8 +338,6 @@ vtblk_attach(device_t dev) device_printf(dev, "cannot allocate taskqueue\n"); goto fail; } - taskqueue_start_threads(&sc->vtblk_tq, 1, PI_DISK, "%s taskq", - device_get_nameunit(dev)); error = virtio_setup_intr(dev, INTR_TYPE_BIO | INTR_ENTROPY); if (error) { @@ -361,6 +345,9 @@ vtblk_attach(device_t dev) goto fail; } + taskqueue_start_threads(&sc->vtblk_tq, 1, PI_DISK, "%s taskq", + device_get_nameunit(dev)); + vtblk_create_disk(sc); virtqueue_enable_intr(sc->vtblk_vq); @@ -493,7 +480,6 @@ vtblk_dump(void *arg, void *virtual, vm_ int error; dp = arg; - error = 0; if ((sc = dp->d_drv1) == NULL) return (ENXIO); @@ -539,7 +525,7 @@ vtblk_strategy(struct bio *bp) return; } -#ifdef INVARIANTS +#ifdef INVARIANTS /* * Prevent read/write buffers spanning too many segments from * getting into the queue. This should only trip if d_maxsize @@ -547,13 +533,13 @@ vtblk_strategy(struct bio *bp) */ if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { int nsegs, max_nsegs; - + nsegs = sglist_count(bp->bio_data, bp->bio_bcount); max_nsegs = sc->vtblk_max_nsegs - VTBLK_MIN_SEGMENTS; KASSERT(nsegs <= max_nsegs, - ("bio spanned too many segments: %d, max: %d", - nsegs, max_nsegs)); + ("bio %p spanned too many segments: %d, max: %d", + bp, nsegs, max_nsegs)); } #endif @@ -800,27 +786,22 @@ vtblk_execute_request(struct vtblk_softc VTBLK_LOCK_ASSERT(sc); sglist_reset(sg); - error = sglist_append(sg, &req->vbr_hdr, - sizeof(struct virtio_blk_outhdr)); - KASSERT(error == 0, ("error adding header to sglist")); - KASSERT(sg->sg_nseg == 1, - ("header spanned multiple segments: %d", sg->sg_nseg)); + + sglist_append(sg, &req->vbr_hdr, sizeof(struct virtio_blk_outhdr)); if (bp->bio_cmd == BIO_READ || bp->bio_cmd == BIO_WRITE) { error = sglist_append(sg, bp->bio_data, bp->bio_bcount); - KASSERT(error == 0, ("error adding buffer to sglist")); + if (error || sg->sg_nseg == sg->sg_maxseg) + panic("%s: data buffer too big bio:%p error:%d", + __FUNCTION__, bp, error); /* BIO_READ means the host writes into our buffer. */ if (bp->bio_cmd == BIO_READ) - writable += sg->sg_nseg - 1; + writable = sg->sg_nseg - 1; } - error = sglist_append(sg, &req->vbr_ack, sizeof(uint8_t)); - KASSERT(error == 0, ("error adding ack to sglist")); writable++; - - KASSERT(sg->sg_nseg >= VTBLK_MIN_SEGMENTS, - ("fewer than min segments: %d", sg->sg_nseg)); + sglist_append(sg, &req->vbr_ack, sizeof(uint8_t)); readable = sg->sg_nseg - writable; @@ -995,12 +976,10 @@ vtblk_flush_dump(struct vtblk_softc *sc) static int vtblk_poll_request(struct vtblk_softc *sc, struct vtblk_request *req) { - device_t dev; struct virtqueue *vq; struct vtblk_request *r; int error; - dev = sc->vtblk_dev; vq = sc->vtblk_vq; if (!virtqueue_empty(vq)) @@ -1013,12 +992,12 @@ vtblk_poll_request(struct vtblk_softc *s virtqueue_notify(vq); r = virtqueue_poll(vq, NULL); - KASSERT(r == req, ("unexpected request response")); + KASSERT(r == req, ("unexpected request response: %p/%p", r, req)); error = vtblk_request_error(req); if (error && bootverbose) { - device_printf(dev, "vtblk_poll_request: IO error: %d\n", - error); + device_printf(sc->vtblk_dev, + "%s: IO error: %d\n", __FUNCTION__, error); } return (error); @@ -1090,6 +1069,20 @@ vtblk_drain(struct vtblk_softc *sc) vtblk_free_requests(sc); } +#ifdef INVARIANTS +static void +vtblk_request_invariants(struct vtblk_request *req) +{ + int hdr_nsegs, ack_nsegs; + + hdr_nsegs = sglist_count(&req->vbr_hdr, sizeof(req->vbr_hdr)); + ack_nsegs = sglist_count(&req->vbr_ack, sizeof(req->vbr_ack)); + + KASSERT(hdr_nsegs == 1, ("request header crossed page boundary")); + KASSERT(ack_nsegs == 1, ("request ack crossed page boundary")); +} +#endif + static int vtblk_alloc_requests(struct vtblk_softc *sc) { @@ -1107,10 +1100,14 @@ vtblk_alloc_requests(struct vtblk_softc nreqs /= VTBLK_MIN_SEGMENTS; for (i = 0; i < nreqs; i++) { - req = uma_zalloc(vtblk_req_zone, M_NOWAIT); + req = malloc(sizeof(struct vtblk_request), M_DEVBUF, M_NOWAIT); if (req == NULL) return (ENOMEM); +#ifdef INVARIANTS + vtblk_request_invariants(req); +#endif + sc->vtblk_request_count++; vtblk_enqueue_request(sc, req); } @@ -1128,10 +1125,11 @@ vtblk_free_requests(struct vtblk_softc * while ((req = vtblk_dequeue_request(sc)) != NULL) { sc->vtblk_request_count--; - uma_zfree(vtblk_req_zone, req); + free(req, M_DEVBUF); } - KASSERT(sc->vtblk_request_count == 0, ("leaked requests")); + KASSERT(sc->vtblk_request_count == 0, + ("leaked requests: %d", sc->vtblk_request_count)); } static struct vtblk_request * Modified: stable/9/sys/dev/virtio/block/virtio_blk.h ============================================================================== --- stable/9/sys/dev/virtio/block/virtio_blk.h Sat Feb 9 04:13:45 2013 (r246581) +++ stable/9/sys/dev/virtio/block/virtio_blk.h Sat Feb 9 06:11:45 2013 (r246582) @@ -31,8 +31,6 @@ #ifndef _VIRTIO_BLK_H #define _VIRTIO_BLK_H -#include - /* Feature bits */ #define VIRTIO_BLK_F_BARRIER 0x0001 /* Does host support barriers? */ #define VIRTIO_BLK_F_SIZE_MAX 0x0002 /* Indicates maximum segment size */ Modified: stable/9/sys/dev/virtio/network/if_vtnet.c ============================================================================== --- stable/9/sys/dev/virtio/network/if_vtnet.c Sat Feb 9 04:13:45 2013 (r246581) +++ stable/9/sys/dev/virtio/network/if_vtnet.c Sat Feb 9 06:11:45 2013 (r246582) @@ -439,18 +439,17 @@ vtnet_attach(device_t dev) ether_ifdetach(ifp); goto fail; } - taskqueue_start_threads(&sc->vtnet_tq, 1, PI_NET, "%s taskq", - device_get_nameunit(dev)); error = virtio_setup_intr(dev, INTR_TYPE_NET); if (error) { device_printf(dev, "cannot setup virtqueue interrupts\n"); - taskqueue_free(sc->vtnet_tq); - sc->vtnet_tq = NULL; ether_ifdetach(ifp); goto fail; } + taskqueue_start_threads(&sc->vtnet_tq, 1, PI_NET, "%s taskq", + device_get_nameunit(dev)); + /* * Device defaults to promiscuous mode for backwards * compatibility. Turn it off if possible. @@ -748,11 +747,9 @@ vtnet_is_link_up(struct vtnet_softc *sc) static void vtnet_update_link_status(struct vtnet_softc *sc) { - device_t dev; struct ifnet *ifp; int link; - dev = sc->vtnet_dev; ifp = sc->vtnet_ifp; link = vtnet_is_link_up(sc); Modified: stable/9/sys/dev/virtio/network/virtio_net.h ============================================================================== --- stable/9/sys/dev/virtio/network/virtio_net.h Sat Feb 9 04:13:45 2013 (r246581) +++ stable/9/sys/dev/virtio/network/virtio_net.h Sat Feb 9 06:11:45 2013 (r246582) @@ -31,8 +31,6 @@ #ifndef _VIRTIO_NET_H #define _VIRTIO_NET_H -#include - /* The feature bitmap for virtio net */ #define VIRTIO_NET_F_CSUM 0x00001 /* Host handles pkts w/ partial csum */ #define VIRTIO_NET_F_GUEST_CSUM 0x00002 /* Guest handles pkts w/ partial csum*/ Modified: stable/9/sys/dev/virtio/pci/virtio_pci.c ============================================================================== --- stable/9/sys/dev/virtio/pci/virtio_pci.c Sat Feb 9 04:13:45 2013 (r246581) +++ stable/9/sys/dev/virtio/pci/virtio_pci.c Sat Feb 9 06:11:45 2013 (r246582) @@ -57,12 +57,15 @@ struct vtpci_softc { struct resource *vtpci_msix_res; uint64_t vtpci_features; uint32_t vtpci_flags; -#define VIRTIO_PCI_FLAG_NO_MSI 0x0001 -#define VIRTIO_PCI_FLAG_MSI 0x0002 -#define VIRTIO_PCI_FLAG_NO_MSIX 0x0010 -#define VIRTIO_PCI_FLAG_MSIX 0x0020 -#define VIRTIO_PCI_FLAG_SHARED_MSIX 0x0040 +#define VTPCI_FLAG_NO_MSI 0x0001 +#define VTPCI_FLAG_NO_MSIX 0x0002 +#define VTPCI_FLAG_LEGACY 0x1000 +#define VTPCI_FLAG_MSI 0x2000 +#define VTPCI_FLAG_MSIX 0x4000 +#define VTPCI_FLAG_SHARED_MSIX 0x8000 +#define VTPCI_FLAG_ITYPE_MASK 0xF000 + /* This "bus" will only ever have one child. */ device_t vtpci_child_dev; struct virtio_feature_desc *vtpci_child_feat_desc; @@ -80,7 +83,8 @@ struct vtpci_softc { int vtpci_nvqs; struct vtpci_virtqueue { struct virtqueue *vq; - + /* Device did not provide a callback for this virtqueue. */ + int no_intr; /* Index into vtpci_intr_res[] below. Unused, then -1. */ int ires_idx; } vtpci_vqx[VIRTIO_MAX_VIRTQUEUES]; @@ -130,24 +134,39 @@ static void vtpci_describe_features(stru uint64_t); static void vtpci_probe_and_attach_child(struct vtpci_softc *); -static int vtpci_alloc_interrupts(struct vtpci_softc *, int, int, - struct vq_alloc_info *); -static int vtpci_alloc_intr_resources(struct vtpci_softc *, int, - struct vq_alloc_info *); -static int vtpci_alloc_msi(struct vtpci_softc *); -static int vtpci_alloc_msix(struct vtpci_softc *, int); +static int vtpci_alloc_msix(struct vtpci_softc *, int); +static int vtpci_alloc_msi(struct vtpci_softc *); +static int vtpci_alloc_intr_msix_pervq(struct vtpci_softc *); +static int vtpci_alloc_intr_msix_shared(struct vtpci_softc *); +static int vtpci_alloc_intr_msi(struct vtpci_softc *); +static int vtpci_alloc_intr_legacy(struct vtpci_softc *); +static int vtpci_alloc_intr_resources(struct vtpci_softc *); + +static int vtpci_setup_legacy_interrupt(struct vtpci_softc *, + enum intr_type); +static int vtpci_setup_msix_interrupts(struct vtpci_softc *, + enum intr_type); +static int vtpci_setup_interrupts(struct vtpci_softc *, enum intr_type); + static int vtpci_register_msix_vector(struct vtpci_softc *, int, int); +static int vtpci_set_host_msix_vectors(struct vtpci_softc *); +static int vtpci_reinit_virtqueue(struct vtpci_softc *, int); static void vtpci_free_interrupts(struct vtpci_softc *); static void vtpci_free_virtqueues(struct vtpci_softc *); +static void vtpci_cleanup_setup_intr_attempt(struct vtpci_softc *); static void vtpci_release_child_resources(struct vtpci_softc *); static void vtpci_reset(struct vtpci_softc *); +static void vtpci_select_virtqueue(struct vtpci_softc *, int); + static int vtpci_legacy_intr(void *); static int vtpci_vq_shared_intr(void *); static int vtpci_vq_intr(void *); static int vtpci_config_intr(void *); +#define vtpci_setup_msi_interrupt vtpci_setup_legacy_interrupt + /* * I/O port read/write wrappers. */ @@ -252,7 +271,7 @@ vtpci_attach(device_t dev) } if (pci_find_extcap(dev, PCIY_MSI, NULL) != 0) - sc->vtpci_flags |= VIRTIO_PCI_FLAG_NO_MSI; + sc->vtpci_flags |= VTPCI_FLAG_NO_MSI; if (pci_find_extcap(dev, PCIY_MSIX, NULL) == 0) { rid = PCIR_BAR(1); @@ -261,7 +280,7 @@ vtpci_attach(device_t dev) } if (sc->vtpci_msix_res == NULL) - sc->vtpci_flags |= VIRTIO_PCI_FLAG_NO_MSIX; + sc->vtpci_flags |= VTPCI_FLAG_NO_MSIX; vtpci_reset(sc); @@ -372,6 +391,16 @@ vtpci_read_ivar(device_t dev, device_t c switch (index) { case VIRTIO_IVAR_DEVTYPE: + case VIRTIO_IVAR_SUBDEVICE: + *result = pci_get_subdevice(dev); + break; + case VIRTIO_IVAR_VENDOR: + *result = pci_get_vendor(dev); + break; + case VIRTIO_IVAR_DEVICE: + *result = pci_get_device(dev); + break; + case VIRTIO_IVAR_SUBVENDOR: *result = pci_get_subdevice(dev); break; default: @@ -442,102 +471,97 @@ vtpci_alloc_virtqueues(device_t dev, int struct vq_alloc_info *vq_info) { struct vtpci_softc *sc; + struct virtqueue *vq; struct vtpci_virtqueue *vqx; struct vq_alloc_info *info; - int queue, error; - uint16_t vq_size; + int idx, error; + uint16_t size; sc = device_get_softc(dev); + error = 0; - if (sc->vtpci_nvqs != 0 || nvqs <= 0 || - nvqs > VIRTIO_MAX_VIRTQUEUES) + if (sc->vtpci_nvqs != 0) + return (EALREADY); + if (nvqs <= 0 || nvqs > VIRTIO_MAX_VIRTQUEUES) return (EINVAL); - error = vtpci_alloc_interrupts(sc, flags, nvqs, vq_info); - if (error) { - device_printf(dev, "cannot allocate interrupts\n"); - return (error); - } - - if (sc->vtpci_flags & VIRTIO_PCI_FLAG_MSIX) { - error = vtpci_register_msix_vector(sc, - VIRTIO_MSI_CONFIG_VECTOR, 0); - if (error) - return (error); - } + if (flags & VIRTIO_ALLOC_VQS_DISABLE_MSIX) + sc->vtpci_flags |= VTPCI_FLAG_NO_MSIX; - for (queue = 0; queue < nvqs; queue++) { - vqx = &sc->vtpci_vqx[queue]; - info = &vq_info[queue]; - - vtpci_write_config_2(sc, VIRTIO_PCI_QUEUE_SEL, queue); - - vq_size = vtpci_read_config_2(sc, VIRTIO_PCI_QUEUE_NUM); - error = virtqueue_alloc(dev, queue, vq_size, - VIRTIO_PCI_VRING_ALIGN, 0xFFFFFFFFUL, info, &vqx->vq); - if (error) - return (error); - - if (sc->vtpci_flags & VIRTIO_PCI_FLAG_MSIX) { - error = vtpci_register_msix_vector(sc, - VIRTIO_MSI_QUEUE_VECTOR, vqx->ires_idx); - if (error) - return (error); + for (idx = 0; idx < nvqs; idx++) { + vqx = &sc->vtpci_vqx[idx]; + info = &vq_info[idx]; + + vtpci_select_virtqueue(sc, idx); + size = vtpci_read_config_2(sc, VIRTIO_PCI_QUEUE_NUM); + + error = virtqueue_alloc(dev, idx, size, VIRTIO_PCI_VRING_ALIGN, + 0xFFFFFFFFUL, info, &vq); + if (error) { + device_printf(dev, + "cannot allocate virtqueue %d: %d\n", idx, error); + break; } vtpci_write_config_4(sc, VIRTIO_PCI_QUEUE_PFN, - virtqueue_paddr(vqx->vq) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT); + virtqueue_paddr(vq) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT); + + vqx->vq = *info->vqai_vq = vq; + vqx->no_intr = info->vqai_intr == NULL; - *info->vqai_vq = vqx->vq; sc->vtpci_nvqs++; } - return (0); + return (error); } static int vtpci_setup_intr(device_t dev, enum intr_type type) { struct vtpci_softc *sc; - struct vtpci_intr_resource *ires; - struct vtpci_virtqueue *vqx; - int i, flags, error; + int attempt, error; sc = device_get_softc(dev); - flags = type | INTR_MPSAFE; - ires = &sc->vtpci_intr_res[0]; - - if ((sc->vtpci_flags & VIRTIO_PCI_FLAG_MSIX) == 0) { - error = bus_setup_intr(dev, ires->irq, flags, - vtpci_legacy_intr, NULL, sc, &ires->intrhand); - return (error); - } - - error = bus_setup_intr(dev, ires->irq, flags, vtpci_config_intr, - NULL, sc, &ires->intrhand); - if (error) - return (error); + for (attempt = 0; attempt < 5; attempt++) { + /* + * Start with the most desirable interrupt configuration and + * fallback towards less desirable ones. + */ + switch (attempt) { + case 0: + error = vtpci_alloc_intr_msix_pervq(sc); + break; + case 1: + error = vtpci_alloc_intr_msix_shared(sc); + break; + case 2: + error = vtpci_alloc_intr_msi(sc); + break; + case 3: + error = vtpci_alloc_intr_legacy(sc); + break; + default: + device_printf(dev, + "exhausted all interrupt allocation attempts\n"); + return (ENXIO); + } - if (sc->vtpci_flags & VIRTIO_PCI_FLAG_SHARED_MSIX) { - ires = &sc->vtpci_intr_res[1]; - error = bus_setup_intr(dev, ires->irq, flags, - vtpci_vq_shared_intr, NULL, sc, &ires->intrhand); + if (error == 0 && vtpci_setup_interrupts(sc, type) == 0) + break; - return (error); + vtpci_cleanup_setup_intr_attempt(sc); } - /* Setup an interrupt handler for each virtqueue. */ - for (i = 0; i < sc->vtpci_nvqs; i++) { - vqx = &sc->vtpci_vqx[i]; - if (vqx->ires_idx < 1) - continue; - - ires = &sc->vtpci_intr_res[vqx->ires_idx]; - error = bus_setup_intr(dev, ires->irq, flags, - vtpci_vq_intr, NULL, vqx->vq, &ires->intrhand); - if (error) - return (error); + if (bootverbose) { + if (sc->vtpci_flags & VTPCI_FLAG_LEGACY) + device_printf(dev, "using legacy interrupt\n"); + else if (sc->vtpci_flags & VTPCI_FLAG_MSI) + device_printf(dev, "using MSI interrupt\n"); + else if (sc->vtpci_flags & VTPCI_FLAG_SHARED_MSIX) + device_printf(dev, "using shared MSIX interrupts\n"); + else + device_printf(dev, "using per VQ MSIX interrupts\n"); } return (0); @@ -554,20 +578,19 @@ static int vtpci_reinit(device_t dev, uint64_t features) { struct vtpci_softc *sc; - struct vtpci_virtqueue *vqx; - struct virtqueue *vq; - int queue, error; - uint16_t vq_size; + int idx, error; sc = device_get_softc(dev); /* - * Redrive the device initialization. This is a bit of an abuse - * of the specification, but both VirtualBox and QEMU/KVM seem - * to play nice. We do not allow the host device to change from - * what was originally negotiated beyond what the guest driver - * changed (MSIX state should not change, number of virtqueues - * and their size remain the same, etc). + * Redrive the device initialization. This is a bit of an abuse of + * the specification, but VirtualBox, QEMU/KVM, and BHyVe seem to + * play nice. + * + * We do not allow the host device to change from what was originally + * negotiated beyond what the guest driver changed. MSIX state should + * not change, number of virtqueues and their size remain the same, etc. + * This will need to be rethought when we want to support migration. */ if (vtpci_get_status(dev) != VIRTIO_CONFIG_STATUS_RESET) @@ -582,34 +605,16 @@ vtpci_reinit(device_t dev, uint64_t feat vtpci_negotiate_features(dev, features); - if (sc->vtpci_flags & VIRTIO_PCI_FLAG_MSIX) { - error = vtpci_register_msix_vector(sc, - VIRTIO_MSI_CONFIG_VECTOR, 0); + for (idx = 0; idx < sc->vtpci_nvqs; idx++) { + error = vtpci_reinit_virtqueue(sc, idx); if (error) return (error); } - for (queue = 0; queue < sc->vtpci_nvqs; queue++) { - vqx = &sc->vtpci_vqx[queue]; - vq = vqx->vq; - - KASSERT(vq != NULL, ("vq %d not allocated", queue)); - vtpci_write_config_2(sc, VIRTIO_PCI_QUEUE_SEL, queue); - - vq_size = vtpci_read_config_2(sc, VIRTIO_PCI_QUEUE_NUM); - error = virtqueue_reinit(vq, vq_size); + if (sc->vtpci_flags & VTPCI_FLAG_MSIX) { + error = vtpci_set_host_msix_vectors(sc); if (error) return (error); - - if (sc->vtpci_flags & VIRTIO_PCI_FLAG_MSIX) { - error = vtpci_register_msix_vector(sc, - VIRTIO_MSI_QUEUE_VECTOR, vqx->ires_idx); - if (error) - return (error); - } - - vtpci_write_config_4(sc, VIRTIO_PCI_QUEUE_PFN, - virtqueue_paddr(vqx->vq) >> VIRTIO_PCI_QUEUE_ADDR_SHIFT); } return (0); @@ -744,7 +749,6 @@ vtpci_probe_and_attach_child(struct vtpc vtpci_set_status(dev, VIRTIO_CONFIG_STATUS_FAILED); vtpci_reset(sc); vtpci_release_child_resources(sc); - /* Reset status for future attempt. */ vtpci_set_status(dev, VIRTIO_CONFIG_STATUS_ACK); } else @@ -752,42 +756,126 @@ vtpci_probe_and_attach_child(struct vtpc } static int -vtpci_alloc_interrupts(struct vtpci_softc *sc, int flags, int nvqs, - struct vq_alloc_info *vq_info) +vtpci_alloc_msix(struct vtpci_softc *sc, int nvectors) +{ + device_t dev; + int nmsix, cnt, required; + + dev = sc->vtpci_dev; + + /* Allocate an additional vector for the config changes. */ + required = nvectors + 1; + + nmsix = pci_msix_count(dev); + if (nmsix < required) + return (1); + + cnt = required; + if (pci_alloc_msix(dev, &cnt) == 0 && cnt >= required) { + sc->vtpci_nintr_res = required; + return (0); + } + + pci_release_msi(dev); + + return (1); +} + +static int +vtpci_alloc_msi(struct vtpci_softc *sc) +{ + device_t dev; + int nmsi, cnt, required; + + dev = sc->vtpci_dev; + required = 1; + + nmsi = pci_msi_count(dev); + if (nmsi < required) + return (1); + + cnt = required; + if (pci_alloc_msi(dev, &cnt) == 0 && cnt >= required) { + sc->vtpci_nintr_res = required; + return (0); + } + + pci_release_msi(dev); + + return (1); +} + +static int +vtpci_alloc_intr_msix_pervq(struct vtpci_softc *sc) { int i, nvectors, error; - /* - * Only allocate a vector for virtqueues that are actually - * expecting an interrupt. - */ - for (nvectors = 0, i = 0; i < nvqs; i++) - if (vq_info[i].vqai_intr != NULL) + if (vtpci_disable_msix != 0 || + sc->vtpci_flags & VTPCI_FLAG_NO_MSIX) + return (ENOTSUP); + + for (nvectors = 0, i = 0; i < sc->vtpci_nvqs; i++) { + if (sc->vtpci_vqx[i].no_intr == 0) nvectors++; + } + + error = vtpci_alloc_msix(sc, nvectors); + if (error) + return (error); + + sc->vtpci_flags |= VTPCI_FLAG_MSIX; + + return (0); +} + +static int +vtpci_alloc_intr_msix_shared(struct vtpci_softc *sc) +{ + int error; if (vtpci_disable_msix != 0 || - sc->vtpci_flags & VIRTIO_PCI_FLAG_NO_MSIX || - flags & VIRTIO_ALLOC_VQS_DISABLE_MSIX || - vtpci_alloc_msix(sc, nvectors) != 0) { - /* - * Use MSI interrupts if available. Otherwise, we fallback - * to legacy interrupts. - */ - if ((sc->vtpci_flags & VIRTIO_PCI_FLAG_NO_MSI) == 0 && - vtpci_alloc_msi(sc) == 0) - sc->vtpci_flags |= VIRTIO_PCI_FLAG_MSI; + sc->vtpci_flags & VTPCI_FLAG_NO_MSIX) + return (ENOTSUP); - sc->vtpci_nintr_res = 1; - } + error = vtpci_alloc_msix(sc, 1); + if (error) + return (error); - error = vtpci_alloc_intr_resources(sc, nvqs, vq_info); + sc->vtpci_flags |= VTPCI_FLAG_MSIX | VTPCI_FLAG_SHARED_MSIX; - return (error); + return (0); } static int -vtpci_alloc_intr_resources(struct vtpci_softc *sc, int nvqs, - struct vq_alloc_info *vq_info) +vtpci_alloc_intr_msi(struct vtpci_softc *sc) +{ + int error; + + /* Only BHyVe supports MSI. */ + if (sc->vtpci_flags & VTPCI_FLAG_NO_MSI) + return (ENOTSUP); + + error = vtpci_alloc_msi(sc); + if (error) + return (error); + + sc->vtpci_flags |= VTPCI_FLAG_MSI; + + return (0); +} + +static int +vtpci_alloc_intr_legacy(struct vtpci_softc *sc) +{ + + sc->vtpci_flags |= VTPCI_FLAG_LEGACY; + sc->vtpci_nintr_res = 1; + + return (0); +} + +static int +vtpci_alloc_intr_resources(struct vtpci_softc *sc) { device_t dev; struct resource *irq; @@ -795,14 +883,14 @@ vtpci_alloc_intr_resources(struct vtpci_ int i, rid, flags, res_idx; dev = sc->vtpci_dev; - flags = RF_ACTIVE; - if ((sc->vtpci_flags & - (VIRTIO_PCI_FLAG_MSI | VIRTIO_PCI_FLAG_MSIX)) == 0) { + if (sc->vtpci_flags & VTPCI_FLAG_LEGACY) { rid = 0; - flags |= RF_SHAREABLE; - } else + flags = RF_ACTIVE | RF_SHAREABLE; + } else { rid = 1; + flags = RF_ACTIVE; + } for (i = 0; i < sc->vtpci_nintr_res; i++) { irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, flags); @@ -814,16 +902,16 @@ vtpci_alloc_intr_resources(struct vtpci_ } /* - * Map the virtqueue into the correct index in vq_intr_res[]. Note the - * first index is reserved for configuration changes notifications. + * Map the virtqueue into the correct index in vq_intr_res[]. The + * first index is reserved for configuration changed notifications. */ - for (i = 0, res_idx = 1; i < nvqs; i++) { + for (i = 0, res_idx = 1; i < sc->vtpci_nvqs; i++) { vqx = &sc->vtpci_vqx[i]; - if (sc->vtpci_flags & VIRTIO_PCI_FLAG_MSIX) { - if (vq_info[i].vqai_intr == NULL) + if (sc->vtpci_flags & VTPCI_FLAG_MSIX) { + if (vqx->no_intr != 0) vqx->ires_idx = -1; - else if (sc->vtpci_flags & VIRTIO_PCI_FLAG_SHARED_MSIX) + else if (sc->vtpci_flags & VTPCI_FLAG_SHARED_MSIX) vqx->ires_idx = res_idx; else vqx->ires_idx = res_idx++; @@ -835,110 +923,180 @@ vtpci_alloc_intr_resources(struct vtpci_ } static int -vtpci_alloc_msi(struct vtpci_softc *sc) +vtpci_setup_legacy_interrupt(struct vtpci_softc *sc, enum intr_type type) { device_t dev; - int nmsi, cnt; + struct vtpci_intr_resource *ires; + int error; dev = sc->vtpci_dev; - nmsi = pci_msi_count(dev); - - if (nmsi < 1) - return (1); - cnt = 1; - if (pci_alloc_msi(dev, &cnt) == 0 && cnt == 1) - return (0); + ires = &sc->vtpci_intr_res[0]; + error = bus_setup_intr(dev, ires->irq, type, vtpci_legacy_intr, NULL, + sc, &ires->intrhand); - return (1); + return (error); } static int -vtpci_alloc_msix(struct vtpci_softc *sc, int nvectors) +vtpci_setup_msix_interrupts(struct vtpci_softc *sc, enum intr_type type) { device_t dev; - int nmsix, cnt, required; + struct vtpci_intr_resource *ires; + struct vtpci_virtqueue *vqx; + int i, error; dev = sc->vtpci_dev; - nmsix = pci_msix_count(dev); - if (nmsix < 1) - return (1); + /* + * The first resource is used for configuration changed interrupts. + */ + ires = &sc->vtpci_intr_res[0]; + error = bus_setup_intr(dev, ires->irq, type, vtpci_config_intr, + NULL, sc, &ires->intrhand); + if (error) + return (error); - /* An additional vector is needed for the config changes. */ - required = nvectors + 1; - if (nmsix >= required) { - cnt = required; - if (pci_alloc_msix(dev, &cnt) == 0 && cnt >= required) - goto out; + if (sc->vtpci_flags & VTPCI_FLAG_SHARED_MSIX) { + ires = &sc->vtpci_intr_res[1]; - pci_release_msi(dev); + error = bus_setup_intr(dev, ires->irq, type, + vtpci_vq_shared_intr, NULL, sc, &ires->intrhand); + if (error) + return (error); + } else { + /* + * Each remaining resource is assigned to a specific virtqueue. + */ + for (i = 0; i < sc->vtpci_nvqs; i++) { + vqx = &sc->vtpci_vqx[i]; + if (vqx->ires_idx < 1) + continue; + + ires = &sc->vtpci_intr_res[vqx->ires_idx]; + error = bus_setup_intr(dev, ires->irq, type, + vtpci_vq_intr, NULL, vqx->vq, &ires->intrhand); + if (error) + return (error); + } } - /* Attempt shared MSIX configuration. */ - required = 2; - if (nmsix >= required) { - cnt = required; - if (pci_alloc_msix(dev, &cnt) == 0 && cnt >= required) { - sc->vtpci_flags |= VIRTIO_PCI_FLAG_SHARED_MSIX; - goto out; - } + error = vtpci_set_host_msix_vectors(sc); + if (error) + return (error); - pci_release_msi(dev); - } + return (0); +} - return (1); +static int +vtpci_setup_interrupts(struct vtpci_softc *sc, enum intr_type type) +{ + int error; -out: - sc->vtpci_nintr_res = required; - sc->vtpci_flags |= VIRTIO_PCI_FLAG_MSIX; + type |= INTR_MPSAFE; + KASSERT(sc->vtpci_flags & VTPCI_FLAG_ITYPE_MASK, + ("no interrupt type selected: %#x", sc->vtpci_flags)); - if (bootverbose) { - if (sc->vtpci_flags & VIRTIO_PCI_FLAG_SHARED_MSIX) - device_printf(dev, "using shared virtqueue MSIX\n"); - else - device_printf(dev, "using per virtqueue MSIX\n"); - } + error = vtpci_alloc_intr_resources(sc); + if (error) + return (error); - return (0); + if (sc->vtpci_flags & VTPCI_FLAG_LEGACY) + error = vtpci_setup_legacy_interrupt(sc, type); + else if (sc->vtpci_flags & VTPCI_FLAG_MSI) + error = vtpci_setup_msi_interrupt(sc, type); + else + error = vtpci_setup_msix_interrupts(sc, type); + + return (error); } static int *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable@FreeBSD.ORG Sat Feb 9 06:29:16 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 65E0FF41; Sat, 9 Feb 2013 06:29:16 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 3FB73A3E; Sat, 9 Feb 2013 06:29:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r196TG4C010792; Sat, 9 Feb 2013 06:29:16 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r196TGKg010791; Sat, 9 Feb 2013 06:29:16 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201302090629.r196TGKg010791@svn.freebsd.org> From: Bryan Venteicher Date: Sat, 9 Feb 2013 06:29:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246583 - stable/9/share/man/man4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 06:29:16 -0000 Author: bryanv Date: Sat Feb 9 06:29:15 2013 New Revision: 246583 URL: http://svnweb.freebsd.org/changeset/base/246583 Log: MFC r230461 Connect VirtIO-related manpages to the build. Approved by: grehan (mentor) Modified: stable/9/share/man/man4/Makefile Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/Makefile ============================================================================== --- stable/9/share/man/man4/Makefile Sat Feb 9 06:11:45 2013 (r246582) +++ stable/9/share/man/man4/Makefile Sat Feb 9 06:29:15 2013 (r246583) @@ -509,11 +509,15 @@ MAN= aac.4 \ viapm.4 \ ${_viawd.4} \ vinum.4 \ + ${_virtio.4} \ + ${_virtio_balloon.4} \ + ${_virtio_blk.4} \ vkbd.4 \ vlan.4 \ vpo.4 \ vr.4 \ vte.4 \ + ${_vtnet.4} \ ${_vxge.4} \ watchdog.4 \ wb.4 \ @@ -676,6 +680,7 @@ MLINKS+=vlan.4 if_vlan.4 MLINKS+=vpo.4 imm.4 MLINKS+=vr.4 if_vr.4 MLINKS+=vte.4 if_vte.4 +MLINKS+=${_vtnet.4} ${_if_vtnet.4} MLINKS+=${_vxge.4} ${_if_vxge.4} MLINKS+=watchdog.4 SW_WATCHDOG.4 MLINKS+=wb.4 if_wb.4 @@ -722,6 +727,7 @@ _if_nfe.4= if_nfe.4 _if_nve.4= if_nve.4 _if_nxge.4= if_nxge.4 _if_urtw.4= if_urtw.4 +_if_vtnet.4= if_vtnet.4 _if_vxge.4= if_vxge.4 _if_wpi.4= if_wpi.4 _ipmi.4= ipmi.4 @@ -734,6 +740,10 @@ _nfsmb.4= nfsmb.4 _nve.4= nve.4 _nvram.4= nvram.4 _nxge.4= nxge.4 +_virtio.4= virtio.4 +_virtio_balloon.4=virtio_balloon.4 +_virtio_blk.4= virtio_blk.4 +_vtnet.4= vtnet.4 _vxge.4= vxge.4 _padlock.4= padlock.4 _rr232x.4= rr232x.4 From owner-svn-src-stable@FreeBSD.ORG Sat Feb 9 06:31:14 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id AAF9E151; Sat, 9 Feb 2013 06:31:14 +0000 (UTC) (envelope-from bryanv@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 8F14EA52; Sat, 9 Feb 2013 06:31:14 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r196VECv012709; Sat, 9 Feb 2013 06:31:14 GMT (envelope-from bryanv@svn.freebsd.org) Received: (from bryanv@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r196VEnx012703; Sat, 9 Feb 2013 06:31:14 GMT (envelope-from bryanv@svn.freebsd.org) Message-Id: <201302090631.r196VEnx012703@svn.freebsd.org> From: Bryan Venteicher Date: Sat, 9 Feb 2013 06:31:14 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246584 - stable/9/share/man/man4 X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 06:31:14 -0000 Author: bryanv Date: Sat Feb 9 06:31:13 2013 New Revision: 246584 URL: http://svnweb.freebsd.org/changeset/base/246584 Log: MFC r241470 Add VirtIO SCSI driver man page Approved by: grehan (mentor) Added: stable/9/share/man/man4/virtio_scsi.4 - copied unchanged from r241470, head/share/man/man4/virtio_scsi.4 Modified: stable/9/share/man/man4/Makefile stable/9/share/man/man4/virtio.4 Directory Properties: stable/9/share/man/man4/ (props changed) Modified: stable/9/share/man/man4/Makefile ============================================================================== --- stable/9/share/man/man4/Makefile Sat Feb 9 06:29:15 2013 (r246583) +++ stable/9/share/man/man4/Makefile Sat Feb 9 06:31:13 2013 (r246584) @@ -512,6 +512,7 @@ MAN= aac.4 \ ${_virtio.4} \ ${_virtio_balloon.4} \ ${_virtio_blk.4} \ + ${_virtio_scsi.4} \ vkbd.4 \ vlan.4 \ vpo.4 \ @@ -743,6 +744,7 @@ _nxge.4= nxge.4 _virtio.4= virtio.4 _virtio_balloon.4=virtio_balloon.4 _virtio_blk.4= virtio_blk.4 +_virtio_scsi.4= virtio_scsi.4 _vtnet.4= vtnet.4 _vxge.4= vxge.4 _padlock.4= padlock.4 Modified: stable/9/share/man/man4/virtio.4 ============================================================================== --- stable/9/share/man/man4/virtio.4 Sat Feb 9 06:29:15 2013 (r246583) +++ stable/9/share/man/man4/virtio.4 Sat Feb 9 06:31:13 2013 (r246584) @@ -72,6 +72,10 @@ device driver. An emulated disk controller is provided by the .Xr virtio_blk 4 device driver. +.It Nm SCSI +An emulated SCSI HBA is provided by the +.Xr virtio_scsi 4 +device driver. .It Nm Balloon A pseudo-device to allow the VM to release memory back to the hypervisor is provided by the @@ -81,6 +85,7 @@ device driver. .Sh SEE ALSO .Xr virtio_balloon 4 , .Xr virtio_blk 4 , +.Xr virtio_scsi 4 , .Xr vtnet 4 .Sh HISTORY Support for VirtIO first appeared in Copied: stable/9/share/man/man4/virtio_scsi.4 (from r241470, head/share/man/man4/virtio_scsi.4) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/9/share/man/man4/virtio_scsi.4 Sat Feb 9 06:31:13 2013 (r246584, copy of r241470, head/share/man/man4/virtio_scsi.4) @@ -0,0 +1,92 @@ +.\" Copyright (c) 2012 Bryan Venteicher +.\" 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 June 24, 2012 +.Dt VIRTIO_SCSI 4 +.Os +.Sh NAME +.Nm virtio_scsi +.Nd VirtIO SCSI driver +.Sh SYNOPSIS +To compile this driver into the kernel, +place the following lines in your +kernel configuration file: +.Bd -ragged -offset indent +.Cd "device virtio_scsi" +.Ed +.Pp +Alternatively, to load the driver as a +module at boot time, place the following line in +.Xr loader.conf 5 : +.Bd -literal -offset indent +virtio_scsi_load="YES" +.Ed +.Sh DESCRIPTION +The +.Nm +device driver provides support for VirtIO SCSI devices. +.Sh LOADER TUNABLES +Tunables can be set at the +.Xr loader 8 +prompt before booting the kernel or stored in +.Xr loader.conf 5 . +.Bl -tag -width "xxxxxx" +.It Va hw.vtscsi.bus_reset_disable +In the initial QEMU release with VirtIO SCSI support, in-flight +operations were not aborted when stopping the device, rendering +bus reset ineffective. This tunable disables attempts to issue +reset bus commands. The default value is 1. +.El +.Sh DEBUGGING +To enable debugging prints from the +.Nm +driver, set the +.Bd -literal -offset indent +hw.vtscsi.X.debug_level +.Ed +.Pp +variable, where X is the adapter number, either in +.Xr loader.conf 5 +or via +.Xr sysctl 8 . +The following bits have the described effects: +.Bl -tag -width 6n -offset indent +.It 0x01 +Enable informational prints. +.It 0x02 +Enable prints for driver errors. +.It 0x04 +Enable tracing prints. +.El +.Sh SEE ALSO +.Xr virtio 4 +.Sh HISTORY +The +.Nm +driver was written by +.An Bryan Venteicher Aq bryanv@daemoninthecloset.org . +It first appeared in +.Fx 10.0 . From owner-svn-src-stable@FreeBSD.ORG Sat Feb 9 16:52:57 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 9AFA5221 for ; Sat, 9 Feb 2013 16:52:57 +0000 (UTC) (envelope-from andrey@zonov.org) Received: from mail-la0-x233.google.com (mail-la0-x233.google.com [IPv6:2a00:1450:4010:c03::233]) by mx1.freebsd.org (Postfix) with ESMTP id 20D33245 for ; Sat, 9 Feb 2013 16:52:56 +0000 (UTC) Received: by mail-la0-f51.google.com with SMTP id fo13so4748705lab.38 for ; Sat, 09 Feb 2013 08:52:56 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:sender:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:x-enigmail-version:content-type :x-gm-message-state; bh=iOCjVlkxu+ICmR2zeI4AD5dMu3D/x1v0hwFHhEb8eI4=; b=eyGn+urV9K4m8DtK5Awb8wCW8XZVktD7WJmI4Uzelt9De6EWcSO86rMQpSOS5WM4G+ 2MZkKMK0F1bWTQeDsTF+oT2V7F8a2dFin2VuWrF4K7Pyha9NsrZ6ZuGZ6Eb61MlOdhwM okDLUmu2iN6qA5ZbSqu+uFVg+tshSiouBSQGtWTXMM0EamrOIOv/qWspvuQY/b2cn8oc jUipfxYPfb3zd9KkEYlnhZzqtEpPA2fCsjN8d817rzD/mepzHgQ+/GjyCeGEUFjl/pv0 RwabXZtLezjH7o4Xj+WgV2p7SpaNKBwtJ3sP0Kzb301t+X7TdlxnSaA1uLZRZyqAT7tm vwHQ== X-Received: by 10.152.145.37 with SMTP id sr5mr8212327lab.33.1360428776018; Sat, 09 Feb 2013 08:52:56 -0800 (PST) Received: from zont-osx.local (ppp95-165-158-215.pppoe.spdop.ru. [95.165.158.215]) by mx.google.com with ESMTPS id gm20sm3012080lab.7.2013.02.09.08.52.52 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sat, 09 Feb 2013 08:52:54 -0800 (PST) Sender: Andrey Zonov Message-ID: <51167EDF.5010808@FreeBSD.org> Date: Sat, 09 Feb 2013 20:52:47 +0400 From: Andrey Zonov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 MIME-Version: 1.0 To: Ian Lepore Subject: Re: svn commit: r246402 - stable/9/usr.sbin/inetd References: <201302061316.r16DGh6m024337@svn.freebsd.org> <1360159920.93359.594.camel@revolution.hippie.lan> In-Reply-To: <1360159920.93359.594.camel@revolution.hippie.lan> X-Enigmail-Version: 1.5 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="----enig2OANEGRQWNNVVETRRIOCV" X-Gm-Message-State: ALoCoQmmwU29GkXrvp4aYogniYxJtE8cv/xT7qjg7l9tefTUSSQ1mU64MXEwC4a/p1KGudAtEfRq Cc: svn-src-stable@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org, svn-src-stable-9@FreeBSD.org X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 16:52:57 -0000 This is an OpenPGP/MIME signed message (RFC 4880 and 3156) ------enig2OANEGRQWNNVVETRRIOCV Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 2/6/13 6:12 PM, Ian Lepore wrote: > On Wed, 2013-02-06 at 13:16 +0000, Andrey Zonov wrote: >> Author: zont >> Date: Wed Feb 6 13:16:43 2013 >> New Revision: 246402 >> URL: http://svnweb.freebsd.org/changeset/base/246402 >> >> Log: >> MFC r245696: >> - Force inetd to have listen queue size to be set to the value of >> kern.ipc.somaxconn instead of hardcoded value 64. >> >> Modified: >> stable/9/usr.sbin/inetd/inetd.c >> Directory Properties: >> stable/9/usr.sbin/inetd/ (props changed) >> >> Modified: stable/9/usr.sbin/inetd/inetd.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- stable/9/usr.sbin/inetd/inetd.c Wed Feb 6 13:14:30 2013 (r246401)= >> +++ stable/9/usr.sbin/inetd/inetd.c Wed Feb 6 13:16:43 2013 (r246402)= >> @@ -1387,7 +1387,7 @@ setsockopt(fd, SOL_SOCKET, opt, (char *) >> } >> } >> if (sep->se_socktype =3D=3D SOCK_STREAM) >> - listen(sep->se_fd, 64); >> + listen(sep->se_fd, -1); >> enable(sep); >> if (debug) { >> warnx("registered %s on %d", >=20 > I recently discovered that the posix documentation for listen(2) states= > that a queue depth less than zero is to be treated as if zero were > specified, and the behavior for zero is to minimize the length of the > queue to the smallest value the implementation supports (with words tha= t > imply the desired (but not required) effect is to stop listening if > possible). >=20 Hm, I could not imagine that POSIX creates new shiny bike for that. > Given that, perhaps it's unwise to expand the amount of code we've got > that relies on this freebsd-specific non-conformance? >=20 I think it is BSD-specific and I like -1 more than INT_MAX here. Note that Linux is going crazy when you set backlog more than system limi= t. --=20 Andrey Zonov ------enig2OANEGRQWNNVVETRRIOCV Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.18 (Darwin) Comment: GPGTools - http://gpgtools.org iQEcBAEBAgAGBQJRFn7iAAoJEBWLemxX/CvTczYH/jQn5WpJ6xWG6gTuUp0/HtLy qtoFeEb4D4G+cqx1SXYSgo6WinFdqx71daBCT18u1a0fPs4SBgMfMirLYW1Q1AeS FoPPaTsuoXo9I8ObmdJXyc1JLHUF0eDKp1So9qFUc6KWa+nDwrbnMRlp9B9rYzSo +kub1Hg8WmRpLsauNorfHsxEhsvq2NLIRwO6tEaeMy/YF0lX71nM7dY/esCFdeDU 0OajrNmmXA7tjrkyWGP95K2tMumQI3QRXGuBhjwgCRcGnEK8aXFY7zXs0EPpuxqd ANoIFOTAwQwjWtwOJVCfvkEIM+Bt6gGT4kPoB1DMT2o0P/0xyyRjLnP4LYcJLUw= =hmBk -----END PGP SIGNATURE----- ------enig2OANEGRQWNNVVETRRIOCV-- From owner-svn-src-stable@FreeBSD.ORG Sat Feb 9 20:13:30 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id A0006AEE; Sat, 9 Feb 2013 20:13:30 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 928F8109; Sat, 9 Feb 2013 20:13:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r19I0TEq019361; Sat, 9 Feb 2013 18:00:29 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r19I0T1u019360; Sat, 9 Feb 2013 18:00:29 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201302091800.r19I0T1u019360@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 9 Feb 2013 18:00:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r246599 - stable/8/etc/rc.d X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 20:13:30 -0000 Author: ume Date: Sat Feb 9 18:00:29 2013 New Revision: 246599 URL: http://svnweb.freebsd.org/changeset/base/246599 Log: MFC r246255: Use the default policy table of RFC 6724. Modified: stable/8/etc/rc.d/ip6addrctl Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/rc.d/ip6addrctl ============================================================================== --- stable/8/etc/rc.d/ip6addrctl Sat Feb 9 17:56:57 2013 (r246598) +++ stable/8/etc/rc.d/ip6addrctl Sat Feb 9 18:00:29 2013 (r246599) @@ -22,22 +22,30 @@ prefer_ipv4_cmd="ip6addrctl_prefer_ipv4" ip6addrctl_prefer_ipv6() { ip6addrctl flush >/dev/null 2>&1 - ip6addrctl add ::1/128 50 0 - ip6addrctl add ::/0 40 1 - ip6addrctl add 2002::/16 30 2 - ip6addrctl add ::/96 20 3 - ip6addrctl add ::ffff:0:0/96 10 4 + ip6addrctl add ::1/128 50 0 + ip6addrctl add ::/0 40 1 + ip6addrctl add ::ffff:0:0/96 35 4 + ip6addrctl add 2002::/16 30 2 + ip6addrctl add 2001::/32 5 5 + ip6addrctl add fc00::/7 3 13 + ip6addrctl add ::/96 1 3 + ip6addrctl add fec0::/10 1 11 + ip6addrctl add 3ffe::/16 1 12 checkyesno ip6addrctl_verbose && ip6addrctl } ip6addrctl_prefer_ipv4() { ip6addrctl flush >/dev/null 2>&1 - ip6addrctl add ::ffff:0:0/96 50 0 - ip6addrctl add ::1/128 40 1 - ip6addrctl add ::/0 30 2 - ip6addrctl add 2002::/16 20 3 - ip6addrctl add ::/96 10 4 + ip6addrctl add ::1/128 50 0 + ip6addrctl add ::/0 40 1 + ip6addrctl add ::ffff:0:0/96 100 4 + ip6addrctl add 2002::/16 30 2 + ip6addrctl add 2001::/32 5 5 + ip6addrctl add fc00::/7 3 13 + ip6addrctl add ::/96 1 3 + ip6addrctl add fec0::/10 1 11 + ip6addrctl add 3ffe::/16 1 12 checkyesno ip6addrctl_verbose && ip6addrctl } From owner-svn-src-stable@FreeBSD.ORG Sat Feb 9 20:13:30 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id AB152AEF; Sat, 9 Feb 2013 20:13:30 +0000 (UTC) (envelope-from ume@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 9DA9110A; Sat, 9 Feb 2013 20:13:30 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r19HuvTp018614; Sat, 9 Feb 2013 17:56:57 GMT (envelope-from ume@svn.freebsd.org) Received: (from ume@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r19Huva2018613; Sat, 9 Feb 2013 17:56:57 GMT (envelope-from ume@svn.freebsd.org) Message-Id: <201302091756.r19Huva2018613@svn.freebsd.org> From: Hajimu UMEMOTO Date: Sat, 9 Feb 2013 17:56:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org Subject: svn commit: r246598 - stable/9/etc/rc.d X-SVN-Group: stable-9 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 09 Feb 2013 20:13:30 -0000 Author: ume Date: Sat Feb 9 17:56:57 2013 New Revision: 246598 URL: http://svnweb.freebsd.org/changeset/base/246598 Log: MFC r246255: Use the default policy table of RFC 6724. Modified: stable/9/etc/rc.d/ip6addrctl Directory Properties: stable/9/etc/ (props changed) Modified: stable/9/etc/rc.d/ip6addrctl ============================================================================== --- stable/9/etc/rc.d/ip6addrctl Sat Feb 9 17:34:48 2013 (r246597) +++ stable/9/etc/rc.d/ip6addrctl Sat Feb 9 17:56:57 2013 (r246598) @@ -29,11 +29,15 @@ ip6addrctl_prefer_ipv6() afexists inet6 || return 0 ip6addrctl flush >/dev/null 2>&1 - ip6addrctl add ::1/128 50 0 - ip6addrctl add ::/0 40 1 - ip6addrctl add 2002::/16 30 2 - ip6addrctl add ::/96 20 3 - ip6addrctl add ::ffff:0:0/96 10 4 + ip6addrctl add ::1/128 50 0 + ip6addrctl add ::/0 40 1 + ip6addrctl add ::ffff:0:0/96 35 4 + ip6addrctl add 2002::/16 30 2 + ip6addrctl add 2001::/32 5 5 + ip6addrctl add fc00::/7 3 13 + ip6addrctl add ::/96 1 3 + ip6addrctl add fec0::/10 1 11 + ip6addrctl add 3ffe::/16 1 12 checkyesno ip6addrctl_verbose && ip6addrctl } @@ -42,11 +46,15 @@ ip6addrctl_prefer_ipv4() afexists inet6 || return 0 ip6addrctl flush >/dev/null 2>&1 - ip6addrctl add ::ffff:0:0/96 50 0 - ip6addrctl add ::1/128 40 1 - ip6addrctl add ::/0 30 2 - ip6addrctl add 2002::/16 20 3 - ip6addrctl add ::/96 10 4 + ip6addrctl add ::1/128 50 0 + ip6addrctl add ::/0 40 1 + ip6addrctl add ::ffff:0:0/96 100 4 + ip6addrctl add 2002::/16 30 2 + ip6addrctl add 2001::/32 5 5 + ip6addrctl add fc00::/7 3 13 + ip6addrctl add ::/96 1 3 + ip6addrctl add fec0::/10 1 11 + ip6addrctl add 3ffe::/16 1 12 checkyesno ip6addrctl_verbose && ip6addrctl }