svn commit: r265214 - head/crypto/openssh
Author: des Date: Fri May 2 07:04:35 2014 New Revision: 265214 URL: http://svnweb.freebsd.org/changeset/base/265214 Log: The mergeinfo was somehow left out of previous commit. Modified: Directory Properties: head/crypto/openssh/ (props changed) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r265215 - in head/sys: amd64/conf boot/forth conf i386/conf pc98/conf sys
Author: eadler Date: Fri May 2 07:14:22 2014 New Revision: 265215 URL: http://svnweb.freebsd.org/changeset/base/265215 Log: lindev(4): finish the partial commit in r265212 lindev(4) was only used to provide /dev/full which is now a standard feature of FreeBSD. /dev/full was never linux-specific and provides a generally useful feature. Document this in UPDATING and bump __FreeBSD_version. This will be documented in the PH shortly. Reported by: jkim Modified: head/sys/amd64/conf/NOTES head/sys/boot/forth/loader.conf head/sys/conf/files.amd64 head/sys/conf/files.i386 head/sys/i386/conf/NOTES head/sys/pc98/conf/NOTES head/sys/sys/param.h Modified: head/sys/amd64/conf/NOTES == --- head/sys/amd64/conf/NOTES Fri May 2 07:04:35 2014(r265214) +++ head/sys/amd64/conf/NOTES Fri May 2 07:14:22 2014(r265215) @@ -647,8 +647,5 @@ options VM_KMEM_SIZE_SCALE optionsNDISAPI device ndis -# Linux-specific pseudo devices support -device lindev - # Module to enable execution of application via emulators like QEMU options IMAGACT_BINMISC Modified: head/sys/boot/forth/loader.conf == --- head/sys/boot/forth/loader.conf Fri May 2 07:04:35 2014 (r265214) +++ head/sys/boot/forth/loader.conf Fri May 2 07:14:22 2014 (r265215) @@ -241,7 +241,6 @@ screensave_name="green_saver" # Set to t ibcs2_load="NO"# IBCS2 (SCO) emulation ibcs2_coff_load="NO" linux_load="NO"# Linux emulation -lindev_load="NO" # Linux-specific pseudo devices (see lindev(4)) svr4_load="NO" # SystemV R4 emulation streams_load="NO" # System V streams module Modified: head/sys/conf/files.amd64 == --- head/sys/conf/files.amd64 Fri May 2 07:04:35 2014(r265214) +++ head/sys/conf/files.amd64 Fri May 2 07:14:22 2014(r265215) @@ -232,8 +232,6 @@ dev/hyperv/vmbus/hv_hv.c optionalhyp dev/hyperv/vmbus/hv_ring_buffer.c optionalhyperv dev/hyperv/vmbus/hv_vmbus_drv_freebsd.coptional hyperv dev/kbd/kbd.c optionalatkbd | sc | ukbd | vt -dev/lindev/full.c optionallindev -dev/lindev/lindev.coptionallindev dev/nfe/if_nfe.c optionalnfe pci dev/ntb/if_ntb/if_ntb.coptionalif_ntb dev/ntb/ntb_hw/ntb_hw.coptionalif_ntb ntb_hw Modified: head/sys/conf/files.i386 == --- head/sys/conf/files.i386Fri May 2 07:04:35 2014(r265214) +++ head/sys/conf/files.i386Fri May 2 07:14:22 2014(r265215) @@ -240,8 +240,6 @@ dev/ipmi/ipmi_pci.c optional ipmi pci dev/ipmi/ipmi_linux.c optional ipmi compat_linux dev/kbd/kbd.c optional atkbd | sc | ukbd | vt dev/le/if_le_isa.c optional le isa -dev/lindev/full.c optional lindev -dev/lindev/lindev.coptional lindev dev/mse/mse.c optional mse dev/mse/mse_isa.c optional mse isa dev/nfe/if_nfe.c optional nfe pci Modified: head/sys/i386/conf/NOTES == --- head/sys/i386/conf/NOTESFri May 2 07:04:35 2014(r265214) +++ head/sys/i386/conf/NOTESFri May 2 07:14:22 2014(r265215) @@ -1002,9 +1002,6 @@ devicestreams # STREAMS network drive optionsNDISAPI device ndis -# Linux-specific pseudo devices support -device lindev - # # VM OPTIONS Modified: head/sys/pc98/conf/NOTES == --- head/sys/pc98/conf/NOTESFri May 2 07:04:35 2014(r265214) +++ head/sys/pc98/conf/NOTESFri May 2 07:14:22 2014(r265215) @@ -545,9 +545,6 @@ options COMPAT_SVR4 # build emulator st optionsDEBUG_SVR4 # enable verbose debugging device streams # STREAMS network driver (required for svr4). -# Linux-specific pseudo devices support -device lindev - # # VM OPTIONS Modified: head/sys/sys/param.h == --- head/sys/sys/param.hFri May 2 07:04:35 2014(r265214) +++ head/sys/sys/param.hFri May 2 07:14:22 2014(r265215) @@ -58,7 +58,7 @@ *
svn commit: r265216 - in head/sys: kern sys
Author: rwatson Date: Fri May 2 07:57:40 2014 New Revision: 265216 URL: http://svnweb.freebsd.org/changeset/base/265216 Log: Garbage collect mtxpool_lockbuilder, the mutex pool historically used for lockmgr and sx interlocks, but unused since optimised versions of those sleep locks were introduced. This will save a (quite) small amount of memory in all kernel configurations. The sleep mutex pool is retained as it is used for 'struct bio' and several other consumers. Discussed with: jhb MFC after:3 days Modified: head/sys/kern/kern_mtxpool.c head/sys/sys/kernel.h head/sys/sys/mutex.h Modified: head/sys/kern/kern_mtxpool.c == --- head/sys/kern/kern_mtxpool.cFri May 2 07:14:22 2014 (r265215) +++ head/sys/kern/kern_mtxpool.cFri May 2 07:57:40 2014 (r265216) @@ -59,9 +59,6 @@ __FBSDID("$FreeBSD$"); static MALLOC_DEFINE(M_MTXPOOL, "mtx_pool", "mutex pool"); /* Pool sizes must be a power of two */ -#ifndef MTX_POOL_LOCKBUILDER_SIZE -#define MTX_POOL_LOCKBUILDER_SIZE 128 -#endif #ifndef MTX_POOL_SLEEP_SIZE #define MTX_POOL_SLEEP_SIZE128 #endif @@ -78,18 +75,12 @@ struct mtx_pool { struct mtx mtx_pool_ary[1]; }; -static struct mtx_pool_lockbuilder { - struct mtxpool_header mtx_pool_header; - struct mtx mtx_pool_ary[MTX_POOL_LOCKBUILDER_SIZE]; -} lockbuilder_pool; - #define mtx_pool_size mtx_pool_header.mtxpool_size #define mtx_pool_mask mtx_pool_header.mtxpool_mask #define mtx_pool_shift mtx_pool_header.mtxpool_shift #define mtx_pool_next mtx_pool_header.mtxpool_next struct mtx_pool *mtxpool_sleep; -struct mtx_pool *mtxpool_lockbuilder; #if UINTPTR_MAX == UINT64_MAX /* 64 bits */ # define POINTER_BITS 64 @@ -166,15 +157,6 @@ mtx_pool_destroy(struct mtx_pool **poolp } static void -mtx_pool_setup_static(void *dummy __unused) -{ - mtx_pool_initialize((struct mtx_pool *)&lockbuilder_pool, - "lockbuilder mtxpool", MTX_POOL_LOCKBUILDER_SIZE, - MTX_DEF | MTX_NOWITNESS | MTX_QUIET); - mtxpool_lockbuilder = (struct mtx_pool *)&lockbuilder_pool; -} - -static void mtx_pool_setup_dynamic(void *dummy __unused) { mtxpool_sleep = mtx_pool_create("sleep mtxpool", @@ -202,17 +184,5 @@ mtx_pool_alloc(struct mtx_pool *pool) return (&pool->mtx_pool_ary[i]); } -/* - * The lockbuilder pool must be initialized early because the lockmgr - * and sx locks depend on it. The sx locks are used in the kernel - * memory allocator. The lockmgr subsystem is initialized by - * SYSINIT(..., SI_SUB_LOCKMGR, ...). - * - * We can't call malloc() to dynamically allocate the sleep pool - * until after kmeminit() has been called, which is done by - * SYSINIT(..., SI_SUB_KMEM, ...). - */ -SYSINIT(mtxpooli1, SI_SUB_MTX_POOL_STATIC, SI_ORDER_FIRST, -mtx_pool_setup_static, NULL); SYSINIT(mtxpooli2, SI_SUB_MTX_POOL_DYNAMIC, SI_ORDER_FIRST, mtx_pool_setup_dynamic, NULL); Modified: head/sys/sys/kernel.h == --- head/sys/sys/kernel.h Fri May 2 07:14:22 2014(r265215) +++ head/sys/sys/kernel.h Fri May 2 07:57:40 2014(r265216) @@ -92,7 +92,6 @@ enum sysinit_sub_id { SI_SUB_COPYRIGHT= 0x081,/* first use of console*/ SI_SUB_SETTINGS = 0x088,/* check and recheck settings */ SI_SUB_MTX_POOL_STATIC = 0x090,/* static mutex pool */ - SI_SUB_LOCKMGR = 0x098,/* lockmgr locks */ SI_SUB_VM = 0x100,/* virtual memory system init*/ SI_SUB_KMEM = 0x180,/* kernel memory*/ SI_SUB_KVM_RSRC = 0x1A0,/* kvm operational limits*/ Modified: head/sys/sys/mutex.h == --- head/sys/sys/mutex.hFri May 2 07:14:22 2014(r265215) +++ head/sys/sys/mutex.hFri May 2 07:57:40 2014(r265216) @@ -323,12 +323,8 @@ struct mtx *mtx_pool_alloc(struct mtx_po mtx_unlock_spin(mtx_pool_find((pool), (ptr))) /* - * mtxpool_lockbuilder is a pool of sleep locks that is not witness - * checked and should only be used for building higher level locks. - * * mtxpool_sleep is a general purpose pool of sleep mutexes. */ -extern struct mtx_pool *mtxpool_lockbuilder; extern struct mtx_pool *mtxpool_sleep; #ifndef LOCK_DEBUG ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r265132 - in head: share/man/man4 sys/dev/null
On Thu, 1 May 2014, Eitan Adler wrote: On 1 May 2014 09:59, Jung-uk Kim wrote: On 2014-04-30 15:38:18 -0400, ?? wrote: On 2014-04-30 02:20:48 -0400, ?? wrote: Mail clients keep getting worse. Fitst the apostrophes were corrupted, now the names... Author: eadler Date: Wed Apr 30 06:20:48 2014 New Revision: 265132 URL: http://svnweb.freebsd.org/changeset/base/265132 Log: Add a /dev/full device. /dev/full is similar to /dev/zero except it always returns ENOSPC when you attempt to write to it. Reviewed by: jhibbits Discussed with:rpaulo ... Please see lindev(4). I guess I wasn't loud enough. We already had the exact same feature via lindev(4). In fact, now it panics if we load both, i.e., "make_dev_credv: bad si_name (error=17, si_name=full)". Please see sys/dev/lindev/full.c. Also, the manual page is still symlinked from lindev.4. Thanks for letting me know about lindev(4). I've brought up /dev/full to a few people and no one else mentioned it. Since /dev/full is not linux specific and code/binary size addition is minor I've opted to just remove lindev and leave my implementation. It seems reasonable to have it unconditional, since it is so small when it is not a separate module. Please merge any better style from lindev to null.c. I only noticed a couple of remaining style bugs in the new code in null.c. There are a few more in old code in null.c. lindev has about the same density of style bugs: full.c: % /* ARGSUSED */ The __unused annotations are ugly enough. lint has been unusable for a long time. % static int % full_read(struct cdev *dev __unused, struct uio *uio, int flags __unused) % { % int error = 0; Initialization in declaration. % % while (uio->uio_resid > 0 && error == 0) % error = uiomove(zbuf, MIN(uio->uio_resid, PAGE_SIZE), uio); Use of the MIN() macro. MIN() was removed from the kernel in 4.4BSD, but was restored in FreeBSD to allow broken code that uses it to work. The min() family of inline functions is supposed to be used in 4.4BSD and later. It is still used a lot. However, it is broken as designed since it is type-specific and thus is especially hard to use with typedefed types like typeof(uio->uio_resid). MIN() has smaller design errors. The correct API is a type-generic version of min(). Unfortunately, the good name min() is already used (it means take the minimum of u_int values). % Extra blank line. % return (error); % } % % /* ARGSUSED */ As above. % static int % full_write(struct cdev *dev __unused, struct uio *uio __unused, % int flags __unused) % { % This blank line is not extra, but is perfectly ugly to style(9) spec. % return (ENOSPC); % } % % /* ARGSUSED */ % int % lindev_modevent_full(module_t mod __unused, int type, void *data __unused) % { % % switch(type) { % case MOD_LOAD: % zbuf = (void *)malloc(PAGE_SIZE, M_TEMP, M_WAITOK | M_ZERO); Bogus cast. Has no effect. This is not C++. % full_dev = make_dev(&full_cdevsw, 0, UID_ROOT, GID_WHEEL, % 0666, "full"); % if (bootverbose) % printf("full: \n"); I don't like hiding this under bootverbose. 1 line per device is not much spam. % break; % I don't like the style of an extra blank line for each case in a switch. This style is normal in the kernel, but is not permitted by style(9) (because the example in style(9) doesn't use it). Fully ugly versions of this style put the extra blank line before each case statement. This switch statement is missing the extra blank line before the first case statement. null.c does this inconsistently. It uses the extra blank line for the switch statement in null_modevent(), but not for any other switch statement in the file. indent(1) has no chance of preserving such differences. % case MOD_UNLOAD: % destroy_dev(full_dev); % free(zbuf, M_TEMP); % break; % % case MOD_SHUTDOWN: % break; % % default: % return (EOPNOTSUPP); % } % Extra blank line. % return (0); % } lindev.c: % ... % /* % * "lindev" is supposed to be a collection of linux-specific devices % * that we also support, just not by default. % * While currently there is only "/dev/full", we are planning to see % * more in the future. % * This file is only the container to load/unload all supported devices; % * the implementation of each should go into its own file. % */ There is only dev/full in lindev now. I don't like having lots of little files supporting 1 feature each or 1 feature across 3 files. After removing lindev/full.c but not all of lindev, the 2 remaining files support 0 features. Removing all of lindev would break adding more features, if any. % /* ARGSUSED */ % static int % lindev_modevent(module_t mod, int type, void *data) Here there is useless lint markup, but no useful compiler markup (__unused).
Re: svn commit: r265191 - head/sys/dev/gpio
On Thu, 1 May 2014, Luiz Otavio O Souza wrote: Log: Remove unnecessary headers. Sort out the headers. Add a missing header on ofw_gpiobus.c (it was working because of sys/libkern.h). Do you use /usr/src/tools/tools/kerninclude/kerninclude.sh to find the unused includes? There are many false positives and negatives which are hard to find without a lot of testing. kerninclude.sh automates some of the testing. I think it is rarely used and has rotted. A full universe build is probably required, but kerninclude.sh is i386-centric and only tests LINT, GENERIC and GENERIC98 (GENERIC98 last existed in the source tree in FreeBSD-3, but the script creates it by copying GENERIC and building with pc98 options). I prefer my unusedinc script. It is easier to run 1 on file at a time, but does less hacking to reduce the false positives and negatives. Modified: head/sys/dev/gpio/gpiobus.c == --- head/sys/dev/gpio/gpiobus.c Thu May 1 14:08:19 2014(r265190) +++ head/sys/dev/gpio/gpiobus.c Thu May 1 14:09:47 2014(r265191) @@ -28,21 +28,16 @@ __FBSDID("$FreeBSD$"); #include -#include This unsorts the includes. must be included after , and should be always included, since other headers may depend on it (for things like KASSERT() in inline functions). Some broken headers include it nested. This makes it difficult to tell whether it is used. Some other headers that don't do this may compile accidentally because they are included after the polluted ones. +#include +#include +#include #include #include -#include -#include is probably used. It is included nested in many headers, and this is not considered pollution, unlike for , but it makes it very hard to determine if is included as needed in other headers and .c files. kerninclude.sh attempts to determine if headers like are needed by doing things like replacing it by an empty header in some contexts. I suspect this doesn't handle the full complications. Ideally, the include of in a .c file should be explicit iff the .c files uses any queue macro. -#include +#include #include is certainly not needed. It is standard pollution in , and it is a style bug to not depend on that. It is also usually a style bug (in kernel code) to include and not include . Many things depend on the standard pollution, or might be changed to depend on it. Modified: head/sys/dev/gpio/ofw_gpiobus.c == --- head/sys/dev/gpio/ofw_gpiobus.c Thu May 1 14:08:19 2014 (r265190) +++ head/sys/dev/gpio/ofw_gpiobus.c Thu May 1 14:09:47 2014 (r265191) @@ -33,17 +33,13 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include Correct. is standard pollution in , and it is a style bug to include it directly. -#include #include -#include +#include Not using mutexes may indicate missing locking. I think this works because almost everything in new-bus is Giant-locked and Giant locking hides its own details very well. Elsewhere, there are lots of polluting nested includes of and (not even of and which make it very unclear whether explicit includes of these are needed. The worst cases are in , , , , and . Only some of these are relatively easy to fix by including in the headers. Bruce ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r265217 - in head/sys/modules: . lindev
Author: brueffer Date: Fri May 2 09:24:06 2014 New Revision: 265217 URL: http://svnweb.freebsd.org/changeset/base/265217 Log: libdev(4) has been removed, get rid of the module as well to fix the build. Submitted by: Sainath Varanasi Deleted: head/sys/modules/lindev/ Modified: head/sys/modules/Makefile Modified: head/sys/modules/Makefile == --- head/sys/modules/Makefile Fri May 2 07:57:40 2014(r265216) +++ head/sys/modules/Makefile Fri May 2 09:24:06 2014(r265217) @@ -186,7 +186,6 @@ SUBDIR= \ libiconv \ libmbpool \ libmchain \ - ${_lindev} \ ${_linprocfs} \ ${_linsysfs} \ ${_linux} \ @@ -514,7 +513,6 @@ _io=io .if ${MK_OFED} != "no" || defined(ALL_MODULES) _ipoib= ipoib .endif -_lindev= lindev _linprocfs=linprocfs _linsysfs= linsysfs _linux=linux @@ -716,7 +714,6 @@ _iwnfw= iwnfw .endif _ixgb= ixgb _ixgbe=ixgbe -_lindev= lindev _linprocfs=linprocfs _linsysfs= linsysfs _linux=linux ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r265218 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: smh Date: Fri May 2 09:31:21 2014 New Revision: 265218 URL: http://svnweb.freebsd.org/changeset/base/265218 Log: Removed pointless / duplicated call to trim_map_first. MFC after:1 month X-MFC-With: r265152 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Fri May 2 09:24:06 2014(r265217) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/trim_map.c Fri May 2 09:31:21 2014(r265218) @@ -490,7 +490,6 @@ trim_map_vdev_commit(spa_t *spa, zio_t * zio_nowait(zio_trim(zio, spa, vd, offset, size)); mutex_enter(&tm->tm_lock); - ts = trim_map_first(tm, txgtarget, txgsafe, timelimit); } mutex_exit(&tm->tm_lock); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r265225 - in head: sys/conf tools/kerneldoc/subsys
Author: brueffer Date: Fri May 2 11:09:01 2014 New Revision: 265225 URL: http://svnweb.freebsd.org/changeset/base/265225 Log: Clean up more lindev(4) vestiges. Deleted: head/tools/kerneldoc/subsys/Doxyfile-dev_lindev Modified: head/sys/conf/files.pc98 Modified: head/sys/conf/files.pc98 == --- head/sys/conf/files.pc98Fri May 2 10:48:26 2014(r265224) +++ head/sys/conf/files.pc98Fri May 2 11:09:01 2014(r265225) @@ -110,8 +110,6 @@ dev/hwpmc/hwpmc_x86.c optional hwpmc dev/io/iodev.c optional io dev/kbd/kbd.c optional pckbd | sc | ukbd dev/le/if_le_cbus.coptional le isa -dev/lindev/full.c optional lindev -dev/lindev/lindev.coptional lindev dev/mse/mse.c optional mse dev/mse/mse_cbus.c optional mse isa dev/sbni/if_sbni.c optional sbni ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r265229 - head/bin/ps
Author: bdrewery Date: Fri May 2 15:05:47 2014 New Revision: 265229 URL: http://svnweb.freebsd.org/changeset/base/265229 Log: Add -J to filter by matching jail IDs and names. -J 0 can be used to show only host processes. Patch partially based on work by bz@ PR: bin/78763 MFC after:2 weeks Relnotes: yes Modified: head/bin/ps/Makefile head/bin/ps/ps.1 head/bin/ps/ps.c Modified: head/bin/ps/Makefile == --- head/bin/ps/MakefileFri May 2 14:47:53 2014(r265228) +++ head/bin/ps/MakefileFri May 2 15:05:47 2014(r265229) @@ -11,7 +11,7 @@ SRCS= fmt.c keyword.c nlist.c print.c ps # on large systems. # CFLAGS+=-DLAZY_PS -DPADD= ${LIBM} ${LIBKVM} -LDADD= -lm -lkvm +DPADD= ${LIBM} ${LIBKVM} ${LIBJAIL} +LDADD= -lm -lkvm -ljail .include Modified: head/bin/ps/ps.1 == --- head/bin/ps/ps.1Fri May 2 14:47:53 2014(r265228) +++ head/bin/ps/ps.1Fri May 2 15:05:47 2014(r265229) @@ -29,7 +29,7 @@ .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 .\" $FreeBSD$ .\" -.Dd December 27, 2013 +.Dd May 2, 2014 .Dt PS 1 .Os .Sh NAME @@ -40,6 +40,7 @@ .Op Fl aCcdefHhjlmrSTuvwXxZ .Op Fl O Ar fmt | Fl o Ar fmt .Op Fl G Ar gid Ns Op , Ns Ar gid Ns Ar ... +.Op Fl J Ar jid Ns Op , Ns Ar jid Ns Ar ... .Op Fl M Ar core .Op Fl N Ar system .Op Fl p Ar pid Ns Op , Ns Ar pid Ns Ar ... @@ -62,7 +63,7 @@ will also display processes that do not .Pp A different set of processes can be selected for display by using any combination of the -.Fl a , G , p , T , t , +.Fl a , G , J , p , T , t , and .Fl U options. @@ -152,6 +153,20 @@ Print information associated with the fo .Cm user , pid , ppid , pgid , sid , jobc , state , tt , time , and .Cm command . +.It Fl J +Display information about processes which match the specified jail IDs. +This may be either the +.Cm jid +or +.Cm name +of the jail. +Use +.Fl J +.Sy 0 +to display only host processes. +This flag implies +.Fl x +by default. .It Fl L List the set of keywords available for the .Fl O Modified: head/bin/ps/ps.c == --- head/bin/ps/ps.cFri May 2 14:47:53 2014(r265228) +++ head/bin/ps/ps.cFri May 2 15:05:47 2014(r265229) @@ -50,6 +50,7 @@ static char sccsid[] = "@(#)ps.c 8.4 (Be __FBSDID("$FreeBSD$"); #include +#include #include #include #include @@ -62,6 +63,7 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include #include #include #include @@ -124,6 +126,7 @@ struct listinfo { const char *lname; union { gid_t *gids; + int *jids; pid_t *pids; dev_t *ttys; uid_t *uids; @@ -132,6 +135,7 @@ struct listinfo { }; static int addelem_gid(struct listinfo *, const char *); +static int addelem_jid(struct listinfo *, const char *); static int addelem_pid(struct listinfo *, const char *); static int addelem_tty(struct listinfo *, const char *); static int addelem_uid(struct listinfo *, const char *); @@ -163,12 +167,12 @@ static char vfmt[] = "pid,state,time,sl, "%cpu,%mem,command"; static char Zfmt[] = "label"; -#definePS_ARGS "AaCcde" OPT_LAZY_f "G:gHhjLlM:mN:O:o:p:rSTt:U:uvwXxZ" +#definePS_ARGS "AaCcde" OPT_LAZY_f "G:gHhjJ:LlM:mN:O:o:p:rSTt:U:uvwXxZ" int main(int argc, char *argv[]) { - struct listinfo gidlist, pgrplist, pidlist; + struct listinfo gidlist, jidlist, pgrplist, pidlist; struct listinfo ruidlist, sesslist, ttylist, uidlist; struct kinfo_proc *kp; KINFO *kinfo = NULL, *next_KINFO; @@ -208,6 +212,7 @@ main(int argc, char *argv[]) prtheader = showthreads = wflag = xkeep_implied = 0; xkeep = -1; /* Neither -x nor -X. */ init_list(&gidlist, addelem_gid, sizeof(gid_t), "group"); + init_list(&jidlist, addelem_jid, sizeof(int), "jail id"); init_list(&pgrplist, addelem_pid, sizeof(pid_t), "process group"); init_list(&pidlist, addelem_pid, sizeof(pid_t), "process id"); init_list(&ruidlist, addelem_uid, sizeof(uid_t), "ruser"); @@ -275,6 +280,11 @@ main(int argc, char *argv[]) case 'h': prtheader = ws.ws_row > 5 ? ws.ws_row : 22; break; + case 'J': + add_list(&jidlist, optarg); + xkeep_implied = 1; + nselectors++; + break; case 'j': parsefmt(jfmt, 0); _fmt = 1; @@ -538,6 +548,11 @@ main(int argc, char *argv[]) if (kp->ki_rgid ==
svn commit: r265230 - head/share/man/man5
Author: gjb Date: Fri May 2 15:52:50 2014 New Revision: 265230 URL: http://svnweb.freebsd.org/changeset/base/265230 Log: Clarify that MAKEOBJDIRPREFIX and MAKEOBJDIR are not honored as make(1) arguments. Requested by: smh MFC After:3 days Sponsored by: The FreeBSD Foundation Modified: head/share/man/man5/make.conf.5 Modified: head/share/man/man5/make.conf.5 == --- head/share/man/man5/make.conf.5 Fri May 2 15:05:47 2014 (r265229) +++ head/share/man/man5/make.conf.5 Fri May 2 15:52:50 2014 (r265230) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd May 28, 2013 +.Dd May 2, 2014 .Dt MAKE.CONF 5 .Os .Sh NAME @@ -692,6 +692,8 @@ and .Ev MAKEOBJDIR are environment variables and should not be set in .Nm +or as command line arguments to +.Xr make 1 , but in make's environment. .Sh BUGS This manual page may occasionally be out of date with respect to ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r265231 - head/contrib/gcc/config/i386
Author: pfg Date: Fri May 2 16:15:34 2014 New Revision: 265231 URL: http://svnweb.freebsd.org/changeset/base/265231 Log: gcc: fix strict alignment. From the OpenBSD log: x86-64 ABI requires arrays greater than 16 bytes to be aligned to 16byte boundary. However, GCC 16-byte aligns arrays of >=16 BITS, not BYTES. This diff improves bug detectability for code which has local arrays of [16 .. 127] bits: in those cases SSP will now detect even 1-byte overflows. Obtained from:OpenBSD (CVS rev 1.4) MFC after:1 week Modified: head/contrib/gcc/config/i386/i386.c Modified: head/contrib/gcc/config/i386/i386.c == --- head/contrib/gcc/config/i386/i386.c Fri May 2 15:52:50 2014 (r265230) +++ head/contrib/gcc/config/i386/i386.c Fri May 2 16:15:34 2014 (r265231) @@ -14408,7 +14408,7 @@ ix86_local_alignment (tree type, int ali if (AGGREGATE_TYPE_P (type) && TYPE_SIZE (type) && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST - && (TREE_INT_CST_LOW (TYPE_SIZE (type)) >= 16 + && (TREE_INT_CST_LOW (TYPE_SIZE (type)) >= 128 || TREE_INT_CST_HIGH (TYPE_SIZE (type))) && align < 128) return 128; } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r265232 - head/sys/net
Author: asomers Date: Fri May 2 16:24:09 2014 New Revision: 265232 URL: http://svnweb.freebsd.org/changeset/base/265232 Log: Fix a panic caused by doing "ifconfig -am" while a lagg is being destroyed. The thread that is destroying the lagg has already set sc->sc_psc=NULL when the "ifconfig -am" thread gets to lacp_req(). It tries to dereference sc->sc_psc and panics. The solution is for lacp_req() to check the value of sc->sc_psc. If NULL, harmlessly return an lacp_opreq structure full of zeros. Full details in GNATS. PR: kern/189003 Reviewed by: timeout on freebsd-net@ MFC after:3 weeks Sponsored by: Spectra Logic Corporation Modified: head/sys/net/ieee8023ad_lacp.c Modified: head/sys/net/ieee8023ad_lacp.c == --- head/sys/net/ieee8023ad_lacp.c Fri May 2 16:15:34 2014 (r265231) +++ head/sys/net/ieee8023ad_lacp.c Fri May 2 16:24:09 2014 (r265232) @@ -590,10 +590,20 @@ lacp_req(struct lagg_softc *sc, caddr_t { struct lacp_opreq *req = (struct lacp_opreq *)data; struct lacp_softc *lsc = LACP_SOFTC(sc); - struct lacp_aggregator *la = lsc->lsc_active_aggregator; + struct lacp_aggregator *la; - LACP_LOCK(lsc); bzero(req, sizeof(struct lacp_opreq)); + + /* +* If the LACP softc is NULL, return with the opreq structure full of +* zeros. It is normal for the softc to be NULL while the lagg is +* being destroyed. +*/ + if (NULL == lsc) + return; + + la = lsc->lsc_active_aggregator; + LACP_LOCK(lsc); if (la != NULL) { req->actor_prio = ntohs(la->la_actor.lip_systemid.lsi_prio); memcpy(&req->actor_mac, &la->la_actor.lip_systemid.lsi_mac, ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r265231 - head/contrib/gcc/config/i386
On 05/02/14 11:15, Pedro F. Giffuni wrote: Author: pfg Date: Fri May 2 16:15:34 2014 New Revision: 265231 URL: http://svnweb.freebsd.org/changeset/base/265231 Log: gcc: fix strict alignment. From the OpenBSD log: x86-64 ABI requires arrays greater than 16 bytes to be aligned to 16byte boundary. However, GCC 16-byte aligns arrays of >=16 BITS, not BYTES. This diff improves bug detectability for code which has local arrays of [16 .. 127] bits: in those cases SSP will now detect even 1-byte overflows. Obtained from: OpenBSD (CVS rev 1.4) MFC after: 1 week I only plan to merge this to 10/stable since I am not really using 9/stable and I don't like running "risks" before a release. The fix looks interesting though so feel free to try to convince me if you have tested it :). Pedro. Modified: head/contrib/gcc/config/i386/i386.c Modified: head/contrib/gcc/config/i386/i386.c == --- head/contrib/gcc/config/i386/i386.c Fri May 2 15:52:50 2014 (r265230) +++ head/contrib/gcc/config/i386/i386.c Fri May 2 16:15:34 2014 (r265231) @@ -14408,7 +14408,7 @@ ix86_local_alignment (tree type, int ali if (AGGREGATE_TYPE_P (type) && TYPE_SIZE (type) && TREE_CODE (TYPE_SIZE (type)) == INTEGER_CST - && (TREE_INT_CST_LOW (TYPE_SIZE (type)) >= 16 + && (TREE_INT_CST_LOW (TYPE_SIZE (type)) >= 128 || TREE_INT_CST_HIGH (TYPE_SIZE (type))) && align < 128) return 128; } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r265232 - head/sys/net
On 02.05.2014 20:24, Alan Somers wrote: Author: asomers Date: Fri May 2 16:24:09 2014 New Revision: 265232 URL: http://svnweb.freebsd.org/changeset/base/265232 Log: Fix a panic caused by doing "ifconfig -am" while a lagg is being destroyed. The thread that is destroying the lagg has already set sc->sc_psc=NULL when the "ifconfig -am" thread gets to lacp_req(). It tries to dereference sc->sc_psc and panics. The solution is for lacp_req() to check the value of sc->sc_psc. If NULL, harmlessly return an lacp_opreq structure full of zeros. Full details in GNATS. Sorry, it looks like I've missed -net@ discussion. While this patch minimizes panics, they still can occur. If one thread performs lagg_clone_destroy() -> lagg_lacp_detach() (1) -> lacp_detach(), executing struct lacp_softc *lsc = LACP_SOFTC(sc); (e.g. one line before sc_psc = NULL assignment) At the same moment, another thread (initiated by ifconfig) executes struct lacp_softc *lsc = LACP_SOFTC(sc); Then, thread #1 goes further to LACP_LOCK_DESTROY(lsc); free(lsc, M_DEVBUF); After that, thread #2 performs bzero(req, sizeof(struct lacp_opreq)); passes lsc check for NULL and crashes on destroyed mutex. Briefly looking, we can remove WUNLOCK() before lacp_detach() in lagg_lacp_detach() (I'm unsure about the reasons why do we need unlock here). lacp_req() is already protected by at least LAGG_RLOCK() so we should get consistent view of sc->sc_psc. PR: kern/189003 Reviewed by: timeout on freebsd-net@ MFC after: 3 weeks Sponsored by:Spectra Logic Corporation Modified: head/sys/net/ieee8023ad_lacp.c Modified: head/sys/net/ieee8023ad_lacp.c == --- head/sys/net/ieee8023ad_lacp.c Fri May 2 16:15:34 2014 (r265231) +++ head/sys/net/ieee8023ad_lacp.c Fri May 2 16:24:09 2014 (r265232) @@ -590,10 +590,20 @@ lacp_req(struct lagg_softc *sc, caddr_t { struct lacp_opreq *req = (struct lacp_opreq *)data; struct lacp_softc *lsc = LACP_SOFTC(sc); - struct lacp_aggregator *la = lsc->lsc_active_aggregator; + struct lacp_aggregator *la; - LACP_LOCK(lsc); bzero(req, sizeof(struct lacp_opreq)); + + /* +* If the LACP softc is NULL, return with the opreq structure full of +* zeros. It is normal for the softc to be NULL while the lagg is +* being destroyed. +*/ + if (NULL == lsc) + return; + + la = lsc->lsc_active_aggregator; + LACP_LOCK(lsc); if (la != NULL) { req->actor_prio = ntohs(la->la_actor.lip_systemid.lsi_prio); memcpy(&req->actor_mac, &la->la_actor.lip_systemid.lsi_mac, ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r255672 - in head/sys: amd64/linux32 compat/linux conf i386/linux kern modules/linux sys
On Wed, Sep 18, 2013 at 08:46:48PM +0200, Mateusz Guzik wrote: > On Wed, Sep 18, 2013 at 05:56:04PM +, Roman Divacky wrote: > > Author: rdivacky > > Date: Wed Sep 18 17:56:04 2013 > > New Revision: 255672 > > URL: http://svnweb.freebsd.org/changeset/base/255672 > > > > Log: > > Implement epoll support in Linuxulator. This is a tiny wrapper around > > kqueue > > to implement epoll subset of functionality. The kqueue user data are 32bit > > on i386 which is not enough for epoll user data so this patch overrides > > kqueue fileops to maintain enough space in struct file. > > > > Initial patch developed by me in 2007 and then extended and finished > > by Yuri Victorovich. > > > I'm strongly dislike a hacking kqueue file ops. I would prefer more generic mechanism. Maybe we need a emulator file ops in struct file, or a per proc list of such files. Any ideas? > First of all thank you both for doing this work. > > I have some important though (I didn't spend too much on this, so maybe > I missed some stuff or what I write here is incorrect). > > In general some lines are longer than 80 characters and simple stile > violations are present ("if (!error)"). > > > +/* Create a new epoll file descriptor. */ > > + > > +static int > > +linux_epoll_create_common(struct thread *td) > > +{ > > + struct file *fp; > > + int error; > > + > > + error = kern_kqueue_locked(td, &fp); > > +#if EPOLL_WIDE_USER_DATA > > + if (error == 0) { > > + epoll_init_user_data(td, fp); > > + fdrop(fp, td); > > + } > > +#endif > > + return (error); > > +} > > This leaks fd reference if EPOLL_WIDE_USER_DATA is not defined. > > > +int > > +linux_epoll_create1(struct thread *td, struct linux_epoll_create1_args > > *args) > > +{ > > + int error; > > + > > + error = linux_epoll_create_common(td); > > + > > + if (!error) { > > + if (args->flags & LINUX_EPOLL_CLOEXEC) > > + > > td->td_proc->p_fd->fd_ofiles[td->td_retval[0]].fde_flags |= UF_EXCLOSE; > > This is very racy for no good reason. This should be passed down to > kqueue and be set on fd creation. > > > + if (args->flags & LINUX_EPOLL_NONBLOCK) > > + linux_msg(td, "epoll_create1 doesn't yet support > > EPOLL_NONBLOCK flag\n"); > > + } > > + > > + return (error); > > +} > > + > > + > > +static void > > +epoll_init_user_data(struct thread *td, struct file *epfp) > > +{ > > + struct epoll_user_data *udv; > > + > > + /* override file ops to have our close operation */ > > + atomic_store_rel_ptr((volatile uintptr_t *)&epfp->f_ops, > > (uintptr_t)&epollops); > > + > > + /* allocate epoll_user_data initially for up to 16 file descriptor > > values */ > > + udv = malloc(EPOLL_USER_DATA_SIZE(EPOLL_USER_DATA_MARGIN), > > M_LINUX_EPOLL, M_WAITOK); > > + udv->sz = EPOLL_USER_DATA_MARGIN; > > + EPOLL_USER_DATA_SET(epfp, udv); > > +} > > Is not this racy? There is a window when fd is installed with epoll ops, > yet no userdata is allocated. > > > +/*ARGSUSED*/ > > +static int > > +epoll_close(struct file *epfp, struct thread *td) > > +{ > > + /* free user data vector */ > > + free(EPOLL_USER_DATA_GET(epfp), M_LINUX_EPOLL); > > + /* over to kqueue parent */ > > + return (kqueue_close(epfp, td)); > > +} > > +#endif > > Unnecessary comments. > > > + > > +static struct file* > > +epoll_fget(struct thread *td, int epfd) > > +{ > > + struct file *fp; > > + cap_rights_t rights; > > + > > + if (fget(td, epfd, cap_rights_init(&rights, CAP_POLL_EVENT), &fp) != 0) > > + panic("epoll: no file object found for kqueue descriptor"); > > + > > + return (fp); > > +} > > + > > Callers pass arbitrary fd here (provided by the user), yet this panics > if fd is bad. > > > int > > +kern_kqueue(struct thread *td) > > +{ > > + struct file *fp; > > + int error; > > + > > + error = kern_kqueue_locked(td, &fp); > > + > > Why is this _locked? Typically such naming is used when some locks are > held around the call. > > > + fdrop(fp, td); > > If there was an error, fdrop is called even though there is nothing to > fdrop. > > > + return (error); > > +} > > > -- > Mateusz Guzik -- Have fun! chd pgp4PKIssVjdZ.pgp Description: PGP signature
Re: svn commit: r255672 - in head/sys: amd64/linux32 compat/linux conf i386/linux kern modules/linux sys
Hi, why not just extend the kqueue data fields to 64 bits and leave the freebsd API only copy 32 bits in? -a On 18 September 2013 10:56, Roman Divacky wrote: > Author: rdivacky > Date: Wed Sep 18 17:56:04 2013 > New Revision: 255672 > URL: http://svnweb.freebsd.org/changeset/base/255672 > > Log: > Implement epoll support in Linuxulator. This is a tiny wrapper around kqueue > to implement epoll subset of functionality. The kqueue user data are 32bit > on i386 which is not enough for epoll user data so this patch overrides > kqueue fileops to maintain enough space in struct file. > > Initial patch developed by me in 2007 and then extended and finished > by Yuri Victorovich. > > Approved by:re (delphij) > Sponsored by: Google Summer of Code > Submitted by: Yuri Victorovich > Tested by: Yuri Victorovich > > Added: > head/sys/compat/linux/linux_epoll.c (contents, props changed) > head/sys/compat/linux/linux_epoll.h (contents, props changed) > Modified: > head/sys/amd64/linux32/linux32_dummy.c > head/sys/amd64/linux32/syscalls.master > head/sys/conf/files.amd64 > head/sys/conf/files.i386 > head/sys/conf/files.pc98 > head/sys/i386/linux/linux_dummy.c > head/sys/i386/linux/syscalls.master > head/sys/kern/kern_event.c > head/sys/modules/linux/Makefile > head/sys/sys/event.h > head/sys/sys/file.h > head/sys/sys/syscallsubr.h > > Modified: head/sys/amd64/linux32/linux32_dummy.c > == > --- head/sys/amd64/linux32/linux32_dummy.c Wed Sep 18 17:28:19 2013 > (r255671) > +++ head/sys/amd64/linux32/linux32_dummy.c Wed Sep 18 17:56:04 2013 > (r255672) > @@ -70,9 +70,6 @@ DUMMY(pivot_root); > DUMMY(mincore); > DUMMY(ptrace); > DUMMY(lookup_dcookie); > -DUMMY(epoll_create); > -DUMMY(epoll_ctl); > -DUMMY(epoll_wait); > DUMMY(remap_file_pages); > DUMMY(timer_create); > DUMMY(timer_settime); > @@ -129,7 +126,6 @@ DUMMY(timerfd_gettime); > /* linux 2.6.27: */ > DUMMY(signalfd4); > DUMMY(eventfd2); > -DUMMY(epoll_create1); > DUMMY(dup3); > DUMMY(inotify_init1); > /* linux 2.6.30: */ > > Modified: head/sys/amd64/linux32/syscalls.master > == > --- head/sys/amd64/linux32/syscalls.master Wed Sep 18 17:28:19 2013 > (r255671) > +++ head/sys/amd64/linux32/syscalls.master Wed Sep 18 17:56:04 2013 > (r255672) > @@ -430,9 +430,11 @@ > 251AUE_NULLUNIMPL > 252AUE_EXITSTD { int linux_exit_group(int error_code); } > 253AUE_NULLSTD { int linux_lookup_dcookie(void); } > -254AUE_NULLSTD { int linux_epoll_create(void); } > -255AUE_NULLSTD { int linux_epoll_ctl(void); } > -256AUE_NULLSTD { int linux_epoll_wait(void); } > +254AUE_NULLSTD { int linux_epoll_create(l_int size); } > +255AUE_NULLSTD { int linux_epoll_ctl(l_int epfd, l_int op, > l_int fd, \ > + struct linux_epoll_event *event); } > +256AUE_NULLSTD { int linux_epoll_wait(l_int epfd, struct > linux_epoll_event *events, \ > + l_int maxevents, l_int timeout); } > 257AUE_NULLSTD { int linux_remap_file_pages(void); } > 258AUE_NULLSTD { int linux_set_tid_address(int *tidptr); } > 259AUE_NULLSTD { int linux_timer_create(void); } > @@ -534,7 +536,7 @@ > ; linux 2.6.27: > 327AUE_NULLSTD { int linux_signalfd4(void); } > 328AUE_NULLSTD { int linux_eventfd2(void); } > -329AUE_NULLSTD { int linux_epoll_create1(void); } > +329AUE_NULLSTD { int linux_epoll_create1(l_int flags); } > 330AUE_NULLSTD { int linux_dup3(void); } > 331AUE_NULLSTD { int linux_pipe2(l_int *pipefds, l_int > flags); } > 332AUE_NULLSTD { int linux_inotify_init1(void); } > > Added: head/sys/compat/linux/linux_epoll.c > == > --- /dev/null 00:00:00 1970 (empty, because file is newly added) > +++ head/sys/compat/linux/linux_epoll.c Wed Sep 18 17:56:04 2013 > (r255672) > @@ -0,0 +1,554 @@ > +/*- > + * Copyright (c) 2007 Roman Divacky > + * All rights reserved. > + * > + * Redistribution and use in source and binary forms, with or without > + * modification, are permitted provided that the following conditions > + * are met: > + * 1. Redistributions of source code must retain the above copyright > + *notice, this list of conditions and the following disclaimer. > + * 2. Redistributions in binary form must reproduce the above copyright > + *notice, this list of conditions and the following disclaimer in the > + *documentation and/or other materials provided with the distributi
Re: svn commit: r255672 - in head/sys: amd64/linux32 compat/linux conf i386/linux kern modules/linux sys
On Fri, May 02, 2014 at 10:37:05PM +0400, Chagin Dmitry wrote: > On Wed, Sep 18, 2013 at 08:46:48PM +0200, Mateusz Guzik wrote: > > On Wed, Sep 18, 2013 at 05:56:04PM +, Roman Divacky wrote: > > > Author: rdivacky > > > Date: Wed Sep 18 17:56:04 2013 > > > New Revision: 255672 > > > URL: http://svnweb.freebsd.org/changeset/base/255672 > > > > > > Log: > > > Implement epoll support in Linuxulator. This is a tiny wrapper around > > > kqueue > > > to implement epoll subset of functionality. The kqueue user data are > > > 32bit > > > on i386 which is not enough for epoll user data so this patch overrides > > > kqueue fileops to maintain enough space in struct file. > > > > > > Initial patch developed by me in 2007 and then extended and finished > > > by Yuri Victorovich. > > > > > > > > I'm strongly dislike a hacking kqueue file ops. I would prefer more > generic mechanism. > > Maybe we need a emulator file ops in struct file, or a per proc list of > such files. Any ideas? > Not sure what you mean. I don't see any acceptable way around modifying kqueue. kqueue syscall will install fd with kqops in your table, but you don't want that. You want fd with epoll op. What's more, with epoll_create1 you want to be able to set O_CLOEXEC atomically. Thus, you need to either duplicate kqueue initialization code (but why?) or modify it so that it supports both interfaces, which to some extent was done in this patch. -- Mateusz Guzik ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r255672 - in head/sys: amd64/linux32 compat/linux conf i386/linux kern modules/linux sys
On Fri, May 02, 2014 at 11:49:29AM -0700, Adrian Chadd wrote: > Hi, > > why not just extend the kqueue data fields to 64 bits and leave the > freebsd API only copy 32 bits in? > > > well, this is the first that comes to mind. -- Have fun! chd pgp_Hn3rjWNPu.pgp Description: PGP signature
Re: svn commit: r265217 - in head/sys/modules: . lindev
On 2 May 2014 02:24, Christian Brueffer wrote: > Author: brueffer > Date: Fri May 2 09:24:06 2014 > New Revision: 265217 > URL: http://svnweb.freebsd.org/changeset/base/265217 > > Log: > libdev(4) has been removed, get rid of the module as well to fix the build. Thanks. My cleanup of lindev(4) was much too incomplete. :( -- Eitan Adler Source, Ports, Doc committer Bugmeister, Ports Security teams ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r265229 - head/bin/ps
On Fri, 2014-05-02 at 15:05 +, Bryan Drewery wrote: > Author: bdrewery > Date: Fri May 2 15:05:47 2014 > New Revision: 265229 > URL: http://svnweb.freebsd.org/changeset/base/265229 > > Log: > Add -J to filter by matching jail IDs and names. > > -J 0 can be used to show only host processes. > > Patch partially based on work by bz@ > > PR: bin/78763 > MFC after: 2 weeks > Relnotes: yes > > Modified: > head/bin/ps/Makefile > head/bin/ps/ps.1 > head/bin/ps/ps.c > > Modified: head/bin/ps/Makefile > == > --- head/bin/ps/Makefile Fri May 2 14:47:53 2014(r265228) > +++ head/bin/ps/Makefile Fri May 2 15:05:47 2014(r265229) > @@ -11,7 +11,7 @@ SRCS= fmt.c keyword.c nlist.c print.c ps > # on large systems. > # > CFLAGS+=-DLAZY_PS > -DPADD= ${LIBM} ${LIBKVM} > -LDADD= -lm -lkvm > +DPADD= ${LIBM} ${LIBKVM} ${LIBJAIL} > +LDADD= -lm -lkvm -ljail > > .include > > Modified: head/bin/ps/ps.1 > == > --- head/bin/ps/ps.1 Fri May 2 14:47:53 2014(r265228) > +++ head/bin/ps/ps.1 Fri May 2 15:05:47 2014(r265229) > @@ -29,7 +29,7 @@ > .\" @(#)ps.1 8.3 (Berkeley) 4/18/94 > .\" $FreeBSD$ > .\" > -.Dd December 27, 2013 > +.Dd May 2, 2014 > .Dt PS 1 > .Os > .Sh NAME > @@ -40,6 +40,7 @@ > .Op Fl aCcdefHhjlmrSTuvwXxZ > .Op Fl O Ar fmt | Fl o Ar fmt > .Op Fl G Ar gid Ns Op , Ns Ar gid Ns Ar ... > +.Op Fl J Ar jid Ns Op , Ns Ar jid Ns Ar ... > .Op Fl M Ar core > .Op Fl N Ar system > .Op Fl p Ar pid Ns Op , Ns Ar pid Ns Ar ... > @@ -62,7 +63,7 @@ will also display processes that do not > .Pp > A different set of processes can be selected for display by using any > combination of the > -.Fl a , G , p , T , t , > +.Fl a , G , J , p , T , t , > and > .Fl U > options. > @@ -152,6 +153,20 @@ Print information associated with the fo > .Cm user , pid , ppid , pgid , sid , jobc , state , tt , time , > and > .Cm command . > +.It Fl J > +Display information about processes which match the specified jail IDs. > +This may be either the > +.Cm jid > +or > +.Cm name > +of the jail. > +Use > +.Fl J > +.Sy 0 > +to display only host processes. > +This flag implies > +.Fl x > +by default. > .It Fl L > List the set of keywords available for the > .Fl O > > Modified: head/bin/ps/ps.c > == > --- head/bin/ps/ps.c Fri May 2 14:47:53 2014(r265228) > +++ head/bin/ps/ps.c Fri May 2 15:05:47 2014(r265229) > @@ -50,6 +50,7 @@ static char sccsid[] = "@(#)ps.c8.4 (Be > __FBSDID("$FreeBSD$"); > > #include > +#include > #include > #include > #include > @@ -62,6 +63,7 @@ __FBSDID("$FreeBSD$"); > #include > #include > #include > +#include > #include > #include > #include > @@ -124,6 +126,7 @@ struct listinfo { > const char *lname; > union { > gid_t *gids; > + int *jids; > pid_t *pids; > dev_t *ttys; > uid_t *uids; > @@ -132,6 +135,7 @@ struct listinfo { > }; > > static intaddelem_gid(struct listinfo *, const char *); > +static intaddelem_jid(struct listinfo *, const char *); > static intaddelem_pid(struct listinfo *, const char *); > static intaddelem_tty(struct listinfo *, const char *); > static intaddelem_uid(struct listinfo *, const char *); > @@ -163,12 +167,12 @@ static char vfmt[] = "pid,state,time,sl, > "%cpu,%mem,command"; > static char Zfmt[] = "label"; > > -#define PS_ARGS "AaCcde" OPT_LAZY_f "G:gHhjLlM:mN:O:o:p:rSTt:U:uvwXxZ" > +#define PS_ARGS "AaCcde" OPT_LAZY_f "G:gHhjJ:LlM:mN:O:o:p:rSTt:U:uvwXxZ" > > int > main(int argc, char *argv[]) > { > - struct listinfo gidlist, pgrplist, pidlist; > + struct listinfo gidlist, jidlist, pgrplist, pidlist; > struct listinfo ruidlist, sesslist, ttylist, uidlist; > struct kinfo_proc *kp; > KINFO *kinfo = NULL, *next_KINFO; > @@ -208,6 +212,7 @@ main(int argc, char *argv[]) > prtheader = showthreads = wflag = xkeep_implied = 0; > xkeep = -1; /* Neither -x nor -X. */ > init_list(&gidlist, addelem_gid, sizeof(gid_t), "group"); > + init_list(&jidlist, addelem_jid, sizeof(int), "jail id"); > init_list(&pgrplist, addelem_pid, sizeof(pid_t), "process group"); > init_list(&pidlist, addelem_pid, sizeof(pid_t), "process id"); > init_list(&ruidlist, addelem_uid, sizeof(uid_t), "ruser"); > @@ -275,6 +280,11 @@ main(int argc, char *argv[]) > case 'h': > prtheader = ws.ws_row > 5 ? ws.ws_row : 22; > break; > + case 'J': > + add_list(&jidlist, optarg); > +
Re: svn commit: r265229 - head/bin/ps
On 2014-05-02 15:19, Ian Lepore wrote: On Fri, 2014-05-02 at 15:05 +, Bryan Drewery wrote: Author: bdrewery Date: Fri May 2 15:05:47 2014 New Revision: 265229 URL: http://svnweb.freebsd.org/changeset/base/265229 Log: Add -J to filter by matching jail IDs and names. -J 0 can be used to show only host processes. Patch partially based on work by bz@ [...] I'm getting an error building rescue after this change: --- rescue.all__D --- ps.lo: In function `_$$hide$$ ps.lo $a': _$$hide$$ ps.lo ps.c:(.text+0x26ec): undefined reference to `jail_getid' *** [rescue] Error code 1 bmake[4]: stopped in /local/build/staging/freebsd/wand/obj/arm.armv6/local/build/staging/freebsd/wand/src/rescue/rescue 1 error This is on arm, building with gcc, but I'm not sure whether that's germane or not. -- Ian Yes, sorry about that. Testing a fix. I had made a bad assumption about rescue. I see now it doesn't work at all like I thought. That's what I get for not doing a full build. I did test on GCC though. -- Regards, Bryan Drewery ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r265232 - head/sys/net
On Fri, May 2, 2014 at 11:01 AM, Alexander V. Chernikov wrote: > On 02.05.2014 20:24, Alan Somers wrote: >> >> Author: asomers >> Date: Fri May 2 16:24:09 2014 >> New Revision: 265232 >> URL: http://svnweb.freebsd.org/changeset/base/265232 >> >> Log: >>Fix a panic caused by doing "ifconfig -am" while a lagg is being >> destroyed. >>The thread that is destroying the lagg has already set sc->sc_psc=NULL >> when >>the "ifconfig -am" thread gets to lacp_req(). It tries to dereference >>sc->sc_psc and panics. The solution is for lacp_req() to check the >> value of >>sc->sc_psc. If NULL, harmlessly return an lacp_opreq structure full of >>zeros. Full details in GNATS. > > Sorry, it looks like I've missed -net@ discussion. Thanks for the retroactive review; it's good too. > > While this patch minimizes panics, they still can occur. > If one thread performs lagg_clone_destroy() -> lagg_lacp_detach() (1) -> > lacp_detach(), executing > > struct lacp_softc *lsc = LACP_SOFTC(sc); (e.g. one line before sc_psc = NULL > assignment) > > At the same moment, another thread (initiated by ifconfig) executes > > > struct lacp_softc *lsc = LACP_SOFTC(sc); > > Then, thread #1 goes further to > > LACP_LOCK_DESTROY(lsc); > free(lsc, M_DEVBUF); > > After that, thread #2 performs > > bzero(req, sizeof(struct lacp_opreq)); > > passes lsc check for NULL and crashes on destroyed mutex. > > > Briefly looking, we can remove WUNLOCK() before lacp_detach() in > lagg_lacp_detach() (I'm unsure about the reasons why do we need unlock > here). > lacp_req() is already protected by at least LAGG_RLOCK() so we should get > consistent view of sc->sc_psc. The WUNLOCK was added in r168561 without comment. Removing it seems like it would work. It doesn't cause any new LORs or WITNESS warnings. And I can no longer reproduce the panic in lacp_req. However, it doesn't fix another panic in lagg_port_ioctl line 825 (my patch didn't either). Do you have any good ideas what to do about that? #9 0x808cee81 in __mtx_lock_sleep (c=0xf800052bb648, tid=18446735277704396800, opts=, file=, line=) at /usr/home/alans/freebsd/head/sys/kern/kern_mutex.c:430 #10 0x808ced02 in __mtx_lock_flags (c=, opts=0, file=0x80f6dd8c "/usr/home/alans/freebsd/head/sys/kern/kern_rmlock.c", line=407) at /usr/home/alans/freebsd/head/sys/kern/kern_mutex.c:223 #11 0x808e0032 in _rm_rlock (rm=0xf800052bb608, tracker=0xfe0097751918, trylock=) at /usr/home/alans/freebsd/head/sys/kern/kern_rmlock.c:407 #12 0x808e0812 in _rm_rlock_debug (rm=0xf800052bb608, tracker=0xfe0097751918, trylock=0, file=0x81c1dd13 "/usr/home/alans/freebsd/head/sys/modules/if_lagg/../../net/if_lagg.c", line=825) at /usr/home/alans/freebsd/head/sys/kern/kern_rmlock.c:659 #13 0x81c19f62 in lagg_port_ioctl (ifp=0xf8000590d800, cmd=, data=0xf80005582c00 "tap0") at /usr/home/alans/freebsd/head/sys/modules/if_lagg/../../net/if_lagg.c:825 #14 0x809ae407 in ifioctl (so=, cmd=3225971084, data=0xf80005582c00 "tap0", td=) at /usr/home/alans/freebsd/head/sys/net/if.c:2643 #15 0x8093b9fb in kern_ioctl (td=, fd=, com=) at file.h:323 #16 0x8093b77c in sys_ioctl (td=0xf800053cc000, uap=0xfe0097751b80) at /usr/home/alans/freebsd/head/sys/kern/sys_generic.c:702 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r265236 - in head: share/man/man4 sys/amd64/conf sys/conf sys/dev/mpr sys/dev/mpr/mpi sys/i386/conf sys/ia64/conf sys/mips/conf sys/modules sys/modules/mpr sys/sparc64/conf
Author: ken Date: Fri May 2 20:25:09 2014 New Revision: 265236 URL: http://svnweb.freebsd.org/changeset/base/265236 Log: Bring in the mpr(4) driver for LSI's MPT3 12Gb SAS controllers. This is derived from the mps(4) driver, but it supports only the 12Gb IT and IR hardware including the SAS 3004, SAS 3008 and SAS 3108. Some notes about this driver: o The 12Gb hardware can do "FastPath" I/O, and that capability is included in this driver. o WarpDrive functionality has been removed, since it isn't supported in the 12Gb driver interface. o The Scatter/Gather list handling code is significantly different between the 6Gb and 12Gb hardware. The 12Gb boards support IEEE Scatter/Gather lists. Thanks to LSI for developing and testing this driver for FreeBSD. share/man/man4/mpr.4: mpr(4) man page. sys/dev/mpr/*: mpr(4) driver files. sys/modules/Makefile, sys/modules/mpr/Makefile: Add a module Makefile for the mpr(4) driver. sys/conf/files: Add the mpr(4) driver. sys/amd64/conf/GENERIC, sys/i386/conf/GENERIC, sys/mips/conf/OCTEON1, sys/sparc64/conf/GENERIC: Add the mpr(4) driver to all config files that currently have the mps(4) driver. sys/ia64/conf/GENERIC: Add the mps(4) and mpr(4) drivers to the ia64 GENERIC config file. sys/i386/conf/XEN: Exclude the mpr module from building here. Submitted by: Steve McConnell MFC after:3 days Tested by:Chris Reeves Sponsored by: LSI, Spectra Logic Relnotes: LSI 12Gb SAS driver mpr(4) added Added: head/share/man/man4/mpr.4 (contents, props changed) head/sys/dev/mpr/ head/sys/dev/mpr/mpi/ head/sys/dev/mpr/mpi/mpi2.h (contents, props changed) head/sys/dev/mpr/mpi/mpi2_cnfg.h (contents, props changed) head/sys/dev/mpr/mpi/mpi2_hbd.h (contents, props changed) head/sys/dev/mpr/mpi/mpi2_history.txt (contents, props changed) head/sys/dev/mpr/mpi/mpi2_init.h (contents, props changed) head/sys/dev/mpr/mpi/mpi2_ioc.h (contents, props changed) head/sys/dev/mpr/mpi/mpi2_ra.h (contents, props changed) head/sys/dev/mpr/mpi/mpi2_raid.h (contents, props changed) head/sys/dev/mpr/mpi/mpi2_sas.h (contents, props changed) head/sys/dev/mpr/mpi/mpi2_targ.h (contents, props changed) head/sys/dev/mpr/mpi/mpi2_tool.h (contents, props changed) head/sys/dev/mpr/mpi/mpi2_type.h (contents, props changed) head/sys/dev/mpr/mpr.c (contents, props changed) head/sys/dev/mpr/mpr_config.c (contents, props changed) head/sys/dev/mpr/mpr_ioctl.h (contents, props changed) head/sys/dev/mpr/mpr_mapping.c (contents, props changed) head/sys/dev/mpr/mpr_mapping.h (contents, props changed) head/sys/dev/mpr/mpr_pci.c (contents, props changed) head/sys/dev/mpr/mpr_sas.c (contents, props changed) head/sys/dev/mpr/mpr_sas.h (contents, props changed) head/sys/dev/mpr/mpr_sas_lsi.c (contents, props changed) head/sys/dev/mpr/mpr_table.c (contents, props changed) head/sys/dev/mpr/mpr_table.h (contents, props changed) head/sys/dev/mpr/mpr_user.c (contents, props changed) head/sys/dev/mpr/mprvar.h (contents, props changed) head/sys/modules/mpr/ head/sys/modules/mpr/Makefile (contents, props changed) Modified: head/sys/amd64/conf/GENERIC head/sys/conf/files head/sys/i386/conf/GENERIC head/sys/i386/conf/XEN head/sys/ia64/conf/GENERIC head/sys/mips/conf/OCTEON1 head/sys/modules/Makefile head/sys/sparc64/conf/GENERIC Added: head/share/man/man4/mpr.4 == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/share/man/man4/mpr.4 Fri May 2 20:25:09 2014(r265236) @@ -0,0 +1,226 @@ +.\" +.\" Copyright (c) 2010 Spectra Logic Corporation +.\" Copyright (c) 2014 LSI Corp +.\" All rights reserved. +.\" +.\" Redistribution and use in source and binary forms, with or without +.\" modification, are permitted provided that the following conditions +.\" are met: +.\" 1. Redistributions of source code must retain the above copyright +.\"notice, this list of conditions, and the following disclaimer, +.\"without modification. +.\" 2. Redistributions in binary form must reproduce at minimum a disclaimer +.\"substantially similar to the "NO WARRANTY" disclaimer below +.\"("Disclaimer") and any redistribution must be conditioned upon +.\"including a substantially similar Disclaimer requirement for further +.\"binary redistribution. +.\" +.\" NO WARRANTY +.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +.\" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR +.\" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +.\" HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLAR
svn commit: r265237 - head/share/man/man4
Author: ken Date: Fri May 2 20:36:20 2014 New Revision: 265237 URL: http://svnweb.freebsd.org/changeset/base/265237 Log: Add the mpr(4) man page to the man4 Makefile. This should have been included in r265236. Submitted by: Steve McConnell MFC after:3 days Sponsored by: LSI, Spectra Logic Modified: head/share/man/man4/Makefile Modified: head/share/man/man4/Makefile == --- head/share/man/man4/MakefileFri May 2 20:25:09 2014 (r265236) +++ head/share/man/man4/MakefileFri May 2 20:36:20 2014 (r265237) @@ -262,6 +262,7 @@ MAN=aac.4 \ mod_cc.4 \ mos.4 \ mouse.4 \ + mpr.4 \ mps.4 \ mpt.4 \ msk.4 \ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r265238 - head/lib/libc/rpc
Author: brueffer Date: Fri May 2 20:41:09 2014 New Revision: 265238 URL: http://svnweb.freebsd.org/changeset/base/265238 Log: Properly free resources in case of error. CID: 1007032 Found with: Coverity Prevent(tm) MFC after:2 weeks Modified: head/lib/libc/rpc/clnt_vc.c Modified: head/lib/libc/rpc/clnt_vc.c == --- head/lib/libc/rpc/clnt_vc.c Fri May 2 20:36:20 2014(r265237) +++ head/lib/libc/rpc/clnt_vc.c Fri May 2 20:41:09 2014(r265238) @@ -301,15 +301,13 @@ clnt_vc_create(fd, raddr, prog, vers, se return (cl); err: - if (cl) { - if (ct) { - if (ct->ct_addr.len) - mem_free(ct->ct_addr.buf, ct->ct_addr.len); - mem_free(ct, sizeof (struct ct_data)); - } - if (cl) - mem_free(cl, sizeof (CLIENT)); + if (ct) { + if (ct->ct_addr.len) + mem_free(ct->ct_addr.buf, ct->ct_addr.len); + mem_free(ct, sizeof (struct ct_data)); } + if (cl) + mem_free(cl, sizeof (CLIENT)); return ((CLIENT *)NULL); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r265240 - head/sys/rpc
Author: brueffer Date: Fri May 2 20:45:55 2014 New Revision: 265240 URL: http://svnweb.freebsd.org/changeset/base/265240 Log: Properly free resources in case of error. CID: 1007032 Found with: Coverity Prevent(tm) MFC after:2 weeks Modified: head/sys/rpc/clnt_vc.c Modified: head/sys/rpc/clnt_vc.c == --- head/sys/rpc/clnt_vc.c Fri May 2 20:45:34 2014(r265239) +++ head/sys/rpc/clnt_vc.c Fri May 2 20:45:55 2014(r265240) @@ -270,14 +270,12 @@ clnt_vc_create( return (cl); err: - if (cl) { - if (ct) { - mtx_destroy(&ct->ct_lock); - mem_free(ct, sizeof (struct ct_data)); - } - if (cl) - mem_free(cl, sizeof (CLIENT)); + if (ct) { + mtx_destroy(&ct->ct_lock); + mem_free(ct, sizeof (struct ct_data)); } + if (cl) + mem_free(cl, sizeof (CLIENT)); return ((CLIENT *)NULL); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r265239 - head/rescue/rescue
Author: bdrewery Date: Fri May 2 20:45:34 2014 New Revision: 265239 URL: http://svnweb.freebsd.org/changeset/base/265239 Log: - Fix build WITHOUT_ZFS/WITHOUT_CDDL after r265229, bin/ps needs libjail. MFC after:2 weeks X-MFC-with: r265229 Modified: head/rescue/rescue/Makefile Modified: head/rescue/rescue/Makefile == --- head/rescue/rescue/Makefile Fri May 2 20:41:09 2014(r265238) +++ head/rescue/rescue/Makefile Fri May 2 20:45:34 2014(r265239) @@ -52,7 +52,7 @@ CRUNCH_SRCDIRS+= bin CRUNCH_PROGS_bin= cat chflags chio chmod cp date dd df echo\ ed expr getfacl hostname kenv kill ln ls mkdir mv \ pkill ps pwd realpath rm rmdir setfacl sh stty sync test -CRUNCH_LIBS+= -lcrypt -ledit -lkvm -ll -ltermcap -lutil +CRUNCH_LIBS+= -lcrypt -ledit -ljail -lkvm -ll -ltermcap -lutil CRUNCH_BUILDTOOLS+= bin/sh # Additional options for specific programs @@ -120,7 +120,7 @@ CRUNCH_PROGS_sbin+= zpool CRUNCH_LIBS+= -lalias -lcam -lcurses -ldevstat -lipsec .if ${MK_ZFS} != "no" -CRUNCH_LIBS+= -lavl -ljail -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem +CRUNCH_LIBS+= -lavl -lzfs_core -lzfs -lnvpair -lpthread -luutil -lumem .endif CRUNCH_LIBS+= -lgeom -lbsdxml -lkiconv -lmd -lsbuf -lufs -lz ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r265229 - head/bin/ps
On 2014-05-02 15:19, Ian Lepore wrote: On Fri, 2014-05-02 at 15:05 +, Bryan Drewery wrote: Author: bdrewery Date: Fri May 2 15:05:47 2014 New Revision: 265229 URL: http://svnweb.freebsd.org/changeset/base/265229 Log: Add -J to filter by matching jail IDs and names. [...] I'm getting an error building rescue after this change: --- rescue.all__D --- ps.lo: In function `_$$hide$$ ps.lo $a': _$$hide$$ ps.lo ps.c:(.text+0x26ec): undefined reference to `jail_getid' *** [rescue] Error code 1 bmake[4]: stopped in /local/build/staging/freebsd/wand/obj/arm.armv6/local/build/staging/freebsd/wand/src/rescue/rescue 1 error This is on arm, building with gcc, but I'm not sure whether that's germane or not. -- Ian Fixed in r265239. Was only if not building ZFS. -- Regards, Bryan Drewery ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r265229 - head/bin/ps
On Fri, 2014-05-02 at 15:46 -0500, Bryan Drewery wrote: > On 2014-05-02 15:19, Ian Lepore wrote: > > On Fri, 2014-05-02 at 15:05 +, Bryan Drewery wrote: > >> Author: bdrewery > >> Date: Fri May 2 15:05:47 2014 > >> New Revision: 265229 > >> URL: http://svnweb.freebsd.org/changeset/base/265229 > >> > >> Log: > >> Add -J to filter by matching jail IDs and names. > >> > [...] > > I'm getting an error building rescue after this change: > > > > --- rescue.all__D --- > > ps.lo: In function `_$$hide$$ ps.lo $a': > > _$$hide$$ ps.lo ps.c:(.text+0x26ec): undefined reference to > > `jail_getid' > > *** [rescue] Error code 1 > > > > bmake[4]: stopped > > in > > /local/build/staging/freebsd/wand/obj/arm.armv6/local/build/staging/freebsd/wand/src/rescue/rescue > > 1 error > > > > This is on arm, building with gcc, but I'm not sure whether that's > > germane or not. > > > > -- Ian > > Fixed in r265239. > > Was only if not building ZFS. > Oh. No wonder I was the first one to run into it, I'm building WITHOUT_CDDL (just to save time, because I never need that stuff). Thanks. -- Ian ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r265232 - head/sys/net
On 03.05.2014 00:22, Alan Somers wrote: > On Fri, May 2, 2014 at 11:01 AM, Alexander V. Chernikov > wrote: >> On 02.05.2014 20:24, Alan Somers wrote: >>> >>> Author: asomers >>> Date: Fri May 2 16:24:09 2014 >>> New Revision: 265232 >>> URL: http://svnweb.freebsd.org/changeset/base/265232 >>> >>> Log: >>>Fix a panic caused by doing "ifconfig -am" while a lagg is being >>> destroyed. >>>The thread that is destroying the lagg has already set sc->sc_psc=NULL >>> when >>>the "ifconfig -am" thread gets to lacp_req(). It tries to dereference >>>sc->sc_psc and panics. The solution is for lacp_req() to check the >>> value of >>>sc->sc_psc. If NULL, harmlessly return an lacp_opreq structure full of >>>zeros. Full details in GNATS. >> >> Sorry, it looks like I've missed -net@ discussion. > > Thanks for the retroactive review; it's good too. > >> >> While this patch minimizes panics, they still can occur. >> If one thread performs lagg_clone_destroy() -> lagg_lacp_detach() (1) -> >> lacp_detach(), executing >> >> struct lacp_softc *lsc = LACP_SOFTC(sc); (e.g. one line before sc_psc = NULL >> assignment) >> >> At the same moment, another thread (initiated by ifconfig) executes >> >> >> struct lacp_softc *lsc = LACP_SOFTC(sc); >> >> Then, thread #1 goes further to >> >> LACP_LOCK_DESTROY(lsc); >> free(lsc, M_DEVBUF); >> >> After that, thread #2 performs >> >> bzero(req, sizeof(struct lacp_opreq)); >> >> passes lsc check for NULL and crashes on destroyed mutex. >> >> >> Briefly looking, we can remove WUNLOCK() before lacp_detach() in >> lagg_lacp_detach() (I'm unsure about the reasons why do we need unlock >> here). >> lacp_req() is already protected by at least LAGG_RLOCK() so we should get >> consistent view of sc->sc_psc. > > The WUNLOCK was added in r168561 without comment. Removing it seems > like it would work. It doesn't cause any new LORs or WITNESS > warnings. And I can no longer reproduce the panic in lacp_req. > However, it doesn't fix another panic in lagg_port_ioctl line 825 (my > patch didn't either). Do you have any good ideas what to do about > that? Interesting. Line numbers look a bit shifted. Is line 825 'LAGG_RUNLOCK(sc, &tracker)' ? Are the steps to reproduce it the same as in kern/189003? > > #9 0x808cee81 in __mtx_lock_sleep (c=0xf800052bb648, > tid=18446735277704396800, opts=, > file=, line=) > at /usr/home/alans/freebsd/head/sys/kern/kern_mutex.c:430 > #10 0x808ced02 in __mtx_lock_flags (c=, opts=0, > file=0x80f6dd8c > "/usr/home/alans/freebsd/head/sys/kern/kern_rmlock.c", line=407) at > /usr/home/alans/freebsd/head/sys/kern/kern_mutex.c:223 > #11 0x808e0032 in _rm_rlock (rm=0xf800052bb608, > tracker=0xfe0097751918, trylock=) > at /usr/home/alans/freebsd/head/sys/kern/kern_rmlock.c:407 > #12 0x808e0812 in _rm_rlock_debug (rm=0xf800052bb608, > tracker=0xfe0097751918, trylock=0, > file=0x81c1dd13 > "/usr/home/alans/freebsd/head/sys/modules/if_lagg/../../net/if_lagg.c", > line=825) > at /usr/home/alans/freebsd/head/sys/kern/kern_rmlock.c:659 > #13 0x81c19f62 in lagg_port_ioctl (ifp=0xf8000590d800, > cmd=, data=0xf80005582c00 "tap0") > at > /usr/home/alans/freebsd/head/sys/modules/if_lagg/../../net/if_lagg.c:825 > #14 0x809ae407 in ifioctl (so=, cmd=3225971084, > data=0xf80005582c00 "tap0", td=) > at /usr/home/alans/freebsd/head/sys/net/if.c:2643 > #15 0x8093b9fb in kern_ioctl (td=, > fd=, com=) at file.h:323 > #16 0x8093b77c in sys_ioctl (td=0xf800053cc000, > uap=0xfe0097751b80) > at /usr/home/alans/freebsd/head/sys/kern/sys_generic.c:702 > ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r265241 - head/share/man/man4
Author: brueffer Date: Fri May 2 21:14:28 2014 New Revision: 265241 URL: http://svnweb.freebsd.org/changeset/base/265241 Log: Use our standard SYNOPSIS wording; perform some cleanup while here. Modified: head/share/man/man4/mpr.4 Modified: head/share/man/man4/mpr.4 == --- head/share/man/man4/mpr.4 Fri May 2 20:45:55 2014(r265240) +++ head/share/man/man4/mpr.4 Fri May 2 21:14:28 2014(r265241) @@ -36,7 +36,7 @@ .\" $Id$ .\" $FreeBSD$ .\" -.Dd Apr 28, 2014 +.Dd May 2, 2014 .Dt MPR 4 .Os .Sh NAME @@ -51,7 +51,8 @@ kernel configuration file: .Cd "device mpr" .Ed .Pp -Or, to load the driver as a module at boot, place the following line in +Alternatively, to load the driver as a +module at boot time, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent mpr_load="YES" @@ -156,7 +157,8 @@ control for all adapters by setting the hw.mpr.exclude_ids=Y .Ed .Pp -where Y is the target ID of the device. If more than one device is to be +where Y is the target ID of the device. +If more than one device is to be excluded, target ID's are separated by commas. .Pp Devices can be excluded from @@ -167,7 +169,8 @@ control for a specific adapter by settin dev.mpr.X.exclude_ids=Y .Ed .Pp -where X is the adapter number and Y is the target ID of the device. If more +where X is the adapter number and Y is the target ID of the device. +If more than one device is to be excluded, target ID's are separated by commas. .Sh DEBUGGING To enable debugging prints from the @@ -200,8 +203,8 @@ The following bits have the described ef .Xr cd 4 , .Xr ch 4 , .Xr da 4 , -.Xr mpt 4 , .Xr mps 4 , +.Xr mpt 4 , .Xr pci 4 , .Xr sa 4 , .Xr scsi 4 , ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r265242 - head/release/doc/en_US.ISO8859-1/hardware
Author: brueffer Date: Fri May 2 21:19:13 2014 New Revision: 265242 URL: http://svnweb.freebsd.org/changeset/base/265242 Log: Generate hardware notes for mpr(4) and bump copyright for 2014. Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml Modified: head/release/doc/en_US.ISO8859-1/hardware/article.xml == --- head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri May 2 21:14:28 2014(r265241) +++ head/release/doc/en_US.ISO8859-1/hardware/article.xml Fri May 2 21:19:13 2014(r265242) @@ -29,6 +29,7 @@ 2011 2012 2013 + 2014 mailto:d...@freebsd.org";>The &os; Documentation Project @@ -732,6 +733,8 @@ &hwlist.mly; + &hwlist.mpr; + &hwlist.mps; &hwlist.mpt; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r265232 - head/sys/net
On Fri, May 2, 2014 at 3:08 PM, Alexander V. Chernikov wrote: > On 03.05.2014 00:22, Alan Somers wrote: >> On Fri, May 2, 2014 at 11:01 AM, Alexander V. Chernikov >> wrote: >>> On 02.05.2014 20:24, Alan Somers wrote: Author: asomers Date: Fri May 2 16:24:09 2014 New Revision: 265232 URL: http://svnweb.freebsd.org/changeset/base/265232 Log: Fix a panic caused by doing "ifconfig -am" while a lagg is being destroyed. The thread that is destroying the lagg has already set sc->sc_psc=NULL when the "ifconfig -am" thread gets to lacp_req(). It tries to dereference sc->sc_psc and panics. The solution is for lacp_req() to check the value of sc->sc_psc. If NULL, harmlessly return an lacp_opreq structure full of zeros. Full details in GNATS. >>> >>> Sorry, it looks like I've missed -net@ discussion. >> >> Thanks for the retroactive review; it's good too. >> >>> >>> While this patch minimizes panics, they still can occur. >>> If one thread performs lagg_clone_destroy() -> lagg_lacp_detach() (1) -> >>> lacp_detach(), executing >>> >>> struct lacp_softc *lsc = LACP_SOFTC(sc); (e.g. one line before sc_psc = NULL >>> assignment) >>> >>> At the same moment, another thread (initiated by ifconfig) executes >>> >>> >>> struct lacp_softc *lsc = LACP_SOFTC(sc); >>> >>> Then, thread #1 goes further to >>> >>> LACP_LOCK_DESTROY(lsc); >>> free(lsc, M_DEVBUF); >>> >>> After that, thread #2 performs >>> >>> bzero(req, sizeof(struct lacp_opreq)); >>> >>> passes lsc check for NULL and crashes on destroyed mutex. >>> >>> >>> Briefly looking, we can remove WUNLOCK() before lacp_detach() in >>> lagg_lacp_detach() (I'm unsure about the reasons why do we need unlock >>> here). >>> lacp_req() is already protected by at least LAGG_RLOCK() so we should get >>> consistent view of sc->sc_psc. >> >> The WUNLOCK was added in r168561 without comment. Removing it seems >> like it would work. It doesn't cause any new LORs or WITNESS >> warnings. And I can no longer reproduce the panic in lacp_req. >> However, it doesn't fix another panic in lagg_port_ioctl line 825 (my >> patch didn't either). Do you have any good ideas what to do about >> that? > Interesting. > Line numbers look a bit shifted. Is line 825 'LAGG_RUNLOCK(sc, &tracker)' ? Yes. > > Are the steps to reproduce it the same as in kern/189003? Yes. BTW, In kern/189003, I suggested reverting 253687. In reality, I didn't revert it; I commented out the sysctl lines it added in lacp_attach(). > >> >> #9 0x808cee81 in __mtx_lock_sleep (c=0xf800052bb648, >> tid=18446735277704396800, opts=, >> file=, line=) >> at /usr/home/alans/freebsd/head/sys/kern/kern_mutex.c:430 >> #10 0x808ced02 in __mtx_lock_flags (c=, opts=0, >> file=0x80f6dd8c >> "/usr/home/alans/freebsd/head/sys/kern/kern_rmlock.c", line=407) at >> /usr/home/alans/freebsd/head/sys/kern/kern_mutex.c:223 >> #11 0x808e0032 in _rm_rlock (rm=0xf800052bb608, >> tracker=0xfe0097751918, trylock=) >> at /usr/home/alans/freebsd/head/sys/kern/kern_rmlock.c:407 >> #12 0x808e0812 in _rm_rlock_debug (rm=0xf800052bb608, >> tracker=0xfe0097751918, trylock=0, >> file=0x81c1dd13 >> "/usr/home/alans/freebsd/head/sys/modules/if_lagg/../../net/if_lagg.c", >> line=825) >> at /usr/home/alans/freebsd/head/sys/kern/kern_rmlock.c:659 >> #13 0x81c19f62 in lagg_port_ioctl (ifp=0xf8000590d800, >> cmd=, data=0xf80005582c00 "tap0") >> at >> /usr/home/alans/freebsd/head/sys/modules/if_lagg/../../net/if_lagg.c:825 >> #14 0x809ae407 in ifioctl (so=, cmd=3225971084, >> data=0xf80005582c00 "tap0", td=) >> at /usr/home/alans/freebsd/head/sys/net/if.c:2643 >> #15 0x8093b9fb in kern_ioctl (td=, >> fd=, com=) at file.h:323 >> #16 0x8093b77c in sys_ioctl (td=0xf800053cc000, >> uap=0xfe0097751b80) >> at /usr/home/alans/freebsd/head/sys/kern/sys_generic.c:702 >> > ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r265244 - head/sys/kern
Author: brueffer Date: Fri May 2 21:34:17 2014 New Revision: 265244 URL: http://svnweb.freebsd.org/changeset/base/265244 Log: Free resources in an error case. CID: 1018947 Found with: Coverity Prevent(tm) MFC after:1 week Modified: head/sys/kern/kern_cpu.c Modified: head/sys/kern/kern_cpu.c == --- head/sys/kern/kern_cpu.cFri May 2 21:30:59 2014(r265243) +++ head/sys/kern/kern_cpu.cFri May 2 21:34:17 2014(r265244) @@ -1037,6 +1037,7 @@ cpufreq_unregister(device_t dev) if (cf_dev == NULL) { device_printf(dev, "warning: cpufreq_unregister called with no cpufreq device active\n"); + free(devs, M_TEMP); return (0); } cfcount = 0; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r265245 - head/sys/sys
Author: mjg Date: Fri May 2 21:41:35 2014 New Revision: 265245 URL: http://svnweb.freebsd.org/changeset/base/265245 Log: Fix typo in KF_FD_TYPE_TRACE comment: ptrace -> ktrace Modified: head/sys/sys/user.h Modified: head/sys/sys/user.h == --- head/sys/sys/user.h Fri May 2 21:34:17 2014(r265244) +++ head/sys/sys/user.h Fri May 2 21:41:35 2014(r265245) @@ -271,7 +271,7 @@ struct user { #defineKF_FD_TYPE_CWD -1 /* Current working directory */ #defineKF_FD_TYPE_ROOT -2 /* Root directory */ #defineKF_FD_TYPE_JAIL -3 /* Jail directory */ -#defineKF_FD_TYPE_TRACE-4 /* ptrace vnode */ +#defineKF_FD_TYPE_TRACE-4 /* Ktrace vnode */ #defineKF_FD_TYPE_TEXT -5 /* Text vnode */ #defineKF_FD_TYPE_CTTY -6 /* Controlling terminal */ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r255672 - in head/sys: amd64/linux32 compat/linux conf i386/linux kern modules/linux sys
Well, have a chat with jmg and see if it can just be extended this way. Allocating another 8 bytes each time is a waste of memory bandwidth and allocator CPU cycles. :-) (Great work though! I'm glad this finally got shepharded into the tree!) -a On 2 May 2014 12:02, Chagin Dmitry wrote: > On Fri, May 02, 2014 at 11:49:29AM -0700, Adrian Chadd wrote: >> Hi, >> >> why not just extend the kqueue data fields to 64 bits and leave the >> freebsd API only copy 32 bits in? >> >> >> > > well, this is the first that comes to mind. > > > -- > Have fun! > chd ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r265247 - head/sys/kern
Author: mjg Date: Fri May 2 21:55:09 2014 New Revision: 265247 URL: http://svnweb.freebsd.org/changeset/base/265247 Log: Request a non-exiting process in sysctl_kern_proc_{o,}filedesc This fixes a race with exit1 freeing p_textvp. Suggested by: kib MFC after:1 week Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c == --- head/sys/kern/kern_descrip.cFri May 2 21:54:36 2014 (r265246) +++ head/sys/kern/kern_descrip.cFri May 2 21:55:09 2014 (r265247) @@ -3010,7 +3010,7 @@ sysctl_kern_proc_ofiledesc(SYSCTL_HANDLE struct tty *tp; name = (int *)arg1; - error = pget((pid_t)name[0], PGET_CANDEBUG, &p); + error = pget((pid_t)name[0], PGET_CANDEBUG | PGET_NOTWEXIT, &p); if (error != 0) return (error); fdp = fdhold(p); @@ -3503,7 +3503,7 @@ sysctl_kern_proc_filedesc(SYSCTL_HANDLER name = (int *)arg1; sbuf_new_for_sysctl(&sb, NULL, FILEDESC_SBUF_SIZE, req); - error = pget((pid_t)name[0], PGET_CANDEBUG, &p); + error = pget((pid_t)name[0], PGET_CANDEBUG | PGET_NOTWEXIT, &p); if (error != 0) { sbuf_delete(&sb); return (error); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r265248 - in head: sbin/gvinum sys/conf
Author: marius Date: Fri May 2 23:23:18 2014 New Revision: 265248 URL: http://svnweb.freebsd.org/changeset/base/265248 Log: Allow GEOM_VINUM to be statically compiled into the kernel. Submitted by: gleb MFC after:3 days Modified: head/sbin/gvinum/gvinum.c head/sbin/gvinum/gvinum.h head/sys/conf/NOTES head/sys/conf/files head/sys/conf/options Modified: head/sbin/gvinum/gvinum.c == --- head/sbin/gvinum/gvinum.c Fri May 2 21:55:09 2014(r265247) +++ head/sbin/gvinum/gvinum.c Fri May 2 23:23:18 2014(r265248) @@ -95,8 +95,10 @@ main(int argc, char **argv) char buffer[BUFSIZ], *inputline, *token[GV_MAXARGS]; /* Load the module if necessary. */ - if (kldfind(GVINUMMOD) < 0 && kldload(GVINUMMOD) < 0) - err(1, GVINUMMOD ": Kernel module not available"); + if (modfind(GVINUMMOD) < 0) { + if (kldload(GVINUMKLD) < 0 && modfind(GVINUMMOD) < 0) + err(1, GVINUMKLD ": Kernel module not available"); + } /* Arguments given on the command line. */ if (argc > 1) { @@ -1207,9 +1209,10 @@ gvinum_stop(int argc, char **argv) { int err, fileid; - fileid = kldfind(GVINUMMOD); + fileid = kldfind(GVINUMKLD); if (fileid == -1) { - warn("cannot find " GVINUMMOD); + if (modfind(GVINUMMOD) < 0) + warn("cannot find " GVINUMKLD); return; } @@ -1219,7 +1222,7 @@ gvinum_stop(int argc, char **argv) * event thread will be free for the g_wither_geom() call from * gv_unload(). It's silly, but it works. */ - printf("unloading " GVINUMMOD " kernel module... "); + printf("unloading " GVINUMKLD " kernel module... "); fflush(stdout); if ((err = kldunload(fileid)) != 0 && (errno == EAGAIN)) { sleep(1); @@ -1227,7 +1230,7 @@ gvinum_stop(int argc, char **argv) } if (err != 0) { printf(" failed!\n"); - warn("cannot unload " GVINUMMOD); + warn("cannot unload " GVINUMKLD); return; } Modified: head/sbin/gvinum/gvinum.h == --- head/sbin/gvinum/gvinum.h Fri May 2 21:55:09 2014(r265247) +++ head/sbin/gvinum/gvinum.h Fri May 2 23:23:18 2014(r265248) @@ -36,4 +36,5 @@ /* $FreeBSD$ */ -#define GVINUMMOD "geom_vinum" +#defineGVINUMMOD "g_vinum" +#defineGVINUMKLD "geom_vinum" Modified: head/sys/conf/NOTES == --- head/sys/conf/NOTES Fri May 2 21:55:09 2014(r265247) +++ head/sys/conf/NOTES Fri May 2 23:23:18 2014(r265248) @@ -176,6 +176,7 @@ options GEOM_SHSEC # Shared secret. optionsGEOM_STRIPE # Disk striping. optionsGEOM_SUNLABEL # Sun/Solaris partitioning optionsGEOM_UZIP # Read-only compressed disks +optionsGEOM_VINUM # Vinum logical volume manager optionsGEOM_VIRSTOR# Virtual storage. optionsGEOM_VOL# Volume names from UFS superblock optionsGEOM_ZERO # Performance testing helper. Modified: head/sys/conf/files == --- head/sys/conf/files Fri May 2 21:55:09 2014(r265247) +++ head/sys/conf/files Fri May 2 23:23:18 2014(r265248) @@ -2770,6 +2770,21 @@ contrib/xz-embedded/linux/lib/xz/xz_dec_ optional xz_embedded | geom_uncompress \ compile-with "${NORMAL_C} -I$S/contrib/xz-embedded/freebsd/ -I$S/contrib/xz-embedded/linux/lib/xz/ -I$S/contrib/xz-embedded/linux/include/linux/" geom/uzip/g_uzip.c optional geom_uzip +geom/vinum/geom_vinum.coptional geom_vinum +geom/vinum/geom_vinum_create.c optional geom_vinum +geom/vinum/geom_vinum_drive.c optional geom_vinum +geom/vinum/geom_vinum_plex.c optional geom_vinum +geom/vinum/geom_vinum_volume.c optional geom_vinum +geom/vinum/geom_vinum_subr.c optional geom_vinum +geom/vinum/geom_vinum_raid5.c optional geom_vinum +geom/vinum/geom_vinum_share.c optional geom_vinum +geom/vinum/geom_vinum_list.c optional geom_vinum +geom/vinum/geom_vinum_rm.c optional geom_vinum +geom/vinum/geom_vinum_init.c optional geom_vinum +geom/vinum/geom_vinum_state.c optional geom_vinum +geom/vinum/geom_vinum_rename.c optional geom_vinum +geom/vinum/geom_vinum_move.c optional geom_vinum +geom/vinum/geom_vinum_events.c optional geom_vinum geom/virstor/binstream.c optional geom_virstor geom/virstor/g_virstor.c optional geom_virstor geom/virstor/g_virstor_md.coptional geom_virstor Modified: head/sys/c
svn commit: r265249 - in head: contrib/top usr.bin/top
Author: bdrewery Date: Fri May 2 23:30:39 2014 New Revision: 265249 URL: http://svnweb.freebsd.org/changeset/base/265249 Log: Add -J command/flag to filter by jail name/jid. This will automatically display the JID as well (the -j command/flag). 0 displays host. + displays all. MFC after:2 weeks Relnotes: yes Modified: head/contrib/top/machine.h head/contrib/top/top.X head/contrib/top/top.c head/usr.bin/top/Makefile head/usr.bin/top/machine.c Modified: head/contrib/top/machine.h == --- head/contrib/top/machine.h Fri May 2 23:23:18 2014(r265248) +++ head/contrib/top/machine.h Fri May 2 23:30:39 2014(r265249) @@ -66,6 +66,7 @@ struct process_select int thread;/* show threads */ int uid; /* only this uid (unless uid == -1) */ int wcpu; /* show weighted cpu */ +int jid; /* only this jid (unless jid == -1) */ int jail; /* show jail ID */ int kidle; /* show per-CPU idle threads */ char *command; /* only this command (unless == NULL) */ Modified: head/contrib/top/top.X == --- head/contrib/top/top.X Fri May 2 23:23:18 2014(r265248) +++ head/contrib/top/top.X Fri May 2 23:30:39 2014(r265249) @@ -20,6 +20,8 @@ top \- display and update information ab ] [ .BI \-s time ] [ +.BI \-J jail +] [ .BI \-U username ] [ .I number @@ -171,6 +173,21 @@ values are \*(lqcpu\*(rq, \*(lqsize\*(rq but may vary on different operating systems. Note that not all operating systems support this option. .TP +.BI \-J jail +Show only those processes owned by +.IR jail . +This may be either the +.B jid +or +.B name +of the jail. +Use +.B 0 +to limit to host processes. +Using this option implies the +.B \-j +flag. +.PP .BI \-U username Show only those processes owned by .IR username . @@ -315,6 +332,12 @@ Toggle the display of .IR jail (8) ID. .TP +.B J +Display only processes owned by a specific jail (prompt for jail). +If the jail specified is simply \*(lq+\*(rq, then processes belonging +to all jails and the host will be displayed. +This will also enable the display of JID. +.TP .B P Toggle the display of per-CPU statistics. .TP Modified: head/contrib/top/top.c == --- head/contrib/top/top.c Fri May 2 23:23:18 2014(r265248) +++ head/contrib/top/top.c Fri May 2 23:30:39 2014(r265249) @@ -38,7 +38,9 @@ char *copyright = #include #include #include +#include #include +#include /* includes specific to top */ #include "display.h" /* interface to display package */ @@ -198,9 +200,9 @@ char *argv[]; fd_set readfds; #ifdef ORDER -static char command_chars[] = "\f qh?en#sdkriIutHmSCajzPo"; +static char command_chars[] = "\f qh?en#sdkriIutHmSCajzPJo"; #else -static char command_chars[] = "\f qh?en#sdkriIutHmSCajzP"; +static char command_chars[] = "\f qh?en#sdkriIutHmSCajzPJ"; #endif /* these defines enumerate the "strchr"s of the commands in command_chars */ #define CMD_redraw 0 @@ -228,8 +230,9 @@ char *argv[]; #defineCMD_jidtog 21 #define CMD_kidletog 22 #define CMD_pcputog23 +#define CMD_jail 24 #ifdef ORDER -#define CMD_order 24 +#define CMD_order 25 #endif /* set the buffer for stdout */ @@ -261,6 +264,7 @@ char *argv[]; ps.uid = -1; ps.thread = No; ps.wcpu= 1; +ps.jid = -1; ps.jail= No; ps.kidle = Yes; ps.command = NULL; @@ -288,7 +292,7 @@ char *argv[]; optind = 1; } - while ((i = getopt(ac, av, "CSIHPabijnquvzs:d:U:m:o:t")) != EOF) + while ((i = getopt(ac, av, "CSIHPabijJ:nquvzs:d:U:m:o:t")) != EOF) { switch(i) { @@ -413,6 +417,15 @@ char *argv[]; ps.jail = !ps.jail; break; + case 'J': /* display only jail's processes */ + if ((ps.jid = jail_getid(optarg)) == -1) + { + fprintf(stderr, "%s: unknown jail\n", optarg); + exit(1); + } + ps.jail = 1; + break; + case 'P': pcpu_stats = !pcpu_stats; break; @@ -425,7 +438,7 @@ char *argv[]; fprintf(stderr, "Top version %s\n" "Usage: %s [-abCHIijnPqStuvz] [-d count] [-m io | cpu] [-o field] [-s time]\n" -" [-U username] [number]\n", +" [-J jail] [-U username] [number]\n", version_string(), myname); exit(1); } @@ -1085,6 +1098,44 @@ restart: reset_display(); putchar('\r');
svn commit: r265250 - head/contrib/top
Author: bdrewery Date: Fri May 2 23:32:44 2014 New Revision: 265250 URL: http://svnweb.freebsd.org/changeset/base/265250 Log: - Add a hint for 'u' and 'J' command that '+' displays all. MFC after:2 weeks Modified: head/contrib/top/top.c Modified: head/contrib/top/top.c == --- head/contrib/top/top.c Fri May 2 23:30:39 2014(r265249) +++ head/contrib/top/top.c Fri May 2 23:32:44 2014(r265250) @@ -1007,7 +1007,7 @@ restart: case CMD_user: new_message(MT_standout, - "Username to show: "); + "Username to show (+ for all): "); if (readline(tempbuf2, sizeof(tempbuf2), No) > 0) { if (tempbuf2[0] == '+' && @@ -1101,7 +1101,7 @@ restart: case CMD_jail: new_message(MT_standout, - "Jail to show: "); + "Jail to show (+ for all): "); if (readline(tempbuf2, sizeof(tempbuf2), No) > 0) { if (tempbuf2[0] == '+' && ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r265250 - head/contrib/top
On Fri, May 2, 2014 at 4:32 PM, Bryan Drewery wrote: > Author: bdrewery > Date: Fri May 2 23:32:44 2014 > New Revision: 265250 > URL: http://svnweb.freebsd.org/changeset/base/265250 > > Log: > - Add a hint for 'u' and 'J' command that '+' displays all. > Thanks! I keep forgetting about '+'. - Justin ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r265250 - head/contrib/top
On 5/2/2014 6:39 PM, Justin Hibbits wrote: > On Fri, May 2, 2014 at 4:32 PM, Bryan Drewery wrote: >> Author: bdrewery >> Date: Fri May 2 23:32:44 2014 >> New Revision: 265250 >> URL: http://svnweb.freebsd.org/changeset/base/265250 >> >> Log: >> - Add a hint for 'u' and 'J' command that '+' displays all. >> > > Thanks! I keep forgetting about '+'. > > - Justin > I had no idea about it! -- Regards, Bryan Drewery signature.asc Description: OpenPGP digital signature
svn commit: r265251 - head/contrib/top
Author: bdrewery Date: Fri May 2 23:47:14 2014 New Revision: 265251 URL: http://svnweb.freebsd.org/changeset/base/265251 Log: - Add J command to help. MFC after:2 weeks X-MFC-with: r265249 Modified: head/contrib/top/commands.c Modified: head/contrib/top/commands.c == --- head/contrib/top/commands.c Fri May 2 23:32:44 2014(r265250) +++ head/contrib/top/commands.c Fri May 2 23:47:14 2014(r265251) @@ -74,6 +74,7 @@ e - list errors generated by last H - toggle the displaying of threads\n\ i or I - toggle the displaying of idle processes\n\ j - toggle the displaying of jail ID\n\ +J - display processes for only one jail (+ selects all jails)\n\ k - kill processes; send a signal to a list of processes\n\ m - toggle the display between 'cpu' and 'io' modes\n\ n or # - change number of processes to display\n", stdout); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r265252 - in head/sys/fs: nfs nfsserver
Author: rmacklem Date: Sat May 3 00:13:45 2014 New Revision: 265252 URL: http://svnweb.freebsd.org/changeset/base/265252 Log: The new draft specification for NFSv4.0 specifies that a server should either accept owner and owner_group strings that are just the digits of the uid/gid or return NFS4ERR_BADOWNER. This patch adds a sysctl vfs.nfsd.enable_stringtouid, which can be set to enable the server w.r.t. accepting numeric string. It also ensures that NFS4ERR_BADOWNER is returned if numeric uid/gid strings are not enabled. This fixes the server for recent Linux nfs4 clients that use numeric uid/gid strings by default. Reported and tested by: crai...@gmail.com MFC after:2 weeks Modified: head/sys/fs/nfs/nfs_commonsubs.c head/sys/fs/nfsserver/nfs_nfsdport.c Modified: head/sys/fs/nfs/nfs_commonsubs.c == --- head/sys/fs/nfs/nfs_commonsubs.cFri May 2 23:47:14 2014 (r265251) +++ head/sys/fs/nfs/nfs_commonsubs.cSat May 3 00:13:45 2014 (r265252) @@ -65,6 +65,7 @@ uid_t nfsrv_defaultuid; gid_t nfsrv_defaultgid; int nfsrv_lease = NFSRV_LEASE; int ncl_mbuf_mlen = MLEN; +int nfsd_enable_stringtouid = 0; NFSNAMEIDMUTEX; NFSSOCKMUTEX; @@ -2640,9 +2641,14 @@ nfsv4_strtouid(struct nfsrv_descript *nd /* If a string of digits and an AUTH_SYS mount, just convert it. */ str0 = str; tuid = (uid_t)strtoul(str0, &endstr, 10); - if ((endstr - str0) == len && - (nd->nd_flag & (ND_KERBV | ND_NFSCL)) == ND_NFSCL) { - *uidp = tuid; + if ((endstr - str0) == len) { + /* A numeric string. */ + if ((nd->nd_flag & ND_KERBV) == 0 && + ((nd->nd_flag & ND_NFSCL) != 0 || + nfsd_enable_stringtouid != 0)) + *uidp = tuid; + else + error = NFSERR_BADOWNER; goto out; } /* @@ -2845,9 +2851,14 @@ nfsv4_strtogid(struct nfsrv_descript *nd /* If a string of digits and an AUTH_SYS mount, just convert it. */ str0 = str; tgid = (gid_t)strtoul(str0, &endstr, 10); - if ((endstr - str0) == len && - (nd->nd_flag & (ND_KERBV | ND_NFSCL)) == ND_NFSCL) { - *gidp = tgid; + if ((endstr - str0) == len) { + /* A numeric string. */ + if ((nd->nd_flag & ND_KERBV) == 0 && + ((nd->nd_flag & ND_NFSCL) != 0 || + nfsd_enable_stringtouid != 0)) + *gidp = tgid; + else + error = NFSERR_BADOWNER; goto out; } /* Modified: head/sys/fs/nfsserver/nfs_nfsdport.c == --- head/sys/fs/nfsserver/nfs_nfsdport.cFri May 2 23:47:14 2014 (r265251) +++ head/sys/fs/nfsserver/nfs_nfsdport.cSat May 3 00:13:45 2014 (r265252) @@ -80,6 +80,7 @@ static int nfs_commit_blks; static int nfs_commit_miss; extern int nfsrv_issuedelegs; extern int nfsrv_dolocallocks; +extern int nfsd_enable_stringtouid; SYSCTL_NODE(_vfs, OID_AUTO, nfsd, CTLFLAG_RW, 0, "New NFS server"); SYSCTL_INT(_vfs_nfsd, OID_AUTO, mirrormnt, CTLFLAG_RW, @@ -92,6 +93,8 @@ SYSCTL_INT(_vfs_nfsd, OID_AUTO, issue_de &nfsrv_issuedelegs, 0, "Enable nfsd to issue delegations"); SYSCTL_INT(_vfs_nfsd, OID_AUTO, enable_locallocks, CTLFLAG_RW, &nfsrv_dolocallocks, 0, "Enable nfsd to acquire local locks on files"); +SYSCTL_INT(_vfs_nfsd, OID_AUTO, enable_stringtouid, CTLFLAG_RW, +&nfsd_enable_stringtouid, 0, "Enable nfsd to accept numeric owner_names"); #defineMAX_REORDERED_RPC 16 #defineNUM_HEURISTIC 1031 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
Re: svn commit: r265252 - in head/sys/fs: nfs nfsserver
I wrote: > Author: rmacklem > Date: Sat May 3 00:13:45 2014 > New Revision: 265252 > URL: http://svnweb.freebsd.org/changeset/base/265252 > > Log: > The new draft specification for NFSv4.0 specifies that a server > should either accept owner and owner_group strings that are just > the digits of the uid/gid or return NFS4ERR_BADOWNER. > This patch adds a sysctl vfs.nfsd.enable_stringtouid, which can > be set to enable the server w.r.t. accepting numeric string. It > also ensures that NFS4ERR_BADOWNER is returned if numeric uid/gid > strings are not enabled. This fixes the server for recent Linux > nfs4 clients that use numeric uid/gid strings by default. > > Reported and tested by: crai...@gmail.com > MFC after: 2 weeks > Oops, I meant to MFC in 1 week, since I'd like to get this in 9.3. rick > Modified: > head/sys/fs/nfs/nfs_commonsubs.c > head/sys/fs/nfsserver/nfs_nfsdport.c > > Modified: head/sys/fs/nfs/nfs_commonsubs.c > == > --- head/sys/fs/nfs/nfs_commonsubs.c Fri May 2 23:47:14 2014 > (r265251) > +++ head/sys/fs/nfs/nfs_commonsubs.c Sat May 3 00:13:45 2014 > (r265252) > @@ -65,6 +65,7 @@ uid_t nfsrv_defaultuid; > gid_t nfsrv_defaultgid; > int nfsrv_lease = NFSRV_LEASE; > int ncl_mbuf_mlen = MLEN; > +int nfsd_enable_stringtouid = 0; > NFSNAMEIDMUTEX; > NFSSOCKMUTEX; > > @@ -2640,9 +2641,14 @@ nfsv4_strtouid(struct nfsrv_descript *nd > /* If a string of digits and an AUTH_SYS mount, just convert it. */ > str0 = str; > tuid = (uid_t)strtoul(str0, &endstr, 10); > - if ((endstr - str0) == len && > - (nd->nd_flag & (ND_KERBV | ND_NFSCL)) == ND_NFSCL) { > - *uidp = tuid; > + if ((endstr - str0) == len) { > + /* A numeric string. */ > + if ((nd->nd_flag & ND_KERBV) == 0 && > + ((nd->nd_flag & ND_NFSCL) != 0 || > + nfsd_enable_stringtouid != 0)) > + *uidp = tuid; > + else > + error = NFSERR_BADOWNER; > goto out; > } > /* > @@ -2845,9 +2851,14 @@ nfsv4_strtogid(struct nfsrv_descript *nd > /* If a string of digits and an AUTH_SYS mount, just convert it. */ > str0 = str; > tgid = (gid_t)strtoul(str0, &endstr, 10); > - if ((endstr - str0) == len && > - (nd->nd_flag & (ND_KERBV | ND_NFSCL)) == ND_NFSCL) { > - *gidp = tgid; > + if ((endstr - str0) == len) { > + /* A numeric string. */ > + if ((nd->nd_flag & ND_KERBV) == 0 && > + ((nd->nd_flag & ND_NFSCL) != 0 || > + nfsd_enable_stringtouid != 0)) > + *gidp = tgid; > + else > + error = NFSERR_BADOWNER; > goto out; > } > /* > > Modified: head/sys/fs/nfsserver/nfs_nfsdport.c > == > --- head/sys/fs/nfsserver/nfs_nfsdport.c Fri May 2 23:47:14 2014 > (r265251) > +++ head/sys/fs/nfsserver/nfs_nfsdport.c Sat May 3 00:13:45 2014 > (r265252) > @@ -80,6 +80,7 @@ static int nfs_commit_blks; > static int nfs_commit_miss; > extern int nfsrv_issuedelegs; > extern int nfsrv_dolocallocks; > +extern int nfsd_enable_stringtouid; > > SYSCTL_NODE(_vfs, OID_AUTO, nfsd, CTLFLAG_RW, 0, "New NFS server"); > SYSCTL_INT(_vfs_nfsd, OID_AUTO, mirrormnt, CTLFLAG_RW, > @@ -92,6 +93,8 @@ SYSCTL_INT(_vfs_nfsd, OID_AUTO, issue_de > &nfsrv_issuedelegs, 0, "Enable nfsd to issue delegations"); > SYSCTL_INT(_vfs_nfsd, OID_AUTO, enable_locallocks, CTLFLAG_RW, > &nfsrv_dolocallocks, 0, "Enable nfsd to acquire local locks on > files"); > +SYSCTL_INT(_vfs_nfsd, OID_AUTO, enable_stringtouid, CTLFLAG_RW, > +&nfsd_enable_stringtouid, 0, "Enable nfsd to accept numeric > owner_names"); > > #define MAX_REORDERED_RPC 16 > #define NUM_HEURISTIC 1031 > > ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r265253 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: smh Date: Sat May 3 02:30:01 2014 New Revision: 265253 URL: http://svnweb.freebsd.org/changeset/base/265253 Log: Don't treat TRIM requests returning ENOTSUP as an unexpected error. MFC after:1 month X-MFC-With: r265152 Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sat May 3 00:13:45 2014(r265252) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zio.c Sat May 3 02:30:01 2014(r265253) @@ -2674,7 +2674,10 @@ zio_vdev_io_done(zio_t **ziop) zio->io_error = zio_handle_label_injection(zio, EIO); if (zio->io_error) { - if (!vdev_accessible(vd, zio)) { + if (zio->io_error == ENOTSUP && + zio->io_type == ZIO_TYPE_FREE) { + /* Not all devices support TRIM. */ + } else if (!vdev_accessible(vd, zio)) { zio->io_error = SET_ERROR(ENXIO); } else { unexpected_error = B_TRUE; ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r265254 - head/sys/arm/conf
Author: loos Date: Sat May 3 03:40:36 2014 New Revision: 265254 URL: http://svnweb.freebsd.org/changeset/base/265254 Log: Fix the tinderbox armv6/arm build failure. VYBRID code depends on FDT. Modified: head/sys/arm/conf/VYBRID Modified: head/sys/arm/conf/VYBRID == --- head/sys/arm/conf/VYBRIDSat May 3 02:30:01 2014(r265253) +++ head/sys/arm/conf/VYBRIDSat May 3 03:40:36 2014(r265254) @@ -147,3 +147,5 @@ device kbdmux optionsSC_DFLT_FONT# compile font in makeoptionsSC_DFLT_FONT=cp437 device ukbd + +optionsFDT ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"
svn commit: r265255 - head/lib/libproc
Author: markj Date: Sat May 3 04:44:03 2014 New Revision: 265255 URL: http://svnweb.freebsd.org/changeset/base/265255 Log: Allow "a.out" as an alias for the executable if no other matching entries are found. This improves compatibility with Solaris' libproc and fixes a number of failing DTrace tests that rely on this feature. MFC after:3 weeks Modified: head/lib/libproc/_libproc.h head/lib/libproc/proc_create.c head/lib/libproc/proc_rtld.c head/lib/libproc/proc_sym.c Modified: head/lib/libproc/_libproc.h == --- head/lib/libproc/_libproc.h Sat May 3 03:40:36 2014(r265254) +++ head/lib/libproc/_libproc.h Sat May 3 04:44:03 2014(r265255) @@ -46,6 +46,8 @@ struct proc_handle { size_t rdobjsz; size_t nobjs; struct lwpstatus lwps; + rd_loadobj_t *rdexec; /* rdobj index of program executable. */ + charexecname[MAXPATHLEN]; /* Path to program executable. */ }; #ifdef DEBUG Modified: head/lib/libproc/proc_create.c == --- head/lib/libproc/proc_create.c Sat May 3 03:40:36 2014 (r265254) +++ head/lib/libproc/proc_create.c Sat May 3 04:44:03 2014 (r265255) @@ -26,8 +26,10 @@ * $FreeBSD$ */ -#include "_libproc.h" -#include +#include +#include +#include + #include #include #include @@ -35,7 +37,37 @@ #include #include #include -#include + +#include "_libproc.h" + +static int proc_init(pid_t, int, int, struct proc_handle *); + +static int +proc_init(pid_t pid, int flags, int status, struct proc_handle *phdl) +{ + int mib[4], error; + size_t len; + + memset(phdl, 0, sizeof(*phdl)); + phdl->pid = pid; + phdl->flags = flags; + phdl->status = status; + + mib[0] = CTL_KERN; + mib[1] = KERN_PROC; + mib[2] = KERN_PROC_PATHNAME; + mib[3] = pid; + len = sizeof(phdl->execname); + if (sysctl(mib, 4, phdl->execname, &len, NULL, 0) != 0) { + error = errno; + DPRINTF("ERROR: cannot get pathname for child process %d", pid); + return (error); + } + if (len == 0) + phdl->execname[0] = '\0'; + + return (0); +} int proc_attach(pid_t pid, int flags, struct proc_handle **pphdl) @@ -54,12 +86,12 @@ proc_attach(pid_t pid, int flags, struct if ((phdl = malloc(sizeof(struct proc_handle))) == NULL) return (ENOMEM); - memset(phdl, 0, sizeof(struct proc_handle)); - phdl->pid = pid; - phdl->flags = flags; - phdl->status = PS_RUN; elf_version(EV_CURRENT); + error = proc_init(pid, flags, PS_RUN, phdl); + if (error != 0) + goto out; + if (ptrace(PT_ATTACH, phdl->pid, 0, 0) != 0) { error = errno; DPRINTF("ERROR: cannot ptrace child process %d", pid); @@ -123,9 +155,9 @@ proc_create(const char *file, char * con _exit(2); } else { /* The parent owns the process handle. */ - memset(phdl, 0, sizeof(struct proc_handle)); - phdl->pid = pid; - phdl->status = PS_IDLE; + error = proc_init(pid, 0, PS_IDLE, phdl); + if (error != 0) + goto bad; /* Wait for the child process to stop. */ if (waitpid(pid, &status, WUNTRACED) == -1) { Modified: head/lib/libproc/proc_rtld.c == --- head/lib/libproc/proc_rtld.cSat May 3 03:40:36 2014 (r265254) +++ head/lib/libproc/proc_rtld.cSat May 3 04:44:03 2014 (r265255) @@ -49,6 +49,9 @@ map_iter(const rd_loadobj_t *lop, void * if (phdl->rdobjs == NULL) return (-1); } + if (strcmp(lop->rdl_path, phdl->execname) == 0 && + (lop->rdl_prot & RD_RDL_X) != 0) + phdl->rdexec = &phdl->rdobjs[phdl->nobjs]; memcpy(&phdl->rdobjs[phdl->nobjs++], lop, sizeof(*lop)); return (0); Modified: head/lib/libproc/proc_sym.c == --- head/lib/libproc/proc_sym.c Sat May 3 03:40:36 2014(r265254) +++ head/lib/libproc/proc_sym.c Sat May 3 04:44:03 2014(r265255) @@ -112,17 +112,23 @@ proc_obj2map(struct proc_handle *p, cons rd_loadobj_t *rdl; char path[MAXPATHLEN]; + rdl = NULL; for (i = 0; i < p->nobjs; i++) { - rdl = &p->rdobjs[i]; - basename_r(rdl->rdl_path, path); + basename_r(p->rdobjs[i].rdl_path, path); if (strcmp(path, objname) == 0) { - if ((map = malloc(sizeof(*map))) == NULL) - r