svn commit: r202070 - head/usr.bin/make
Author: harti Date: Mon Jan 11 09:16:42 2010 New Revision: 202070 URL: http://svn.freebsd.org/changeset/base/202070 Log: Fix the previous commit (still not used to svn vs. cvs). Use the define from paths.h for the default temporary directory and remove and unneccessary getenv call. Modified: head/usr.bin/make/job.c Modified: head/usr.bin/make/job.c == --- head/usr.bin/make/job.c Mon Jan 11 05:26:18 2010(r202069) +++ head/usr.bin/make/job.c Mon Jan 11 09:16:42 2010(r202070) @@ -115,6 +115,7 @@ __FBSDID($FreeBSD$); #include fcntl.h #include inttypes.h #include limits.h +#include paths.h #include string.h #include signal.h #include stdlib.h @@ -139,7 +140,6 @@ __FBSDID($FreeBSD$); #include var.h #defineTMPPAT makeXX -#defineTMPDIR /tmp #ifndef USE_KQUEUE /* @@ -1611,7 +1611,7 @@ JobStart(GNode *gn, int flags, Job *prev } if ((tdir = getenv(TMPDIR)) == NULL) - tdir = TMPDIR; + tdir = _PATH_TMP; /* * If the -n flag wasn't given, we open up OUR (not the child's) @@ -1807,8 +1807,6 @@ JobStart(GNode *gn, int flags, Job *prev } else { fprintf(stdout, Remaking `%s'\n, gn-name); fflush(stdout); - if ((tdir = getenv(TMPDIR)) == NULL) - tdir = TMPDIR; snprintf(job-outFile, sizeof(job-outFile), %s/%s, tdir, TMPPAT); if ((job-outFd = mkstemp(job-outFile)) == -1) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r201999 - head/lib/libc/stdio
On Mon, Jan 11, 2010 at 02:29:03PM +1100, Bruce Evans wrote: 3) errno should be EOVERFLOW, see other owerflow checks in the stdio. There are none. I (we?) intentionally didn't set errno when the correct F.e. see fseek()/fseeko() stdio checks, as POSIX says: [EOVERFLOW] For fseek(), the resulting file offset would be a value which cannot be represented correctly in an object of type long. [EOVERFLOW] For fseeko(), the resulting file offset would be a value which cannot be represented correctly in an object of type off_t. Moreover, POSIX tends to introduce EOVERFLOW now in many places like old system calls too, see read()/pread(): [EOVERFLOW] The file is a regular file, nbyte is greater than 0, the starting position is before the end-of-file, and the starting position is greater than or equal to the offset maximum established in the open file description associated with fildes. (IEEE P1003.1 Draft 5.1 Issue 7 quoted in both cases) -- http://ache.pp.ru/ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202081 - in stable/8: share/man/man4 sys/netinet
Author: ru Date: Mon Jan 11 12:32:06 2010 New Revision: 202081 URL: http://svn.freebsd.org/changeset/base/202081 Log: MFC: r200026,201801: Swap carp(4) log levels. Modified: stable/8/share/man/man4/carp.4 stable/8/sys/netinet/ip_carp.c Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/share/man/man4/de.4 (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/share/man/man4/carp.4 == --- stable/8/share/man/man4/carp.4 Mon Jan 11 12:31:36 2010 (r202080) +++ stable/8/share/man/man4/carp.4 Mon Jan 11 12:32:06 2010 (r202081) @@ -25,7 +25,7 @@ .\ .\ $FreeBSD$ .\ -.Dd June 6, 2006 +.Dd January 5, 2010 .Dt CARP 4 .Os .Sh NAME @@ -118,12 +118,12 @@ See also the first example. Disabled by default. .It Va net.inet.carp.log Value of 0 disables any logging. -Value of 1 enables logging of bad -.Nm -packets. -Values above 1 enable logging state changes of +Value of 1 enables logging state changes of .Nm interfaces. +Values above 1 enable logging of bad +.Nm +packets. Default value is 1. .It Va net.inet.carp.arpbalance Balance local traffic using ARP (see below). Modified: stable/8/sys/netinet/ip_carp.c == --- stable/8/sys/netinet/ip_carp.c Mon Jan 11 12:31:36 2010 (r202080) +++ stable/8/sys/netinet/ip_carp.c Mon Jan 11 12:32:06 2010 (r202081) @@ -550,7 +550,7 @@ carp_input(struct mbuf *m, int hlen) /* check if received on a valid carp interface */ if (m-m_pkthdr.rcvif-if_carp == NULL) { CARPSTATS_INC(carps_badif); - CARP_LOG(carp_input: packet received on non-carp + CARP_DEBUG(carp_input: packet received on non-carp interface: %s\n, m-m_pkthdr.rcvif-if_xname); m_freem(m); @@ -560,7 +560,7 @@ carp_input(struct mbuf *m, int hlen) /* verify that the IP TTL is 255. */ if (ip-ip_ttl != CARP_DFLTTL) { CARPSTATS_INC(carps_badttl); - CARP_LOG(carp_input: received ttl %d != 255i on %s\n, + CARP_DEBUG(carp_input: received ttl %d != 255 on %s\n, ip-ip_ttl, m-m_pkthdr.rcvif-if_xname); m_freem(m); @@ -571,7 +571,7 @@ carp_input(struct mbuf *m, int hlen) if (m-m_pkthdr.len iplen + sizeof(*ch)) { CARPSTATS_INC(carps_badlen); - CARP_LOG(carp_input: received len %zd + CARP_DEBUG(carp_input: received len %zd sizeof(struct carp_header) on %s\n, m-m_len - sizeof(struct ip), m-m_pkthdr.rcvif-if_xname); @@ -582,7 +582,7 @@ carp_input(struct mbuf *m, int hlen) if (iplen + sizeof(*ch) m-m_len) { if ((m = m_pullup(m, iplen + sizeof(*ch))) == NULL) { CARPSTATS_INC(carps_hdrops); - CARP_LOG(carp_input: pullup failed\n); + CARP_DEBUG(carp_input: pullup failed\n); return; } ip = mtod(m, struct ip *); @@ -596,7 +596,7 @@ carp_input(struct mbuf *m, int hlen) len = iplen + sizeof(*ch); if (len m-m_pkthdr.len) { CARPSTATS_INC(carps_badlen); - CARP_LOG(carp_input: packet too short %d on %s\n, + CARP_DEBUG(carp_input: packet too short %d on %s\n, m-m_pkthdr.len, m-m_pkthdr.rcvif-if_xname); m_freem(m); @@ -614,7 +614,7 @@ carp_input(struct mbuf *m, int hlen) m-m_data += iplen; if (carp_cksum(m, len - iplen)) { CARPSTATS_INC(carps_badsum); - CARP_LOG(carp_input: checksum failed on %s\n, + CARP_DEBUG(carp_input: checksum failed on %s\n, m-m_pkthdr.rcvif-if_xname); m_freem(m); return; @@ -643,7 +643,7 @@ carp6_input(struct mbuf **mp, int *offp, /* check if received on a valid carp interface */ if (m-m_pkthdr.rcvif-if_carp == NULL) { CARPSTATS_INC(carps_badif); - CARP_LOG(carp6_input: packet received on non-carp + CARP_DEBUG(carp6_input: packet received on non-carp interface: %s\n, m-m_pkthdr.rcvif-if_xname); m_freem(m); @@ -653,7 +653,7 @@ carp6_input(struct mbuf **mp, int *offp, /* verify that the IP TTL is 255 */ if (ip6-ip6_hlim != CARP_DFLTTL) {
svn commit: r202082 - in stable/8/sys: kern sys ufs/ffs vm
Author: kib Date: Mon Jan 11 12:35:16 2010 New Revision: 202082 URL: http://svn.freebsd.org/changeset/base/202082 Log: MFC r200770: Remove VI_OBJDIRTY and make sure that OBJ_MIGHTBEDIRTY is set only for vnode-backed vm objects. Modified: stable/8/sys/kern/vfs_subr.c stable/8/sys/sys/vnode.h stable/8/sys/ufs/ffs/ffs_rawread.c stable/8/sys/vm/vm_object.c stable/8/sys/vm/vm_object.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/vfs_subr.c == --- stable/8/sys/kern/vfs_subr.cMon Jan 11 12:32:06 2010 (r202081) +++ stable/8/sys/kern/vfs_subr.cMon Jan 11 12:35:16 2010 (r202082) @@ -2697,14 +2697,12 @@ vn_printf(struct vnode *vp, const char * strlcat(buf, |VI_DOOMED, sizeof(buf)); if (vp-v_iflag VI_FREE) strlcat(buf, |VI_FREE, sizeof(buf)); - if (vp-v_iflag VI_OBJDIRTY) - strlcat(buf, |VI_OBJDIRTY, sizeof(buf)); if (vp-v_iflag VI_DOINGINACT) strlcat(buf, |VI_DOINGINACT, sizeof(buf)); if (vp-v_iflag VI_OWEINACT) strlcat(buf, |VI_OWEINACT, sizeof(buf)); flags = vp-v_iflag ~(VI_MOUNT | VI_AGE | VI_DOOMED | VI_FREE | - VI_OBJDIRTY | VI_DOINGINACT | VI_OWEINACT); + VI_DOINGINACT | VI_OWEINACT); if (flags != 0) { snprintf(buf2, sizeof(buf2), |VI(0x%lx), flags); strlcat(buf, buf2, sizeof(buf)); @@ -3198,7 +3196,8 @@ vfs_msync(struct mount *mp, int flags) MNT_ILOCK(mp); MNT_VNODE_FOREACH(vp, mp, mvp) { VI_LOCK(vp); - if ((vp-v_iflag VI_OBJDIRTY) + obj = vp-v_object; + if (obj != NULL (obj-flags OBJ_MIGHTBEDIRTY) != 0 (flags == MNT_WAIT || VOP_ISLOCKED(vp) == 0)) { MNT_IUNLOCK(mp); if (!vget(vp, Modified: stable/8/sys/sys/vnode.h == --- stable/8/sys/sys/vnode.hMon Jan 11 12:32:06 2010(r202081) +++ stable/8/sys/sys/vnode.hMon Jan 11 12:35:16 2010(r202082) @@ -237,7 +237,6 @@ struct xvnode { #defineVI_AGE 0x0040 /* Insert vnode at head of free list */ #defineVI_DOOMED 0x0080 /* This vnode is being recycled */ #defineVI_FREE 0x0100 /* This vnode is on the freelist */ -#defineVI_OBJDIRTY 0x0400 /* object might be dirty */ #defineVI_DOINGINACT 0x0800 /* VOP_INACTIVE is in progress */ #defineVI_OWEINACT 0x1000 /* Need to call inactive */ Modified: stable/8/sys/ufs/ffs/ffs_rawread.c == --- stable/8/sys/ufs/ffs/ffs_rawread.c Mon Jan 11 12:32:06 2010 (r202081) +++ stable/8/sys/ufs/ffs/ffs_rawread.c Mon Jan 11 12:35:16 2010 (r202082) @@ -101,6 +101,7 @@ ffs_rawread_sync(struct vnode *vp) int upgraded; struct bufobj *bo; struct mount *mp; + vm_object_t obj; /* Check for dirty mmap, pending writes and dirty buffers */ bo = vp-v_bufobj; @@ -108,7 +109,8 @@ ffs_rawread_sync(struct vnode *vp) VI_LOCK(vp); if (bo-bo_numoutput 0 || bo-bo_dirty.bv_cnt 0 || - (vp-v_iflag VI_OBJDIRTY) != 0) { + ((obj = vp-v_object) != NULL +(obj-flags OBJ_MIGHTBEDIRTY) != 0)) { VI_UNLOCK(vp); BO_UNLOCK(bo); @@ -138,13 +140,12 @@ ffs_rawread_sync(struct vnode *vp) return (EIO); } /* Attempt to msync mmap() regions to clean dirty mmap */ - if ((vp-v_iflag VI_OBJDIRTY) != 0) { + if ((obj = vp-v_object) != NULL + (obj-flags OBJ_MIGHTBEDIRTY) != 0) { VI_UNLOCK(vp); - if (vp-v_object != NULL) { - VM_OBJECT_LOCK(vp-v_object); - vm_object_page_clean(vp-v_object, 0, 0, OBJPC_SYNC); - VM_OBJECT_UNLOCK(vp-v_object); - } + VM_OBJECT_LOCK(obj); + vm_object_page_clean(obj, 0, 0, OBJPC_SYNC); + VM_OBJECT_UNLOCK(obj); } else VI_UNLOCK(vp); Modified: stable/8/sys/vm/vm_object.c == --- stable/8/sys/vm/vm_object.c Mon Jan 11 12:32:06 2010(r202081)
Re: svn commit: r202070 - head/usr.bin/make
On Mon, Jan 11, 2010 at 09:16:42AM +, Hartmut Brandt wrote: @@ -1807,8 +1807,6 @@ JobStart(GNode *gn, int flags, Job *prev } else { fprintf(stdout, Remaking `%s'\n, gn-name); fflush(stdout); - if ((tdir = getenv(TMPDIR)) == NULL) - tdir = TMPDIR; snprintf(job-outFile, sizeof(job-outFile), %s/%s, tdir, TMPPAT); if ((job-outFd = mkstemp(job-outFile)) == -1) With the presence of .EXPORTVAR directive (setenv() called) TMPDIR environment can be changed on the fly, so perhaps this lines are for reason. -- http://ache.pp.ru/ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r201794 - in head/sys: ddb dev/ep dev/ex netinet6
Bruce Evans b...@optusnet.com.au writes: All of these bugs should have been avoided by using normal style. KNF doesn't even use the ! operator for testing simple booleans! Older KNF code in kern uses comparisions with 0 fairly consistently for testing flags in a bitmap being 0. Even the not-so-old KNF code in kern that tests the not-so-old flag TDF_SINTR does this (there is only one instance, in kern_sig.c, where the above is spelled correctly as ((td-td_flags TDF_SINTR) == 0). I like to use ! for testing even sets of flags so I prefer the above, but this is not KNF. Spelling for testing the opposite sense is more mixed. Omitting the != 0 seems to be most common. ISTR that 1) the rule is don't use it as a predicate unless the name clearly marks it as such and 2) it isn't actually written down anywhere... TD_IS_SLEEPING(td) is clearly a predicate, so it's OK not to compare it explicitly with 0; (td-td_flags TDF_SINTR) may well be a predicate, but this is not obvious from a quick glance at the code, so there should be an explicit comparison. The canonical example is strcmp(), which is *not* a predicate, but is often used (and easily misused) as one. It almost makes me want to add the following to string.h: #define streq(s1, s1) (strcmp((s1), (s2)) == 0) #define strlt(s1, s1) (strcmp((s1), (s2)) 0) #define strgt(s1, s1) (strcmp((s1), (s2)) 0) (or the equivalent static inline functions to avoid double expansion issues) DES -- Dag-Erling Smørgrav - d...@des.no ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r201999 - head/lib/libc/stdio
On Mon, Jan 11, 2010 at 02:29:03PM +1100, Bruce Evans wrote: calloc() has the same overflow bug, if any. Standards seem to require fread and calloc to work even if the multiplication would occur, though they cannot work in most cases where the multiplication would occur, even if the overflow is avoided. Well, calloc on any BSD supported architecture can not allocate more than SIZE_MAX (or SIZE_MAX itself). There is an error defined for that. fread and fwrite will access invalid addressses, so doing nothing would be a correct implementation of undefined. Cutting it off at SIZE_MAX/size seems silly as it would give the same behavior. Frankly, I would just back this out and let the application hit the wall... Joerg ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202084 - head/sys/i386/xen
Author: alc Date: Mon Jan 11 15:51:13 2010 New Revision: 202084 URL: http://svn.freebsd.org/changeset/base/202084 Log: Eliminate an unused declaration. Modified: head/sys/i386/xen/mp_machdep.c Modified: head/sys/i386/xen/mp_machdep.c == --- head/sys/i386/xen/mp_machdep.c Mon Jan 11 15:12:13 2010 (r202083) +++ head/sys/i386/xen/mp_machdep.c Mon Jan 11 15:51:13 2010 (r202084) @@ -105,9 +105,6 @@ static char callfunc_name[NR_CPUS][15]; /* Free these after use */ void *bootstacks[MAXCPU]; -/* Hotwire a 0-4MB V==P mapping */ -extern pt_entry_t *KPTphys; - struct pcb stoppcbs[MAXCPU]; /* Variables needed for SMP tlb shootdown. */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202085 - in head/sys: amd64/amd64 i386/i386
Author: alc Date: Mon Jan 11 16:01:20 2010 New Revision: 202085 URL: http://svn.freebsd.org/changeset/base/202085 Log: Simplify pmap_init(). Additionally, correct a harmless misbehavior on i386. Specifically, where locore had created large page mappings for the kernel, the wrong vm page array entries were being initialized. The vm page array entries for the pages containing the kernel were being initialized instead of the vm page array entries for page table pages. MFC after:1 week Modified: head/sys/amd64/amd64/pmap.c head/sys/i386/i386/locore.s head/sys/i386/i386/pmap.c Modified: head/sys/amd64/amd64/pmap.c == --- head/sys/amd64/amd64/pmap.c Mon Jan 11 15:51:13 2010(r202084) +++ head/sys/amd64/amd64/pmap.c Mon Jan 11 16:01:20 2010(r202085) @@ -664,7 +664,6 @@ pmap_page_init(vm_page_t m) void pmap_init(void) { - pd_entry_t *pd; vm_page_t mpte; vm_size_t s; int i, pv_npg; @@ -673,18 +672,13 @@ pmap_init(void) * Initialize the vm page array entries for the kernel pmap's * page table pages. */ - pd = pmap_pde(kernel_pmap, KERNBASE); for (i = 0; i NKPT; i++) { - if ((pd[i] (PG_PS | PG_V)) == (PG_PS | PG_V)) - continue; - KASSERT((pd[i] PG_V) != 0, - (pmap_init: page table page is missing)); - mpte = PHYS_TO_VM_PAGE(pd[i] PG_FRAME); + mpte = PHYS_TO_VM_PAGE(KPTphys + (i PAGE_SHIFT)); KASSERT(mpte = vm_page_array mpte vm_page_array[vm_page_array_size], (pmap_init: page table page is out of range)); mpte-pindex = pmap_pde_pindex(KERNBASE) + i; - mpte-phys_addr = pd[i] PG_FRAME; + mpte-phys_addr = KPTphys + (i PAGE_SHIFT); } /* Modified: head/sys/i386/i386/locore.s == --- head/sys/i386/i386/locore.s Mon Jan 11 15:51:13 2010(r202084) +++ head/sys/i386/i386/locore.s Mon Jan 11 16:01:20 2010(r202085) @@ -104,9 +104,7 @@ IdlePTD:.long 0 /* phys addr of kernel IdlePDPT: .long 0 /* phys addr of kernel PDPT */ #endif -#ifdef SMP .globl KPTphys -#endif KPTphys: .long 0 /* phys addr of kernel page tables */ .globl proc0kstack Modified: head/sys/i386/i386/pmap.c == --- head/sys/i386/i386/pmap.c Mon Jan 11 15:51:13 2010(r202084) +++ head/sys/i386/i386/pmap.c Mon Jan 11 16:01:20 2010(r202085) @@ -206,6 +206,7 @@ int pseflag = 0;/* PG_PS or-in */ static int nkpt; vm_offset_t kernel_vm_end; extern u_int32_t KERNend; +extern u_int32_t KPTphys; #ifdef PAE pt_entry_t pg_nx; @@ -659,13 +660,13 @@ pmap_init(void) * Initialize the vm page array entries for the kernel pmap's * page table pages. */ - for (i = 0; i nkpt; i++) { - mpte = PHYS_TO_VM_PAGE(PTD[i + KPTDI] PG_FRAME); + for (i = 0; i NKPT; i++) { + mpte = PHYS_TO_VM_PAGE(KPTphys + (i PAGE_SHIFT)); KASSERT(mpte = vm_page_array mpte vm_page_array[vm_page_array_size], (pmap_init: page table page is out of range)); mpte-pindex = i + KPTDI; - mpte-phys_addr = PTD[i + KPTDI] PG_FRAME; + mpte-phys_addr = KPTphys + (i PAGE_SHIFT); } /* ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202086 - head/contrib/opie/libopie
Author: ed Date: Mon Jan 11 16:27:56 2010 New Revision: 202086 URL: http://svn.freebsd.org/changeset/base/202086 Log: Don't include utmp.h when using utmpx.h. libopie includes both utmp.h and utmpx.h in this case and uses some #defines to let the code use struct utmpx and its utility functions. We'd better not include utmp.h here, because maybe it will not be present in the future. Modified: head/contrib/opie/libopie/getutmpentry.c head/contrib/opie/libopie/insecure.c head/contrib/opie/libopie/login.c Modified: head/contrib/opie/libopie/getutmpentry.c == --- head/contrib/opie/libopie/getutmpentry.cMon Jan 11 16:01:20 2010 (r202085) +++ head/contrib/opie/libopie/getutmpentry.cMon Jan 11 16:27:56 2010 (r202086) @@ -15,13 +15,14 @@ you didn't get a copy, you may request o #include opie_cfg.h #include stdio.h #include sys/types.h -#include utmp.h #if DOUTMPX #include utmpx.h #define setutent setutxent #define getutline(x) getutxline(x) #define utmp utmpx +#else +#include utmp.h #endif /* DOUTMPX */ #if HAVE_STRING_H Modified: head/contrib/opie/libopie/insecure.c == --- head/contrib/opie/libopie/insecure.cMon Jan 11 16:01:20 2010 (r202085) +++ head/contrib/opie/libopie/insecure.cMon Jan 11 16:27:56 2010 (r202086) @@ -39,11 +39,12 @@ $FreeBSD$ #include sys/param.h #include unistd.h -#include utmp.h #if DOUTMPX #include utmpx.h #define utmp utmpx #define endutent endutxent +#else +#include utmp.h #endif /* DOUTMPX */ #if HAVE_SYS_UTSNAME_H Modified: head/contrib/opie/libopie/login.c == --- head/contrib/opie/libopie/login.c Mon Jan 11 16:01:20 2010 (r202085) +++ head/contrib/opie/libopie/login.c Mon Jan 11 16:27:56 2010 (r202086) @@ -21,13 +21,14 @@ you didn't get a copy, you may request o #include opie_cfg.h #include stdio.h #include sys/types.h -#include utmp.h #if DOUTMPX #include utmpx.h #define pututline(x) pututxline(x) #define endutent endutxent #define utmp utmpx +#else +#include utmp.h #endif /* DOUTMPX */ #if HAVE_STRING_H ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202089 - head/sys/mips/sibyte
Author: imp Date: Mon Jan 11 17:14:10 2010 New Revision: 202089 URL: http://svn.freebsd.org/changeset/base/202089 Log: Get sb_zbpci.c compiling again after the macros PCI_BUSMAX, PCI_SLOTMAX and PCI_FUNCMAX were moved to pcireg.h. Submitted by: neel@ Modified: head/sys/mips/sibyte/sb_zbpci.c Modified: head/sys/mips/sibyte/sb_zbpci.c == --- head/sys/mips/sibyte/sb_zbpci.c Mon Jan 11 16:31:29 2010 (r202088) +++ head/sys/mips/sibyte/sb_zbpci.c Mon Jan 11 17:14:10 2010 (r202089) @@ -39,6 +39,7 @@ #include vm/vm_extern.h #include vm/pmap.h +#include dev/pci/pcireg.h #include dev/pci/pcivar.h #include dev/pci/pcib_private.h ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202090 - head/sys/mips/sibyte
Author: imp Date: Mon Jan 11 17:14:46 2010 New Revision: 202090 URL: http://svn.freebsd.org/changeset/base/202090 Log: Remove redundant interrupt mapper code. We don't need to disable the interrupt sources feeding into a hardintr anymore. The mips_mask_hard_irq() function does that for us while an interrupt is being processed. Submitted by: neel@ Modified: head/sys/mips/sibyte/sb_zbbus.c Modified: head/sys/mips/sibyte/sb_zbbus.c == --- head/sys/mips/sibyte/sb_zbbus.c Mon Jan 11 17:14:10 2010 (r202089) +++ head/sys/mips/sibyte/sb_zbbus.c Mon Jan 11 17:14:46 2010 (r202090) @@ -45,7 +45,7 @@ static MALLOC_DEFINE(M_INTMAP, sb1250 i struct sb_intmap { int intsrc; /* interrupt mapper register number (0 - 63) */ - int active; /* Does this source generate interrupts? */ + int hardint;/* cpu interrupt from 0 to NUM_HARD_IRQS - 1 */ /* * The device that the interrupt belongs to. Note that multiple @@ -60,36 +60,23 @@ struct sb_intmap { SLIST_ENTRY(sb_intmap) next; }; -/* - * We register 'sb_intsrc.isrc' using cpu_register_hard_intsrc() for each - * hard interrupt source [0-5]. - * - * The mask/unmask callbacks use the information in 'sb_intmap' to figure - * out the corresponding interrupt sources to mask/unmask. - */ -struct sb_intsrc { - struct intsrc isrc; - SLIST_HEAD(, sb_intmap) sb_intmap_head; -}; - -static struct sb_intsrc sb_intsrc[NUM_HARD_IRQS]; +static SLIST_HEAD(, sb_intmap) sb_intmap_head; static struct sb_intmap * sb_intmap_lookup(int intrnum, device_t dev, int rid) { - struct sb_intsrc *isrc; struct sb_intmap *map; - isrc = sb_intsrc[intrnum]; - SLIST_FOREACH(map, isrc-sb_intmap_head, next) { - if (dev == map-dev rid == map-rid) + SLIST_FOREACH(map, sb_intmap_head, next) { + if (dev == map-dev rid == map-rid + intrnum == map-hardint) break; } return (map); } /* - * Keep track of which (dev,rid) tuple is using the interrupt source. + * Keep track of which (dev,rid,hardint) tuple is using the interrupt source. * * We don't actually unmask the interrupt source until the device calls * a bus_setup_intr() on the resource. @@ -97,14 +84,11 @@ sb_intmap_lookup(int intrnum, device_t d static void sb_intmap_add(int intrnum, device_t dev, int rid, int intsrc) { - struct sb_intsrc *isrc; struct sb_intmap *map; - register_t sr; KASSERT(intrnum = 0 intrnum NUM_HARD_IRQS, (intrnum is out of range: %d, intrnum)); - isrc = sb_intsrc[intrnum]; map = sb_intmap_lookup(intrnum, dev, rid); if (map) { KASSERT(intsrc == map-intsrc, @@ -117,32 +101,24 @@ sb_intmap_add(int intrnum, device_t dev, map = malloc(sizeof(*map), M_INTMAP, M_WAITOK | M_ZERO); map-intsrc = intsrc; + map-hardint = intrnum; map-dev = dev; map-rid = rid; - sr = intr_disable(); - SLIST_INSERT_HEAD(isrc-sb_intmap_head, map, next); - intr_restore(sr); + SLIST_INSERT_HEAD(sb_intmap_head, map, next); } static void sb_intmap_activate(int intrnum, device_t dev, int rid) { struct sb_intmap *map; - register_t sr; KASSERT(intrnum = 0 intrnum NUM_HARD_IRQS, (intrnum is out of range: %d, intrnum)); map = sb_intmap_lookup(intrnum, dev, rid); if (map) { - /* -* See comments in sb_unmask_func() about disabling cpu intr -*/ - sr = intr_disable(); - map-active = 1; sb_enable_intsrc(map-intsrc); - intr_restore(sr); } else { /* * In zbbus_setup_intr() we blindly call sb_intmap_activate() @@ -157,75 +133,6 @@ sb_intmap_activate(int intrnum, device_t } } -static void -sb_mask_func(struct intsrc *arg) -{ - struct sb_intmap *map; - struct sb_intsrc *isrc; - uint64_t isrc_bitmap; - - isrc_bitmap = 0; - isrc = (struct sb_intsrc *)arg; - SLIST_FOREACH(map, isrc-sb_intmap_head, next) { - if (map-active == 0) - continue; - /* -* If we have already disabled this interrupt source then don't -* do it again. This can happen when multiple devices share -* an interrupt source (e.g. PCI_INT_x). -*/ - if (isrc_bitmap (1ULL map-intsrc)) - continue; - sb_disable_intsrc(map-intsrc); - isrc_bitmap |= 1ULL map-intsrc; - } -} - -static void -sb_unmask_func(struct intsrc *arg) -{ - struct sb_intmap *map; - struct sb_intsrc
svn commit: r202091 - head/sys/dev/cfe
Author: imp Date: Mon Jan 11 17:16:06 2010 New Revision: 202091 URL: http://svn.freebsd.org/changeset/base/202091 Log: Fix bug in cfe_enumenv(). The CFE API to invoke is CFE_CMD_ENV_ENUM and not CFE_CMD_ENV_SET. Submitted by: neel@ Modified: head/sys/dev/cfe/cfe_api.c Modified: head/sys/dev/cfe/cfe_api.c == --- head/sys/dev/cfe/cfe_api.c Mon Jan 11 17:14:46 2010(r202090) +++ head/sys/dev/cfe/cfe_api.c Mon Jan 11 17:16:06 2010(r202091) @@ -160,7 +160,7 @@ cfe_enumenv(int idx, char *name, int nam { cfe_xiocb_t xiocb; -xiocb.xiocb_fcode = CFE_CMD_ENV_SET; +xiocb.xiocb_fcode = CFE_CMD_ENV_ENUM; xiocb.xiocb_status = 0; xiocb.xiocb_handle = 0; xiocb.xiocb_flags = 0; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202092 - head/sys/mips/rmi/dev/xlr
Author: imp Date: Mon Jan 11 17:29:20 2010 New Revision: 202092 URL: http://svn.freebsd.org/changeset/base/202092 Log: Correct a path in an include I missed earlier Remove references to if_watchdog. The rge_watchdog routine was empty anyway. Modified: head/sys/mips/rmi/dev/xlr/rge.c Modified: head/sys/mips/rmi/dev/xlr/rge.c == --- head/sys/mips/rmi/dev/xlr/rge.c Mon Jan 11 17:16:06 2010 (r202091) +++ head/sys/mips/rmi/dev/xlr/rge.c Mon Jan 11 17:29:20 2010 (r202092) @@ -102,7 +102,7 @@ __FBSDID($FreeBSD$); #include dev/mii/brgphyreg.h #include sys/sysctl.h -#include dev/rmi/xlr/rge.h +#include mips/rmi/dev/xlr/rge.h /* #include opt_rge.h */ @@ -245,7 +245,6 @@ static void rge_start(struct ifnet *); static int rge_ioctl(struct ifnet *, u_long, caddr_t); static void rge_init(void *); static void rge_stop(struct rge_softc *); -static void rge_watchdog(struct ifnet *); static int rge_shutdown(device_t); static void rge_reset(struct rge_softc *); @@ -1936,7 +1935,6 @@ rge_attach(device_t dev) ifp-if_flags = IFF_BROADCAST | IFF_SIMPLEX | IFF_MULTICAST; ifp-if_ioctl = rge_ioctl; ifp-if_start = rge_start; - ifp-if_watchdog = rge_watchdog; ifp-if_init = rge_init; ifp-if_mtu = ETHERMTU; ifp-if_snd.ifq_drv_maxlen = RGE_TX_Q_SIZE; @@ -2404,11 +2402,6 @@ rge_stop(struct rge_softc *sc) rmi_xlr_mac_close(sc); } -static void -rge_watchdog(struct ifnet *sc) -{ -} - static int rge_shutdown(device_t dev) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r202070 - head/usr.bin/make
Hi, On Mon, 11 Jan 2010, Andrey Chernov wrote: ACOn Mon, Jan 11, 2010 at 09:16:42AM +, Hartmut Brandt wrote: AC @@ -1807,8 +1807,6 @@ JobStart(GNode *gn, int flags, Job *prev AC} else { ACfprintf(stdout, Remaking `%s'\n, gn-name); ACfflush(stdout); AC - if ((tdir = getenv(TMPDIR)) == NULL) AC - tdir = TMPDIR; ACsnprintf(job-outFile, sizeof(job-outFile), %s/%s, ACtdir, TMPPAT); ACif ((job-outFd = mkstemp(job-outFile)) == -1) AC ACWith the presence of .EXPORTVAR directive (setenv() called) TMPDIR ACenvironment can be changed on the fly, so perhaps this lines are for reason. There is the same getenv() just a couple of lines above of all the if()s so that it covers both uses of tdir. I just though that doing the getenv() in both places is slightly more performing that do it all the time. But decided that this gain would be clearly below noise level. The I forgot to remove the now unneeded second getenv. harti ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202097 - in head/sys: amd64/amd64 amd64/include conf dev/io i386/i386 i386/include ia64/conf ia64/ia64 ia64/include
Author: marcel Date: Mon Jan 11 18:10:13 2010 New Revision: 202097 URL: http://svn.freebsd.org/changeset/base/202097 Log: Use io(4) for I/O port access on ia64, rather than through sysarch(2). I/O port access is implemented on Itanium by reading and writing to a special region in memory. To hide details and avoid misaligned memory accesses, a process did I/O port reads and writes by making a MD system call. There's one fatal problem with this approach: unprivileged access was not being prevented. /dev/io serves that purpose on amd64/i386, so employ it on ia64 as well. Use an ioctl for doing the actual I/O and remove the sysarch(2) interface. Backward compatibility is not being considered. The sysarch(2) approach was added to support X11, but support for FreeBSD/ia64 was never fully implemented in X11. Thus, nothing gets broken that didn't need more work to begin with. MFC after:1 week Added: head/sys/ia64/ia64/iodev_machdep.c (contents, props changed) head/sys/ia64/include/iodev.h (contents, props changed) Modified: head/sys/amd64/amd64/io.c head/sys/amd64/include/iodev.h head/sys/conf/files.ia64 head/sys/dev/io/iodev.c head/sys/i386/i386/io.c head/sys/i386/include/iodev.h head/sys/ia64/conf/DEFAULTS head/sys/ia64/ia64/sys_machdep.c head/sys/ia64/include/sysarch.h Modified: head/sys/amd64/amd64/io.c == --- head/sys/amd64/amd64/io.c Mon Jan 11 18:08:39 2010(r202096) +++ head/sys/amd64/amd64/io.c Mon Jan 11 18:10:13 2010(r202097) @@ -76,3 +76,12 @@ ioclose(struct cdev *dev __unused, int f return (0); } + +/* ARGSUSED */ +int +ioioctl(struct cdev *dev __unused, u_long cmd __unused, caddr_t data __unused, +int fflag __unused, struct thread *td __unused) +{ + + return (ENXIO); +} Modified: head/sys/amd64/include/iodev.h == --- head/sys/amd64/include/iodev.h Mon Jan 11 18:08:39 2010 (r202096) +++ head/sys/amd64/include/iodev.h Mon Jan 11 18:10:13 2010 (r202097) @@ -28,3 +28,4 @@ d_open_t ioopen; d_close_t ioclose; +d_ioctl_t ioioctl; Modified: head/sys/conf/files.ia64 == --- head/sys/conf/files.ia64Mon Jan 11 18:08:39 2010(r202096) +++ head/sys/conf/files.ia64Mon Jan 11 18:10:13 2010(r202097) @@ -54,6 +54,7 @@ dev/atkbdc/psm.c optionalpsm atkbdc dev/fb/fb.coptionalfb | vga dev/fb/vga.c optionalvga dev/hwpmc/hwpmc_ia64.c optionalhwpmc +dev/io/iodev.c optionalio dev/kbd/kbd.c optionalatkbd | sc | ukbd | usb2_input_kbd dev/syscons/scterm-teken.c optionalsc dev/syscons/scvgarndr.coptionalsc vga @@ -86,6 +87,7 @@ ia64/ia64/gdb_machdep.c optionalgdb ia64/ia64/highfp.c standard ia64/ia64/in_cksum.c optionalinet ia64/ia64/interrupt.c standard +ia64/ia64/iodev_machdep.c optionalio ia64/ia64/locore.S standardno-obj ia64/ia64/machdep.cstandard ia64/ia64/mca.cstandard Modified: head/sys/dev/io/iodev.c == --- head/sys/dev/io/iodev.c Mon Jan 11 18:08:39 2010(r202096) +++ head/sys/dev/io/iodev.c Mon Jan 11 18:10:13 2010(r202097) @@ -41,8 +41,6 @@ __FBSDID($FreeBSD$); #include sys/systm.h #include sys/uio.h -#include machine/specialreg.h - #include vm/vm.h #include vm/pmap.h @@ -54,6 +52,7 @@ static struct cdevsw io_cdevsw = { .d_version =D_VERSION, .d_open = ioopen, .d_close = ioclose, + .d_ioctl = ioioctl, .d_name = io, }; Modified: head/sys/i386/i386/io.c == --- head/sys/i386/i386/io.c Mon Jan 11 18:08:39 2010(r202096) +++ head/sys/i386/i386/io.c Mon Jan 11 18:10:13 2010(r202097) @@ -76,3 +76,12 @@ ioclose(struct cdev *dev __unused, int f return (0); } + +/* ARGSUSED */ +int +ioioctl(struct cdev *dev __unused, u_long cmd __unused, caddr_t data __unused, +int fflag __unused, struct thread *td __unused) +{ + + return (ENXIO); +} Modified: head/sys/i386/include/iodev.h == --- head/sys/i386/include/iodev.h Mon Jan 11 18:08:39 2010 (r202096) +++ head/sys/i386/include/iodev.h Mon Jan 11 18:10:13 2010 (r202097) @@ -28,3 +28,4 @@ d_open_t ioopen; d_close_t ioclose; +d_ioctl_t ioioctl; Modified:
svn commit: r202100 - stable/8/etc/defaults
Author: jhb Date: Mon Jan 11 18:42:29 2010 New Revision: 202100 URL: http://svn.freebsd.org/changeset/base/202100 Log: MFC 201522: Expose the upper 256 ptys in the default devfs rules. I should have updated this when expanding the old pty(4) driver to use 512 ptys by default. This is more important for 7.x. Modified: stable/8/etc/defaults/devfs.rules Directory Properties: stable/8/etc/ (props changed) Modified: stable/8/etc/defaults/devfs.rules == --- stable/8/etc/defaults/devfs.rules Mon Jan 11 18:39:11 2010 (r202099) +++ stable/8/etc/defaults/devfs.rules Mon Jan 11 18:42:29 2010 (r202100) @@ -44,6 +44,14 @@ add path 'ptyP*' unhide add path 'ptyQ*' unhide add path 'ptyR*' unhide add path 'ptyS*' unhide +add path 'ptyl*' unhide +add path 'ptym*' unhide +add path 'ptyn*' unhide +add path 'ptyo*' unhide +add path 'ptyL*' unhide +add path 'ptyM*' unhide +add path 'ptyN*' unhide +add path 'ptyO*' unhide add path 'ttyp*' unhide add path 'ttyq*' unhide add path 'ttyr*' unhide @@ -52,6 +60,14 @@ add path 'ttyP*' unhide add path 'ttyQ*' unhide add path 'ttyR*' unhide add path 'ttyS*' unhide +add path 'ttyl*' unhide +add path 'ttym*' unhide +add path 'ttyn*' unhide +add path 'ttyo*' unhide +add path 'ttyL*' unhide +add path 'ttyM*' unhide +add path 'ttyN*' unhide +add path 'ttyO*' unhide add path ptmx unhide add path pts unhide add path 'pts/*' unhide ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202101 - stable/7/etc/defaults
Author: jhb Date: Mon Jan 11 18:44:41 2010 New Revision: 202101 URL: http://svn.freebsd.org/changeset/base/202101 Log: MFC 201522: Expose the upper 256 ptys in the default devfs rules. I should have updated this when expanding the old pty(4) driver to use 512 ptys by default. This is more important for 7.x. Modified: stable/7/etc/defaults/devfs.rules Directory Properties: stable/7/etc/ (props changed) Modified: stable/7/etc/defaults/devfs.rules == --- stable/7/etc/defaults/devfs.rules Mon Jan 11 18:42:29 2010 (r202100) +++ stable/7/etc/defaults/devfs.rules Mon Jan 11 18:44:41 2010 (r202101) @@ -44,6 +44,14 @@ add path 'ptyP*' unhide add path 'ptyQ*' unhide add path 'ptyR*' unhide add path 'ptyS*' unhide +add path 'ptyl*' unhide +add path 'ptym*' unhide +add path 'ptyn*' unhide +add path 'ptyo*' unhide +add path 'ptyL*' unhide +add path 'ptyM*' unhide +add path 'ptyN*' unhide +add path 'ptyO*' unhide add path 'ttyp*' unhide add path 'ttyq*' unhide add path 'ttyr*' unhide @@ -52,6 +60,14 @@ add path 'ttyP*' unhide add path 'ttyQ*' unhide add path 'ttyR*' unhide add path 'ttyS*' unhide +add path 'ttyl*' unhide +add path 'ttym*' unhide +add path 'ttyn*' unhide +add path 'ttyo*' unhide +add path 'ttyL*' unhide +add path 'ttyM*' unhide +add path 'ttyN*' unhide +add path 'ttyO*' unhide add path 'pts/*' unhide add path 'pty/*' unhide add path fd unhide ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202103 - head/sys/conf
Author: imp Date: Mon Jan 11 19:04:24 2010 New Revision: 202103 URL: http://svn.freebsd.org/changeset/base/202103 Log: Using svn cp rather than cp to copy these files over had the benefit of preserving their history. It had the problem that it also copied over mergeinfo data. Since we're retiring the projects/mips branch, I'm removing the svn:mergeinfo property from them all. Submitted by: jhb Modified: Directory Properties: head/sys/conf/ldscript.mips.mips64 (props changed) head/sys/conf/ldscript.mips.octeon1.32 (props changed) head/sys/conf/ldscript.mips.octeon1.64 (props changed) head/sys/conf/ldscript.mips.octeon1.n32 (props changed) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202105 - in head/sys: dev/cfe dev/flash dev/siba mips/conf mips/include mips/mips
Author: imp Date: Mon Jan 11 19:21:52 2010 New Revision: 202105 URL: http://svn.freebsd.org/changeset/base/202105 Log: Using svn cp rather than cp to copy these files over had the benefit of preserving their history. It had the problem that it also copied over mergeinfo data. Since we're retiring the projects/mips branch, I'm removing the svn:mergeinfo property from them all. Submitted by: jhb Modified: Directory Properties: head/sys/dev/cfe/cfe_env.c (props changed) head/sys/dev/flash/mx25l.c (props changed) head/sys/dev/flash/mx25lreg.h (props changed) head/sys/dev/siba/siba_cc.c (props changed) head/sys/mips/alchemy/ (props changed) head/sys/mips/atheros/ (props changed) head/sys/mips/cavium/ (props changed) head/sys/mips/conf/ALCHEMY (props changed) head/sys/mips/conf/AR71XX (props changed) head/sys/mips/conf/AR71XX.hints (props changed) head/sys/mips/conf/MALTA64 (props changed) head/sys/mips/conf/OCTEON1 (props changed) head/sys/mips/conf/OCTEON1-32 (props changed) head/sys/mips/conf/OCTEON1.hints (props changed) head/sys/mips/conf/SWARM (props changed) head/sys/mips/conf/SWARM.hints (props changed) head/sys/mips/conf/XLR (props changed) head/sys/mips/include/cdefs.h (props changed) head/sys/mips/include/fls64.h (props changed) head/sys/mips/mips/bus_space_generic.c (props changed) head/sys/mips/mips/elf_trampoline.c (props changed) head/sys/mips/mips/inckern.S (props changed) head/sys/mips/mips/ptrace_machdep.c (props changed) head/sys/mips/mips/sys_machdep.c (props changed) head/sys/mips/rmi/ (props changed) head/sys/mips/rmi/dev/ (props changed) head/sys/mips/sibyte/ (props changed) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202106 - stable/8/sys/fs/nfsclient
Author: rmacklem Date: Mon Jan 11 19:30:23 2010 New Revision: 202106 URL: http://svn.freebsd.org/changeset/base/202106 Log: MFC: r201029 When porting the experimental nfs subsystem to the FreeBSD8 krpc, I added 3 functions that were already in the experimental client under different names. This patch deletes the functions in the experimental client and renames the calls to use the other set. (This is just removal of duplicated code and does not fix any bug.) Modified: stable/8/sys/fs/nfsclient/nfs.h stable/8/sys/fs/nfsclient/nfs_clbio.c stable/8/sys/fs/nfsclient/nfs_clvnops.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/fs/nfsclient/nfs.h == --- stable/8/sys/fs/nfsclient/nfs.h Mon Jan 11 19:21:52 2010 (r202105) +++ stable/8/sys/fs/nfsclient/nfs.h Mon Jan 11 19:30:23 2010 (r202106) @@ -67,7 +67,6 @@ int ncl_vinvalbuf(struct vnode *, int, s int ncl_asyncio(struct nfsmount *, struct buf *, struct ucred *, struct thread *); int ncl_doio(struct vnode *, struct buf *, struct ucred *, struct thread *); -int ncl_msleep(struct thread *, void *, struct mtx *, int, char *, int); void ncl_nhinit(void); void ncl_nhuninit(void); void ncl_nodelock(struct nfsnode *); Modified: stable/8/sys/fs/nfsclient/nfs_clbio.c == --- stable/8/sys/fs/nfsclient/nfs_clbio.c Mon Jan 11 19:21:52 2010 (r202105) +++ stable/8/sys/fs/nfsclient/nfs_clbio.c Mon Jan 11 19:30:23 2010 (r202106) @@ -75,101 +75,6 @@ static int nfs_directio_write(struct vno struct ucred *cred, int ioflag); /* - * Any signal that can interrupt an NFS operation in an intr mount - * should be added to this set. SIGSTOP and SIGKILL cannot be masked. - */ -static int nfs_sig_set[] = { - SIGINT, - SIGTERM, - SIGHUP, - SIGKILL, - SIGSTOP, - SIGQUIT -}; - -#ifdef notnow -/* - * Check to see if one of the signals in our subset is pending on - * the process (in an intr mount). - */ -int -ncl_sig_pending(sigset_t set) -{ - int i; - - for (i = 0 ; i sizeof(nfs_sig_set)/sizeof(int) ; i++) - if (SIGISMEMBER(set, nfs_sig_set[i])) - return (1); - return (0); -} -#endif - -/* - * The set/restore sigmask functions are used to (temporarily) overwrite - * the process p_sigmask during an RPC call (for example). These are also - * used in other places in the NFS client that might tsleep(). - */ -static void -ncl_set_sigmask(struct thread *td, sigset_t *oldset) -{ - sigset_t newset; - int i; - struct proc *p; - - SIGFILLSET(newset); - if (td == NULL) - td = curthread; /* XXX */ - p = td-td_proc; - /* Remove the NFS set of signals from newset */ - PROC_LOCK(p); - mtx_lock(p-p_sigacts-ps_mtx); - for (i = 0 ; i sizeof(nfs_sig_set)/sizeof(int) ; i++) { - /* -* But make sure we leave the ones already masked -* by the process, ie. remove the signal from the -* temporary signalmask only if it wasn't already -* in p_sigmask. -*/ - if (!SIGISMEMBER(td-td_sigmask, nfs_sig_set[i]) - !SIGISMEMBER(p-p_sigacts-ps_sigignore, nfs_sig_set[i])) - SIGDELSET(newset, nfs_sig_set[i]); - } - mtx_unlock(p-p_sigacts-ps_mtx); - PROC_UNLOCK(p); - kern_sigprocmask(td, SIG_SETMASK, newset, oldset, 0); -} - -static void -ncl_restore_sigmask(struct thread *td, sigset_t *set) -{ - if (td == NULL) - td = curthread; /* XXX */ - kern_sigprocmask(td, SIG_SETMASK, set, NULL, 0); -} - -/* - * NFS wrapper to msleep(), that shoves a new p_sigmask and restores the - * old one after msleep() returns. - */ -int -ncl_msleep(struct thread *td, void *ident, struct mtx *mtx, int priority, char *wmesg, int timo) -{ - sigset_t oldset; - int error; - struct proc *p; - - if ((priority PCATCH) == 0) - return msleep(ident, mtx, priority, wmesg, timo); - if (td == NULL) - td = curthread; /* XXX */ - ncl_set_sigmask(td, oldset); - error = msleep(ident, mtx, priority, wmesg, timo); - ncl_restore_sigmask(td, oldset); - p = td-td_proc; - return (error); -} - -/* * Vnode op for VM getpages. */ int @@ -1356,9 +1261,9 @@ nfs_getcacheblk(struct vnode *vp, daddr_ if (nmp-nm_flag NFSMNT_INT) { sigset_t oldset; -
Re: svn commit: r201811 - head/sys/netinet
Qing Li wrote: Author: qingli Date: Fri Jan 8 17:49:24 2010 New Revision: 201811 URL: http://svn.freebsd.org/changeset/base/201811 Log: Ensure an address is removed from the interface address list when the installation of that address fails. PR: 139559 After this change it's indeed impossible to create a tunnel with the same peer address - file exists error raises and new tun device appears without any address assigned. However, after several attempts to do it I have almost the same behavior as described in the PR. However, I cannot provide an easy way to reproduce it after this commit. Roman Bogorodskiy pgpko5xl1W0l3.pgp Description: PGP signature
svn commit: r202107 - head/sbin/fsck_ffs
Author: mckusick Date: Mon Jan 11 19:52:40 2010 New Revision: 202107 URL: http://svn.freebsd.org/changeset/base/202107 Log: When renaming a directory it passes through several intermediate states. First its new name will be created causing it to have two names (from possibly different parents). Next, if it has different parents, its value of .. will be changed from pointing to the old parent to pointing to the new parent. Concurrently, its old name will be removed bringing it back into a consistent state. When fsck encounters an extra name for a directory, it offers to remove the extraneous hard link; when it finds that the names have been changed but the update to .. has not happened, it offers to rewrite .. to point at the correct parent. Both of these changes were considered unexpected so would cause fsck in preen mode or fsck in background mode to fail with the need to run fsck manually to fix these problems. This update changes these errors to be expected so that in preen mode fsck will simply fix these transitional errors. For now, background fsck will note these errors, but will need additional kernel support to fix them, so will simply ignore them rather than fail. A future update will allow background fsck to fix these problems. Reported by: jeff Modified: head/sbin/fsck_ffs/pass2.c Modified: head/sbin/fsck_ffs/pass2.c == --- head/sbin/fsck_ffs/pass2.c Mon Jan 11 19:30:23 2010(r202106) +++ head/sbin/fsck_ffs/pass2.c Mon Jan 11 19:52:40 2010(r202107) @@ -49,6 +49,8 @@ __FBSDID($FreeBSD$); #define MINDIRSIZE (sizeof (struct dirtemplate)) +static int fix_extraneous(struct inoinfo *, struct inodesc *); +static int deleteentry(struct inodesc *); static int blksort(const void *, const void *); static int pass2check(struct inodesc *); @@ -236,8 +238,6 @@ pass2check(struct inodesc *idesc) union dinode *dp; const char *errmsg; struct direct proto; - char namebuf[MAXPATHLEN + 1]; - char pathbuf[MAXPATHLEN + 1]; /* * check for . @@ -416,27 +416,12 @@ again: case DFOUND: inp = getinoinfo(dirp-d_ino); - if (inp-i_parent != 0 idesc-id_entryno 2) { - getpathname(pathbuf, idesc-id_number, - idesc-id_number); - getpathname(namebuf, dirp-d_ino, dirp-d_ino); - pwarn(%s%s%s %s %s\n, pathbuf, - (strcmp(pathbuf, /) == 0 ? : /), - dirp-d_name, - IS AN EXTRANEOUS HARD LINK TO DIRECTORY, - namebuf); - if (cursnapshot != 0) - break; - if (preen) { - printf( (REMOVED)\n); - n = 1; - break; - } - if ((n = reply(REMOVE)) == 1) + if (idesc-id_entryno 2) { + if (inp-i_parent == 0) + inp-i_parent = idesc-id_number; + else if ((n = fix_extraneous(inp, idesc)) == 1) break; } - if (idesc-id_entryno 2) - inp-i_parent = idesc-id_number; /* FALLTHROUGH */ case FSTATE: @@ -462,6 +447,109 @@ again: return (ret|KEEPON|ALTERED); } +static int +fix_extraneous(struct inoinfo *inp, struct inodesc *idesc) +{ + struct inodesc dotdesc; + char oldname[MAXPATHLEN + 1]; + char newname[MAXPATHLEN + 1]; + + /* +* If we have not yet found .., look it up now so we know +* which inode the directory itself believes is its parent. +*/ + if (inp-i_dotdot == 0) { + memset(dotdesc, 0, sizeof(struct inodesc)); + dotdesc.id_type = DATA; + dotdesc.id_number = idesc-id_dirp-d_ino; + dotdesc.id_func = findino; + dotdesc.id_name = strdup(..); + if ((ckinode(ginode(dotdesc.id_number), dotdesc) FOUND)) + inp-i_dotdot = dotdesc.id_parent; + } + /* +* We have the previously found old name (inp-i_parent) and the +* just found new name (idesc-id_number). We have five cases: +* 1) .. is missing - can remove either name, choose to delete +* new one and let fsck create .. pointing to old name. +* 2) Both new and old are in same directory, choose to delete +*
svn commit: r202109 - head/sbin/fsck_ffs
Author: mckusick Date: Mon Jan 11 20:05:38 2010 New Revision: 202109 URL: http://svn.freebsd.org/changeset/base/202109 Log: This update utilizes new fsck sysctl commands that allow fsck running in background mode to correct expected inconsistencies that arise during directory rename (see immediately previous update to this file for details). If run on a kernel without the new functionality, background fsck will simply ignore these inconsistencies rather than fail. Reported by:jeff Modified: head/sbin/fsck_ffs/pass2.c Modified: head/sbin/fsck_ffs/pass2.c == --- head/sbin/fsck_ffs/pass2.c Mon Jan 11 19:59:12 2010(r202108) +++ head/sbin/fsck_ffs/pass2.c Mon Jan 11 20:05:38 2010(r202109) @@ -36,12 +36,14 @@ static const char sccsid[] = @(#)pass2. __FBSDID($FreeBSD$); #include sys/param.h +#include sys/sysctl.h #include ufs/ufs/dinode.h #include ufs/ufs/dir.h #include ufs/ffs/fs.h #include err.h +#include errno.h #include stdint.h #include string.h @@ -214,9 +216,48 @@ pass2(void) inoinfo(inp-i_parent)-ino_linkcnt--; continue; } - fileerror(inp-i_parent, inp-i_number, - BAD INODE NUMBER FOR '..'); - if (reply(FIX) == 0) + /* +* Here we have: +*inp-i_number is directory with bad .. in it. +*inp-i_dotdot is current value of ... +*inp-i_parent is directory to which .. should point. +*/ + getpathname(pathbuf, inp-i_parent, inp-i_number); + printf(BAD INODE NUMBER FOR '..' in DIR I=%d (%s)\n, + inp-i_number, pathbuf); + getpathname(pathbuf, inp-i_dotdot, inp-i_dotdot); + printf(CURRENTLY POINTS TO I=%d (%s), , inp-i_dotdot, + pathbuf); + getpathname(pathbuf, inp-i_parent, inp-i_parent); + printf(SHOULD POINT TO I=%d (%s), inp-i_parent, pathbuf); + if (cursnapshot != 0) { + /* +* We need to: +*setcwd(inp-i_number); +*setdotdot(inp-i_dotdot, inp-i_parent); +*/ + cmd.value = inp-i_number; + if (sysctlbyname(vfs.ffs.setcwd, 0, 0, + cmd, sizeof cmd) == -1) { + /* kernel lacks support for these functions */ + printf( (IGNORED)\n); + continue; + } + cmd.value = inp-i_dotdot; /* verify same value */ + cmd.size = inp-i_parent; /* new parent */ + if (sysctlbyname(vfs.ffs.setdotdot, 0, 0, + cmd, sizeof cmd) == -1) { + printf( (FIX FAILED: %s)\n, strerror(errno)); + continue; + } + printf( (FIXED)\n); + inoinfo(inp-i_parent)-ino_linkcnt--; + inp-i_dotdot = inp-i_parent; + continue; + } + if (preen) + printf( (FIXED)\n); + else if (reply(FIX) == 0) continue; inoinfo(inp-i_dotdot)-ino_linkcnt++; inoinfo(inp-i_parent)-ino_linkcnt--; @@ -450,6 +491,7 @@ again: static int fix_extraneous(struct inoinfo *inp, struct inodesc *idesc) { + char *cp; struct inodesc dotdesc; char oldname[MAXPATHLEN + 1]; char newname[MAXPATHLEN + 1]; @@ -491,7 +533,7 @@ fix_extraneous(struct inoinfo *inp, stru strcat (newname, /); strcat(newname, idesc-id_dirp-d_name); getpathname(oldname, inp-i_number, inp-i_number); - pwarn(%s IS AN EXTRANEOUS HARD LINK TO DIRECTORY %s\n, + pwarn(%s IS AN EXTRANEOUS HARD LINK TO DIRECTORY %s, newname, oldname); if (cursnapshot != 0) { /* @@ -499,7 +541,21 @@ fix_extraneous(struct inoinfo *inp, stru *setcwd(idesc-id_number); *unlink(idesc-id_dirp-d_name); */ - printf( (IGNORED)\n); + cmd.value = idesc-id_number; + if (sysctlbyname(vfs.ffs.setcwd, 0, 0, + cmd, sizeof cmd) == -1) { + printf( (IGNORED)\n); + return (0); + } + cmd.value = (int)idesc-id_dirp-d_name; + cmd.size = inp-i_number; /* verify
Re: svn commit: r202105 - in head/sys: dev/cfe dev/flash dev/siba mips/conf mips/include mips/mips
On Monday 11 January 2010 2:21:52 pm Warner Losh wrote: Author: imp Date: Mon Jan 11 19:21:52 2010 New Revision: 202105 URL: http://svn.freebsd.org/changeset/base/202105 Log: Using svn cp rather than cp to copy these files over had the benefit of preserving their history. It had the problem that it also copied over mergeinfo data. Since we're retiring the projects/mips branch, I'm removing the svn:mergeinfo property from them all. Submitted by: jhb Thanks. -- John Baldwin ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202113 - in head/sys: compat/linux kern sys ufs/ffs ufs/ufs
Author: mckusick Date: Mon Jan 11 20:44:05 2010 New Revision: 202113 URL: http://svn.freebsd.org/changeset/base/202113 Log: Background: When renaming a directory it passes through several intermediate states. First its new name will be created causing it to have two names (from possibly different parents). Next, if it has different parents, its value of .. will be changed from pointing to the old parent to pointing to the new parent. Concurrently, its old name will be removed bringing it back into a consistent state. When fsck encounters an extra name for a directory, it offers to remove the extraneous hard link; when it finds that the names have been changed but the update to .. has not happened, it offers to rewrite .. to point at the correct parent. Both of these changes were considered unexpected so would cause fsck in preen mode or fsck in background mode to fail with the need to run fsck manually to fix these problems. Fsck running in preen mode or background mode now corrects these expected inconsistencies that arise during directory rename. The functionality added with this update is used by fsck running in background mode to make these fixes. Solution: This update adds three new fsck sysctl commands to support background fsck in correcting expected inconsistencies that arise from incomplete directory rename operations. They are: setcwd(dirinode) - set the current directory to dirinode in the filesystem associated with the snapshot. setdotdot(oldvalue, newvalue) - Verify that the inode number for .. in the current directory is oldvalue then change it to newvalue. unlink(nameptr, oldvalue) - Verify that the inode number associated with nameptr in the current directory is oldvalue then unlink it. As with all other fsck sysctls, these new ones may only be used by processes with appropriate priviledge. Reported by: jeff Security issues: rwatson Modified: head/sys/compat/linux/linux_file.c head/sys/kern/vfs_syscalls.c head/sys/sys/syscallsubr.h head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/fs.h head/sys/ufs/ufs/ufs_lookup.c Modified: head/sys/compat/linux/linux_file.c == --- head/sys/compat/linux/linux_file.c Mon Jan 11 20:32:51 2010 (r202112) +++ head/sys/compat/linux/linux_file.c Mon Jan 11 20:44:05 2010 (r202113) @@ -652,7 +652,7 @@ linux_unlinkat(struct thread *td, struct if (args-flag LINUX_AT_REMOVEDIR) error = kern_rmdirat(td, dfd, path, UIO_SYSSPACE); else - error = kern_unlinkat(td, dfd, path, UIO_SYSSPACE); + error = kern_unlinkat(td, dfd, path, UIO_SYSSPACE, 0); if (error == EPERM !(args-flag LINUX_AT_REMOVEDIR)) { /* Introduce POSIX noncompliant behaviour of Linux */ if (kern_statat(td, AT_SYMLINK_NOFOLLOW, dfd, path, Modified: head/sys/kern/vfs_syscalls.c == --- head/sys/kern/vfs_syscalls.cMon Jan 11 20:32:51 2010 (r202112) +++ head/sys/kern/vfs_syscalls.cMon Jan 11 20:44:05 2010 (r202113) @@ -1815,23 +1815,25 @@ unlinkat(struct thread *td, struct unlin if (flag AT_REMOVEDIR) return (kern_rmdirat(td, fd, path, UIO_USERSPACE)); else - return (kern_unlinkat(td, fd, path, UIO_USERSPACE)); + return (kern_unlinkat(td, fd, path, UIO_USERSPACE, 0)); } int kern_unlink(struct thread *td, char *path, enum uio_seg pathseg) { - return (kern_unlinkat(td, AT_FDCWD, path, pathseg)); + return (kern_unlinkat(td, AT_FDCWD, path, pathseg, 0)); } int -kern_unlinkat(struct thread *td, int fd, char *path, enum uio_seg pathseg) +kern_unlinkat(struct thread *td, int fd, char *path, enum uio_seg pathseg, +ino_t oldinum) { struct mount *mp; struct vnode *vp; int error; struct nameidata nd; + struct stat sb; int vfslocked; restart: @@ -1842,9 +1844,13 @@ restart: return (error == EINVAL ? EPERM : error); vfslocked = NDHASGIANT(nd); vp = nd.ni_vp; - if (vp-v_type == VDIR) + if (vp-v_type == VDIR oldinum == 0) { error = EPERM; /* POSIX */ - else { + } else if (oldinum != 0 + ((error = vn_stat(vp, sb, td-td_ucred, NOCRED, td)) == 0) + sb.st_ino != oldinum) { + error = EIDRM; /* Identifier removed */ + } else { /* * The root of a mounted filesystem cannot be deleted. * Modified: head/sys/sys/syscallsubr.h == --- head/sys/sys/syscallsubr.h Mon Jan 11 20:32:51 2010(r202112) +++
svn commit: r202115 - head/games/fortune/datfiles
Author: gavin Date: Mon Jan 11 21:17:49 2010 New Revision: 202115 URL: http://svn.freebsd.org/changeset/base/202115 Log: Our standard xterm termcap entry supports colour, so this tip is redundant. As it happens, xterm-color has just been an alias for xterm since src/share/termcap/termcap.src 1.131 in September 2002. PR: docs/132959 Approved by: ed (mentor) Modified: head/games/fortune/datfiles/freebsd-tips Modified: head/games/fortune/datfiles/freebsd-tips == --- head/games/fortune/datfiles/freebsd-tipsMon Jan 11 21:01:35 2010 (r202114) +++ head/games/fortune/datfiles/freebsd-tipsMon Jan 11 21:17:49 2010 (r202115) @@ -50,18 +50,6 @@ If you are in the C shell and have just be able to run it unless you first type rehash. -- Dru gene...@istar.ca % -If you are running xterm, the default TERM variable will be 'xterm'. If you -set this environment variable to 'xterm-color' instead, a lot of programs will -use colors. You can do this by - - TERM=xterm-color; export TERM - -in Bourne-derived shells, and - - setenv TERM xterm-color - -in csh-derived shells. -% If you do not want to get beeps in X11 (X Windows), you can turn them off with xset b off ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202116 - head/sys/kern
Author: bz Date: Mon Jan 11 21:21:30 2010 New Revision: 202116 URL: http://svn.freebsd.org/changeset/base/202116 Log: Adjust a comment to reflect reality, as we have proper source address selection, even for IPv4, since r183571. Pointed out by: Jase Thew (bazerka beardz.net) MFC after:3 days Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c == --- head/sys/kern/kern_jail.c Mon Jan 11 21:17:49 2010(r202115) +++ head/sys/kern/kern_jail.c Mon Jan 11 21:21:30 2010(r202116) @@ -753,7 +753,9 @@ kern_jail_set(struct thread *td, struct * IP addresses are all sorted but ip[0] to preserve * the primary IP address as given from userland. * This special IP is used for unbound outgoing -* connections as well for loopback traffic. +* connections as well for loopback traffic in case +* source address selection cannot find any more fitting +* address to connect from. */ if (ip4s 1) qsort(ip4 + 1, ip4s - 1, sizeof(*ip4), qcmp_v4); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202117 - stable/7/sys/dev/mxge
Author: gallatin Date: Mon Jan 11 21:23:59 2010 New Revision: 202117 URL: http://svn.freebsd.org/changeset/base/202117 Log: MFC: Merge older mxge(4) fixes/improvements from head: r193250: Set an rx jumbo cluster to the correct size for bus_dmamap_load_mbuf_sg() r194836: Initial mtu r195818: Rename hw.mxge.rss_hash_type - hw.mxge.rss_hashtype r197391: Add support for TX throttling Modified: stable/7/sys/dev/mxge/if_mxge.c stable/7/sys/dev/mxge/if_mxge_var.h Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/dev/mxge/if_mxge.c == --- stable/7/sys/dev/mxge/if_mxge.c Mon Jan 11 21:21:30 2010 (r202116) +++ stable/7/sys/dev/mxge/if_mxge.c Mon Jan 11 21:23:59 2010 (r202117) @@ -99,6 +99,8 @@ static int mxge_ticks; static int mxge_max_slices = 1; static int mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_PORT; static int mxge_always_promisc = 0; +static int mxge_initial_mtu = ETHERMTU_JUMBO; +static int mxge_throttle = 0; static char *mxge_fw_unaligned = mxge_ethp_z8e; static char *mxge_fw_aligned = mxge_eth_z8e; static char *mxge_fw_rss_aligned = mxge_rss_eth_z8e; @@ -589,10 +591,13 @@ static int mxge_select_firmware(mxge_softc_t *sc) { int aligned = 0; + int force_firmware = mxge_force_firmware; + if (sc-throttle) + force_firmware = sc-throttle; - if (mxge_force_firmware != 0) { - if (mxge_force_firmware == 1) + if (force_firmware != 0) { + if (force_firmware == 1) aligned = 1; else aligned = 0; @@ -1300,10 +1305,48 @@ mxge_reset(mxge_softc_t *sc, int interru mxge_change_promisc(sc, sc-ifp-if_flags IFF_PROMISC); mxge_change_pause(sc, sc-pause); mxge_set_multicast_list(sc); + if (sc-throttle) { + cmd.data0 = sc-throttle; + if (mxge_send_cmd(sc, MXGEFW_CMD_SET_THROTTLE_FACTOR, + cmd)) { + device_printf(sc-dev, + can't enable throttle\n); + } + } return status; } static int +mxge_change_throttle(SYSCTL_HANDLER_ARGS) +{ + mxge_cmd_t cmd; + mxge_softc_t *sc; + int err; + unsigned int throttle; + + sc = arg1; + throttle = sc-throttle; + err = sysctl_handle_int(oidp, throttle, arg2, req); +if (err != 0) { +return err; +} + + if (throttle == sc-throttle) + return 0; + +if (throttle MXGE_MIN_THROTTLE || throttle MXGE_MAX_THROTTLE) +return EINVAL; + + mtx_lock(sc-driver_mtx); + cmd.data0 = throttle; + err = mxge_send_cmd(sc, MXGEFW_CMD_SET_THROTTLE_FACTOR, cmd); + if (err == 0) + sc-throttle = throttle; + mtx_unlock(sc-driver_mtx); + return err; +} + +static int mxge_change_intr_coal(SYSCTL_HANDLER_ARGS) { mxge_softc_t *sc; @@ -1495,6 +1538,12 @@ mxge_add_sysctls(mxge_softc_t *sc) I, interrupt coalescing delay in usecs); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + throttle, + CTLTYPE_INT|CTLFLAG_RW, sc, + 0, mxge_change_throttle, + I, transmit throttling); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, flow_control_enabled, CTLTYPE_INT|CTLFLAG_RW, sc, 0, mxge_change_flow_control, @@ -2206,7 +2255,7 @@ mxge_get_buf_big(struct mxge_slice_state err = ENOBUFS; goto done; } - m-m_len = rx-cl_size; + m-m_len = rx-mlen; err = bus_dmamap_load_mbuf_sg(rx-dmat, map, m, seg, cnt, BUS_DMA_NOWAIT); if (err != 0) { @@ -3240,6 +3289,8 @@ mxge_slice_open(struct mxge_slice_state } ss-rx_big.nbufs = nbufs; ss-rx_big.cl_size = cl_size; + ss-rx_big.mlen = ss-sc-ifp-if_mtu + ETHER_HDR_LEN + + ETHER_VLAN_ENCAP_LEN + MXGEFW_PAD; for (i = 0; i = ss-rx_big.mask; i += ss-rx_big.nbufs) { map = ss-rx_big.info[i].map; err = mxge_get_buf_big(ss, map, i); @@ -3840,6 +3891,9 @@ mxge_fetch_tunables(mxge_softc_t *sc) TUNABLE_INT_FETCH(hw.mxge.lro_cnt, sc-lro_cnt); TUNABLE_INT_FETCH(hw.mxge.always_promisc, mxge_always_promisc); TUNABLE_INT_FETCH(hw.mxge.rss_hash_type, mxge_rss_hash_type); + TUNABLE_INT_FETCH(hw.mxge.rss_hashtype, mxge_rss_hash_type); + TUNABLE_INT_FETCH(hw.mxge.initial_mtu, mxge_initial_mtu); +
svn commit: r202118 - stable/6/sys/dev/mxge
Author: gallatin Date: Mon Jan 11 21:32:39 2010 New Revision: 202118 URL: http://svn.freebsd.org/changeset/base/202118 Log: MFC: Merge older mxge(4) fixes/improvements from head: r193250: Set an rx jumbo cluster to the correct size for bus_dmamap_load_mbuf_sg() r194836: Initial mtu r195818: Rename hw.mxge.rss_hash_type - hw.mxge.rss_hashtype r197391: Add support for TX throttling. Modified: stable/6/sys/dev/mxge/if_mxge.c stable/6/sys/dev/mxge/if_mxge_var.h Directory Properties: stable/6/sys/ (props changed) stable/6/sys/contrib/pf/ (props changed) stable/6/sys/dev/cxgb/ (props changed) Modified: stable/6/sys/dev/mxge/if_mxge.c == --- stable/6/sys/dev/mxge/if_mxge.c Mon Jan 11 21:23:59 2010 (r202117) +++ stable/6/sys/dev/mxge/if_mxge.c Mon Jan 11 21:32:39 2010 (r202118) @@ -99,6 +99,8 @@ static int mxge_ticks; static int mxge_max_slices = 1; static int mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_PORT; static int mxge_always_promisc = 0; +static int mxge_initial_mtu = ETHERMTU_JUMBO; +static int mxge_throttle = 0; static char *mxge_fw_unaligned = mxge_ethp_z8e; static char *mxge_fw_aligned = mxge_eth_z8e; static char *mxge_fw_rss_aligned = mxge_rss_eth_z8e; @@ -589,10 +591,13 @@ static int mxge_select_firmware(mxge_softc_t *sc) { int aligned = 0; + int force_firmware = mxge_force_firmware; + if (sc-throttle) + force_firmware = sc-throttle; - if (mxge_force_firmware != 0) { - if (mxge_force_firmware == 1) + if (force_firmware != 0) { + if (force_firmware == 1) aligned = 1; else aligned = 0; @@ -1300,10 +1305,48 @@ mxge_reset(mxge_softc_t *sc, int interru mxge_change_promisc(sc, sc-ifp-if_flags IFF_PROMISC); mxge_change_pause(sc, sc-pause); mxge_set_multicast_list(sc); + if (sc-throttle) { + cmd.data0 = sc-throttle; + if (mxge_send_cmd(sc, MXGEFW_CMD_SET_THROTTLE_FACTOR, + cmd)) { + device_printf(sc-dev, + can't enable throttle\n); + } + } return status; } static int +mxge_change_throttle(SYSCTL_HANDLER_ARGS) +{ + mxge_cmd_t cmd; + mxge_softc_t *sc; + int err; + unsigned int throttle; + + sc = arg1; + throttle = sc-throttle; + err = sysctl_handle_int(oidp, throttle, arg2, req); +if (err != 0) { +return err; +} + + if (throttle == sc-throttle) + return 0; + +if (throttle MXGE_MIN_THROTTLE || throttle MXGE_MAX_THROTTLE) +return EINVAL; + + mtx_lock(sc-driver_mtx); + cmd.data0 = throttle; + err = mxge_send_cmd(sc, MXGEFW_CMD_SET_THROTTLE_FACTOR, cmd); + if (err == 0) + sc-throttle = throttle; + mtx_unlock(sc-driver_mtx); + return err; +} + +static int mxge_change_intr_coal(SYSCTL_HANDLER_ARGS) { mxge_softc_t *sc; @@ -1495,6 +1538,12 @@ mxge_add_sysctls(mxge_softc_t *sc) I, interrupt coalescing delay in usecs); SYSCTL_ADD_PROC(ctx, children, OID_AUTO, + throttle, + CTLTYPE_INT|CTLFLAG_RW, sc, + 0, mxge_change_throttle, + I, transmit throttling); + + SYSCTL_ADD_PROC(ctx, children, OID_AUTO, flow_control_enabled, CTLTYPE_INT|CTLFLAG_RW, sc, 0, mxge_change_flow_control, @@ -2206,7 +2255,7 @@ mxge_get_buf_big(struct mxge_slice_state err = ENOBUFS; goto done; } - m-m_len = rx-cl_size; + m-m_len = rx-mlen; err = bus_dmamap_load_mbuf_sg(rx-dmat, map, m, seg, cnt, BUS_DMA_NOWAIT); if (err != 0) { @@ -3240,6 +3289,8 @@ mxge_slice_open(struct mxge_slice_state } ss-rx_big.nbufs = nbufs; ss-rx_big.cl_size = cl_size; + ss-rx_big.mlen = ss-sc-ifp-if_mtu + ETHER_HDR_LEN + + ETHER_VLAN_ENCAP_LEN + MXGEFW_PAD; for (i = 0; i = ss-rx_big.mask; i += ss-rx_big.nbufs) { map = ss-rx_big.info[i].map; err = mxge_get_buf_big(ss, map, i); @@ -3840,6 +3891,9 @@ mxge_fetch_tunables(mxge_softc_t *sc) TUNABLE_INT_FETCH(hw.mxge.lro_cnt, sc-lro_cnt); TUNABLE_INT_FETCH(hw.mxge.always_promisc, mxge_always_promisc); TUNABLE_INT_FETCH(hw.mxge.rss_hash_type, mxge_rss_hash_type); + TUNABLE_INT_FETCH(hw.mxge.rss_hashtype, mxge_rss_hash_type); + TUNABLE_INT_FETCH(hw.mxge.initial_mtu, mxge_initial_mtu); + TUNABLE_INT_FETCH(hw.mxge.throttle, mxge_throttle); if (sc-lro_cnt
Re: svn commit: r202113 - in head/sys: compat/linux kern sys ufs/ffs ufs/ufs
On Mon, 11 Jan 2010, Kirk McKusick wrote: Author: mckusick Date: Mon Jan 11 20:44:05 2010 New Revision: 202113 URL: http://svn.freebsd.org/changeset/base/202113 Log: Background: When renaming a directory it passes through several intermediate states. First its new name will be created causing it to have two names (from possibly different parents). Next, if it has different ... Modified: head/sys/compat/linux/linux_file.c head/sys/kern/vfs_syscalls.c head/sys/sys/syscallsubr.h head/sys/ufs/ffs/ffs_alloc.c head/sys/ufs/ffs/fs.h head/sys/ufs/ufs/ufs_lookup.c it seesm this broke the build on amd64: 34 /scratch/tmp/bz/HEAD.commit/sys/ufs/ffs/ffs_alloc.c: In function 'sysctl_ffs_fsck': 35 /scratch/tmp/bz/HEAD.commit/sys/ufs/ffs/ffs_alloc.c:2705: warning: cast to pointer from integer of different size -- Bjoern A. Zeeb It will not break if you know what you are doing. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202119 - head/sys/dev/mxge
Author: gallatin Date: Mon Jan 11 22:08:59 2010 New Revision: 202119 URL: http://svn.freebsd.org/changeset/base/202119 Log: Fix reporting of 10G Twinax media Reported by: mjacob MFC after: 3 days Modified: head/sys/dev/mxge/if_mxge.c Modified: head/sys/dev/mxge/if_mxge.c == --- head/sys/dev/mxge/if_mxge.c Mon Jan 11 21:32:39 2010(r202118) +++ head/sys/dev/mxge/if_mxge.c Mon Jan 11 22:08:59 2010(r202119) @@ -2774,6 +2774,7 @@ static struct mxge_media_type mxge_xfp_m }; static struct mxge_media_type mxge_sfp_media_types[] = { + {IFM_10G_TWINAX, 0,10GBASE-Twinax}, {0, (1 7), Reserved}, {IFM_10G_LRM, (1 6), 10GBASE-LRM}, {IFM_10G_LR,(1 5), 10GBASE-LR}, @@ -2908,7 +2909,7 @@ mxge_media_probe(mxge_softc_t *sc) if (mxge_verbose) device_printf(sc-dev, %s:%s\n, cage_type, mxge_media_types[0].name); - mxge_set_media(sc, IFM_10G_CX4); + mxge_set_media(sc, mxge_media_types[0].flag); return; } for (i = 1; i mxge_media_type_entries; i++) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202121 - head/sys/dev/mxge
Author: gallatin Date: Mon Jan 11 22:28:40 2010 New Revision: 202121 URL: http://svn.freebsd.org/changeset/base/202121 Log: Use better default RSS hash (src + dst, rather than just src port) MFC after:3 days Modified: head/sys/dev/mxge/if_mxge.c Modified: head/sys/dev/mxge/if_mxge.c == --- head/sys/dev/mxge/if_mxge.c Mon Jan 11 22:25:09 2010(r202120) +++ head/sys/dev/mxge/if_mxge.c Mon Jan 11 22:28:40 2010(r202121) @@ -104,7 +104,7 @@ static int mxge_verbose = 0; static int mxge_lro_cnt = 8; static int mxge_ticks; static int mxge_max_slices = 1; -static int mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_PORT; +static int mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_DST_PORT; static int mxge_always_promisc = 0; static int mxge_initial_mtu = ETHERMTU_JUMBO; static int mxge_throttle = 0; @@ -4174,7 +4174,7 @@ mxge_fetch_tunables(mxge_softc_t *sc) sc-pause = mxge_flow_control; if (mxge_rss_hash_type MXGEFW_RSS_HASH_TYPE_IPV4 || mxge_rss_hash_type MXGEFW_RSS_HASH_TYPE_MAX) { - mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_PORT; + mxge_rss_hash_type = MXGEFW_RSS_HASH_TYPE_SRC_DST_PORT; } if (mxge_initial_mtu ETHERMTU_JUMBO || mxge_initial_mtu ETHER_MIN_LEN) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202123 - head/sys/kern
Author: bz Date: Mon Jan 11 22:34:25 2010 New Revision: 202123 URL: http://svn.freebsd.org/changeset/base/202123 Log: Change DDB show prison: - name some columns more closely to the user space variables, as we do for host.* or allow.* (in the listing) already. - print pr_childmax (children.max). - prefix hex values with 0x. MFC after:3 weeks Modified: head/sys/kern/kern_jail.c Modified: head/sys/kern/kern_jail.c == --- head/sys/kern/kern_jail.c Mon Jan 11 22:31:47 2010(r202122) +++ head/sys/kern/kern_jail.c Mon Jan 11 22:34:25 2010(r202123) @@ -4169,10 +4169,11 @@ db_show_prison(struct prison *pr) #endif db_printf( root= %p\n, pr-pr_root); db_printf( securelevel = %d\n, pr-pr_securelevel); - db_printf( childcount = %d\n, pr-pr_childcount); + db_printf( children.max= %d\n, pr-pr_childmax); + db_printf( children.cur= %d\n, pr-pr_childcount); db_printf( child = %p\n, LIST_FIRST(pr-pr_children)); db_printf( sibling = %p\n, LIST_NEXT(pr, pr_sibling)); - db_printf( flags = %x, pr-pr_flags); + db_printf( flags = 0x%x, pr-pr_flags); for (fi = 0; fi sizeof(pr_flag_names) / sizeof(pr_flag_names[0]); fi++) if (pr_flag_names[fi] != NULL (pr-pr_flags (1 fi))) @@ -4187,7 +4188,7 @@ db_show_prison(struct prison *pr) : (jsf == pr_flag_jailsys[fi].new) ? new : inherit); } - db_printf( allow = %x, pr-pr_allow); + db_printf( allow = 0x%x, pr-pr_allow); for (fi = 0; fi sizeof(pr_allow_names) / sizeof(pr_allow_names[0]); fi++) if (pr_allow_names[fi] != NULL (pr-pr_allow (1 fi))) @@ -4202,14 +4203,14 @@ db_show_prison(struct prison *pr) db_printf( ip4s= %d\n, pr-pr_ip4s); for (ii = 0; ii pr-pr_ip4s; ii++) db_printf( %s %s\n, - ii == 0 ? ip4 = : , + ii == 0 ? ip4.addr= : , inet_ntoa(pr-pr_ip4[ii])); #endif #ifdef INET6 db_printf( ip6s= %d\n, pr-pr_ip6s); for (ii = 0; ii pr-pr_ip6s; ii++) db_printf( %s %s\n, - ii == 0 ? ip6 = : , + ii == 0 ? ip6.addr= : , ip6_sprintf(ip6buf, pr-pr_ip6[ii])); #endif } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202125 - head/sys/ufs/ffs
Author: mckusick Date: Mon Jan 11 22:42:06 2010 New Revision: 202125 URL: http://svn.freebsd.org/changeset/base/202125 Log: Cast 64-bit quantity to intptr_t rather than int so as to work properly with 64-bit architectures (such as amd64). Reported by: bz Modified: head/sys/ufs/ffs/ffs_alloc.c Modified: head/sys/ufs/ffs/ffs_alloc.c == --- head/sys/ufs/ffs/ffs_alloc.cMon Jan 11 22:35:19 2010 (r202124) +++ head/sys/ufs/ffs/ffs_alloc.cMon Jan 11 22:42:06 2010 (r202125) @@ -2689,7 +2689,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) if (fsckcmds) { char buf[32]; - if (copyinstr((char *)(int)cmd.value, buf, 32, NULL)) + if (copyinstr((char *)(intptr_t)cmd.value, buf,32,NULL)) strncpy(buf, Name_too_long, 32); printf(%s: unlink %s (inode %jd)\n, mp-mnt_stat.f_mntonname, buf, (intmax_t)cmd.size); @@ -2702,7 +2702,7 @@ sysctl_ffs_fsck(SYSCTL_HANDLER_ARGS) */ vn_finished_write(mp); mp = NULL; - error = kern_unlinkat(td, AT_FDCWD, (char *)(int)cmd.value, + error = kern_unlinkat(td, AT_FDCWD, (char *)(intptr_t)cmd.value, UIO_USERSPACE, (ino_t)cmd.size); break; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202127 - head/sys/dev/sound/pci/hda
Author: mav Date: Mon Jan 11 22:57:52 2010 New Revision: 202127 URL: http://svn.freebsd.org/changeset/base/202127 Log: Add multichannel (4.0 and 7.1) playback support. 5.1 mode support blocked now due to unidentified synchonization problem. For 7.1 soundcards 5.1 support handled correctly via software upmix done by sound(4). Stereo stream is no more duplicated to all ports. If you loose sound, check you are using right connectors. Front speakers connector is usually green, center/LFE - orange, rear - black, side - gray. Modified: head/sys/dev/sound/pci/hda/hdac.c head/sys/dev/sound/pci/hda/hdac_private.h Modified: head/sys/dev/sound/pci/hda/hdac.c == --- head/sys/dev/sound/pci/hda/hdac.c Mon Jan 11 22:46:24 2010 (r202126) +++ head/sys/dev/sound/pci/hda/hdac.c Mon Jan 11 22:57:52 2010 (r202127) @@ -86,7 +86,7 @@ #include mixer_if.h -#define HDA_DRV_TEST_REV 20091113_0138 +#define HDA_DRV_TEST_REV 20100111_0139 SND_DECLARE_FILE($FreeBSD$); @@ -3455,7 +3455,11 @@ hdac_stream_setup(struct hdac_chan *ch) int i, chn, totalchn, c; nid_t cad = ch-devinfo-codec-cad; uint16_t fmt, dfmt; + uint16_t chmap[2][5] = {{ 0x0010, 0x0001, 0x0201, 0x0231, 0x0231 }, /* 5.1 */ + { 0x0010, 0x0001, 0x2001, 0x2031, 0x2431 }};/* 7.1 */ + int map = -1; + totalchn = AFMT_CHANNEL(ch-fmt); HDA_BOOTHVERBOSE( device_printf(ch-pdevinfo-dev, PCMDIR_%s: Stream setup fmt=%08x speed=%d\n, @@ -3469,7 +3473,6 @@ hdac_stream_setup(struct hdac_chan *ch) fmt |= ch-bit32 4; else fmt |= 1 4; - for (i = 0; i HDA_RATE_TAB_LEN; i++) { if (hda_rate_tab[i].valid ch-spd == hda_rate_tab[i].rate) { fmt |= hda_rate_tab[i].base; @@ -3478,10 +3481,13 @@ hdac_stream_setup(struct hdac_chan *ch) break; } } + fmt |= (totalchn - 1); - totalchn = AFMT_CHANNEL(ch-fmt); - if (totalchn 1) - fmt |= 1; + /* Set channel mapping for known speaker setups. */ + if (as-pinset == 0x0007 || as-pinset == 0x0013) /* Standard 5.1 */ + map = 0; + else if (as-pinset == 0x0017) /* Standard 7.1 */ + map = 1; HDAC_WRITE_2(sc-mem, ch-off + HDAC_SDFMT, fmt); @@ -3495,14 +3501,26 @@ hdac_stream_setup(struct hdac_chan *ch) if (w == NULL) continue; - if (as-hpredir = 0 i == as-pincnt) - chn = 0; + /* If HP redirection is enabled, but failed to use same + DAC, make last DAC to duplicate first one. */ + if (as-hpredir = 0 i == as-pincnt) { + c = (ch-sid 4); + } else { + if (map = 0) /* Map known speaker setups. */ + chn = (((chmap[map][totalchn / 2] i * 4) + 0xf) - 1) * 2; + if (chn 0 || chn = totalchn) { + c = 0; + } else { + c = (ch-sid 4) | chn; + } + } HDA_BOOTHVERBOSE( device_printf(ch-pdevinfo-dev, PCMDIR_%s: Stream setup nid=%d: - fmt=0x%04x, dfmt=0x%04x\n, + fmt=0x%04x, dfmt=0x%04x, chan=0x%04x\n, (ch-dir == PCMDIR_PLAY) ? PLAY : REC, - ch-io[i], fmt, dfmt); + ch-io[i], fmt, dfmt, c); ); hdac_command(sc, HDA_CMD_SET_CONV_FMT(cad, ch-io[i], fmt), cad); @@ -3511,17 +3529,6 @@ hdac_stream_setup(struct hdac_chan *ch) HDA_CMD_SET_DIGITAL_CONV_FMT1(cad, ch-io[i], dfmt), cad); } - /* If HP redirection is enabled, but failed to use same - DAC make last DAC one to duplicate first one. */ - if (as-hpredir = 0 i == as-pincnt) { - c = (ch-sid 4); - } else if (chn = totalchn) { - /* This is until OSS will support multichannel. - Should be: c = 0; to disable unused DAC */ - c = (ch-sid 4); - }else { - c = (ch-sid 4) | chn; - } hdac_command(sc, HDA_CMD_SET_CONV_STREAM_CHAN(cad, ch-io[i], c), cad); #if 0 @@ -3532,9 +3539,7 @@ hdac_stream_setup(struct hdac_chan *ch) hdac_command(sc, HDA_CMD_SET_HDMI_CHAN_SLOT(cad, ch-io[i],
svn commit: r202129 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: delphij Date: Mon Jan 11 23:15:11 2010 New Revision: 202129 URL: http://svn.freebsd.org/changeset/base/202129 Log: Report ZFS filesystem version instead of the zpool version when we say it. Reported by: Yuri Pankov (on -fs@) Submitted by: delphij Approved by: pjd MFC after:1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.cMon Jan 11 23:00:17 2010(r202128) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vfsops.cMon Jan 11 23:15:11 2010(r202129) @@ -1388,7 +1388,7 @@ void zfs_init(void) { - printf(ZFS filesystem version SPA_VERSION_STRING \n); + printf(ZFS filesystem version ZPL_VERSION_STRING \n); /* * Initialize znode cache, vnode ops, etc... ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202130 - head/etc/rc.d
Author: delphij Date: Mon Jan 11 23:32:36 2010 New Revision: 202130 URL: http://svn.freebsd.org/changeset/base/202130 Log: Set svn:executable to *. MFC after:1 month Modified: Directory Properties: head/etc/rc.d/static_arp (props changed) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202131 - head/sbin/fsck_ffs
Author: mckusick Date: Mon Jan 11 23:33:30 2010 New Revision: 202131 URL: http://svn.freebsd.org/changeset/base/202131 Log: Cast 64-bit quantity to intptr_t rather than int so as to work properly with 64-bit architectures (such as amd64). Reported by: Xin LI and Josh Paetzel Modified: head/sbin/fsck_ffs/pass2.c Modified: head/sbin/fsck_ffs/pass2.c == --- head/sbin/fsck_ffs/pass2.c Mon Jan 11 23:32:36 2010(r202130) +++ head/sbin/fsck_ffs/pass2.c Mon Jan 11 23:33:30 2010(r202131) @@ -547,7 +547,7 @@ fix_extraneous(struct inoinfo *inp, stru printf( (IGNORED)\n); return (0); } - cmd.value = (int)idesc-id_dirp-d_name; + cmd.value = (intptr_t)idesc-id_dirp-d_name; cmd.size = inp-i_number; /* verify same name */ if (sysctlbyname(vfs.ffs.unlink, 0, 0, cmd, sizeof cmd) == -1) { @@ -588,7 +588,7 @@ fix_extraneous(struct inoinfo *inp, stru printf( (IGNORED)\n); return (0); } - cmd.value = (int)(cp + 1); + cmd.value = (intptr_t)(cp + 1); cmd.size = inp-i_number; /* verify same name */ if (sysctlbyname(vfs.ffs.unlink, 0, 0, cmd, sizeof cmd) == -1) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202132 - stable/8/sys/netinet
Author: qingli Date: Tue Jan 12 00:04:13 2010 New Revision: 202132 URL: http://svn.freebsd.org/changeset/base/202132 Log: MFC r201544 An existing incomplete ARP entry would expire a subsequent statically configured entry of the same host. This bug was due to the expiration timer was not cancelled when installing the static entry. Since there exist a potential race condition with respect to timer cancellation, simply check for the LLE_STATIC bit inside the expiration function instead of cancelling the active timer. Modified: stable/8/sys/netinet/if_ether.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/netinet/if_ether.c == --- stable/8/sys/netinet/if_ether.c Mon Jan 11 23:33:30 2010 (r202131) +++ stable/8/sys/netinet/if_ether.c Tue Jan 12 00:04:13 2010 (r202132) @@ -168,17 +168,23 @@ arptimer(void *arg) ifp = lle-lle_tbl-llt_ifp; IF_AFDATA_LOCK(ifp); LLE_WLOCK(lle); - if ((!callout_pending(lle-la_timer) - callout_active(lle-la_timer))) { - (void) llentry_free(lle); - } -#ifdef DIAGNOSTIC + if (lle-la_flags LLE_STATIC) + LLE_WUNLOCK(lle); else { - struct sockaddr *l3addr = L3_ADDR(lle); - log(LOG_INFO, arptimer issue: %p, IPv4 address: \%s\\n, lle, - inet_ntoa(((const struct sockaddr_in *)l3addr)-sin_addr)); - } + if (!callout_pending(lle-la_timer) + callout_active(lle-la_timer)) { + (void) llentry_free(lle); + } +#ifdef DIAGNOSTIC + else { + struct sockaddr *l3addr = L3_ADDR(lle); + log(LOG_INFO, + arptimer issue: %p, IPv4 address: \%s\\n, lle, + inet_ntoa( + ((const struct sockaddr_in *)l3addr)-sin_addr)); + } #endif + } IF_AFDATA_UNLOCK(ifp); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r197752 - head/lib/libc/stdio
On Mon, Jan 11, 2010, Max Laier wrote: On Sunday 04 October 2009 21:43:36 David Schultz wrote: Author: das Date: Sun Oct 4 19:43:36 2009 New Revision: 197752 URL: http://svn.freebsd.org/changeset/base/197752 Log: Better glibc compatibility for getline/getdelim: - Tolerate applications that pass a NULL pointer for the buffer and claim that the capacity of the buffer is nonzero. - If an application passes in a non-NULL buffer pointer and claims the buffer has zero capacity, we should free (well, realloc) it anyway. It could have been obtained from malloc(0), so failing to free it would be a small memory leak. MFC After:2 weeks Reported by: naddy PR: ports/138320 Modified: head/lib/libc/stdio/getdelim.c Modified: head/lib/libc/stdio/getdelim.c === === --- head/lib/libc/stdio/getdelim.c Sun Oct 4 19:03:32 2009 (r197751) +++ head/lib/libc/stdio/getdelim.c Sun Oct 4 19:43:36 2009 (r197752) @@ -120,8 +120,8 @@ getdelim(char ** __restrict linep, size_ goto error; } - if (*linecapp == 0) - *linep = NULL; + if (*linep == NULL) + *linecapp = 0; if (fp-_r = 0 __srefill(fp)) { /* If fp is at EOF already, we just need space for the NUL. */ I think we should have kept the original if case here, as well. Otherwise something like this might fail: char *line; /* note uninitialized */ size_t len = 0; getline(line, len, fd); and I think it is a reasonable thing to pass in an uninitialized pointer if you tell that there is no space associated with it, yet. I don't know if there are many (ab)uses of getline like this, but I was just bitten by it. The trouble is that in many malloc() implementations, including ours, malloc(0) actually makes a small allocation instead of returning NULL. Hence, with your proposed change, code such as the following would result in a memory leak: size_t len = 0; char *line = malloc(len); getline(line, len, fd); POSIX says that *linep has to be a valid argument to the free(), but it's allowed to point to a buffer that's larger than advertised (e.g., a 128-byte buffer when *linecapp is 0.) It's a bad API; what's missing is a line buffer ADT that hides the details of its implementation. But it's still a bit better than fgetln() and way better than something hand-rolled. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202133 - head/lib/libc/gen
Author: davidxu Date: Tue Jan 12 01:30:05 2010 New Revision: 202133 URL: http://svn.freebsd.org/changeset/base/202133 Log: Update manuals of sem_open and sem_init. Submitted by: ru Modified: head/lib/libc/gen/sem_init.3 head/lib/libc/gen/sem_open.3 Modified: head/lib/libc/gen/sem_init.3 == --- head/lib/libc/gen/sem_init.3Tue Jan 12 00:04:13 2010 (r202132) +++ head/lib/libc/gen/sem_init.3Tue Jan 12 01:30:05 2010 (r202133) @@ -27,7 +27,7 @@ .\ .\ $FreeBSD$ .\ -.Dd January 7, 2010 +.Dd January 9, 2010 .Dt SEM_INIT 3 .Os .Sh NAME @@ -52,7 +52,7 @@ A non-zero value for specifies a shared semaphore that can be used by multiple processes, the semaphore should be located in shared memory region (see .Xr mmap 2 , -.Xr shm_open 2 , +.Xr shm_open 2 , and .Xr shmget 2 ) , any process having read and write access to address Modified: head/lib/libc/gen/sem_open.3 == --- head/lib/libc/gen/sem_open.3Tue Jan 12 00:04:13 2010 (r202132) +++ head/lib/libc/gen/sem_open.3Tue Jan 12 01:30:05 2010 (r202133) @@ -27,7 +27,7 @@ .\ .\ $FreeBSD$ .\ -.Dd January 15, 2003 +.Dd January 9, 2010 .Dt SEM_OPEN 3 .Os .Sh NAME @@ -61,8 +61,8 @@ and This implementation places strict requirements on the value of .Fa name : it must begin with a slash -.Pq Ql / , -contain no other slash characters. +.Pq Ql / +and contain no other slash characters. .Pp The following bits may be set in the .Fa oflag ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202134 - in stable/8/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf
Author: brooks Date: Tue Jan 12 06:00:56 2010 New Revision: 202134 URL: http://svn.freebsd.org/changeset/base/202134 Log: MFC r201443: Add vlan(4) to all GENERIC kernels. Modified: stable/8/sys/amd64/conf/GENERIC stable/8/sys/i386/conf/GENERIC stable/8/sys/ia64/conf/GENERIC stable/8/sys/pc98/conf/GENERIC stable/8/sys/powerpc/conf/GENERIC stable/8/sys/sparc64/conf/GENERIC stable/8/sys/sun4v/conf/GENERIC Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/amd64/conf/GENERIC == --- stable/8/sys/amd64/conf/GENERIC Tue Jan 12 01:30:05 2010 (r202133) +++ stable/8/sys/amd64/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) @@ -265,6 +265,7 @@ device wi # WaveLAN/Intersil/Symbol 80 device loop# Network loopback device random # Entropy device device ether # Ethernet support +device vlan# 802.1Q VLAN support device tun # Packet tunnel. device pty # BSD-style compatibility pseudo ttys device md # Memory disks Modified: stable/8/sys/i386/conf/GENERIC == --- stable/8/sys/i386/conf/GENERIC Tue Jan 12 01:30:05 2010 (r202133) +++ stable/8/sys/i386/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) @@ -278,6 +278,7 @@ device wi # WaveLAN/Intersil/Symbol 80 device loop# Network loopback device random # Entropy device device ether # Ethernet support +device vlan# 802.1Q VLAN support device tun # Packet tunnel. device pty # BSD-style compatibility pseudo ttys device md # Memory disks Modified: stable/8/sys/ia64/conf/GENERIC == --- stable/8/sys/ia64/conf/GENERIC Tue Jan 12 01:30:05 2010 (r202133) +++ stable/8/sys/ia64/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) @@ -144,6 +144,7 @@ device kue # Kawasaki LSI USB Ethernet # Various (pseudo) devices device ether # Ethernet support +device vlan# 802.1Q VLAN support device faith # IPv6-to-IPv4 relaying (translation) device gif # IPv6 and IPv4 tunneling device loop# Network loopback Modified: stable/8/sys/pc98/conf/GENERIC == --- stable/8/sys/pc98/conf/GENERIC Tue Jan 12 01:30:05 2010 (r202133) +++ stable/8/sys/pc98/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) @@ -232,6 +232,7 @@ device xe # Xircom pccard Ethernet device loop# Network loopback device random # Entropy device device ether # Ethernet support +device vlan# 802.1Q VLAN support device tun # Packet tunnel. device pty # BSD-style compatibility pseudo ttys device md # Memory disks Modified: stable/8/sys/powerpc/conf/GENERIC == --- stable/8/sys/powerpc/conf/GENERIC Tue Jan 12 01:30:05 2010 (r202133) +++ stable/8/sys/powerpc/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) @@ -123,6 +123,7 @@ device fxp # Intel EtherExpress PRO/10 device loop# Network loopback device random # Entropy device device ether # Ethernet support +device vlan# 802.1Q VLAN support device tun # Packet tunnel. device pty # BSD-style compatibility pseudo ttys device md # Memory disks Modified: stable/8/sys/sparc64/conf/GENERIC == --- stable/8/sys/sparc64/conf/GENERIC Tue Jan 12 01:30:05 2010 (r202133) +++ stable/8/sys/sparc64/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) @@ -207,6 +207,7 @@ device ath_rate_sample # SampleRate tx device loop# Network loopback device random # Entropy device device ether # Ethernet support +device vlan# 802.1Q VLAN support device tun
svn commit: r202135 - in stable/7/sys: amd64/conf i386/conf ia64/conf pc98/conf powerpc/conf sparc64/conf sun4v/conf
Author: brooks Date: Tue Jan 12 06:04:32 2010 New Revision: 202135 URL: http://svn.freebsd.org/changeset/base/202135 Log: MFC r201443: Add vlan(4) to all GENERIC kernels. Modified: stable/7/sys/amd64/conf/GENERIC stable/7/sys/i386/conf/GENERIC stable/7/sys/ia64/conf/GENERIC stable/7/sys/pc98/conf/GENERIC stable/7/sys/powerpc/conf/GENERIC stable/7/sys/sparc64/conf/GENERIC stable/7/sys/sun4v/conf/GENERIC Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/amd64/conf/GENERIC == --- stable/7/sys/amd64/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) +++ stable/7/sys/amd64/conf/GENERIC Tue Jan 12 06:04:32 2010 (r202135) @@ -254,6 +254,7 @@ device wi # WaveLAN/Intersil/Symbol 80 device loop# Network loopback device random # Entropy device device ether # Ethernet support +device vlan# 802.1Q VLAN support device sl # Kernel SLIP device ppp # Kernel PPP device tun # Packet tunnel. Modified: stable/7/sys/i386/conf/GENERIC == --- stable/7/sys/i386/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) +++ stable/7/sys/i386/conf/GENERIC Tue Jan 12 06:04:32 2010 (r202135) @@ -268,6 +268,7 @@ device wi # WaveLAN/Intersil/Symbol 80 device loop# Network loopback device random # Entropy device device ether # Ethernet support +device vlan# 802.1Q VLAN support device sl # Kernel SLIP device ppp # Kernel PPP device tun # Packet tunnel. Modified: stable/7/sys/ia64/conf/GENERIC == --- stable/7/sys/ia64/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) +++ stable/7/sys/ia64/conf/GENERIC Tue Jan 12 06:04:32 2010 (r202135) @@ -143,6 +143,7 @@ device sbp # SCSI over FireWire (need # Various (pseudo) devices device ether # Ethernet support +device vlan# 802.1Q VLAN support device faith # IPv6-to-IPv4 relaying (translation) device gif # IPv6 and IPv4 tunneling device loop# Network loopback Modified: stable/7/sys/pc98/conf/GENERIC == --- stable/7/sys/pc98/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) +++ stable/7/sys/pc98/conf/GENERIC Tue Jan 12 06:04:32 2010 (r202135) @@ -222,6 +222,7 @@ device xe # Xircom pccard Ethernet device loop# Network loopback device random # Entropy device device ether # Ethernet support +device vlan# 802.1Q VLAN support device sl # Kernel SLIP device ppp # Kernel PPP device tun # Packet tunnel. Modified: stable/7/sys/powerpc/conf/GENERIC == --- stable/7/sys/powerpc/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) +++ stable/7/sys/powerpc/conf/GENERIC Tue Jan 12 06:04:32 2010 (r202135) @@ -107,6 +107,7 @@ device fxp # Intel EtherExpress PRO/10 device loop# Network loopback device random # Entropy device device ether # Ethernet support +device vlan# 802.1Q VLAN support device sl # Kernel SLIP device ppp # Kernel PPP device tun # Packet tunnel. Modified: stable/7/sys/sparc64/conf/GENERIC == --- stable/7/sys/sparc64/conf/GENERIC Tue Jan 12 06:00:56 2010 (r202134) +++ stable/7/sys/sparc64/conf/GENERIC Tue Jan 12 06:04:32 2010 (r202135) @@ -201,6 +201,7 @@ device ath_rate_sample # SampleRate tx device loop# Network loopback device random # Entropy device device ether # Ethernet support +device vlan# 802.1Q VLAN support device sl # Kernel SLIP device ppp # Kernel PPP device tun # Packet tunnel. Modified: stable/7/sys/sun4v/conf/GENERIC
svn commit: r202136 - stable/8/sys/kern
Author: brooks Date: Tue Jan 12 06:09:56 2010 New Revision: 202136 URL: http://svn.freebsd.org/changeset/base/202136 Log: MFC r201953: Correct the explination text for the kern.ngroups. It reflects the number of supplemental groups, not the total number of groups. Modified: stable/8/sys/kern/kern_mib.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/kern/kern_mib.c == --- stable/8/sys/kern/kern_mib.cTue Jan 12 06:04:32 2010 (r202135) +++ stable/8/sys/kern/kern_mib.cTue Jan 12 06:09:56 2010 (r202136) @@ -125,7 +125,8 @@ SYSCTL_INT(_kern, KERN_POSIX1, posix1ver 0, _POSIX_VERSION, Version of POSIX attempting to comply to); SYSCTL_INT(_kern, KERN_NGROUPS, ngroups, CTLFLAG_RD, -0, NGROUPS_MAX, Maximum number of groups a user can belong to); +0, NGROUPS_MAX, +Maximum number of supplemental groups a user can belong to); SYSCTL_INT(_kern, KERN_JOB_CONTROL, job_control, CTLFLAG_RD, 0, 1, Whether job control is available); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202137 - stable/8/sys/fs/procfs
Author: brooks Date: Tue Jan 12 06:11:36 2010 New Revision: 202137 URL: http://svn.freebsd.org/changeset/base/202137 Log: MFC r201954: Update the comment on printing group membership to reflect that fact that each group the process is a member of is printed rather than an entry for each group the user could be a member of. Modified: stable/8/sys/fs/procfs/procfs_status.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/fs/procfs/procfs_status.c == --- stable/8/sys/fs/procfs/procfs_status.c Tue Jan 12 06:09:56 2010 (r202136) +++ stable/8/sys/fs/procfs/procfs_status.c Tue Jan 12 06:11:36 2010 (r202137) @@ -82,7 +82,7 @@ procfs_doprocstatus(PFS_FILL_ARGS) sid = sess-s_leader ? sess-s_leader-p_pid : 0; /* comm pid ppid pgid sid tty ctty,sldr start ut st wmsg - euid ruid rgid,egid,groups[1 .. NGROUPS] + euid ruid rgid,egid,groups[1 .. ngroups] */ pc = p-p_comm; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202138 - stable/8/sys/sys
Author: brooks Date: Tue Jan 12 06:14:24 2010 New Revision: 202138 URL: http://svn.freebsd.org/changeset/base/202138 Log: MFC r201955: Improve the comment about CMGROUP_MAX. Modified: stable/8/sys/sys/socket.h Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/sys/socket.h == --- stable/8/sys/sys/socket.h Tue Jan 12 06:11:36 2010(r202137) +++ stable/8/sys/sys/socket.h Tue Jan 12 06:14:24 2010(r202138) @@ -483,8 +483,8 @@ struct cmsghdr { #if __BSD_VISIBLE /* * While we may have more groups than this, the cmsgcred struct must - * be able to fit in an mbuf, and NGROUPS_MAX is too large to allow - * this. + * be able to fit in an mbuf and we have historically supported a + * maximum of 16 groups. */ #define CMGROUP_MAX 16 ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202140 - stable/8/crypto/heimdal/kcm
Author: brooks Date: Tue Jan 12 07:33:33 2010 New Revision: 202140 URL: http://svn.freebsd.org/changeset/base/202140 Log: MFC r201444: The size of credential messages is limited by CMGROUP_MAX rather than NGROUPS. Modified: stable/8/crypto/heimdal/kcm/connect.c Directory Properties: stable/8/crypto/heimdal/ (props changed) Modified: stable/8/crypto/heimdal/kcm/connect.c == --- stable/8/crypto/heimdal/kcm/connect.c Tue Jan 12 07:02:54 2010 (r202139) +++ stable/8/crypto/heimdal/kcm/connect.c Tue Jan 12 07:33:33 2010 (r202140) @@ -149,7 +149,7 @@ update_client_creds(int s, kcm_client *p struct sockcred *sc; memset(msg, 0, sizeof(msg)); - crmsgsize = CMSG_SPACE(SOCKCREDSIZE(NGROUPS)); + crmsgsize = CMSG_SPACE(SOCKCREDSIZE(CMGROUP_MAX)); if (crmsgsize == 0) return 1 ; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r202143 - in head/sys: boot/forth compat/linux compat/svr4 i386/ibcs2 kern rpc security/audit sys
Author: brooks Date: Tue Jan 12 07:49:34 2010 New Revision: 202143 URL: http://svn.freebsd.org/changeset/base/202143 Log: Replace the static NGROUPS=NGROUPS_MAX+1=1024 with a dynamic kern.ngroups+1. kern.ngroups can range from NGROUPS_MAX=1023 to INT_MAX-1. Given that the Windows group limit is 1024, this range should be sufficient for most applications. MFC after:1 month Modified: head/sys/boot/forth/loader.conf head/sys/compat/linux/linux_misc.c head/sys/compat/linux/linux_uid16.c head/sys/compat/svr4/svr4_misc.c head/sys/i386/ibcs2/ibcs2_misc.c head/sys/kern/kern_mib.c head/sys/kern/kern_prot.c head/sys/kern/subr_param.c head/sys/rpc/authunix_prot.c head/sys/security/audit/audit_arg.c head/sys/sys/systm.h Modified: head/sys/boot/forth/loader.conf == --- head/sys/boot/forth/loader.conf Tue Jan 12 07:40:58 2010 (r202142) +++ head/sys/boot/forth/loader.conf Tue Jan 12 07:49:34 2010 (r202143) @@ -101,6 +101,7 @@ module_path=/boot/modules # Set the mo #kern.maxusers=32# Set size of various static tables #kern.nbuf= # Set the number of buffer headers #kern.ncallout= # Set the maximum # of timer events +#kern.ngroups=1023 # Set the maximum # of supplemental groups #kern.sgrowsiz= # Set the amount to grow stack #kern.cam.scsi_delay=2000# Delay (in ms) before probing SCSI #kern.ipc.maxsockets=# Set the maximum number of sockets avaliable Modified: head/sys/compat/linux/linux_misc.c == --- head/sys/compat/linux/linux_misc.c Tue Jan 12 07:40:58 2010 (r202142) +++ head/sys/compat/linux/linux_misc.c Tue Jan 12 07:49:34 2010 (r202143) @@ -1138,7 +1138,7 @@ linux_setgroups(struct thread *td, struc struct proc *p; ngrp = args-gidsetsize; - if (ngrp 0 || ngrp = NGROUPS) + if (ngrp 0 || ngrp ngroups_max) return (EINVAL); linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_TEMP, M_WAITOK); error = copyin(args-grouplist, linux_gidset, ngrp * sizeof(l_gid_t)); Modified: head/sys/compat/linux/linux_uid16.c == --- head/sys/compat/linux/linux_uid16.c Tue Jan 12 07:40:58 2010 (r202142) +++ head/sys/compat/linux/linux_uid16.c Tue Jan 12 07:49:34 2010 (r202143) @@ -109,7 +109,7 @@ linux_setgroups16(struct thread *td, str #endif ngrp = args-gidsetsize; - if (ngrp 0 || ngrp = NGROUPS) + if (ngrp 0 || ngrp ngroups_max) return (EINVAL); linux_gidset = malloc(ngrp * sizeof(*linux_gidset), M_TEMP, M_WAITOK); error = copyin(args-gidset, linux_gidset, ngrp * sizeof(l_gid16_t)); Modified: head/sys/compat/svr4/svr4_misc.c == --- head/sys/compat/svr4/svr4_misc.cTue Jan 12 07:40:58 2010 (r202142) +++ head/sys/compat/svr4/svr4_misc.cTue Jan 12 07:49:34 2010 (r202143) @@ -708,7 +708,7 @@ svr4_sys_sysconfig(td, uap) switch (uap-name) { case SVR4_CONFIG_NGROUPS: - *retval = NGROUPS_MAX; + *retval = ngroups_max; break; case SVR4_CONFIG_CHILD_MAX: *retval = maxproc; Modified: head/sys/i386/ibcs2/ibcs2_misc.c == --- head/sys/i386/ibcs2/ibcs2_misc.cTue Jan 12 07:40:58 2010 (r202142) +++ head/sys/i386/ibcs2/ibcs2_misc.cTue Jan 12 07:49:34 2010 (r202143) @@ -665,7 +665,7 @@ ibcs2_getgroups(td, uap) if (uap-gidsetsize 0) return (EINVAL); - ngrp = MIN(uap-gidsetsize, NGROUPS); + ngrp = MIN(uap-gidsetsize, ngroups_max + 1); gp = malloc(ngrp * sizeof(*gp), M_TEMP, M_WAITOK); error = kern_getgroups(td, ngrp, gp); if (error) @@ -693,7 +693,7 @@ ibcs2_setgroups(td, uap) gid_t *gp; int error, i; - if (uap-gidsetsize 0 || uap-gidsetsize NGROUPS) + if (uap-gidsetsize 0 || uap-gidsetsize ngroups_max + 1) return (EINVAL); if (uap-gidsetsize uap-gidset == NULL) return (EINVAL); Modified: head/sys/kern/kern_mib.c == --- head/sys/kern/kern_mib.cTue Jan 12 07:40:58 2010(r202142) +++ head/sys/kern/kern_mib.cTue Jan 12 07:49:34 2010(r202143) @@ -125,7 +125,7 @@ SYSCTL_INT(_kern, KERN_POSIX1, posix1ver 0, _POSIX_VERSION, Version of POSIX attempting to comply to); SYSCTL_INT(_kern, KERN_NGROUPS, ngroups, CTLFLAG_RD, -0, NGROUPS_MAX, +ngroups_max, 0, Maximum number of supplemental groups a user